R / Bioconductor has 'annotation' packages that map between common identifiers and other useful entities, e.g., the KEGG.db package to manage KEGG ids and pathway names, and the org.Hs.eg.db package to manage H. sapiens annotations, including Entrez, KEGG, SYMBOL, GENENAME, etc. There is also a graph package to create and manipulate graphs, and various alternatives for visualization such as the Rgraphviz and RCytoscape packages. Here's a work flow that retrieves the MAPK and Wnt pathways, finds human Entrez gene ids associated with these pathways, translates the Entrez gene ids to gene symbols, then plots the result using Rgraphviz.
library(KEGG.db)
library(org.Hs.eg.db)
library(graph)
library(Rgraphviz)
terms <- c("MAPK signaling pathway", "Wnt signaling pathway")
name2id <- toTable(KEGGPATHNAME2ID[ terms ])
id2gene <- toTable(revmap(org.Hs.egPATH)[ name2id$path_id ])
id2gene$symbol <-
unlist(mget(id2gene$gene_id, org.Hs.egSYMBOL))
path2gene <- merge(name2id, id2gene, by="path_id")
df <- with(path2gene,
data.frame(from=symbol, to=path_id, weight=1,
stringsAsFactors=FALSE))
gr <- graphBAM(df, edgemode="directed")
set.seed(123L)
nodes <- c(sample(df$from, 25), unique(df$to))
subgr <- subGraph(nodes, gr)
to <- unique(df$to)
nodeAttrs <-
list(fillcolor=structure(rep("orange", length(to)), names=to))
plot(subgr,
"fdp",
nodeAttrs=nodeAttrs,
attrs=list(
node=list(shape="ellipse",
width="2"),
edge=list(arrowsize="0.75")
))
Maybe not for the faint of heart, but hopefully showing the possibilities. There are instructions for installing R and Bioconductor packages, and many additional packages, some of which (e.g., KEGGgraph) provide a different interface; RCytoscape is interesting because the graph can be assembled programmatically, and then manipulated in Cytoscape.
Hi blenderous, then you finally could get the proteins and interactions from KEGG database? I'd like to know if you have done this, it's really interesting