Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An error I don't understand #33

Open
yls2g13 opened this issue Nov 25, 2024 · 2 comments
Open

An error I don't understand #33

yls2g13 opened this issue Nov 25, 2024 · 2 comments

Comments

@yls2g13
Copy link

yls2g13 commented Nov 25, 2024

Hi carmonalab, I love this package, but I wish the errors explained themselves more. The following code leads to an error message below, and I think it's because it didn't detect any Monocytes from my integrated scRNAseq data, but it doesn't say that and results in an error instead, and doesn't return the scGate_multi column. However, I know that there are Monocytes in my data as I could detect them (with the same scGate parameters) on a single-sample level before integrating my data. Would you be able to elaborate more on what's happening with this error message?

Code used:

seu.obj <- scGate(seu.obj, 
                  model = models$human$PBMC$Monocyte, 
                  genes.blacklist = scGate::genes.blacklist.default$Hs$Ribo, 
                  min.cells = 1, reduction = 'pca', keep.ranks = FALSE, save.levels = FALSE, seed = 123)

Error message:

Warning: The following genes were not found and will be
                        imputed to exp=0:
* PTPRCAP,SLC34A2,SFTA2,CPA3,TPSAB1,TPSB2,MS4A2,XCR1,RAB7B,FCER1A,CD207
Error: BiocParallel errors
  1 remote errors, element index: 1
  0 unevaluated and other errors
  first remote error:
Error in methods::slot(object = object, name = "layers")[[layer]][features, : incorrect number of dimensions

sessionInfo() :

R version 4.4.1 (2024-06-14)
Platform: x86_64-pc-linux-gnu
Running under: Red Hat Enterprise Linux 9.4 (Plow)

Matrix products: default
BLAS/LAPACK: FlexiBLAS OPENBLAS-OPENMP;  LAPACK version 3.9.0

locale:
 [1] LC_CTYPE=en_AU.UTF-8       LC_NUMERIC=C               LC_TIME=en_AU.UTF-8        LC_COLLATE=en_AU.UTF-8     LC_MONETARY=en_AU.UTF-8   
 [6] LC_MESSAGES=en_AU.UTF-8    LC_PAPER=en_AU.UTF-8       LC_NAME=C                  LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_AU.UTF-8 LC_IDENTIFICATION=C       

time zone: Australia/Melbourne
tzcode source: system (glibc)

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

other attached packages:
 [1] ggpubr_0.6.0                RColorBrewer_1.1-3          scGate_1.6.2                here_1.0.1                  pbmcsca.SeuratData_3.0.0   
 [6] SeuratData_0.2.2.9001       Azimuth_0.5.0               shinyBS_0.61.1              scDblFinder_1.18.0          scater_1.32.1              
[11] scuttle_1.14.0              cowplot_1.1.3               patchwork_1.3.0             decontX_1.2.0               celda_1.20.0               
[16] Matrix_1.7-0                lubridate_1.9.3             forcats_1.0.0               stringr_1.5.1               dplyr_1.1.4                
[21] purrr_1.0.2                 readr_2.1.5                 tidyr_1.3.1                 tibble_3.2.1                ggplot2_3.5.1              
[26] tidyverse_2.0.0             SingleCellExperiment_1.26.0 SummarizedExperiment_1.34.0 Biobase_2.64.0              GenomicRanges_1.56.1       
[31] GenomeInfoDb_1.40.1         IRanges_2.38.1              S4Vectors_0.42.1            BiocGenerics_0.50.0         MatrixGenerics_1.16.0      
[36] matrixStats_1.4.1           SeuratWrappers_0.4.0        Seurat_5.1.0                SeuratObject_5.0.2          sp_2.1-4                   

loaded via a namespace (and not attached):
  [1] R.methodsS3_1.8.2                 progress_1.2.3                    poweRlaw_0.80.0                   goftest_1.2-3                    
  [5] DT_0.33                           Biostrings_2.72.1                 rstan_2.32.6                      vctrs_0.6.5                      
  [9] spatstat.random_3.3-2             digest_0.6.37                     png_0.1-8                         ggrepel_0.9.6                    
 [13] deldir_2.0-4                      parallelly_1.39.0                 combinat_0.0-8                    Signac_1.14.0                    
 [17] MASS_7.3-60.2                     reshape2_1.4.4                    httpuv_1.6.15                     foreach_1.5.2                    
 [21] withr_3.0.2                       xfun_0.49                         survival_3.6-4                    EnsDb.Hsapiens.v86_2.99.0        
 [25] memoise_2.0.1                     ggbeeswarm_0.7.2                  gtools_3.9.5                      zoo_1.8-12                       
 [29] V8_6.0.0                          pbapply_1.7-2                     R.oo_1.27.0                       prettyunits_1.2.0                
 [33] Formula_1.2-5                     KEGGREST_1.42.0                   promises_1.3.0                    httr_1.4.7                       
 [37] rstatix_0.7.2                     restfulr_0.0.15                   rhdf5filters_1.16.0               globals_0.16.3                   
 [41] fitdistrplus_1.2-1                rhdf5_2.48.0                      rstudioapi_0.17.1                 UCSC.utils_1.0.0                 
 [45] miniUI_0.1.1.1                    generics_0.1.3                    curl_6.0.1                        zlibbioc_1.50.0                  
 [49] ScaledMatrix_1.12.0               polyclip_1.10-7                   GenomeInfoDbData_1.2.12           SparseArray_1.4.8                
 [53] RcppEigen_0.3.4.0.2               pracma_2.4.4                      xtable_1.8-4                      doParallel_1.0.17                
 [57] evaluate_1.0.1                    S4Arrays_1.4.1                    BiocFileCache_2.10.2              hms_1.1.3                        
 [61] irlba_2.3.5.1                     filelock_1.0.3                    colorspace_2.1-1                  hdf5r_1.3.11                     
 [65] ROCR_1.0-11                       reticulate_1.40.0                 spatstat.data_3.1-4               magrittr_2.0.3                   
 [69] lmtest_0.9-40                     later_1.3.2                       viridis_0.6.5                     lattice_0.22-6                   
 [73] spatstat.geom_3.3-4               future.apply_1.11.3               scattermore_1.2                   XML_3.99-0.17                    
 [77] RcppAnnoy_0.0.22                  pillar_1.9.0                      StanHeaders_2.32.10               nlme_3.1-164                     
 [81] pwalign_1.0.0                     iterators_1.0.14                  caTools_1.18.3                    compiler_4.4.1                   
 [85] beachmat_2.20.0                   RSpectra_0.16-2                   stringi_1.8.4                     tensor_1.5                       
 [89] GenomicAlignments_1.38.2          MCMCprecision_0.4.0               plyr_1.8.9                        crayon_1.5.3                     
 [93] abind_1.4-8                       BiocIO_1.12.0                     googledrive_2.1.1                 locfit_1.5-9.10                  
 [97] bit_4.5.0                         fastmatch_1.1-4                   codetools_0.2-20                  BiocSingular_1.20.0              
[101] QuickJSR_1.4.0                    plotly_4.10.4                     mime_0.12                         splines_4.4.1                    
[105] Rcpp_1.0.13-1                     fastDummies_1.7.4                 dbplyr_2.5.0                      sparseMatrixStats_1.14.0         
[109] cellranger_1.1.0                  knitr_1.49                        blob_1.2.4                        utf8_1.2.4                       
[113] seqLogo_1.68.0                    AnnotationFilter_1.26.0           fs_1.6.5                          WriteXLS_6.7.0                   
[117] listenv_0.9.1                     DelayedMatrixStats_1.24.0         pkgbuild_1.4.5                    ggsignif_0.6.4                   
[121] statmod_1.5.0                     tzdb_0.4.0                        pkgconfig_2.0.3                   pheatmap_1.0.12                  
[125] tools_4.4.1                       cachem_1.1.0                      RSQLite_2.3.8                     viridisLite_0.4.2                
[129] DBI_1.2.3                         rmarkdown_2.29                    fastmap_1.2.0                     scales_1.3.0                     
[133] grid_4.4.1                        ica_1.0-3                         shinydashboard_0.7.2              Rsamtools_2.18.0                 
[137] broom_1.0.7                       BiocManager_1.30.25               dotCall64_1.2                     carData_3.0-5                    
[141] RANN_2.6.2                        farver_2.1.2                      yaml_2.3.10                       rtracklayer_1.62.0               
[145] cli_3.6.3                         UCell_2.8.0                       leiden_0.4.3.1                    lifecycle_1.0.4                  
[149] uwot_0.2.2                        presto_1.0.0                      bluster_1.14.0                    backports_1.5.0                  
[153] BSgenome.Hsapiens.UCSC.hg38_1.4.5 annotate_1.80.0                   BiocParallel_1.38.0               timechange_0.3.0                 
[157] gtable_0.3.6                      rjson_0.2.23                      ggridges_0.5.6                    progressr_0.15.0                 
[161] parallel_4.4.1                    limma_3.60.6                      jsonlite_1.8.9                    edgeR_4.2.2                      
[165] TFBSTools_1.42.0                  RcppHNSW_0.6.0                    bitops_1.0-9                      bit64_4.5.2                      
[169] xgboost_1.7.8.1                   Rtsne_0.17                        spatstat.utils_3.1-1              BiocNeighbors_1.22.0             
[173] RcppParallel_5.1.9                CNEr_1.38.0                       metapod_1.12.0                    dqrng_0.4.1                      
[177] loo_2.8.0                         shinyjs_2.1.0                     enrichR_3.2                       SeuratDisk_0.0.0.9021            
[181] spatstat.univar_3.1-1             R.utils_2.12.3                    lazyeval_0.2.2                    shiny_1.9.1                      
[185] htmltools_0.5.8.1                 GO.db_3.18.0                      sctransform_0.4.1                 rappdirs_0.3.3                   
[189] ensembldb_2.26.0                  glue_1.8.0                        TFMPvalue_0.0.9                   googlesheets4_1.1.1              
[193] spam_2.11-0                       XVector_0.44.0                    RCurl_1.98-1.16                   rprojroot_2.0.4                  
[197] scran_1.32.0                      BSgenome_1.70.2                   dittoSeq_1.16.0                   gridExtra_2.3                    
[201] JASPAR2020_0.99.10                igraph_2.1.1                      R6_2.5.1                          RcppRoll_0.3.1                   
[205] GenomicFeatures_1.54.4            cluster_2.1.6                     Rhdf5lib_1.26.0                   gargle_1.5.2                     
[209] DirichletMultinomial_1.44.0       ProtGenerics_1.34.0               rstantools_2.4.0                  DelayedArray_0.30.1              
[213] tidyselect_1.2.1                  vipor_0.4.7                       xml2_1.3.6                        inline_0.3.20                    
[217] car_3.1-3                         AnnotationDbi_1.64.1              future_1.34.0                     rsvd_1.0.5                       
[221] munsell_0.5.1                     KernSmooth_2.23-24                data.table_1.16.2                 htmlwidgets_1.6.4                
[225] fgsea_1.30.0                      biomaRt_2.58.2                    rlang_1.1.4                       spatstat.sparse_3.1-0            
[229] spatstat.explore_3.3-3            remotes_2.5.0                     fansi_1.0.6                       beeswarm_0.4.0     
@mass-a
Copy link
Member

mass-a commented Nov 26, 2024

Hi Nicole,
I'm not sure how to reproduce the behaviour, but your error has been previously reported to Seurat: satijalab/seurat#9074

It seems it has to do with the new layer structure of Seurat 5, and with subsetting when layers have only one cell. It doesn't seem it has been solved yet, but I'll see if we can circumvent it internally in scGate.

Best
-m

@yls2g13
Copy link
Author

yls2g13 commented Nov 27, 2024

Thanks for alerting me to this error Massimo, explains a lot.
I want to add that this was the model list I was testing.

models <- scGate::get_scGateDB()
models.list <- list(CD8_TIL_MAIT = models$human$CD8_TIL$CD8_MAIT,
                    HiTME_gdT = models$human$HiTME$gdT,
                    PBMC_gdT = models$human$PBMC$gdT,
                    HiTME_Bcell = models$human$HiTME$Bcell,
                    TME_HiRes_Bcell = models$human$TME_HiRes$Bcell,
                    PBMC_Bcell = models$human$PBMC$Bcell,
                    PBMC_Monocyte = models$human$PBMC$Monocyte)

On a single sample level, this error doesn't happen at all.
After Seurat scVIIntegration, this happens only with models$human$PBMC$Monocyte.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants