[BioC] Using KeggGraph's KEGGpathway2reactionGraph and mergeKEGGgraphs functions

Paul Shannon paul.thurmond.shannon at gmail.com
Tue Sep 3 21:47:12 CEST 2013


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



More information about the Bioconductor mailing list