clusterProfiler icon indicating copy to clipboard operation
clusterProfiler copied to clipboard

Error in enrichKEGG() function

Open BIGRICEgo opened this issue 2 years ago • 4 comments

Hi, I encountered some difficulties using enrichKEGG() function, for the example from document page:

gene <- names(geneList)[abs(geneList) > 2]
kk <- enrichKEGG(gene         = gene,
                 organism     = 'hsa',
                 pvalueCutoff = 0.05)

results show,

--> No gene can be mapped....
--> Expected input gene ID: 
--> return NULL...

And my current version of the packages are as below.

> packageVersion("clusterProfiler")
[1] ‘4.8.3’
> sessionInfo()
R version 4.3.1 (2023-06-16 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)

Matrix products: default


locale:
[1] LC_COLLATE=Chinese (Simplified)_China.936  LC_CTYPE=Chinese (Simplified)_China.936   
[3] LC_MONETARY=Chinese (Simplified)_China.936 LC_NUMERIC=C                              
[5] LC_TIME=Chinese (Simplified)_China.936    

time zone: Asia/Shanghai
tzcode source: internal

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

other attached packages:
[1] clusterProfiler_4.8.3

loaded via a namespace (and not attached):
  [1] RColorBrewer_1.1-3      jsonlite_1.8.7          rstudioapi_0.15.0       magrittr_2.0.3         
  [5] farver_2.1.1            fs_1.6.3                zlibbioc_1.46.0         vctrs_0.6.3            
  [9] memoise_2.0.1           RCurl_1.98-1.12         ggtree_3.8.2            htmltools_0.5.6        
 [13] usethis_2.2.2           curl_5.0.2              gridGraphics_0.5-1      htmlwidgets_1.6.2      
 [17] desc_1.4.2              plyr_1.8.8              cachem_1.0.8            createKEGGdb_0.0.3     
 [21] igraph_1.5.1            mime_0.12               lifecycle_1.0.3         pkgconfig_2.0.3        
 [25] gson_0.1.0              Matrix_1.5-4.1          R6_2.5.1                fastmap_1.1.1          
 [29] GenomeInfoDbData_1.2.10 shiny_1.7.5             digest_0.6.33           aplot_0.2.1            
 [33] enrichplot_1.20.3       colorspace_2.1-0        patchwork_1.1.3         AnnotationDbi_1.62.2   
 [37] S4Vectors_0.38.1        ps_1.7.5                rprojroot_2.0.3         pkgload_1.3.2.1        
 [41] RSQLite_2.3.1           fansi_1.0.4             httr_1.4.7              polyclip_1.10-4        
 [45] compiler_4.3.1          remotes_2.4.2.1         bit64_4.0.5             withr_2.5.0            
 [49] downloader_0.4          BiocParallel_1.34.2     viridis_0.6.4           DBI_1.1.3              
 [53] pkgbuild_1.4.2          ggforce_0.4.1           R.utils_2.12.2          MASS_7.3-60            
 [57] sessioninfo_1.2.2       HDO.db_0.99.1           tools_4.3.1             scatterpie_0.2.1       
 [61] ape_5.7-1               httpuv_1.6.11           R.oo_1.25.0             glue_1.6.2             
 [65] callr_3.7.3             nlme_3.1-162            GOSemSim_2.26.1         promises_1.2.1         
 [69] shadowtext_0.1.2        grid_4.3.1              reshape2_1.4.4          fgsea_1.26.0           
 [73] generics_0.1.3          gtable_0.3.4            R.methodsS3_1.8.2       tidyr_1.3.0            
 [77] data.table_1.14.8       tidygraph_1.2.3         utf8_1.2.3              XVector_0.40.0         
 [81] BiocGenerics_0.46.0     ggrepel_0.9.3           pillar_1.9.0            stringr_1.5.0          
 [85] yulab.utils_0.1.0       later_1.3.1             splines_4.3.1           dplyr_1.1.3            
 [89] tweenr_2.0.2            treeio_1.24.3           lattice_0.21-8          bit_4.0.5              
 [93] tidyselect_1.2.0        GO.db_3.17.0            Biostrings_2.68.1       miniUI_0.1.1.1         
 [97] gridExtra_2.3           IRanges_2.34.1          stats4_4.3.1            graphlayouts_1.0.1     
[101] Biobase_2.60.0          devtools_2.4.5          stringi_1.7.12          lazyeval_0.2.2         
[105] ggfun_0.1.3             codetools_0.2-19        ggraph_2.1.0            tibble_3.2.1           
[109] qvalue_2.32.0           BiocManager_1.30.22     ggplotify_0.1.2         cli_3.6.1              
[113] xtable_1.8-4            munsell_0.5.0           processx_3.8.2          Rcpp_1.0.11            
[117] GenomeInfoDb_1.36.3     png_0.1-8               parallel_4.3.1          ellipsis_0.3.2         
[121] ggplot2_3.4.3           blob_1.2.4              prettyunits_1.1.1       profvis_0.3.8          
[125] DOSE_3.26.1             urlchecker_1.0.1        bitops_1.0-7            tidytree_0.4.5         
[129] viridisLite_0.4.2       scales_1.2.1            purrr_1.0.2             crayon_1.5.2           
[133] rlang_1.1.1             cowplot_1.1.1           fastmatch_1.1-4         KEGGREST_1.40.0  

Additionally, when I ran into trouble when produceing KEGG.db by createKEGGdb package. I can't install KEGG.db.

> remotes::install_github('YuLab-SMU/createKEGGdb')
Downloading GitHub repo YuLab-SMU/createKEGGdb@HEAD
Skipping 1 packages not available: clusterProfiler
-- R CMD build ----------------------------------------------------------------------------------------------
v  checking for file 'C:\Users\hoffnungslos\AppData\Local\Temp\RtmpCAhIOd\remotes2c5464656e92\YuLab-SMU-createKEGGdb-c7f6308/DESCRIPTION' (396ms)
-  preparing 'createKEGGdb':
v  checking DESCRIPTION meta-information ... 
-  checking for LF line-endings in source and make files and shell scripts
-  checking for empty or unneeded directories
   Omitted 'LazyData' from DESCRIPTION
-  building 'createKEGGdb_0.0.3.tar.gz'
   
将程序包安装入‘C:/Users/hoffnungslos/AppData/Local/R/win-library/4.3’
(因为‘lib’没有被指定)
* installing *source* package 'createKEGGdb' ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (createKEGGdb)
> createKEGGdb::create_kegg_db(c('hsa','mmu'))
Reading KEGG annotation online: "https://rest.kegg.jp/list/pathway/hsa"...
Reading KEGG annotation online: "https://rest.kegg.jp/list/pathway/mmu"...
Reading KEGG annotation online: "https://rest.kegg.jp/link/hsa/pathway"...
2023-09-22 15:33:54.101141 Getting KEGG data of hsa.
2023-09-22 15:33:54.155461 KEGG data of hsa has been downloaded.
2023-09-22 15:33:54.21737 KEGG data of hsa has been added to the sqlite database.
Reading KEGG annotation online: "https://rest.kegg.jp/link/mmu/pathway"...
2023-09-22 15:33:54.667968 Getting KEGG data of mmu.
2023-09-22 15:33:54.752116 KEGG data of mmu has been downloaded.
2023-09-22 15:33:54.795117 KEGG data of mmu has been added to the sqlite database.
-- R CMD build ----------------------------------------------------------------------------------------------
v  checking for file 'C:\Users\hoffnungslos\AppData\Local\Temp\RtmpCAhIOd\file2c54748ccb7/DESCRIPTION' (369ms)
-  preparing 'KEGG.db':
v  checking DESCRIPTION meta-information ... 
-  checking for LF line-endings in source and make files and shell scripts
-  checking for empty or unneeded directories
-  building 'KEGG.db_1.0.tar.gz'
   
[1] "./KEGG.db_1.0.tar.gz"
Warning messages:
1: In utils::download.file(url, quiet = TRUE, method = method, ...) :
  the 'wininet' method is deprecated for http:// and https:// URLs
2: In utils::download.file(url, quiet = TRUE, method = method, ...) :
  the 'wininet' method is deprecated for http:// and https:// URLs
3: In utils::download.file(url, quiet = TRUE, method = method, ...) :
  the 'wininet' method is deprecated for http:// and https:// URLs
4: In utils::download.file(url, quiet = TRUE, method = method, ...) :
  the 'wininet' method is deprecated for http:// and https:// URLs
> install.packages('KEGG.db_1.0.tar.gz',type = 'source')
将程序包安装入‘C:/Users/hoffnungslos/AppData/Local/R/win-library/4.3’
(因为‘lib’没有被指定)
Warning in install.packages :
  package ‘KEGG.db_1.0.tar.gz’ is not available for this version of R

A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages
> library(KEGG.db)
Error in library(KEGG.db) : 不存在叫‘KEGG.db’这个名字的程辑包

Looking forward to your reply!

BIGRICEgo avatar Sep 22 '23 08:09 BIGRICEgo

I have the same troble, are you resolve that? Is there some thing wrong with our Internet issue?

SSSYDYSSS avatar Sep 30 '23 07:09 SSSYDYSSS

I have the same troble, are you resolve that? Is there some thing wrong with our Internet issue?

no, I just put aside this R package for the time being.

BIGRICEgo avatar Oct 02 '23 10:10 BIGRICEgo

@BIGRICEgo

  1. Please make sure you have the KEGG.db_1.0.tar.gz file in your working directory
  2. Or use the latest version of clusterProfiler.

huerqiang avatar Oct 03 '23 02:10 huerqiang

Dear all,

I have the same problem. My ClusterProfiler Version should be uptodate. How can I check whether the automatic download has worked?

> head (gene.Entrez)
   13024    12575    11815    20716    19215    57435 
3.058626 2.888222 2.861515 2.474483 2.081870 2.034194 
> enrichWP(gene.Entrez, organism = "Mus musculus") 
--> No gene can be mapped....
--> Expected input gene ID: 16453,15519,18024,13871,209357,69227
--> return NULL...
NULL

sessionInfo() R version 4.4.0 (2024-04-24 ucrt) Platform: x86_64-w64-mingw32/x64 Running under: Windows 10 x64 (build 19045)

Matrix products: default

locale: [1] LC_COLLATE=German_Germany.utf8 LC_CTYPE=German_Germany.utf8 LC_MONETARY=German_Germany.utf8 [4] LC_NUMERIC=C LC_TIME=German_Germany.utf8

time zone: Europe/Berlin tzcode source: internal

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

other attached packages: [1] openxlsx_4.2.5.2 VennDiagram_1.7.3 futile.logger_1.4.3 scales_1.3.0
[5] ggplot2_3.5.1 Seurat_5.1.0 pathview_1.44.0 gprofiler2_0.2.3
[9] DOSE_3.30.1 enrichplot_1.24.0 org.Mm.eg.db_3.19.1 AnnotationDbi_1.66.0
[13] IRanges_2.38.0 S4Vectors_0.42.0 Biobase_2.64.0 BiocGenerics_0.50.0
[17] clusterProfiler_4.12.0 SeuratObject_5.0.2 sp_2.1-4

loaded via a namespace (and not attached): [1] fs_1.6.4 matrixStats_1.3.0 spatstat.sparse_3.0-3
[4] bitops_1.0-7 HDO.db_0.99.1 httr_1.4.7
[7] RColorBrewer_1.1-3 Rgraphviz_2.48.0 tools_4.4.0
[10] sctransform_0.4.1 utf8_1.2.4 R6_2.5.1
[13] lazyeval_0.2.2 uwot_0.2.2 withr_3.0.0
[16] gridExtra_2.3 progressr_0.14.0 cli_3.6.2
[19] formatR_1.14 spatstat.explore_3.2-7 fastDummies_1.7.3
[22] scatterpie_0.2.2 labeling_0.4.3 KEGGgraph_1.64.0
[25] spatstat.data_3.0-4 ggridges_0.5.6 pbapply_1.7-2
[28] yulab.utils_0.1.4 gson_0.1.0 parallelly_1.37.1
[31] RSQLite_2.3.7 generics_0.1.3 gridGraphics_0.5-1
[34] ica_1.0-3 spatstat.random_3.2-3 dplyr_1.1.4
[37] zip_2.3.1 GO.db_3.19.1 Matrix_1.7-0
[40] fansi_1.0.6 abind_1.4-5 lifecycle_1.0.4
[43] SummarizedExperiment_1.34.0 qvalue_2.36.0 SparseArray_1.4.5
[46] Rtsne_0.17 blob_1.2.4 promises_1.3.0
[49] crayon_1.5.2 miniUI_0.1.1.1 lattice_0.22-6
[52] cowplot_1.1.3 KEGGREST_1.44.0 pillar_1.9.0
[55] fgsea_1.30.0 GenomicRanges_1.56.0 future.apply_1.11.2
[58] codetools_0.2-20 fastmatch_1.1-4 leiden_0.4.3.1
[61] glue_1.7.0 ggfun_0.1.4 data.table_1.15.4
[64] remotes_2.5.0 vctrs_0.6.5 png_0.1-8
[67] treeio_1.28.0 spam_2.10-0 gtable_0.3.5
[70] cachem_1.1.0 S4Arrays_1.4.1 mime_0.12
[73] tidygraph_1.3.1 survival_3.6-4 fitdistrplus_1.1-11
[76] ROCR_1.0-11 nlme_3.1-164 ggtree_3.12.0
[79] bit64_4.0.5 RcppAnnoy_0.0.22 GenomeInfoDb_1.40.0
[82] irlba_2.3.5.1 KernSmooth_2.23-24 colorspace_2.1-0
[85] DBI_1.2.2 DESeq2_1.44.0 tidyselect_1.2.1
[88] bit_4.0.5 compiler_4.4.0 graph_1.82.0
[91] DelayedArray_0.30.1 plotly_4.10.4 shadowtext_0.1.3
[94] lmtest_0.9-40 stringr_1.5.1 digest_0.6.35
[97] goftest_1.2-3 spatstat.utils_3.0-4 XVector_0.44.0
[100] htmltools_0.5.8.1 pkgconfig_2.0.3 MatrixGenerics_1.16.0
[103] fastmap_1.2.0 rlang_1.1.3 htmlwidgets_1.6.4
[106] UCSC.utils_1.0.0 shiny_1.8.1.1 farver_2.1.2
[109] zoo_1.8-12 jsonlite_1.8.8 BiocParallel_1.38.0
[112] GOSemSim_2.30.0 RCurl_1.98-1.14 magrittr_2.0.3
[115] GenomeInfoDbData_1.2.12 ggplotify_0.1.2 dotCall64_1.1-1
[118] patchwork_1.2.0 munsell_0.5.1 Rcpp_1.0.12
[121] ape_5.8 ggnewscale_0.4.10 viridis_0.6.5
[124] reticulate_1.37.0 stringi_1.8.4 ggraph_2.2.1
[127] zlibbioc_1.50.0 MASS_7.3-60.2 plyr_1.8.9
[130] org.Hs.eg.db_3.19.1 parallel_4.4.0 listenv_0.9.1
[133] ggrepel_0.9.5 deldir_2.0-4 Biostrings_2.72.0
[136] graphlayouts_1.1.1 splines_4.4.0 tensor_1.5
[139] locfit_1.5-9.9 igraph_2.0.3 spatstat.geom_3.2-9
[142] RcppHNSW_0.6.0 reshape2_1.4.4 futile.options_1.0.1
[145] XML_3.99-0.16.1 lambda.r_1.2.4 renv_1.0.7
[148] BiocManager_1.30.23 tweenr_2.0.3 httpuv_1.6.15
[151] RANN_2.6.1 tidyr_1.3.1 purrr_1.0.2
[154] polyclip_1.10-6 future_1.33.2 scattermore_1.2
[157] ggforce_0.4.2 xtable_1.8-4 RSpectra_0.16-1
[160] tidytree_0.4.6 later_1.3.2 viridisLite_0.4.2
[163] snow_0.4-4 tibble_3.2.1 aplot_0.2.2
[166] memoise_2.0.1 cluster_2.1.6 globals_0.16.3

Best and thanks, Nina

nina-hahn avatar Jun 04 '24 07:06 nina-hahn