pathways<-pathways("hsapiens","kegg")["Prolactin signaling pathway"]
pathways<-convertIdentifiers(pathways[[1]], "SYMBOL")
#gr<-as(pathways,"pathway")
red<-list(RAS=c("NRAS","KRAS","HRAS"), SHC=c("SHC1", "SHC4","SHC2","SHC3"))
reduced<-reduceGraph(pathways, red)
reduced
par(mfrow=c(1,2))
nA<-list(fillcolor=c(NRAS="red", KRAS="red", HRAS="red", SHC1="green", SHC4="green", SHC2="green", SHC3="green"))
plot(as(pathways,"graphNEL"), nodeAttrs=nA, attrs=list(node=list(fontsize=30, height=40)), main="Before")
plot(as(reduced,"graphNEL"),
nodeAttrs=list(fillcolor=c(RAS="red", SHC="green")), attrs=list(node=list(fontsize=30, height=40)), main="After")
#this throws an error, "RELA", "FOS","NFKB1" is not correct set of genes
## Not run:
# pathways<-pathways("hsapiens","kegg")["Prolactin signaling pathway"]
# pathways<-convertIdentifiers(pathways[[1]], "SYMBOL")
#
#
# gr<-convertIdentifiers(kegg[["Prolactin signaling pathway"]],"SYMBOL")
# red<-list(RAS=c("NRAS","KRAS","HRAS"), SHC=c("RELA", "FOS","NFKB1"))
# reduced<-reduceGraph(pathways, red)
# ## End(Not run)
Run the code above in your browser using DataLab