bug in nem's transitive.reduction? (and thus rBiopaxParser)
0
0
Entering edit mode
@ramon-diaz-uriarte-2633
Last seen 5.9 years ago
Spain

transitive.reduction in nem does not always return the transitive reduction unless one applies transitive.reduction on the transitive closure of the graph. So I think that either the code should be fixed (by using transitive.closure first) or the documentation fixed (but this second route seems dangerous for those who do not read the help carefully).  This bug will probably also affect rBiopaxParser (its transitiveReduction function).

 

Examples below taken from discussion and comments in http://stackoverflow.com/a/6702198  as well as comments to  http://stackoverflow.com/a/2372202

library(nem)
m1 <- matrix(0, nrow = 4, ncol = 4)
colnames(m1) <- rownames(m1) <- LETTERS[1:4]
m1[rbind(c(1, 2),
         c(2, 3),
         c(3, 4),
         c(1, 4))] <- 1

## Wrong, since A connected to D directly and through B-> C
nem::transitive.reduction(m1)
## OK
nem::transitive.reduction(transitive.closure(m1))

m2 <- matrix(0, nrow = 4, ncol = 4)
colnames(m2) <- rownames(m2) <- LETTERS[1:4]
m2[rbind(c(1, 2),
         c(2, 3),
         c(3, 4),
         c(1, 3),
         c(1, 4))] <- 1

## Wrong, since A connected to D directly and through B-> C
nem::transitive.reduction(m2)
## OK
nem::transitive.reduction(transitive.closure(m2))


 

nem graphs rbiopaxparser • 1.2k views
ADD COMMENT
0
Entering edit mode

Dear Ramon,

as you noticed rBiopaxParser uses the transitive reduction function implemented in package nem.

Holger Fröhlich (package maintainer)  mentioned that a bug fix for this should be supplied with the next nem version.

 

Best wishes,
Frank

ADD REPLY

Login before adding your answer.

Traffic: 849 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6