Visualize KEGG pathway and fold enrichment

[This article was first published on R – Fabio Marroni's Blog, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

As a useful note to self, I paste here an easy example on the use of the pathview package by Weijun Luo to plot the log fold change of gene expression across a given KEGG pathway. This example is on Vitis vinifera (as the prefix vvi can suggest), but the approach is general.
Basically, you just need to feed pathview the pathway argument and a gene.data argument. In this case, gene.data is a named vector, with names being the (entrez) gene names, and the value is the log Fold Change.
I selected a pathway for which KEGG has a nice representation, you might not be so lucky!

library(pathview)
mypathway<-"vvi03060"
genes<-c("100241050","100243802","100244217","100244265","100247624","100247887","100248517","
100248990","100250268","100250385","100250458","100251379","100252350","100252527","100252725","
100252902","100253826","100254350","100254429","100254996","100255515","100256046","100256113","
100256412","100256941","100257568","100257730","100258179","100258854","100259285","100259443","
100260422","100260431","100261219","100262919","100263033","100264739","100265371","100266802","
100267343","100267692","100852861","100853033","100854110","100854416","100854647","100855182","
104879783","109122671")
logFC<-rnorm(length(genes),-0.5,1)
names(logFC)<-genes
pathview(gene.data=logFC,species="vvi",pathway=mypathway)

The result should be something like this:


To leave a comment for the author, please follow the link and comment on their blog: R – Fabio Marroni's Blog.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)