R studio运行别人共享的关于差异基因GO富集分析作图的代码,报错如图。检索网页后未找到解决办法,更新R包到最新版后依然报错。请前辈们支招,谢谢!
报错:
Error in has_pairsim(x) :
Term similarity matrix not available. Please use pairwise_termsim function to deal with the results of enrichment analysis.
出错部分:
> for(i in c("BP","CC","MF")){
+ #GO???????
+ kk=enrichGO(gene = gene,OrgDb = org.Hs.eg.db, pvalueCutoff =1, qvalueCutoff = 1, ont=i, readable =T)
+ GO=as.data.frame(kk)
+ GO=GO[(GO$pvalue
+ showNum=30
+ if(nrow(GO)<30){
+ showNum=nrow(GO)
+ }
+ if(nrow(GO)!=0){
+ #?״ͼ
+ pdf(file=paste0(i,".barplot.pdf"),width = 11,height = 7)
+ bar=barplot(kk, drop = TRUE, showCategory =showNum,color = colorSel)
+ print(bar)
+ dev.off()
+
+ #??ͼ
+ pdf(file=paste0(i,".bubble.pdf"),width = 11,height = 7)
+ bub=dotplot(kk,showCategory = showNum, orderBy = "GeneRatio", color = colorSel)
+ print(bub)
+ dev.off()
+
+ #Ȧͼ
+ pdf(file=paste0(i,".circos.pdf"),width = 8,height = 5.5)
+ cnet=cnetplot(kk, foldChange=geneFC, circular = TRUE, colorEdge = TRUE)
+ print(cnet)
+ dev.off()
+
+ #Enrichment Map
+ pdf(file=paste0(i,".emapplot.pdf"),width = 7,height = 6)
+ emap=emapplot(kk, showCategory = showNum, color = colorSel)
+ print(emap)
+ dev.off()
+ }
+ }



