chuiqin / irGSEA

The integration of single cell rank-based gene set enrichment analysis
Other
106 stars 17 forks source link

irGSEA.integrate Error:Please imput correct `method` #21

Closed BioLaoXu closed 1 year ago

BioLaoXu commented 1 year ago

Dear team,irGSEA is a very handy tool,But I found it on my own data that it couldn't be integrated,here is my code:

methods = c("ssgsea")
xx=subset(scRNAh,SCT_snn_res.0.3=="20")
yy <- CreateSeuratObject(xx@assays$RNA@counts, meta.data = xx@meta.data,min.cells = 0,min.features = 0)
yy <- SeuratObject::UpdateSeuratObject(yy)

scRNA_gs=irGSEA.score(object = yy, assay = "RNA",
             slot = "data", seeds = 123, ncores = 8,
             min.cells = 0, min.feature = 0,
             custom = T, geneset = subtype_geneset,   
             subcategory = NULL, geneid = "symbol",
             method = methods,
             aucell.MaxRank = 2000, ucell.MaxRank = 2000,
             kcdf = 'Gaussian')

Seurat::Assays(scRNA_gs)
# > [1] "RNA"

result.dge <- irGSEA.integrate(object = scRNA_gs,
                               group.by = "seurat_clusters",
                               metadata = NULL, col.name = NULL,
                               method = methods)

# Error in irGSEA.integrate(object = scRNA_gs, group.by = "seurat_clusters",  : 
  Please imput correct `method`

irGSEA.score run was successful,However, the results were not saved in the assays slot, resulting in errors in subsequent integration analysis.Is it because which of my software versions is wrong or for some other reason?

here is my sessionInfo :

R version 4.2.1 (2022-06-23)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.4 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.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       

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

other attached packages:
 [1] SeuratData_0.2.2      irGSEA_2.1.5          genieclust_1.1.3      cowplot_1.1.1         clustree_0.5.0       
 [6] ggraph_2.1.0          randomcoloR_1.1.0.1   future_1.31.0         enrichplot_1.18.4     clusterProfiler_4.6.2
[11] COSG_0.9.0            harmony_0.1.1         Rcpp_1.0.10           scCustomize_1.1.1     SeuratObject_4.1.3   
[16] Seurat_4.3.0          ComplexHeatmap_2.14.0 GenomicRanges_1.50.2  GenomeInfoDb_1.34.9   IRanges_2.32.0       
[21] S4Vectors_0.36.1      BiocGenerics_0.44.0   ggplotify_0.1.0       purrr_1.0.1           stringr_1.5.0        
[26] reshape2_1.4.4        ggpubr_0.6.0          plotly_4.10.1         RColorBrewer_1.1-3    tibble_3.1.8         
[31] ggsci_2.9             tidyr_1.3.0           data.table_1.14.8     ggplot2_3.4.2         rlang_1.1.0          
[36] dplyr_1.1.0          

loaded via a namespace (and not attached):
  [1] rsvd_1.0.5                  ica_1.0-3                   ps_1.7.2                    foreach_1.5.2              
  [5] lmtest_0.9-40               rprojroot_2.0.3             crayon_1.5.2                V8_4.3.0                   
  [9] MASS_7.3-58.2               rhdf5filters_1.10.1         nlme_3.1-162                backports_1.4.1            
 [13] GOSemSim_2.24.0             XVector_0.38.0              HDO.db_0.99.1               ROCR_1.0-11                
 [17] irlba_2.3.5.1               callr_3.7.3                 limma_3.54.1                BiocParallel_1.32.5        
 [21] rjson_0.2.21                bit64_4.0.5                 glue_1.6.2                  sctransform_0.3.5          
 [25] processx_3.8.0              vipor_0.4.5                 spatstat.sparse_3.0-0       AnnotationDbi_1.60.2       
 [29] DOSE_3.24.2                 spatstat.geom_3.0-6         tidyselect_1.2.0            SummarizedExperiment_1.28.0
 [33] usethis_2.1.6               UCell_2.5.0                 fitdistrplus_1.1-8          XML_3.99-0.14              
 [37] zoo_1.8-11                  xtable_1.8-4                magrittr_2.0.3              cli_3.6.0                  
 [41] zlibbioc_1.44.0             rstudioapi_0.14             miniUI_0.1.1.1              sp_1.6-0                   
 [45] fastmatch_1.1-3             treeio_1.22.0               shiny_1.7.4                 GSVA_1.46.0                
 [49] BiocSingular_1.14.0         clue_0.3-64                 pkgbuild_1.4.0              gson_0.1.0                 
 [53] cluster_2.1.4               tidygraph_1.2.3             KEGGREST_1.38.0             ggrepel_0.9.3              
 [57] ape_5.7                     listenv_0.9.0               Biostrings_2.66.0           png_0.1-8                  
 [61] withr_2.5.0                 bitops_1.0-7                ggforce_0.4.1               plyr_1.8.8                 
 [65] GSEABase_1.60.0             pillar_1.8.1                GlobalOptions_0.1.2         cachem_1.0.6               
 [69] fs_1.6.1                    GetoptLong_1.0.5            paletteer_1.5.0             DelayedMatrixStats_1.20.0  
 [73] vctrs_0.5.2                 ellipsis_0.3.2              generics_0.1.3              devtools_2.4.5             
 [77] tools_4.2.1                 beeswarm_0.4.0              munsell_0.5.0               tweenr_2.0.2               
 [81] fgsea_1.24.0                DelayedArray_0.24.0         fastmap_1.1.0               compiler_4.2.1             
 [85] pkgload_1.3.2               abind_1.4-5                 httpuv_1.6.9                sessioninfo_1.2.2          
 [89] GenomeInfoDbData_1.2.9      gridExtra_2.3               edgeR_3.40.2                lattice_0.20-45            
 [93] deldir_1.0-6                utf8_1.2.3                  later_1.3.0                 jsonlite_1.8.4             
 [97] scales_1.2.1                ScaledMatrix_1.6.0          graph_1.76.0                tidytree_0.4.2             
[101] pbapply_1.7-0               carData_3.0-5               sparseMatrixStats_1.10.0    lazyeval_0.2.2             
[105] promises_1.2.0.1            car_3.1-1                   doParallel_1.0.17           R.utils_2.12.2             
[109] goftest_1.2-3               spatstat.utils_3.0-1        reticulate_1.28             Rtsne_0.16                 
[113] forcats_1.0.0               downloader_0.4              Biobase_2.58.0              uwot_0.1.14                
[117] igraph_1.4.0                HDF5Array_1.26.0            survival_3.5-3              htmltools_0.5.4            
[121] memoise_2.0.1               profvis_0.3.7               locfit_1.5-9.7              graphlayouts_0.8.4         
[125] viridisLite_0.4.1           digest_0.6.31               rappdirs_0.3.3              mime_0.12                  
[129] RSQLite_2.3.1               yulab.utils_0.0.6           future.apply_1.10.0         remotes_2.4.2              
[133] urlchecker_1.0.1            blob_1.2.4                  R.oo_1.25.0                 splines_4.2.1              
[137] rematch2_2.1.2              Rhdf5lib_1.20.0             RCurl_1.98-1.10             broom_1.0.3                
[141] rhdf5_2.42.1                colorspace_2.1-0            BiocManager_1.30.19         ggbeeswarm_0.7.2           
[145] shape_1.4.6                 aplot_0.1.9                 ggrastr_1.0.1               RANN_2.6.1                 
[149] circlize_0.4.15             fansi_1.0.4                 parallelly_1.34.0           R6_2.5.1                   
[153] ggridges_0.5.4              lifecycle_1.0.3             curl_5.0.0                  ggsignif_0.6.4             
[157] leiden_0.4.3                snakecase_0.11.0            Matrix_1.5-3                qvalue_2.30.0              
[161] desc_1.4.2                  RcppAnnoy_0.0.20            iterators_1.0.14            spatstat.explore_3.0-6     
[165] htmlwidgets_1.6.1           beachmat_2.14.0             polyclip_1.10-4             shadowtext_0.1.2           
[169] timechange_0.2.0            gridGraphics_0.5-1          singscore_1.18.0            globals_0.16.2             
[173] patchwork_1.1.2             spatstat.random_3.1-3       progressr_0.13.0            codetools_0.2-19           
[177] matrixStats_0.63.0          lubridate_1.9.2             GO.db_3.16.0                prettyunits_1.1.1          
[181] SingleCellExperiment_1.20.1 R.methodsS3_1.8.2           gtable_0.3.1                DBI_1.1.3                  
[185] ggfun_0.0.9                 tensor_1.5                  httr_1.4.5                  KernSmooth_2.23-20         
[189] stringi_1.7.12              msigdbr_7.5.1               farver_2.1.1                annotate_1.76.0            
[193] viridis_0.6.2               ggtree_3.6.2                BiocNeighbors_1.16.0        AUCell_1.20.2              
[197] scattermore_0.8             bit_4.0.5                   scatterpie_0.2.0            MatrixGenerics_1.10.0      
[201] spatstat.data_3.0-0         janitor_2.2.0               pkgconfig_2.0.3             babelgene_22.9             
[205] ggprism_1.0.4               rstatix_0.7.2
chuiqin commented 1 year ago

The irGSEA.integrate function is the result of a method that evaluates multiple gene sets. Unfortunately, you only used one gene set scoring method. Therefore, the irGSEA.integrate function won't do much for you. Secondly, I found that when you execute the irGSEA.score function and the output of Seurat::Assays(scRNA_gs) is only "RNA", not "RNA", "ssgsea". This prompts you that there is a problem with the execution of the irGSEA.integrate function. I recommend trying my sample data first, if the sample data can run successfully, there is no problem with the process and code. At this time, you can try to replace it with your own data to run.

BioLaoXu commented 1 year ago

thanks @chuiqin

I'm sorry that my dependency packages are not completely installed and caused this problem, and when I complete the missing dependency packages, I tested the pbmc3k data and my own data was fine.

here is my code for installing dependency packages

cran.packages <- c("aplot", "BiocManager", "data.table", "devtools", "doParallel", 
                   "doRNG", "dplyr", "ggfun", "gghalves", "ggplot2", "ggplotify", 
                   "ggridges", "ggsci", "irlba", "magrittr", "Matrix", "msigdbr", 
                   "pagoda2", "pointr", "purrr", "RcppML", "readr", "reshape2", 
                   "reticulate", "rlang", "RMTstat", "RobustRankAggreg", "roxygen2", 
                   "Seurat", "SeuratObject", "stringr", "tibble", "tidyr", "tidyselect", 
                   "tidytree", "VAM")
# If some packages are already installed, the installation code in the following tutorial cannot fully install all packages
# if (!requireNamespace(cran.packages, quietly = TRUE)) { 
#    install.packages(cran.packages, ask = F, update = F)
#}

# install packages from Bioconductor
bioconductor.packages <- c("AUCell", "BiocParallel", "ComplexHeatmap", "decoupleR", "fgsea",
                           "ggtree", "GSEABase", "GSVA", "Nebulosa", "scde", "singscore",
                           "SummarizedExperiment", "UCell", "viper")
# If some packages are already installed, the installation code in the following tutorial cannot fully install all packages
#if (!requireNamespace(bioconductor.packages, quietly = TRUE)) { 
#    BiocManager::install(bioconductor.packages, ask = F, update = F)
#}

# I tried to complete the required dependencies with the following installation method
install.packages(cran.packages[!pacman::p_isinstalled(cran.packages)], ask = F, update = F)
BiocManager::install(bioconductor.packages[!pacman::p_isinstalled(bioconductor.packages)], ask = F, update = F)
install.packages("doMC")