clusterProfiler icon indicating copy to clipboard operation
clusterProfiler copied to clipboard

Error: How to solve the fact that goplot keeps asking for text input?

Open denvercal1234GitHub opened this issue 2 years ago • 2 comments

Hi there,

I aim to goplot() ego output, but it keeps giving me a "?" asking for some text input as below. What is interesting was the ego object egoGOEnrichGeneSet has nothing to do with geneList_FCsorted_OmitNA_gseGO_termsim in the error.

enrichplot::goplot(egoGOEnrichGeneSet) 
Error in parse(text = Ancestors) : <stdin>:1:3: unexpected input
0: base::suppressWarnings(base::try(geneList_FCsorted_OmitNA_gseGO_termsim$Description, silent = TRUE))
1: XT
     ^
> sessionInfo()

R version 4.2.0 (2022-04-22)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS:   /Filers/package/R-base/4.2.0/lib64/R/lib/libRblas.so
LAPACK: /Filers/package/R-base/4.2.0/lib64/R/lib/libRlapack.so

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

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

other attached packages:
 [1] DOSE_3.22.0             enrichplot_1.16.1       clusterProfiler_4.4.4   org.Hs.eg.db_3.15.0     AnnotationDbi_1.58.0   
 [6] IRanges_2.30.0          S4Vectors_0.34.0        Biobase_2.56.0          BiocGenerics_0.42.0     pbmc3k.SeuratData_3.1.4
[11] ifnb.SeuratData_3.1.0   SeuratData_0.2.1        SeuratWrappers_0.3.0    sp_1.5-0                SeuratObject_4.1.0     
[16] Seurat_4.1.1            tidyr_1.2.0             viridis_0.6.2           viridisLite_0.4.0       gridExtra_2.3          
[21] scRepertoire_1.6.0      ggplot2_3.3.6          

loaded via a namespace (and not attached):
  [1] rappdirs_0.3.3              SparseM_1.81                scattermore_0.8             R.methodsS3_1.8.1          
  [5] evmix_2.12                  bit64_4.0.5                 irlba_2.3.5                 DelayedArray_0.22.0        
  [9] R.utils_2.11.0              data.table_1.14.2           rpart_4.1.16                KEGGREST_1.36.0            
 [13] RCurl_1.98-1.6              doParallel_1.0.17           generics_0.1.2              callr_3.7.0                
 [17] cowplot_1.1.1               usethis_2.1.6               RSQLite_2.2.14              shadowtext_0.1.2           
 [21] RANN_2.6.1                  VGAM_1.1-6                  future_1.26.1               bit_4.0.4                  
 [25] spatstat.data_2.2-0         httpuv_1.6.5                SummarizedExperiment_1.26.1 assertthat_0.2.1           
 [29] promises_1.2.0.1            fansi_1.0.3                 igraph_1.3.1                DBI_1.1.2                  
 [33] htmlwidgets_1.5.4           powerTCR_1.16.0             spatstat.geom_2.4-0         stringdist_0.9.8           
 [37] purrr_0.3.4                 ellipsis_0.3.2              dplyr_1.0.9                 permute_0.9-7              
 [41] deldir_1.0-6                MatrixGenerics_1.8.0        vctrs_0.4.1                 ggalluvial_0.12.3          
 [45] remotes_2.4.2               ROCR_1.0-11                 abind_1.4-5                 cachem_1.0.6               
 [49] withr_2.5.0                 ggforce_0.3.3               progressr_0.10.1            sctransform_0.3.3          
 [53] vegan_2.6-2                 treeio_1.20.0               prettyunits_1.1.1           goftest_1.2-3              
 [57] cluster_2.1.3               gsl_2.1-7.1                 ape_5.6-2                   lazyeval_0.2.2             
 [61] crayon_1.5.1                pkgconfig_2.0.3             tweenr_1.0.2                GenomeInfoDb_1.32.2        
 [65] nlme_3.1-157                pkgload_1.3.0               devtools_2.4.3              rlang_1.0.3                
 [69] globals_0.15.0              lifecycle_1.0.1             miniUI_0.1.1.1              downloader_0.4             
 [73] rsvd_1.0.5                  polyclip_1.10-0             matrixStats_0.62.0          lmtest_0.9-40              
 [77] Matrix_1.4-1                aplot_0.1.6                 zoo_1.8-10                  ggridges_0.5.3             
 [81] GlobalOptions_0.1.2         processx_3.7.0              png_0.1-7                   bitops_1.0-7               
 [85] R.oo_1.24.0                 KernSmooth_2.23-20          Biostrings_2.64.0           blob_1.2.3                 
 [89] shape_1.4.6                 stringr_1.4.0               qvalue_2.28.0               parallelly_1.32.0          
 [93] spatstat.random_2.2-0       gridGraphics_0.5-1          scales_1.2.0                memoise_2.0.1              
 [97] magrittr_2.0.3              plyr_1.8.7                  ica_1.0-2                   zlibbioc_1.42.0            
[101] compiler_4.2.0              scatterpie_0.1.7            RColorBrewer_1.1-3          fitdistrplus_1.1-8         
[105] cli_3.3.0                   XVector_0.36.0              listenv_0.8.0               patchwork_1.1.1            
[109] pbapply_1.5-0               ps_1.7.1                    MASS_7.3-57                 mgcv_1.8-40                
[113] tidyselect_1.1.2            stringi_1.7.6               GOSemSim_2.22.0             ggrepel_0.9.1              
[117] fastmatch_1.1-3             tools_4.2.0                 future.apply_1.9.0          parallel_4.2.0             
[121] circlize_0.4.15             rstudioapi_0.13             foreach_1.5.2               cubature_2.0.4.4           
[125] farver_2.1.1                Rtsne_0.16                  ggraph_2.0.5                digest_0.6.29              
[129] BiocManager_1.30.18         rgeos_0.5-9                 shiny_1.7.1                 Rcpp_1.0.8.3               
[133] GenomicRanges_1.48.0        later_1.3.0                 RcppAnnoy_0.0.19            httr_1.4.3                 
[137] colorspace_2.0-3            fs_1.5.2                    tensor_1.5                  reticulate_1.25            
[141] splines_4.2.0               uwot_0.1.11                 yulab.utils_0.0.5           tidytree_0.3.9             
[145] spatstat.utils_2.3-1        graphlayouts_0.8.0          ggplotify_0.1.0             plotly_4.10.0              
[149] sessioninfo_1.2.2           xtable_1.8-4                jsonlite_1.8.0              ggtree_3.4.0               
[153] truncdist_1.0-2             tidygraph_1.2.1             ggfun_0.0.6                 R6_2.5.1                   
[157] pillar_1.7.0                htmltools_0.5.2             mime_0.12                   glue_1.6.2                 
[161] fastmap_1.1.0               BiocParallel_1.30.3         codetools_0.2-18            fgsea_1.22.0               
[165] pkgbuild_1.3.1              utf8_1.2.2                  lattice_0.20-45             spatstat.sparse_2.1-1      
[169] tibble_3.1.7                evd_2.3-6                   leiden_0.4.2                GO.db_3.15.0               
[173] survival_3.3-1              munsell_0.5.0               DO.db_2.9                   GenomeInfoDbData_1.2.8     
[177] iterators_1.0.14            reshape2_1.4.4              gtable_0.3.0                spatstat.core_2.4-4  

denvercal1234GitHub avatar Jul 24 '22 17:07 denvercal1234GitHub

Me too.

> goplot(cprof.up.bp.fisher, showCategory = 10)
?;
Error in parse(text = Ancestors) : <stdin>:1:1: unexpected ';'
1: ;
    ^
> 
> sessionInfo()
R version 4.2.2 (2022-10-31)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Ventura 13.4

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages:
[1] GO.db_3.16.0          AnnotationDbi_1.60.2  IRanges_2.32.0        S4Vectors_0.36.2     
[5] Biobase_2.58.0        BiocGenerics_0.44.0   clusterProfiler_4.6.2

loaded via a namespace (and not attached):
 [1] nlme_3.1-162           bitops_1.0-7           ggtree_3.6.2           enrichplot_1.18.4     
 [5] bit64_4.0.5            HDO.db_0.99.1          RColorBrewer_1.1-3     httr_1.4.6            
 [9] GenomeInfoDb_1.34.9    tools_4.2.2            utf8_1.2.3             R6_2.5.1              
[13] lazyeval_0.2.2         DBI_1.1.3              colorspace_2.1-0       withr_2.5.0           
[17] tidyselect_1.2.0       gridExtra_2.3          bit_4.0.5              compiler_4.2.2        
[21] cli_3.6.1              scatterpie_0.2.1       shadowtext_0.1.2       scales_1.2.1          
[25] stringr_1.5.0          digest_0.6.31          yulab.utils_0.0.6      gson_0.1.0            
[29] DOSE_3.24.2            XVector_0.38.0         pkgconfig_2.0.3        fastmap_1.1.1         
[33] rlang_1.1.1            RSQLite_2.3.1          gridGraphics_0.5-1     farver_2.1.1          
[37] generics_0.1.3         jsonlite_1.8.7         BiocParallel_1.32.6    GOSemSim_2.24.0       
[41] dplyr_1.1.2            RCurl_1.98-1.12        magrittr_2.0.3         ggplotify_0.1.1       
[45] GenomeInfoDbData_1.2.9 patchwork_1.1.2        Matrix_1.5-4.1         Rcpp_1.0.11           
[49] munsell_0.5.0          fansi_1.0.4            ape_5.7-1              viridis_0.6.3         
[53] lifecycle_1.0.3        stringi_1.7.12         ggraph_2.1.0           MASS_7.3-60           
[57] zlibbioc_1.44.0        plyr_1.8.8             qvalue_2.30.0          grid_4.2.2            
[61] blob_1.2.4             parallel_4.2.2         ggrepel_0.9.3          crayon_1.5.2          
[65] lattice_0.21-8         graphlayouts_1.0.0     Biostrings_2.66.0      cowplot_1.1.1         
[69] splines_4.2.2          KEGGREST_1.38.0        pillar_1.9.0           fgsea_1.24.0          
[73] igraph_1.5.0           reshape2_1.4.4         codetools_0.2-19       fastmatch_1.1-3       
[77] glue_1.6.2             ggfun_0.1.1            downloader_0.4         data.table_1.14.8     
[81] treeio_1.22.0          png_0.1-8              vctrs_0.6.3            tweenr_2.0.2          
[85] gtable_0.3.3           purrr_1.0.1            polyclip_1.10-4        tidyr_1.3.0           
[89] cachem_1.0.8           ggplot2_3.4.2          ggforce_0.4.1          tidygraph_1.2.3       
[93] tidytree_0.4.2         viridisLite_0.4.2      tibble_3.2.1           aplot_0.1.10          
[97] memoise_2.0.1         
> 

mickeykawai avatar Jul 11 '23 01:07 mickeykawai

In my case, I found the fix is as follows, after comparison of this object of enricher() with that of enrichGO() with which goplot works.

cprof.up.bp.fisher@ontology <- "BP"
  # for test result of data with ontology 'BP' among ontology type BP/MF/CC

goplot(cprof.up.bp.fisher, showCategory = 10)
> goplot(cprof.up.bp.fisher, showCategory = 10)
?BP
Error in eval(parse(text = Ancestors)) : object 'BP' not found
> goplot(cprof.up.bp.fisher, showCategory = 10)
?"BP"
Error in AnnotationDbi::mget(id, GOANCESTOR) : 
  second argument must be an environment
> 
> cprof.up.bp.fisher@ontology
[1] "UNKNOWN"
> cprof.up.bp.fisher@ontology <- "BP"
> cprof.up.bp.fisher@ontology
[1] "BP"
> goplot(cprof.up.bp.fisher, showCategory = 10)
> 

mickeykawai avatar Jul 11 '23 20:07 mickeykawai