<p><div><div><div><div data-width="100" data-show-faces="false" data-send="true" data-layout="button_count" data-height="21" data-href="https://www.r-bloggers.com/using-clusterprofiler-for-mesh-enrichment-analysis/"></div></div><div><a data-url="https://www.r-bloggers.com/using-clusterprofiler-for-mesh-enrichment-analysis/" data-counturl="https://www.r-bloggers.com/using-clusterprofiler-for-mesh-enrichment-analysis/" data-count="horizontal" data-text="using clusterProfiler for MeSH Enrichment Analysis" class="twitter-share-button" data-via="rbloggers" href="https://twitter.com/share"></a></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://guangchuangyu.github.io/2016/08/using-clusterprofiler-for-mesh-enrichment-analysis"> R on Guangchuang YU</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>MeSH (Medical Subject Headings) is the NLM (U.S. National Library of<br>
Medicine) controlled vocabulary used to manually index articles for<br>
MEDLINE/PubMed. MeSH is comprehensive life science vocabulary. MeSH has<br>
19 categories and <code>MeSH.db</code> contains 16 of them. That is:</p>
<table>
<thead>
<tr>
<th>Abbreviation</th>
<th>Category</th>
</tr>
</thead>
<tbody>
<tr>
<td>A</td>
<td>Anatomy</td>
</tr>
<tr>
<td>B</td>
<td>Organisms</td>
</tr>
<tr>
<td>C</td>
<td>Diseases</td>
</tr>
<tr>
<td>D</td>
<td>Chemicals and Drugs</td>
</tr>
<tr>
<td>E</td>
<td>Analytical, Diagnostic and Therapeutic Techniques and Equipment</td>
</tr>
<tr>
<td>F</td>
<td>Psychiatry and Psychology</td>
</tr>
<tr>
<td>G</td>
<td>Phenomena and Processes</td>
</tr>
<tr>
<td>H</td>
<td>Disciplines and Occupations</td>
</tr>
<tr>
<td>I</td>
<td>Anthropology, Education, Sociology and Social Phenomena</td>
</tr>
<tr>
<td>J</td>
<td>Technology and Food and Beverages</td>
</tr>
<tr>
<td>K</td>
<td>Humanities</td>
</tr>
<tr>
<td>L</td>
<td>Information Science</td>
</tr>
<tr>
<td>M</td>
<td>Persons</td>
</tr>
<tr>
<td>N</td>
<td>Health Care</td>
</tr>
<tr>
<td>V</td>
<td>Publication Type</td>
</tr>
<tr>
<td>Z</td>
<td>Geographical Locations</td>
</tr>
</tbody>
</table>
<p>MeSH terms were associated with Entrez Gene ID by three methods,<br>
<code>gendoo</code>, <code>gene2pubmed</code> and <code>RBBH</code> (Reciprocal Blast Best Hit).</p>
<table>
<thead>
<tr>
<th>Method</th>
<th>Way of corresponding Entrez Gene IDs and MeSH IDs</th>
</tr>
</thead>
<tbody>
<tr>
<td>Gendoo</td>
<td>Text-mining</td>
</tr>
<tr>
<td>gene2pubmed</td>
<td>Manual curation by NCBI teams</td>
</tr>
<tr>
<td>RBBH</td>
<td>sequence homology with BLASTP search (E-value&lt;10<sup>-50</sup>)</td>
</tr>
</tbody>
</table>
<p>Now <a target="_blank" href="https://guangchuangyu.github.io/clusterProfiler">clusterProfiler</a><br>
supports enrichment analysis (over-representation analysis and gene set<br>
enrichment analysis) of gene list or whole expression profile using MeSH<br>
annotation. Data source from <code>gendoo</code>, <code>gene2pubmed</code> and <code>RBBH</code> are all<br>
supported. User can selecte interesting category to test. All 16<br>
categories are supported. The analysis supports >70 species listed in <a target="_blank" href="https://bioconductor.org/packages/release/BiocViews.html#___MeSHDb">MeSHDb BiocView</a>.</p>
<pre><code>source(&quot;https://www.bioconductor.org/biocLite.R&quot;)

if(!require(MeSH.Hsa.eg.db)) {
    biocLite(&quot;MeSH.Hsa.eg.db&quot;)
}

if (!require(&quot;MeSH.db&quot;)) {
    biocLite(&quot;MeSH.db&quot;)
}


library(clusterProfiler)

data(geneList)
de = names(geneList)[1:100]
x &lt;- enrichMeSH(de, MeSHDb = &quot;MeSH.Hsa.eg.db&quot;, database='gendoo', category = 'C')
head(x)

##              ID              Description GeneRatio   BgRatio       pvalue
## D043171 D043171  Chromosomal Instability     16/96 198/16528 2.794765e-14
## D000782 D000782               Aneuploidy     17/96 320/16528 3.866830e-12
## D042822 D042822      Genomic Instability     16/96 312/16528 3.007419e-11
## D012595 D012595    Scleroderma, Systemic     11/96 279/16528 6.449334e-07
## D009303 D009303 Nasopharyngeal Neoplasms     11/96 314/16528 2.049315e-06
## D019698 D019698     Hepatitis C, Chronic     11/96 317/16528 2.246856e-06
##             p.adjust       qvalue
## D043171 2.434241e-11 1.794534e-11
## D000782 1.684004e-09 1.241456e-09
## D042822 8.731539e-09 6.436931e-09
## D012595 1.404343e-04 1.035288e-04
## D009303 3.261686e-04 2.404530e-04
## D019698 3.261686e-04 2.404530e-04
##                                                                                      geneID
## D043171    4312/991/2305/1062/4605/10403/7153/55355/4751/4085/81620/332/7272/9212/1111/6790
## D000782 4312/55143/991/1062/7153/4751/79019/55839/890/983/4085/332/7272/9212/8208/1111/6790
## D042822     55143/991/1062/4605/7153/1381/9787/4751/10635/890/4085/81620/332/9212/1111/6790
## D012595                              4312/6280/1062/4605/7153/3627/4283/6362/7850/3002/4321
## D009303                                4312/7153/3627/6241/983/4085/5918/332/3002/4321/6790
## D019698                               4312/3627/10563/6373/4283/983/6362/7850/332/3002/3620
##         Count
## D043171    16
## D000782    17
## D042822    16
## D012595    11
## D009303    11
## D019698    11
</code></pre>
<p>In the over-representation analysis, we use data source from <code>gendoo</code> and <code>C</code> (Diseases) category.</p>
<p>In the following example, we use data source from <code>gene2pubmed</code> and test category <code>G</code> (Phenomena and Processes) using GSEA.</p>
<pre><code>y &lt;- gseMeSH(geneList, MeSHDb = &quot;MeSH.Hsa.eg.db&quot;, database = 'gene2pubmed', category = &quot;G&quot;)

## [1] &quot;preparing geneSet collections...&quot;
## [1] &quot;GSEA analysis...&quot;
## [1] &quot;leading edge analysis...&quot;
## [1] &quot;done...&quot;

head(y)

##              ID                  Description setSize enrichmentScore
## D009929 D009929                   Organ Size     449      -0.3458797
## D059647 D059647 Gene-Environment Interaction     455      -0.3551242
## D009043 D009043               Motor Activity     398      -0.3391521
## D050156 D050156                 Adipogenesis     368      -0.3618413
## D004041 D004041                 Dietary Fats     314      -0.3427588
## D006339 D006339                   Heart Rate     312      -0.3695689
##               NES      pvalue   p.adjust    qvalues rank
## D009929 -1.524164 0.001248439 0.03715088 0.02756207 2309
## D059647 -1.564984 0.001251564 0.03715088 0.02756207 2237
## D009043 -1.483672 0.001256281 0.03715088 0.02756207 1757
## D050156 -1.577000 0.001256281 0.03715088 0.02756207 2207
## D004041 -1.473730 0.001269036 0.03715088 0.02756207 1684
## D006339 -1.588315 0.001270648 0.03715088 0.02756207 2405
##                           leading_edge
## D009929 tags=27%, list=18%, signal=22%
## D059647 tags=26%, list=18%, signal=22%
## D009043 tags=21%, list=14%, signal=18%
## D050156 tags=26%, list=18%, signal=22%
## D004041 tags=21%, list=13%, signal=19%
## D006339 tags=29%, list=19%, signal=24%
##                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          core_enrichment
## D009929                     154/9846/3315/6716/9732/5139/7337/5530/4086/6532/1499/7157/627/2252/22891/2908/8654/4088/22846/4057/860/268/2735/2104/23522/5480/51131/3082/10253/831/604/1028/182/7173/5624/8743/23047/596/9905/1548/2272/22829/948/27303/4314/196/6019/595/5021/7248/4212/2488/54820/5334/6403/2246/4803/866/5919/79789/1907/7048/1831/4060/2247/5468/8076/5793/3485/1733/3952/126/3778/79068/79633/6653/5244/4313/3625/10468/9201/1501/6720/2273/2099/3480/5764/6387/1471/1462/4016/2690/8817/8821/5125/1191/5350/2162/5744/23541/185/367/4982/25802/4128/150/3479/10451/9370/125/4857/1308/2167/652/57502/4137/8614/5241
## D059647 9497/118/8859/6532/23405/7424/2295/7157/8631/627/2774/22891/2908/4088/51151/11132/1387/860/268/7366/2104/4153/29119/3791/1543/3643/22841/1129/5624/3240/3174/3350/5590/55304/55213/1548/2169/196/8204/8863/5021/23284/9162/11005/4256/3426/84159/5334/629/1793/4208/4322/7048/6817/553/56172/3953/22795/2638/210/5243/5468/1393/1012/27136/51314/4023/5172/4319/4214/3952/5577/126/7832/79068/4313/2944/9369/3075/6720/7494/2099/857/57161/9223/4306/79750/4035/4915/10443/5744/5654/100126791/3551/2487/1746/185/2952/6935/4128/4059/4582/27324/9358/64084/7166/6505/9370/3708/3117/80129/125/5105/2018/2167/652/4137/1524/5241
## D009043                                                                                                                                                                                                       23621/3082/1291/2915/1543/7466/3240/3350/55304/181/2169/27306/80169/9627/196/8678/8863/23284/81627/4692/5799/2259/3087/1278/1277/3953/4747/2247/6414/210/4744/5468/89795/4023/8522/3485/3952/79068/8864/4313/2944/2273/2099/3480/8528/4908/56892/3339/57161/4741/4306/6571/79750/4915/5744/2487/58503/347/6863/2952/5327/367/4982/4128/4059/3572/150/7060/9358/7166/3479/9254/5348/4129/9370/3708/1311/5105/4137/1408/5241
## D050156                                                                                                            5595/8609/9563/27332/1499/79738/4837/7157/79960/5729/408/2908/4088/6500/8038/4057/6649/5564/860/8648/10365/10253/54884/4602/7474/6776/79875/596/25956/8644/80781/79923/1490/50486/7840/84162/6041/4692/2246/4208/11075/63924/5919/284119/2308/9411/54795/5950/79365/2247/5468/50507/6469/8553/4023/594/7350/81029/3952/79068/5733/4313/10468/10628/6720/11213/55893/290/6678/63895/4035/633/23414/8639/2162/165/3551/10788/185/3357/367/4982/3667/1634/4128/23024/3479/6424/9370/2167/652/8839/54829/2625/79689/10974
## D004041                                                                                                                                                                                                                                                                                      3554/4925/22841/7466/2181/3350/201134/181/2169/948/55911/324/4018/3426/3087/6785/2308/1581/56172/3953/1384/5950/2166/60481/5468/5166/50507/1012/27136/4023/7056/4214/9365/7350/3952/3778/79068/8864/2944/6720/5159/3991/2203/2819/9223/4035/32/213/165/347/2152/185/3487/5327/3667/54898/150/64084/3479/9370/5105/5174/2018/5346/7021/79689
## D006339                                                                                                                                                                            4985/7139/8929/3784/3375/154/1760/9781/5139/118/2702/6532/6416/2869/270/7157/627/2908/7138/5563/3643/1129/7779/947/2034/4179/64388/1621/4881/8863/5021/844/4212/11030/5797/6403/4803/84059/79789/5176/3953/5243/5468/1012/2868/5793/4023/7056/3952/5577/126/2946/3778/477/5733/4313/2944/9201/3075/9499/2273/2099/1471/857/775/4306/4487/213/5350/5744/23245/2152/2697/2791/185/6863/2952/5327/80206/9607/3572/150/3479/2006/55259/9370/125/652/55351
</code></pre>
<p><a target="_blank" href="https://guangchuangyu.github.io/clusterProfiler">clusterProfiler</a> inherits visualization methods implemented in <a target="_blank" href="https://guangchuangyu.github.io/DOSE">DOSE</a> and we can visualize these enrichment results by <code>barplot</code>, <code>dotplot</code>, <code>cnetplot</code>, <code>enrichMap</code> <em>etc</em>. With these visualization methods, it’s much easier to interpret enriched results.</p>
<pre><code>gseaplot(y, y[1,1], title=y[1,2])
</code></pre>
<p><img alt="" src="https://i2.wp.com/guangchuangyu.github.io/blog_images/Bioconductor/clusterProfiler/mesh_gsea.png?w=456&ssl=1" data-recalc-dims="1"></p>
<p><div><div><div><div data-width="55" data-show-faces="false" data-send="true" data-layout="box_count" data-height="62" data-href="https://www.r-bloggers.com/using-clusterprofiler-for-mesh-enrichment-analysis/"></div></div><div><a data-url="https://www.r-bloggers.com/using-clusterprofiler-for-mesh-enrichment-analysis/" data-counturl="https://www.r-bloggers.com/using-clusterprofiler-for-mesh-enrichment-analysis/" data-count="vertical" data-text="using clusterProfiler for MeSH Enrichment Analysis" class="twitter-share-button" data-via="rbloggers" href="https://twitter.com/share"></a></div><div></div></div><div></div></div>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="https://guangchuangyu.github.io/2016/08/using-clusterprofiler-for-mesh-enrichment-analysis"> R on Guangchuang YU</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 title="The R Project for Statistical Computing" rel="nofollow" href="https://www.r-project.org/">R</a> news and <a title="R tutorials" rel="nofollow" href="https://www.r-bloggers.com/?s=tutorial">tutorials</a> on topics such as: <a title="Data science" rel="nofollow" href="https://www.r-bloggers.com/?s=data%20science">Data science</a>, <a title="Big Data" rel="nofollow" href="https://www.r-bloggers.com/?s=Big%20Data">Big Data, <a title="R jobs" rel="nofollow" href="https://www.r-users.com/">R jobs</a>, visualization (<a title="ggplot and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/?s=ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/?s=boxplot">Boxplots</a>, <a title="Maps and gis" rel="nofollow" href="https://www.r-bloggers.com/?s=map">maps</a>, <a title="Animation in R" rel="nofollow" href="https://www.r-bloggers.com/?s=animation">animation</a>), programming (<a title="RStudio IDE for R" rel="nofollow" href="https://www.r-bloggers.com/?s=RStudio">RStudio</a>, <a title="Sweave and literate programming" rel="nofollow" href="https://www.r-bloggers.com/?s=sweave">Sweave</a>, <a title="LaTeX in R" rel="nofollow" href="https://www.r-bloggers.com/?s=LaTeX">LaTeX</a>, <a title="SQL and databases" rel="nofollow" href="https://www.r-bloggers.com/?s=SQL">SQL</a>, <a title="Eclipse IDE for R" rel="nofollow" href="https://www.r-bloggers.com/?s=eclipse">Eclipse</a>, <a title="git and github, Version Control System" rel="nofollow" href="https://www.r-bloggers.com/?s=git">git</a>, <a title="Large data in R using Hadoop" rel="nofollow" href="https://www.r-bloggers.com/?s=hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" rel="nofollow" href="https://www.r-bloggers.com/?s=Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" rel="nofollow" href="https://www.r-bloggers.com/?s=regression">regression</a>, <a title="principal component analysis tutorial" rel="nofollow" href="https://www.r-bloggers.com/?s=PCA">PCA</a>, <a title="Time series" rel="nofollow" href="https://www.r-bloggers.com/?s=time+series">time series</a>, <a title="finance trading" rel="nofollow" href="https://www.r-bloggers.com/?s=trading">trading</a>) and more...
<img height="1" alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/i2zA36ix7zI"></a></div>