Hello,
I noticed that quite often the gene-compound interactions from the KEGG maps are not retrieved with the right direction when using the function "KEGGpathway2Graph". For example, in "hsa04930" the D-glucose ("cpd:C00031") interacts with "hsa:5581". This is the direction reported in both the .png image and the corresponding xml file. In particular, in the "hsa04930.xml" file it says:
<relation type="PCrel" entry2="15" entry1="18"> </relation>
, where "15" is "cpd:C00031" and "18" is "hsa:5581"
However, when I use "KEGGpathway2Graph", the interaction is retrieved in the opposite direction: i.e. "hsa:5581" interacts with "cpd:C00031". See details below.
I have observed this same problem other times, always between compound and gene interactions. Any chance this can be fixed?
Thanks very much,
Andrea
library(KEGGgraph)
library(RCurl)
path <- "hsa04930"
file <- paste("http://rest.kegg.jp/get/", path, "/kgml", sep = "")
pathway <- getURL(file)
path_parsed <- parseKGML(pathway)
path_network <- KEGGpathway2Graph(path_parsed, genesOnly = FALSE,
expandGenes = TRUE)
adj_matrix <- as(path_network, "matrix")
adj_matrix[c("cpd:C00031", "hsa:5581"), c("hsa:5581", "cpd:C00031")]
# hsa:5581 cpd:C00031
# cpd:C00031 0 0
# hsa:5581 0 1