[BioC] Visualize KEGG pathway

Saroj K Mohapatra smohapat at vbi.vt.edu
Sat Apr 18 04:17:02 CEST 2009

Hi Tim:

It is possible to set the foreground and background colors for each node in the KEGG pathway through bg.color.list and fg.color.list arguments of the function color.pathway.by.objects. I color just one node below in white-on-blue, rest all in black-on-white.

> library("KEGGSOAP")
Loading required package: XML
Loading required package: SSOAP
Loading required package: RCurl
# Suppose you are looking at the pathway for glycolysis / gluconeogenesis
> pathstr = "path:hsa00010"
# get all genes
> glist = get.genes.by.pathway(pathstr)

# First fix what color you want for which node
# Suppose, you want to color first enzyme hsa:10327 (EC 
# white on blue background and rest all nodes in black on white 
# fgcols = color of text and border
# bgcols = color of the rectangular area
> fgcols = rep("black", length(glist))
> fgcols[1] = "yellow"
> bgcols = rep("white", length(glist))
> bgcols[1] = "blue"
# color the pathway accordingly
> url = color.pathway.by.objects(pathstr, glist, fg=fgcols, bg=bgcols)
# Have a look at the url returned
> url
[1] "http://soap.genome.jp/tmp/mark_pathway_www3_api23663/hsa00010.gif"

> browseURL(url)
> sessionInfo()
R version 2.8.1 (2008-12-22) 


attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] KEGGSOAP_1.14.0 SSOAP_0.4-6     RCurl_0.94-1    XML_2.3-0      

Best wishes,


----- Original Message -----
From: "Tim Smith" <tim_smith_666 at yahoo.com>
To: "bioc" <bioconductor at stat.math.ethz.ch>
Sent: Friday, April 17, 2009 6:19:59 PM GMT -05:00 US/Canada Eastern
Subject: [BioC] Visualize KEGG pathway


I tried the code from a previous post:

 url <- mark.pathway.by.objects("path:eco00260",
                c("eco:b0002", "eco:c00263"))
url <- color.pathway.by.objects("path:eco00260",
                c("eco:b0002", "eco:c00263"),
                c("#ff0000", "#00ff00"), c("#ffff00", "yellow"))---------------

Is there any way to make the all the initial nodes as 'white' (instead of light green), and then to color the nodes that we are interested in?


	[[alternative HTML version deleted]]

Bioconductor mailing list
Bioconductor at stat.math.ethz.ch
Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor

Computational Biology
VBI @ Virginia Tech

More information about the Bioconductor mailing list