irGSEA icon indicating copy to clipboard operation
irGSEA copied to clipboard

Error in irGSEA.integrate(object = pbmc3k.final, group.by = "seurat_annotations", : Please imput correct `method`.

Open RGT183 opened this issue 1 year ago • 5 comments

library(irGSEA) library(Seurat) Loading required package: SeuratObject Loading required package: sp ‘SeuratObject’ was built under R 4.3.0 but the current version is 4.4.0; it is recomended that you reinstall ‘SeuratObject’ as the ABI for R may have changed ‘SeuratObject’ was built with package ‘Matrix’ 1.6.4 but the current version is 1.7.0; it is recomended that you reinstall ‘SeuratObject’ as the ABI for ‘Matrix’ may have changed

Attaching package: ‘SeuratObject’

The following objects are masked from ‘package:base’:

%||%, intersect, t

Attaching package: ‘Seurat’

The following object is masked from ‘package:base’:

%||%

library(SeuratData) ── Installed datasets ───────────────────────────────────────── SeuratData v0.2.2 ── ✔ pbmc3k 3.1.4

──────────────────────────────────────── Key ─────────────────────────────────────── ✔ Dataset loaded successfully ❯ Dataset built with a newer version of Seurat than installed ❓ Unknown version of Seurat installed

download 3k PBMCs from 10X Genomics

InstallData("pbmc3k") Warning: The following packages are already installed and will not be reinstalled: pbmc3k data("pbmc3k.final") pbmc3k.final <- SeuratObject::UpdateSeuratObject(pbmc3k.final) Validating object structure Updating object slots Ensuring keys are in the proper structure Updating matrix keys for DimReduc ‘pca’ Updating matrix keys for DimReduc ‘umap’ Warning: Assay RNA changing from Assay to Assay Warning: Graph RNA_nn changing from Graph to Graph Warning: Graph RNA_snn changing from Graph to Graph Warning: DimReduc pca changing from DimReduc to DimReduc Warning: DimReduc umap changing from DimReduc to DimReduc Ensuring keys are in the proper structure Ensuring feature names don't have underscores or pipes Updating slots in RNA Updating slots in RNA_nn Setting default assay of RNA_nn to RNA Updating slots in RNA_snn Setting default assay of RNA_snn to RNA Updating slots in pca Updating slots in umap Setting umap DimReduc to global Setting assay used for NormalizeData.RNA to RNA Setting assay used for FindVariableFeatures.RNA to RNA Setting assay used for ScaleData.RNA to RNA Setting assay used for RunPCA.RNA to RNA Setting assay used for JackStraw.RNA.pca to RNA No assay information could be found for ScoreJackStraw Setting assay used for FindNeighbors.RNA.pca to RNA No assay information could be found for FindClusters Setting assay used for RunUMAP.RNA.pca to RNA Validating object structure for Assay ‘RNA’ Validating object structure for Graph ‘RNA_nn’ Validating object structure for Graph ‘RNA_snn’ Validating object structure for DimReduc ‘pca’ Validating object structure for DimReduc ‘umap’ Object representation is consistent with the most current Seurat version Warning messages: 1: Adding a command log without an assay associated with it 2: Adding a command log without an assay associated with it

Seurat object

pbmc3k.final <- irGSEA.score(object = pbmc3k.final, assay = "RNA",

  •                          slot = "data", msigdb = T, species = "Homo sapiens",
    
  •                          category = "H", geneid = "symbol",
    
  •                          method = c("AUCell", "UCell", "singscore", "ssgsea"), kcdf = 'Gaussian')
    

Validating object structure Updating object slots Ensuring keys are in the proper structure Updating matrix keys for DimReduc ‘pca’ Updating matrix keys for DimReduc ‘umap’ Ensuring keys are in the proper structure Ensuring feature names don't have underscores or pipes Updating slots in RNA Updating slots in RNA_nn Setting default assay of RNA_nn to RNA Updating slots in RNA_snn Setting default assay of RNA_snn to RNA Updating slots in pca Updating slots in umap Setting umap DimReduc to global Setting assay used for NormalizeData.RNA to RNA Setting assay used for FindVariableFeatures.RNA to RNA Setting assay used for ScaleData.RNA to RNA Setting assay used for RunPCA.RNA to RNA Setting assay used for JackStraw.RNA.pca to RNA No assay information could be found for ScoreJackStraw Setting assay used for FindNeighbors.RNA.pca to RNA No assay information could be found for FindClusters Setting assay used for RunUMAP.RNA.pca to RNA Validating object structure for Assay ‘RNA’ Validating object structure for Graph ‘RNA_nn’ Validating object structure for Graph ‘RNA_snn’ Validating object structure for DimReduc ‘pca’ Validating object structure for DimReduc ‘umap’ Object representation is consistent with the most current Seurat version Calculate AUCell scores Error: invalid class “DelayedMatrix” object: the supplied seed must support extract_array() Calculate UCell scores Warning: Feature names cannot have underscores (''), replacing with dashes ('-') Warning: Feature names cannot have underscores (''), replacing with dashes ('-') Warning: Feature names cannot have underscores (''), replacing with dashes ('-') Finish calculate UCell scores Calculate singscore scores Warning: Feature names cannot have underscores (''), replacing with dashes ('-') Warning: Feature names cannot have underscores (''), replacing with dashes ('-') Warning: Feature names cannot have underscores (''), replacing with dashes ('-') Finish calculate singscore scores Calculate ssgsea scores Setting parallel calculations through a with workers=%d and tasks=100. back-end Estimating ssGSEA scores for 50 gene sets. [1] "Calculating ranks..." [1] "Calculating absolute values from ranks..." Warning: Feature names cannot have underscores (''), replacing with dashes ('-') Warning: Feature names cannot have underscores (''), replacing with dashes ('-') Warning: Feature names cannot have underscores ('_'), replacing with dashes ('-') Finish calculate ssgsea scores

Integrated analysis

result.dge <- irGSEA.integrate(object = pbmc3k.final,

  •                            group.by = "seurat_annotations", metadata = NULL, col.name = NULL,
    
  •                            method = c("AUCell","UCell","singscore","ssgsea"))
    

Error in irGSEA.integrate(object = pbmc3k.final, group.by = "seurat_annotations", : Please imput correct method. 我用示例代码也一直报错,想请教一下原因

RGT183 avatar Nov 13 '24 15:11 RGT183

查看你的irGSEA.score函数运行信息后发现,你的AUCell打分失败了,可能是AUCell版本不对或者AUCell包没有装好。 因此,在运行irGSEA.integrate函数时,应该将AUCell去掉。例如:

result.dge <- irGSEA.integrate(object = pbmc3k.final,
                           group.by = "seurat_annotations", metadata = NULL, col.name = NULL,
                           method = c("UCell","singscore","ssgsea"))

chuiqin avatar Nov 13 '24 15:11 chuiqin

1731513367421

20f21bac6cf7c83c88ab87304dba65d 去掉 AUCell 还是会报错

RGT183 avatar Nov 13 '24 16:11 RGT183

1731513367421

20f21bac6cf7c83c88ab87304dba65d 去掉 AUCell 还是会报错

irGSEA.integrate函数的的运行信息来看,UCell、singscore和ssgsea的差异基因集计算并没有成功,因此,综合评估那一步就出错了。正确的运行信息应该如下:

> result.dge <- irGSEA.integrate(object = pbmc3k.final,
+                                group.by = "seurat_annotations", metadata = NULL, col.name = NULL,
+                                method = c("AUCell","UCell","singscore","ssgsea"))
Calculate differential gene set : AUCell
Finish!
Calculate differential gene set : UCell
Finish!
Calculate differential gene set : singscore
Finish!
Calculate differential gene set : ssgsea
Finish!

我猜大概率是版本问题,你的irGSEA和Seurat版本是多少?

chuiqin avatar Nov 14 '24 00:11 chuiqin

我也遇到了同样的问题

result.dge <- irGSEA.integrate(object = scRNA_sub,

  •                            group.by = "cell_subtypes",
    
  •                            method = c("AUCell","UCell"))
    

Calculate differential gene set : AUCell Calculate differential gene set : UCell Error in UseMethod("distinct") : "distinct"没有适用于"NULL"目标对象的方法

Package: irGSEA Type: Package Title: The integration of single cell rank-based gene set enrichment analysis Version: 3.2.2

Package: Seurat Version: 5.3.0

Package: SeuratObject Title: Data Structures for Single Cell Data Version: 5.1.0

amingjie228 avatar Aug 26 '25 08:08 amingjie228

上述问题已自行解决,是irGSEA包版本和V5 seurat版本冲突的问题。 下面附上我的版本号

sessionInfo() R version 4.3.1 (2023-06-16 ucrt) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 19045)

Matrix products: default

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

time zone: Asia/Hong_Kong tzcode source: internal

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

other attached packages: [1] future_1.67.0 patchwork_1.3.1 scRNAtoolVis_0.1.0 lubridate_1.9.4 forcats_1.0.0 stringr_1.5.1
[7] dplyr_1.1.4 purrr_1.1.0 readr_2.1.5 tidyr_1.3.1 tibble_3.3.0 ggplot2_3.5.2
[13] tidyverse_2.0.0 Seurat_5.3.0 SeuratObject_5.1.0 sp_2.2-0 GSEABase_1.64.0 graph_1.80.0
[19] annotate_1.80.0 XML_3.99-0.19 AnnotationDbi_1.70.0 IRanges_2.36.0 S4Vectors_0.44.0 Biobase_2.62.0
[25] BiocGenerics_0.48.1 irGSEA_3.3.3

loaded via a namespace (and not attached): [1] segmented_2.1-4 GSVA_1.50.5 fs_1.6.6 matrixStats_1.5.0
[5] spatstat.sparse_3.1-0 bitops_1.0-9 devtools_2.4.5 doParallel_1.0.17
[9] httr_1.4.7 RColorBrewer_1.1-3 ggsci_3.2.0 profvis_0.4.0
[13] tools_4.3.1 sctransform_0.4.2 R6_2.6.1 HDF5Array_1.30.1
[17] lazyeval_0.2.2 uwot_0.2.3 GetoptLong_1.0.5 rhdf5filters_1.14.1
[21] urlchecker_1.0.1 withr_3.0.2 splancs_2.01-45 gridExtra_2.3
[25] progressr_0.15.1 sgeostat_1.0-27 cli_3.6.2 Cairo_1.6-5
[29] spatstat.explore_3.5-2 fastDummies_1.7.5 labeling_0.4.3 spatstat.data_3.1-8
[33] proxy_0.4-27 ggridges_0.5.6 pbapply_1.7-4 yulab.utils_0.2.1
[37] dbscan_1.2.2 R.utils_2.13.0 dichromat_2.0-0.1 parallelly_1.45.1
[41] sessioninfo_1.2.3 limma_3.58.1 rstudioapi_0.17.1 RSQLite_2.4.3
[45] gridGraphics_0.5-1 shape_1.4.6.1 generics_0.1.4 ica_1.0-3
[49] spatstat.random_3.4-1 Matrix_1.6-5 interp_1.1-6 abind_1.4-8
[53] R.methodsS3_1.8.2 lifecycle_1.0.4 edgeR_4.0.16 SummarizedExperiment_1.32.0 [57] rhdf5_2.46.1 SparseArray_1.2.4 Rtsne_0.17 grid_4.3.1
[61] blob_1.2.4 promises_1.3.3 crayon_1.5.3 miniUI_0.1.2
[65] lattice_0.21-8 beachmat_2.18.1 cowplot_1.2.0 KEGGREST_1.42.0
[69] magick_2.8.6 ComplexHeatmap_2.18.0 pillar_1.11.0 GenomicRanges_1.54.1
[73] rjson_0.2.23 future.apply_1.20.0 codetools_0.2-19 glue_1.8.0
[77] spatstat.univar_3.1-4 data.table_1.17.8 remotes_2.5.0 vctrs_0.6.5
[81] png_0.1-8 spam_2.11-1 gtable_0.3.6 kernlab_0.9-33
[85] cachem_1.1.0 S4Arrays_1.2.1 mime_0.13 RobustRankAggreg_1.2.1
[89] survival_3.8-3 SingleCellExperiment_1.24.0 iterators_1.0.14 statmod_1.5.0
[93] ellipsis_0.3.2 fitdistrplus_1.2-4 ROCR_1.0-11 nlme_3.1-162
[97] usethis_3.1.0 bit64_4.6.0-1 RcppAnnoy_0.0.22 GenomeInfoDb_1.38.8
[101] irlba_2.3.5.1 KernSmooth_2.23-21 alphahull_2.5 colorspace_2.1-1
[105] DBI_1.2.3 UCell_2.6.2 tidyselect_1.2.1 processx_3.8.6
[109] bit_4.6.0 compiler_4.3.1 curl_5.2.0 AUCell_1.24.0
[113] BiocNeighbors_1.20.2 desc_1.4.3 ggdendro_0.2.0 DelayedArray_0.28.0
[117] plotly_4.11.0 scales_1.4.0 lmtest_0.9-40 callr_3.7.6
[121] rappdirs_0.3.3 digest_0.6.37 goftest_1.2-3 spatstat.utils_3.1-5
[125] mixtools_2.0.0.1 XVector_0.42.0 decoupleR_2.9.1 htmltools_0.5.8.1
[129] pkgconfig_2.0.3 sparseMatrixStats_1.14.0 MatrixGenerics_1.14.0 fastmap_1.2.0
[133] GlobalOptions_0.1.2 rlang_1.1.3 htmlwidgets_1.6.4 ggunchull_1.0.1
[137] shiny_1.11.1 DelayedMatrixStats_1.24.0 farver_2.1.2 zoo_1.8-14
[141] jsonlite_2.0.0 BiocParallel_1.36.0 viper_1.36.0 R.oo_1.27.1
[145] BiocSingular_1.18.0 RCurl_1.98-1.17 magrittr_2.0.3 ggplotify_0.1.2
[149] GenomeInfoDbData_1.2.11 dotCall64_1.2 Rhdf5lib_1.24.2 Rcpp_1.1.0
[153] reticulate_1.43.0 stringi_1.8.7 zlibbioc_1.48.2 MASS_7.3-60
[157] plyr_1.8.9 pkgbuild_1.4.8 parallel_4.3.1 listenv_0.9.1
[161] ggrepel_0.9.6 deldir_2.0-4 Biostrings_2.70.1 splines_4.3.1
[165] tensor_1.5.1 circlize_0.4.16 hms_1.1.3 locfit_1.5-9.12
[169] ps_1.9.1 igraph_2.1.4 spatstat.geom_3.5-0 RcppHNSW_0.6.0
[173] ScaledMatrix_1.10.0 reshape2_1.4.4 pkgload_1.4.0 foreach_1.5.2
[177] tzdb_0.5.0 httpuv_1.6.16 RANN_2.6.2 polyclip_1.10-7
[181] clue_0.3-66 scattermore_1.2 rsvd_1.0.5 xtable_1.8-4
[185] e1071_1.7-16 RSpectra_0.16-2 later_1.4.3 viridisLite_0.4.2
[189] class_7.3-22 singscore_1.22.0 memoise_2.0.1 cluster_2.1.4
[193] timechange_0.3.0 globals_0.18.0

amingjie228 avatar Aug 26 '25 11:08 amingjie228