先來(lái)一段搞笑的街頭賣(mài)膏藥的視頻,大家可以?shī)蕵?lè)一下再繼續(xù)往下看,因?yàn)槲医酉聛?lái)就是要賣(mài)Y叔版「膏藥」!
大家喜歡clusterProfiler
,除了功能強(qiáng)大、支持廣泛之外,我想還有一點(diǎn)必須是可視化,畢竟大家都是視覺(jué)動(dòng)物,顏值即正義。然而這些都是我早期的代碼,我其實(shí)一直想重新寫(xiě),希望可以全部用gplot2
來(lái)實(shí)現(xiàn),方便后續(xù)維護(hù)、更好看、更強(qiáng)大。而這在我博士畢業(yè)后,終于找了個(gè)時(shí)間重寫(xiě)了一遍,并且也加入了部分新的圖形,我把這些代碼重新打包,已經(jīng)在Bioconductor上,叫enrichplot
。有了這個(gè)包,你們更加對(duì)clusterProfiler
系列包無(wú)法自拔,讓其它的工具毫無(wú)顏色。
The enrichplot package implements several methods for enrichment result visualization to help interpretation. It supports both hypergeometric test and gene set enrichment analysis. Both of them are widely used to characterize pathway/function relationships to elucidate molecular mechanisms from high-throughput genomic data.
The enrichplot package supports visualizing enrichment results obtained from
DOSE (Yu et al. 2015), clusterProfiler (Yu et al. 2012), ReactomePA (Yu and He 2016) and meshes.
Gene Ontology (GO) is organized as a directed acyclic graph. An insighful way of looking at the results of the analysis is to investigate how the significant GO terms are distributed over the GO graph. The goplot
function shows subgraph induced by most significant GO terms.
library(clusterProfiler)
data(geneList, package='DOSE')
de <->->abs(geneList) > 2]
ego <- enrichgo(de,="" orgdb="">->'org.Hs.eg.db', ont='BP', readable=TRUE)
library(enrichplot)
goplot(ego)
Bar plot is the most widely used method to visualize enriched terms. It depicts the enrichment scores (e.g. p values) and gene count or ratio as bar height and color.
barplot(ego, showCategory=20)
Dot plot is similar to bar plot with the capability to encode another score as dot size. Both barplot
and dotplot
supports facetting to visualize sub-ontologies simultaneously.
dotplot(ego, showCategory=30)
go <- enrichgo(de,="" orgdb="">->'org.Hs.eg.db', ont='all')
dotplot(go, split='ONTOLOGY') + facet_grid(ONTOLOGY~., scale='free')
Both the barplot
and dotplot
only displayed most significant enriched terms, while users may want to know which genes are involved in these significant terms. The cnetplot
depicts the linkages of genes and biological concepts (e.g. GO terms or KEGG pathways) as a network.
## remove redundent GO terms
ego2 <->->
cnetplot(ego2, foldChange=geneList)
cnetplot(ego2, foldChange=geneList, circular = TRUE, colorEdge = TRUE)
The upsetplot
is an alternative to cnetplot
for visualizing the complex association between genes and gene sets. It emphasizes the gene overlapping among different gene sets.
upsetplot(ego)
The heatplot
is similar to cnetplot
, while displaying the relationships as a heatmap. The gene-concept network may become too complicated if user want to show a large number significant terms. The heatplot
can simplify the result and more easy to identify expression patterns.
heatplot(ego2)
heatplot(ego2, foldChange=geneList)
Enrichment map organizes enriched terms into a network with edges connecting overlapping gene sets. In this way, mutually overlapping gene sets are tend to cluster together, making it easy to identify functional module.
emapplot(ego2)
The ridgeplot
will visualize expression distributions of core enriched genes for GSEA enriched categories. It helps users to interpret up/down-regulated pathways.
kk - gseKEGG(geneList, nPerm=10000)
ridgeplot(kk)
Running score and preranked list are traditional methods for visualizing GSEA result. The enrichplot package supports both of them to visualize the distribution of the gene set and the enrichment score.
gseaplot(kk, geneSetID = 1, by = 'runningScore', title = kk$Description[1])
gseaplot(kk, geneSetID = 1, by = 'preranked', title = kk$Description[1])
gseaplot(kk, geneSetID = 1, title = kk$Description[1])
Yu, Guangchuang, and Qing-Yu He. 2016. “ReactomePA: An R/Bioconductor Package for Reactome Pathway Analysis and Visualization.” Molecular BioSystems 12 (2): 477–79. doi:10.1039/C5MB00663E.
Yu, Guangchuang, Li-Gen Wang, Yanyan Han, and Qing-Yu He. 2012. “clusterProfiler: an R Package for Comparing Biological Themes Among Gene Clusters.” OMICS: A Journal of Integrative Biology 16 (5): 284–87. doi:10.1089/omi.2011.0118.
Yu, Guangchuang, Li-Gen Wang, Guang-Rong Yan, and Qing-Yu He. 2015. “DOSE: An R/Bioconductor Package for Disease Ontology Semantic and Enrichment Analysis.” Bioinformatics 31 (4): 608–9. doi:10.1093/bioinformatics/btu684.
聯(lián)系客服