R clusterProfiler enrichKEGG error: "Wrong 'species' or the network is unreachable."

created at 06-03-2022 views: 22

solution

Change the source of the clusterProfiler package and recompile

step1

download the source code: Bioconductor clusterProfiler

download source code

step2

After decompression, enter \clusterProfiler\R and find the file kegg-utilities.R

step3

Change http in both lines 131 and 137 to https

change http to https

step4

Uninstall the original clusterProfiler package

step5

Recompile the new clusterProfiler package: in RStudio select File->New Project -> select the downloaded source folder ->

recompile

Rerun the code, no more errors

environments

  • clusterProfiler version: 4.4.1
  • R language version: 4.2.0
  • The dependencies of the ClusterProfiler package are all the latest versions

error code

kk.degene <- enrichKEGG(gene = c('12306','12307'),
                        organism = 'hsa',
                        #universe = gene_all,
                        pvalueCutoff = 0.05,
                        qvalueCutoff = 0.05)

error message

"Failed to download KEGG data.",
"Wrong 'species' or the network is unreachable.",
"The 'species' should be one of organisms listed in",
"'https://www.genome.jp/kegg/catalog/org_list.html'"

analyze

Because it is a sudden problem, I have never encountered this problem before, so considering the version problem of the clusterProfiler package or R, I first adopted the method of updating the R version and the clusterProfiler package, but no can be resolved. Further search for information, the online solution "change the network" or change hsa to human does not work. By viewing the update information of the API and the source code, it is found that there may be problems:

  • KEGG API changed, from HTTP to HTTPS
created at:06-03-2022
edited at: 06-03-2022: