在R中用enrichKEGG函数进行富集分析时,发现一直报错,尝试修改网络,导入library(DO.db)等网上的解决方法时都没有用,还是出现如下报错,
> kegg = enrichKEGG(genes$ENTREZID,organism = "mmu",pvalueCutoff = 1)
Reading KEGG annotation online:
fail to download KEGG data...
Error in download.KEGG.Path(species) :
'species' should be one of organisms listed in 'http://www.genome.jp/kegg/catalog/org_list.html'...
In addition: Warning message:
In utils::download.file(url, quiet = TRUE, method = method, ...) :
URL 'https://rest.kegg.jp/link/mmu/pathway': status was 'Couldn't connect to server'
偶然间看到jimmy老师的博客,尝试了下,解决了问题。运行下面代码即可
install.packages("R.utils")
R.utils::setOption("clusterProfiler.download.method",'auto')