Help with enrichKEGG function in clusterProfiler
1
1
Entering edit mode
1992 ▴ 10
@1992-9673
Last seen 5.9 years ago

Dear all,

I've been using clusterProfiler for enrichment analysis of my illumina microarray data. When I try to use the function enrichKEGG I am facing following error. Any one has encountered this error. What might be the problem.

kk=enrichKEGG(gene=genes, organism="human", pvalueCutoff=0.05, pAdjustMethod="BH", qvalueCutoff=0.1, readable=FALSE)
Error in .getUrl(url, .listParser, nameColumn = 1, valueColumn = 2) : 
  invalid request, server returned Success: (200) OK (http://rest.kegg.jp/link/hsa/pathway)

sessioninfo()

R version 3.2.3 (2015-12-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 14.04.3 LTS

locale:
 [1] LC_CTYPE=en_IN          LC_NUMERIC=C            LC_TIME=en_IN          
 [4] LC_COLLATE=en_IN        LC_MONETARY=en_IN       LC_MESSAGES=en_IN      
 [7] LC_PAPER=en_IN          LC_NAME=en_IN           LC_ADDRESS=en_IN       
[10] LC_TELEPHONE=en_IN      LC_MEASUREMENT=en_IN    LC_IDENTIFICATION=en_IN

attached base packages:
[1] parallel  stats4    stats     graphics  grDevices utils     datasets 
[8] methods   base     

other attached packages:
 [1] RDAVIDWebService_1.6.0    ggplot2_2.0.0            
 [3] GOstats_2.34.0            Category_2.34.2          
 [5] Matrix_1.2-3              KEGGREST_1.8.1           
 [7] GO.db_3.1.2               clusterProfiler_2.2.7    
 [9] hgu133plus2.db_3.1.3      SPIA_2.20.0              
[11] KEGGgraph_1.26.0          graph_1.46.0             
[13] XML_3.98-1.3              illuminaHumanv4.db_1.26.0
[15] org.Hs.eg.db_3.1.2        RSQLite_1.0.0            
[17] DBI_0.3.1                 AnnotationDbi_1.30.1     
[19] GenomeInfoDb_1.4.3        IRanges_2.2.9            
[21] S4Vectors_0.6.6           Biobase_2.28.0           
[23] BiocGenerics_0.14.0       limma_3.24.15            

loaded via a namespace (and not attached):
 [1] qvalue_2.0.0           genefilter_1.50.0      reshape2_1.4.1        
 [4] splines_3.2.3          rJava_0.9-8            lattice_0.20-33       
 [7] colorspace_1.2-6       RBGL_1.44.0            survival_2.38-3       
[10] plyr_1.8.3             KEGG.db_3.1.2          stringr_1.0.0         
[13] zlibbioc_1.14.0        Biostrings_2.36.4      munsell_0.4.2         
[16] GOSemSim_1.26.0        gtable_0.1.2           labeling_0.3          
[19] BiocInstaller_1.18.5   curl_0.9.5             GSEABase_1.30.2       
[22] Rcpp_0.12.3            xtable_1.8-2           scales_0.3.0          
[25] DO.db_2.9              annotate_1.46.1        XVector_0.8.0         
[28] png_0.1-7              stringi_1.0-1          grid_3.2.3            
[31] DOSE_2.6.6             tools_3.2.3            magrittr_1.5          
[34] httr_1.1.0             AnnotationForge_1.10.1 R6_2.1.2              
[37] igraph_1.0.1    

Output of BiocInstaller::biocValid() : 15 packages are outdated. (I am updating those)

But the data provided with package was running properly. My data is also in same format, I am not understanding where the problem is.

I will provide more details, if required.

Thank you.

clusterprofiler • 6.1k views
ADD COMMENT
0
Entering edit mode

Please add the output of the sessionInfo() command to your question. Please also confirm that BiocInstaller::biocValid() returns TRUE, or update your packages, especially KEGGREST, if necessary.

ADD REPLY
0
Entering edit mode

Thank you for your reply. Question updated.

ADD REPLY
1
Entering edit mode
@martin-morgan-1513
Last seen 6 weeks ago
United States

The problem is that the KEGG server changed the format of thereturn value, and KEGGREST is failing to detect that the return value is actually OK. KEGGREST has been updated in the release and devel versions of Bioconductor, but you're using an older version (KEGGREST is at version 1.10.1 in the current release, note the '10' versus your '8'; likewise BiocInstaller [which determines the version of Bioconductor you are using] is at version 1.18.5 versus 1.20.1 in release, as seen on the always-release package landing page https://bioconductor.org/packages/release/BiocInstaller.

To fix this, you'll need to upgrade Bioconductor. For your version of R, this means

BiocInstaller::biocLite("BiocUpgrade")

It might be 'painful' in the sense that all Bioconductor packages will be updated, so make sure it is not immediately before thesis defense / grant deadline / etc.

ADD COMMENT
0
Entering edit mode

Thank you very much for explanation. But why it is running properly with their data set?  

ADD REPLY
1
Entering edit mode

If you get the same error with the current version of Bioconductor, then the answer must involve the inputs you provide to the function, compared to the inputs provided by the sample data set. Try to narrow your data set down to the smallest example possible (smallest number of genes) that still produces the same error, and look carefully at those values. If you're still unable to tell what the problem is, then you'll have to arrange to share your data (genes) some how, so others can reproduce the problem without being on your computer.

ADD REPLY
0
Entering edit mode

I will definitely share if I get same error after upgrading. Thank you. 

ADD REPLY
0
Entering edit mode

thank you very much for your explanation. I have problems with enrichKEGG function and I really don't know how to solve them. It seems a problem with the KEGG database.

Thank you

library(clusterProfiler) #version v4.2.0
library(KEGGREST) #version v1.34.0

musmusculus = search_kegg_organism('Mus musculus', by='scientific_name')
dim(musmusculus)
head(musmusculus)

kk_up = enrichKEGG(gene = gene_up, organism = 'mmu', pvalueCutoff = 0.05, qvalueCutoff = 0.05, use_internal_data = F)
# 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'...
# Además: Warning message:
#   In utils::download.file(url, quiet = TRUE, method = method, ...) :
#   URL 'http://rest.kegg.jp/link/mmu/pathway': status was 'Couldn't connect to server'

#https://support.bioconductor.org/p/78048/


kk_up = enrichKEGG(gene = gene_up, organism = 'mmu', pvalueCutoff = 0.05, qvalueCutoff = 0.05, use_internal_data = T)
# Failed with error:  ‘there is no package called ‘KEGG.db’’
# Error in (function (cond) : 
#             error in evaluating the argument 'x' in selecting a method for function 'as.list': there is no package called ‘KEGG.db’
ADD REPLY
0
Entering edit mode

Solved!!! The KEGG.db package has been depreceated at Bioconductor 3.12, so I had to download locally (v3.2.4) and just... works!!!

ADD REPLY
0
Entering edit mode

Can you please provide the steps/code?

ADD REPLY
1
Entering edit mode

The KEGG.db package has been deprecated at Bioconductor. Here are the steps to use KEGG.db in the clusterProfiler

  • Download the KEGG.db zip file locally from Bioconductor URL
            [https://www.bioconductor.org/packages/3.11/data/annotation/src/contrib/KEGG.db_3.2.4.tar.gz]
    
  • Install the KEGG.db locally
            install.packages("C:/path where KEGG.db downloaded/KEGG.db_3.2.4.tar.gz", repos = NULL, type = "source")
  • Add "use_internal_data = T" option in enrichKEGG or any other functions which are using the KEGG.db
    enrichKEGG(entrez.id, organism="mouse", pvalueCutoff=0.05, pAdjustMethod="BH", qvalueCutoff=0.1, use_internal_data = T)
ADD REPLY

Login before adding your answer.

Traffic: 904 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6