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

created at 06-03-2022 views: 22


Change the source of the clusterProfiler package and recompile


download the source code: Bioconductor clusterProfiler

download source code


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


Change http in both lines 131 and 137 to https

change http to https


Uninstall the original clusterProfiler package


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


Rerun the code, no more errors


  • 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",


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: