goplot encountered an error
Dear Uncle Y, hello!
I encountered some issues while using the R package (clusterProfiler) you developed. When using goplot, the following error message appeared:
Error in AnnotationDbi::mget(id, GOANCESTOR) : second argument must be an environment
Subsequently, I followed the user manual you wrote(https://yulab-smu.top/biomedical-knowledge-mining-book/clusterprofiler-go.html) and tried using the example code above(https://yulab-smu.top/biomedical-knowledge-mining-book/clusterprofiler-go.html#clusterprofiler-go-ora), but still encountered the same problem
library(clusterProfiler)
data(geneList, package="DOSE")
gene <- names(geneList)[abs(geneList) > 2]
ego <- enrichGO(gene = gene,
universe = names(geneList),
OrgDb = org.Hs.eg.db,
ont = "CC",
pAdjustMethod = "BH",
pvalueCutoff = 0.01,
qvalueCutoff = 0.05,
readable = TRUE)
goplot(ego)
At first, I thought it might be a problem caused by the server, so I ran the example code in the manual in R studio on my local Windows computer, but the same problem still occurred.
But I use barplot and dotplot, both of which can run normally.
I really couldn't find a solution before coming to you for help. I'm very sorry to disturb you and look forward to your suggestions to help me solve the problem. Thank you very much!
sessionInfo()
R version 4.4.1 (2024-06-14)
Platform: x86_64-redhat-linux-gnu
Running under: CentOS Linux 7 (Core)
Matrix products: default
BLAS/LAPACK: /usr/lib64/libopenblaso-r0.3.15.so; LAPACK version 3.9.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: Asia/Shanghai
tzcode source: system (glibc)
attached base packages:
[1] stats4 stats graphics grDevices utils datasets methods base
other attached packages:
[1] enrichplot_1.24.4 yulab.utils_0.1.7 GOSemSim_2.30.2 org.Hs.eg.db_3.19.1 mirrorselect_0.0.3
[6] lubridate_1.9.3 forcats_1.0.0 stringr_1.5.1 dplyr_1.1.4 purrr_1.0.2
[11] readr_2.1.5 tidyr_1.3.1 tibble_3.2.1 ggplot2_3.5.1 tidyverse_2.0.0
[16] data.table_1.16.0 org.My.eg.db_1.0 AnnotationDbi_1.66.0 IRanges_2.38.1 S4Vectors_0.42.1
[21] Biobase_2.64.0 BiocGenerics_0.50.0 clusterProfiler_4.12.6
loaded via a namespace (and not attached):
[1] RColorBrewer_1.1-3 rstudioapi_0.16.0 jsonlite_1.8.9 magrittr_2.0.3 farver_2.1.2
[6] rmarkdown_2.28 fs_1.6.4 zlibbioc_1.50.0 vctrs_0.6.5 memoise_2.0.1
[11] ggtree_3.12.0 htmltools_0.5.8.1 curl_5.2.3 gridGraphics_0.5-1 desc_1.4.3
[16] plyr_1.8.9 httr2_1.0.5 cachem_1.1.0 igraph_2.0.3 lifecycle_1.0.4
[21] pkgconfig_2.0.3 Matrix_1.7-0 R6_2.5.1 fastmap_1.2.0 gson_0.1.0
[26] GenomeInfoDbData_1.2.12 digest_0.6.37 aplot_0.2.3 colorspace_2.1-1 ps_1.8.0
[31] patchwork_1.3.0 RSQLite_2.3.7 fansi_1.0.6 timechange_0.3.0 httr_1.4.7
[36] polyclip_1.10-7 compiler_4.4.1 remotes_2.5.0 bit64_4.5.2 withr_3.0.1
[41] BiocParallel_1.38.0 viridis_0.6.5 DBI_1.2.3 pkgbuild_1.4.4 ggforce_0.4.2
[46] R.utils_2.12.3 MASS_7.3-61 rappdirs_0.3.3 tools_4.4.1 ape_5.8
[51] scatterpie_0.2.4 R.oo_1.26.0 glue_1.8.0 callr_3.7.6 nlme_3.1-166
[56] grid_4.4.1 shadowtext_0.1.4 reshape2_1.4.4 fgsea_1.30.0 generics_0.1.3
[61] gtable_0.3.5 tzdb_0.4.0 R.methodsS3_1.8.2 hms_1.1.3 tidygraph_1.3.1
[66] utf8_1.2.4 XVector_0.44.0 ggrepel_0.9.6 pillar_1.9.0 splines_4.4.1
[71] tweenr_2.0.3 treeio_1.28.0 lattice_0.22-6 bit_4.5.0 tidyselect_1.2.1
[76] GO.db_3.19.1 Biostrings_2.72.1 knitr_1.48 gridExtra_2.3 xfun_0.48
[81] graphlayouts_1.2.0 stringi_1.8.4 UCSC.utils_1.0.0 lazyeval_0.2.2 ggfun_0.1.6
[86] yaml_2.3.10 evaluate_1.0.1 codetools_0.2-20 ggraph_2.2.1 qvalue_2.36.0
[91] BiocManager_1.30.25 ggplotify_0.1.2 cli_3.6.3 processx_3.8.4 munsell_0.5.1
[96] Rcpp_1.0.13 GenomeInfoDb_1.40.1 png_0.1-8 parallel_4.4.1 blob_1.2.4
[101] DOSE_3.30.5 viridisLite_0.4.2 tidytree_0.4.6 scales_1.3.0 crayon_1.5.3
[106] rlang_1.1.4 cowplot_1.1.3 fastmatch_1.1-4 KEGGREST_1.44.1
I am also getting the same error. I have recently updated to R 4.4 and when I revert back to R4.3.3 I don't get the error occurring anymore. Not a great fix, but you could try reverting back to R4.3.3 and see if you still get the same error?
I am also getting the same error. I have recently updated to R 4.4 and when I revert back to R4.3.3 I don't get the error occurring anymore. Not a great fix, but you could try reverting back to R4.3.3 and see if you still get the same error?
Thanks, When I use the R 4.2.2,don't get the error occurring!
No problem! Seems to be some incompatibility between clusterProfiler 4.12.6 and R 4.4 - hopefully it'll get fixed soon!
fixed.