本文轉(zhuǎn)載自:http://www.360doc.com/content/22/0604/23/76149697_1034565139.shtml
最近在做KEGG富集分析時,碰到了一個問題,問題如下:
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/hsa/pathway': status was 'Failure when receiving data from the peer'
通過學(xué)習(xí)Jimmy老師的文章,http://www.360doc.com/content/22/0604/23/76149697_1034565139.shtml,問題已解決,非常感謝Jimmy老師!在此做一個記錄,僅供學(xué)習(xí)交流,如有侵權(quán),請聯(lián)系我,立馬撤掉。
Y叔的clusterProfiler包的下載協(xié)議是:
getOption("clusterProfiler.download .method")
[1]"libcurl"
下載函數(shù)(utils:.download.file和downloader:.download)使用默認(rèn)的方法,也就是 'auto’是可以去訪問的,
但是如果是"libcurl"的協(xié)議,就會失敗。
所以,最簡單的解決方案就是修改這個默認(rèn)的協(xié)議即可,解決方案:
install.packages("R.utils")
library(R.utils)
R.utils::setOption("clusterProfiler.download.method","auto")
之后,再運行enrichKEGG就可以跑通了。

KEGG數(shù)據(jù)庫沒有倒閉,Y叔的clusterProfiler包也問題不大。僅僅是因為R語言里面的下載文件的函數(shù)的協(xié)議需要注意,這兩個函數(shù)兩個下載函數(shù)(utils:download.file和downloader:.download),都太底層了。初學(xué)者確實不容易找到問題所在。
道阻且長,行則將至 行而不輟,未來可期