YuLab-SMU / clusterProfiler

:bar_chart: A universal enrichment tool for interpreting omics data
https://yulab-smu.top/biomedical-knowledge-mining-book/
1.03k stars 256 forks source link

goplot no longer works with clusterProfiler 4.12.3 #718

Closed davetang closed 1 month ago

davetang commented 3 months ago

Prerequisites

Describe your issue

I can get around the installation problem if I manually install the latest version of yulab.utils.

This works using Docker and the image rocker/verse:4.4.0.

install.packages("remotes")
remotes::install_version("yulab.utils", version = "0.1.6", repos = "https://cloud.r-project.org/")
if (!require("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("clusterProfiler")

But then goplot() no longer works in clusterProfiler 4.12.3. Using the example from the documentation:

library(clusterProfiler)
data(geneList, package = "DOSE")
de <- names(geneList)[1:100]
yy <- enrichGO(de, 'org.Hs.eg.db', ont="BP", pvalueCutoff=0.01)
goplot(yy)
Error in AnnotationDbi::mget(id, GOANCESTOR) : 
  second argument must be an environment

Session info.

sessionInfo()
R version 4.4.0 (2024-04-24)
Platform: x86_64-pc-linux-gnu
Running under: Ubuntu 22.04.4 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so;  LAPACK version 3.10.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

time zone: Etc/UTC
tzcode source: system (glibc)

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

other attached packages:
[1] clusterProfiler_4.12.3 BiocManager_1.30.23    workflowr_1.7.1       

loaded via a namespace (and not attached):
  [1] RColorBrewer_1.1-3      rstudioapi_0.16.0       jsonlite_1.8.8          magrittr_2.0.3         
  [5] farver_2.1.2            rmarkdown_2.27          fs_1.6.4                zlibbioc_1.50.0        
  [9] vctrs_0.6.5             memoise_2.0.1           ggtree_3.12.0           htmltools_0.5.8.1      
 [13] AnnotationHub_3.12.0    curl_5.2.1              gridGraphics_0.5-1      plyr_1.8.9             
 [17] httr2_1.0.2             cachem_1.1.0            whisker_0.4.1           igraph_2.0.3           
 [21] lifecycle_1.0.4         pkgconfig_2.0.3         gson_0.1.0              Matrix_1.7-0           
 [25] R6_2.5.1                fastmap_1.2.0           GenomeInfoDbData_1.2.12 digest_0.6.35          
 [29] aplot_0.2.2             enrichplot_1.24.2       colorspace_2.1-0        patchwork_1.2.0        
 [33] AnnotationDbi_1.66.0    S4Vectors_0.42.1        ps_1.7.6                rprojroot_2.0.4        
 [37] RSQLite_2.3.7           org.Hs.eg.db_3.19.1     filelock_1.0.3          fansi_1.0.6            
 [41] httr_1.4.7              polyclip_1.10-6         compiler_4.4.0          remotes_2.5.0          
 [45] bit64_4.0.5             withr_3.0.1             BiocParallel_1.38.0     viridis_0.6.5          
 [49] DBI_1.2.3               ggforce_0.4.2           MASS_7.3-60.2           rappdirs_0.3.3         
 [53] HDO.db_0.99.1           tools_4.4.0             scatterpie_0.2.3        ape_5.8                
 [57] httpuv_1.6.15           glue_1.7.0              callr_3.7.6             nlme_3.1-164           
 [61] GOSemSim_2.30.1         promises_1.3.0          shadowtext_0.1.3        grid_4.4.0             
 [65] getPass_0.2-4           reshape2_1.4.4          fgsea_1.30.0            generics_0.1.3         
 [69] gtable_0.3.5            tidyr_1.3.1             data.table_1.15.4       tidygraph_1.3.1        
 [73] utf8_1.2.4              XVector_0.44.0          BiocGenerics_0.50.0     ggrepel_0.9.5          
 [77] BiocVersion_3.19.1      pillar_1.9.0            stringr_1.5.1           yulab.utils_0.1.6      
 [81] later_1.3.2             splines_4.4.0           dplyr_1.1.4             tweenr_2.0.3           
 [85] treeio_1.28.0           BiocFileCache_2.12.0    lattice_0.22-6          bit_4.0.5              
 [89] tidyselect_1.2.1        GO.db_3.19.1            Biostrings_2.72.1       knitr_1.47             
 [93] git2r_0.33.0            gridExtra_2.3           IRanges_2.38.1          stats4_4.4.0           
 [97] xfun_0.44               graphlayouts_1.1.1      Biobase_2.64.0          stringi_1.8.4          
[101] UCSC.utils_1.0.0        lazyeval_0.2.2          ggfun_0.1.5             yaml_2.3.8             
[105] evaluate_0.24.0         codetools_0.2-20        ggraph_2.2.1            tibble_3.2.1           
[109] qvalue_2.36.0           ggplotify_0.1.2         cli_3.6.2               munsell_0.5.1          
[113] processx_3.8.4          Rcpp_1.0.12             GenomeInfoDb_1.40.1     dbplyr_2.5.0           
[117] png_0.1-8               parallel_4.4.0          ggplot2_3.5.1           blob_1.2.4             
[121] DOSE_3.30.2             viridisLite_0.4.2       tidytree_0.4.6          scales_1.3.0           
[125] purrr_1.0.2             crayon_1.5.2            rlang_1.1.4             cowplot_1.1.3          
[129] fastmatch_1.1-4         KEGGREST_1.44.1  

Ask in the right place

guidohooiveld commented 3 months ago

FWIW: it is working in my hands.... !?

> library(clusterProfiler)
> data(geneList, package = "DOSE")
> de <- names(geneList)[1:100]
> yy <- enrichGO(de, 'org.Hs.eg.db', ont="BP", pvalueCutoff=0.01)

> goplot(yy)
> 

image

> BiocManager::valid()
[1] TRUE
> 
> packageVersion("yulab.utils")
[1] ‘0.1.6’
> packageVersion("clusterProfiler")
[1] ‘4.12.3’
> packageVersion("enrichplot")
[1] ‘1.24.2’
> packageVersion("GOSemSim")
[1] ‘2.30.1’
> 
> R.Version()$version.string
[1] "R version 4.4.0 Patched (2024-05-21 r86580 ucrt)"
> 
> sessionInfo() 
R version 4.4.0 Patched (2024-05-21 r86580 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 10 x64 (build 19042)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.utf8 
[2] LC_CTYPE=English_United States.utf8   
[3] LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.utf8    

time zone: Europe/Amsterdam
tzcode source: internal

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

other attached packages:
[1] clusterProfiler_4.12.3

loaded via a namespace (and not attached):
  [1] DBI_1.2.3               gson_0.1.0              shadowtext_0.1.4       
  [4] gridExtra_2.3           httr2_1.0.2             rlang_1.1.4            
  [7] magrittr_2.0.3          DOSE_3.30.2             compiler_4.4.0         
 [10] RSQLite_2.3.7           png_0.1-8               vctrs_0.6.5            
 [13] reshape2_1.4.4          stringr_1.5.1           pkgconfig_2.0.3        
 [16] crayon_1.5.3            fastmap_1.2.0           XVector_0.44.0         
 [19] labeling_0.4.3          ggraph_2.2.1            utf8_1.2.4             
 [22] HDO.db_0.99.1           enrichplot_1.24.2       UCSC.utils_1.0.0       
 [25] purrr_1.0.2             bit_4.0.5               zlibbioc_1.50.0        
 [28] cachem_1.1.0            aplot_0.2.3             GenomeInfoDb_1.40.1    
 [31] jsonlite_1.8.8          blob_1.2.4              BiocParallel_1.38.0    
 [34] tweenr_2.0.3            parallel_4.4.0          R6_2.5.1               
 [37] stringi_1.8.4           RColorBrewer_1.1-3      GOSemSim_2.30.1        
 [40] Rcpp_1.0.13             IRanges_2.38.1          Matrix_1.7-0           
 [43] splines_4.4.0           igraph_2.0.3            tidyselect_1.2.1       
 [46] qvalue_2.36.0           viridis_0.6.5           codetools_0.2-20       
 [49] lattice_0.22-6          tibble_3.2.1            plyr_1.8.9             
 [52] Biobase_2.64.0          treeio_1.28.0           withr_3.0.1            
 [55] KEGGREST_1.44.1         gridGraphics_0.5-1      scatterpie_0.2.3       
 [58] polyclip_1.10-7         Biostrings_2.72.1       pillar_1.9.0           
 [61] ggtree_3.12.0           stats4_4.4.0            ggfun_0.1.5            
 [64] generics_0.1.3          S4Vectors_0.42.1        ggplot2_3.5.1          
 [67] munsell_0.5.1           scales_1.3.0            tidytree_0.4.6         
 [70] glue_1.7.0              lazyeval_0.2.2          tools_4.4.0            
 [73] data.table_1.15.4       fgsea_1.30.0            fs_1.6.4               
 [76] graphlayouts_1.1.1      fastmatch_1.1-4         tidygraph_1.3.1        
 [79] cowplot_1.1.3           grid_4.4.0              tidyr_1.3.1            
 [82] ape_5.8                 AnnotationDbi_1.66.0    colorspace_2.1-1       
 [85] nlme_3.1-166            GenomeInfoDbData_1.2.12 patchwork_1.2.0        
 [88] ggforce_0.4.2           cli_3.6.3               rappdirs_0.3.3         
 [91] fansi_1.0.6             viridisLite_0.4.2       dplyr_1.1.4            
 [94] gtable_0.3.5            yulab.utils_0.1.6       digest_0.6.37          
 [97] BiocGenerics_0.50.0     ggrepel_0.9.5           ggplotify_0.1.2        
[100] org.Hs.eg.db_3.19.1     farver_2.1.2            memoise_2.0.1          
[103] lifecycle_1.0.4         httr_1.4.7              GO.db_3.19.1           
[106] bit64_4.0.5             MASS_7.3-61            
> 
GuangchuangYu commented 1 month ago

fixed.