Question: bug in nem's transitive.reduction? (and thus rBiopaxParser)
0
gravatar for Ramon Diaz-Uriarte
2.7 years ago by
Spain
Ramon Diaz-Uriarte70 wrote:

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 rbiopaxparser graphs • 423 views
ADD COMMENTlink modified 2.7 years ago • written 2.7 years ago by Ramon Diaz-Uriarte70

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 REPLYlink written 2.7 years ago by Frank Kramer60
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 401 users visited in the last hour