emapplot是富集分析可视化的一种,展示有共同基因的通路,详见://www.greatytc.com/p/c45cc2e3890f
前几天上课时,原本能运行的emapplot发生了报错,我猜这个是版本问题,就去查了一下,发现11月15号,enrichplot刚更新了一下。
1.示例数据
library(clusterProfiler)
##
## clusterProfiler v3.18.0 For help: https://guangchuangyu.github.io/software/clusterProfiler
##
## If you use clusterProfiler in published research, please cite:
## Guangchuang Yu, Li-Gen Wang, Yanyan Han, Qing-Yu He. clusterProfiler: an R package for comparing biological themes among gene clusters. OMICS: A Journal of Integrative Biology. 2012, 16(5):284-287.
##
## Attaching package: 'clusterProfiler'
## The following object is masked from 'package:stats':
##
## filter
library(DOSE)
## DOSE v3.16.0 For help: https://guangchuangyu.github.io/software/DOSE
##
## If you use DOSE in published research, please cite:
## Guangchuang Yu, Li-Gen Wang, Guang-Rong Yan, Qing-Yu He. DOSE: an R/Bioconductor package for Disease Ontology Semantic and Enrichment analysis. Bioinformatics 2015, 31(4):608-609
library(enrichplot)
data(geneList)
de <- names(geneList)[1:100]
x <- enrichDO(de)
2.问题重现
我的版本是1.4.0,画emapplot直接运行emapplot(X)
即可
但学员运行时出了错
emapplot(x)
## Error in has_pairsim(x): Term similarity matrix not available. Please use pairwise_termsim function to deal with the results of enrichment analysis.
经过核实,我问了他的版本是1.10.0,我的版本是1.4.0,因为学员的包都是课前安装的,而我的很早前就安装啦。
3.解决办法
我把clusterprofiler和erichplot都更新到最新版本,查看emapplot的帮助文档,发现y叔写了滴,照搬即可
x2 <- pairwise_termsim(x)
emapplot(x2)
为啥要多加这么一步,俺也不知道,俺也不敢问,反正这是事实,知道怎么解决就行了呗,在非常多编程问题里,“为什么”没啥重要的。