Using KeggGraph's KEGGpathway2reactionGraph and mergeKEGGgraphs functions
1
0
Entering edit mode
@stuart-bradley-6131
Last seen 9.6 years ago
Hello all, I'm trying to build unified compound pathway maps, and have been successful using this method: library(graph) library(KEGGgraph) KEGGList <- list.files(path = "C:/Users/Castor Castle/Documents/kgml/metabolic/ko/subset/", full.names = TRUE) AllGraphs <- lapply(KEGGList, function(x) { pathway <- parseKGML(x) pathway <- KEGGpathway2reactionGraph(pathway, uniqueReaction = FALSE) }) FinalGraph <- mergeGraphs(AllGraphs, edgemode = "directed") However, I'd like to be able to use mergeKEGGgraphs as it retains more information. The problem is that when I replace mergeGraphs with mergeKEGGgraphs I get the following error (regardless of whether it's my own files, or the example ones provided): Error in .verifyAttrName(attr, names(self@defaults)): unknown attribute name: ‘KEGGNode’ Has anyone found a work around for this? I was fiddling with setKEGGnodeData/setKEGGEdgeData in conjunction with mergeGraphs, but I can't get it to work. Any help would be greatly appreciated. Cheers, Stuart Bradley [[alternative HTML version deleted]]
• 1.0k views
ADD COMMENT
0
Entering edit mode
Paul Shannon ▴ 470
@paul-shannon-5944
Last seen 22 months ago
United States
Hi Stuart, I have included Jitao David Zhang here as well, the package author and maintainer. I think I can reduce your problem report to these steps: library(KEGGgraph) filename <- "hsa00260.kgml" retrieveKGML("00260", organism="hsa", destfile=filename, method = "internal") pathway <- parseKGML(filename) g.reaction <- KEGGpathway2reactionGraph(pathway, uniqueReaction = FALSE) g.pathway <- KEGGpathway2Graph(pathway, genesOnly=FALSE) names(nodeDataDefaults(g.reaction)) # NULL names(nodeDataDefaults(g.pathway)) # KEGGNode mergeKEGGgraphs (in KEGGgraph/R/graph.R) requires that there be an edge attribute "KEGGEdge" and a node attribute "KEGGNode", and fails with the error you saw. So the reaction graph does not have the two attributes required by mergeKEGGgraphs. I am not sure whether this is by design, or whether it is an oversight. Once David clarifies that, we can devise some possible next steps for you. - Paul P.S For future posts, please include (as I have tried to do here) a smallish, self-contained and reproducible example, along with your sessionInfo: R version 3.0.1 Patched (2013-05-26 r62815) Platform: x86_64-apple-darwin10.8.0 (64-bit) locale: [1] C attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] KEGGgraph_1.17.0 graph_1.39.3 XML_3.95-0.2 loaded via a namespace (and not attached): [1] BiocGenerics_0.7.4 parallel_3.0.1 stats4_3.0.1 tools_3.0.1 On Sep 2, 2013, at 2:51 PM, Stuart Bradley wrote: > Hello all, > > I'm trying to build unified compound pathway maps, and have been successful > using this method: > > library(graph) > library(KEGGgraph) > > KEGGList <- list.files(path = "C:/Users/Castor > Castle/Documents/kgml/metabolic/ko/subset/", full.names = TRUE) > > AllGraphs <- lapply(KEGGList, function(x) { > pathway <- parseKGML(x) > pathway <- KEGGpathway2reactionGraph(pathway, uniqueReaction = FALSE) > }) > > FinalGraph <- mergeGraphs(AllGraphs, edgemode = "directed") > > However, I'd like to be able to use mergeKEGGgraphs as it retains more > information. The problem is that when I replace mergeGraphs with > mergeKEGGgraphs > I get the following error (regardless of whether it's my own files, or the > example ones provided): > > Error in .verifyAttrName(attr, names(self at defaults)): > unknown attribute name: ?KEGGNode? > > Has anyone found a work around for this? I was fiddling with > setKEGGnodeData/setKEGGEdgeData in conjunction with mergeGraphs, but I > can't get it to work. > > Any help would be greatly appreciated. > > Cheers, > Stuart Bradley > > [[alternative HTML version deleted]] > > _______________________________________________ > Bioconductor mailing list > Bioconductor at r-project.org > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
ADD COMMENT
0
Entering edit mode
Dear Paul and dear Stuart, I see the point and will have a look at the code. It seems that Paul detected a bug in the KEGGgraph package - the compounds seem to be neglected. I will look into this issue and get back to you as soon as possible. My big thanks going to Paul for the alert! Best wishes, David On Tue, Sep 3, 2013 at 9:47 PM, Paul Shannon < paul.thurmond.shannon@gmail.com> wrote: > Hi Stuart, > > I have included Jitao David Zhang here as well, the package author and > maintainer. > > I think I can reduce your problem report to these steps: > > library(KEGGgraph) > filename <- "hsa00260.kgml" > retrieveKGML("00260", organism="hsa", destfile=filename, method = > "internal") > pathway <- parseKGML(filename) > > g.reaction <- KEGGpathway2reactionGraph(pathway, uniqueReaction = FALSE) > g.pathway <- KEGGpathway2Graph(pathway, genesOnly=FALSE) > > names(nodeDataDefaults(g.reaction)) # NULL > names(nodeDataDefaults(g.pathway)) # KEGGNode > > mergeKEGGgraphs (in KEGGgraph/R/graph.R) requires that there be an edge > attribute "KEGGEdge" and a node attribute "KEGGNode", and fails with the > error you saw. > > > So the reaction graph does not have the two attributes required by > mergeKEGGgraphs. I am not sure whether this is by design, or whether it is > an oversight. > Once David clarifies that, we can devise some possible next steps for you. > > - Paul > > P.S For future posts, please include (as I have tried to do here) a > smallish, self-contained and reproducible example, along with your > sessionInfo: > > R version 3.0.1 Patched (2013-05-26 r62815) > Platform: x86_64-apple-darwin10.8.0 (64-bit) > > locale: > [1] C > > attached base packages: > [1] stats graphics grDevices utils datasets methods base > > other attached packages: > [1] KEGGgraph_1.17.0 graph_1.39.3 XML_3.95-0.2 > > loaded via a namespace (and not attached): > [1] BiocGenerics_0.7.4 parallel_3.0.1 stats4_3.0.1 tools_3.0.1 > > > On Sep 2, 2013, at 2:51 PM, Stuart Bradley wrote: > > > Hello all, > > > > I'm trying to build unified compound pathway maps, and have been > successful > > using this method: > > > > library(graph) > > library(KEGGgraph) > > > > KEGGList <- list.files(path = "C:/Users/Castor > > Castle/Documents/kgml/metabolic/ko/subset/", full.names = TRUE) > > > > AllGraphs <- lapply(KEGGList, function(x) { > > pathway <- parseKGML(x) > > pathway <- KEGGpathway2reactionGraph(pathway, uniqueReaction = FALSE) > > }) > > > > FinalGraph <- mergeGraphs(AllGraphs, edgemode = "directed") > > > > However, I'd like to be able to use mergeKEGGgraphs as it retains more > > information. The problem is that when I replace mergeGraphs with > > mergeKEGGgraphs > > I get the following error (regardless of whether it's my own files, or > the > > example ones provided): > > > > Error in .verifyAttrName(attr, names(self@defaults)): > > unknown attribute name: ŒKEGGNode‚ > > > > Has anyone found a work around for this? I was fiddling with > > setKEGGnodeData/setKEGGEdgeData in conjunction with mergeGraphs, but I > > can't get it to work. > > > > Any help would be greatly appreciated. > > > > Cheers, > > Stuart Bradley > > > > [[alternative HTML version deleted]] > > > > _______________________________________________ > > Bioconductor mailing list > > Bioconductor@r-project.org > > https://stat.ethz.ch/mailman/listinfo/bioconductor > > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor > > -- *Jitao David Zhang | **张继涛** |Computational Biology | Pharmaceutical Divison | F. Hoffmann-La-Roche AG | CH-4070 Basel | Switzerland***** *Tel +41 61 688 62 51 * Confidentiality Note: This message is intended only for ...{{dropped:11}}
ADD REPLY

Login before adding your answer.

Traffic: 936 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