<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/visualize-kegg-pathway-and-fold-enrichment/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://fabiomarroni.wordpress.com/2017/11/14/visualize-kegg-pathway-and-fold-enrichment/"> R – Fabio Marroni's Blog</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>As a useful note to self, I paste here an easy example on the use of the <a rel="nofollow" href="http://bioconductor.org/packages/release/bioc/html/pathview.html" target="_blank">pathview</a> 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.<br>
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.<br>
I selected a pathway for which KEGG has a nice representation, you might not be so lucky!</p>
<pre>
library(pathview)
mypathway&lt;-&quot;vvi03060&quot;
genes&lt;-c(&quot;100241050&quot;,&quot;100243802&quot;,&quot;100244217&quot;,&quot;100244265&quot;,&quot;100247624&quot;,&quot;100247887&quot;,&quot;100248517&quot;,&quot;
100248990&quot;,&quot;100250268&quot;,&quot;100250385&quot;,&quot;100250458&quot;,&quot;100251379&quot;,&quot;100252350&quot;,&quot;100252527&quot;,&quot;100252725&quot;,&quot;
100252902&quot;,&quot;100253826&quot;,&quot;100254350&quot;,&quot;100254429&quot;,&quot;100254996&quot;,&quot;100255515&quot;,&quot;100256046&quot;,&quot;100256113&quot;,&quot;
100256412&quot;,&quot;100256941&quot;,&quot;100257568&quot;,&quot;100257730&quot;,&quot;100258179&quot;,&quot;100258854&quot;,&quot;100259285&quot;,&quot;100259443&quot;,&quot;
100260422&quot;,&quot;100260431&quot;,&quot;100261219&quot;,&quot;100262919&quot;,&quot;100263033&quot;,&quot;100264739&quot;,&quot;100265371&quot;,&quot;100266802&quot;,&quot;
100267343&quot;,&quot;100267692&quot;,&quot;100852861&quot;,&quot;100853033&quot;,&quot;100854110&quot;,&quot;100854416&quot;,&quot;100854647&quot;,&quot;100855182&quot;,&quot;
104879783&quot;,&quot;109122671&quot;)
logFC&lt;-rnorm(length(genes),-0.5,1)
names(logFC)&lt;-genes
pathview(gene.data=logFC,species=&quot;vvi&quot;,pathway=mypathway)
</pre>
<p>The result should be something like this:</p>
<p><img src="https://i2.wp.com/i.imgur.com/inE2tel.png?w=456&ssl=1" data-recalc-dims="1"></p>
<p> <a rel="nofollow" href="https://feeds.wordpress.com/1.0/gocomments/fabiomarroni.wordpress.com/320/" target="_blank"><img border="0" alt="" src="https://feeds.wordpress.com/1.0/comments/fabiomarroni.wordpress.com/320/"></a> <img border="0" alt="" src="https://i1.wp.com/pixel.wp.com/b.gif?resize=1%2C1&ssl=1" data-recalc-dims="1"></p>
	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="https://fabiomarroni.wordpress.com/2017/11/14/visualize-kegg-pathway-and-fold-enrichment/"> R – Fabio Marroni's Blog</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a rel="nofollow" href="https://www.r-project.org/" title="The R Project for Statistical Computing">R</a> news and <a rel="nofollow" href="https://www.r-bloggers.com/search/tutorial" title="R tutorials">tutorials</a> on topics such as: <a rel="nofollow" href="https://www.r-bloggers.com/search/data%20science" title="Data science">Data science</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data" title="Big Data">Big Data, <a rel="nofollow" href="https://www.r-users.com/" title="R jobs">R jobs</a>, visualization (<a rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2" title="ggplot and ggplot2 tutorials">ggplot2</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/boxplot" title="Boxplots using lattice and ggplot2 tutorials">Boxplots</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/map" title="Maps and gis">maps</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/animation" title="Animation in R">animation</a>), programming (<a rel="nofollow" href="https://www.r-bloggers.com/search/RStudio" title="RStudio IDE for R">RStudio</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/sweave" title="Sweave and literate programming">Sweave</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX" title="LaTeX in R">LaTeX</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/SQL" title="SQL and databases">SQL</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/eclipse" title="Eclipse IDE for R">Eclipse</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/git" title="git and github, Version Control System">git</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/hadoop" title="Large data in R using Hadoop">hadoop</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping" title="Web Scraping of google, facebook, yahoo, twitter and more using R">Web Scraping</a>) statistics (<a rel="nofollow" href="https://www.r-bloggers.com/search/regression" title="Regressions and ANOVA analysis tutorials">regression</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/PCA" title="principal component analysis tutorial">PCA</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/time+series" title="Time series">time series</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/trading" title="finance trading">trading</a>) and more...
<img width="1" alt="" src="http://feeds.feedburner.com/~r/RBloggers/~4/PPNauzNH9q0" height="1"></a></div>