samuel-marsh/scCustomize

Error in DelayedArray::colAutoGrid(x = counts, ncol = length(x = layer.cells))

Closed this issue · 4 comments

Hello,

I am unsure if this is an issue with scCustomize or Seurat as a similar issue has been mentioned here.

I am trying to merge my list of seurat objects after running SCTransform.

 obj <- SplitObject(obj, split.by = "splitCol")
 obj <- lapply(obj, SCTransform)
 var.features <- SelectIntegrationFeatures(obj)
 obj.merged <- Merge_Seurat_List(obj)

After the last line, I get the following error message.

Error in DelayedArray::colAutoGrid(x = counts, ncol = length(x = layer.cells)) : 
  'ncol' must be >= 1 and <= ncol(x)

However, if do NOT run SCTransform I can merge the list of seurat objects just fine.

sessionInfo()
R version 4.2.2 (2022-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux 8.8 (Ootpa)

Matrix products: default
BLAS:   /usr/lib64/libblas.so.3.8.0
LAPACK: /usr/lib64/liblapack.so.3.8.0

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

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

other attached packages:
 [1] sctransform_0.4.1  scCustomize_1.1.3  harmony_1.1.0      Rcpp_1.0.11        tidyr_1.3.0        ShinyCell_2.1.0    RColorBrewer_1.1-3 readr_2.1.4        glue_1.6.2        
[10] R.utils_2.12.2     R.oo_1.25.0        R.methodsS3_1.8.2  reticulate_1.34.0  hdf5r_1.3.8        Matrix_1.6-1.1     data.table_1.14.8  Seurat_4.9.9.9058  SeuratObject_5.0.0
[19] sp_2.1-1           plotly_4.10.3      ggplot2_3.4.4      gtools_3.9.4       gridExtra_2.3      ggtree_3.9.0.001   dplyr_1.1.3       

loaded via a namespace (and not attached):
  [1] utf8_1.2.4                  spatstat.explore_3.2-5      tidyselect_1.2.0            htmlwidgets_1.6.2           Rtsne_0.16                  munsell_0.5.0              
  [7] codetools_0.2-18            ica_1.0-3                   future_1.33.0               miniUI_0.1.1.1              withr_2.5.1                 spatstat.random_3.2-1      
 [13] colorspace_2.1-0            progressr_0.14.0            Biobase_2.58.0              knitr_1.44                  rstudioapi_0.15.0           stats4_4.2.2               
 [19] ROCR_1.0-11                 tensor_1.5                  listenv_0.9.0               MatrixGenerics_1.10.0       labeling_0.4.3              GenomeInfoDbData_1.2.9     
 [25] polyclip_1.10-6             bit64_4.0.5                 farver_2.1.1                parallelly_1.36.0           vctrs_0.6.4                 treeio_1.25.1.002          
 [31] generics_0.1.3              xfun_0.40                   timechange_0.2.0            R6_2.5.1                    GenomeInfoDb_1.34.9         ggbeeswarm_0.7.2           
 [37] bitops_1.0-7                spatstat.utils_3.0-4        cachem_1.0.8                gridGraphics_0.5-1          DelayedArray_0.24.0         promises_1.2.1             
 [43] scales_1.2.1                beeswarm_0.4.0              gtable_0.3.4                globals_0.16.2              goftest_1.2-3               spam_2.10-0                
 [49] rlang_1.1.1                 GlobalOptions_0.1.2         splines_4.2.2               lazyeval_0.2.2              spatstat.geom_3.2-7         yaml_2.3.7                 
 [55] reshape2_1.4.4              abind_1.4-5                 httpuv_1.6.12               tools_4.2.2                 ggplotify_0.1.2             ellipsis_0.3.2             
 [61] BiocGenerics_0.44.0         ggridges_0.5.4              plyr_1.8.9                  sparseMatrixStats_1.10.0    zlibbioc_1.44.0             purrr_1.0.2                
 [67] RCurl_1.98-1.12             deldir_1.0-9                pbapply_1.7-2               cowplot_1.1.1               S4Vectors_0.36.2            zoo_1.8-12                 
 [73] SummarizedExperiment_1.28.0 ggrepel_0.9.4               cluster_2.1.4               fs_1.6.3                    magrittr_2.0.3              RSpectra_0.16-1            
 [79] glmGamPoi_1.10.2            scattermore_1.2             circlize_0.4.15             lmtest_0.9-40               RANN_2.6.1                  fitdistrplus_1.1-11        
 [85] matrixStats_1.0.0           hms_1.1.3                   patchwork_1.1.3             mime_0.12                   evaluate_0.22               xtable_1.8-4               
 [91] fastDummies_1.7.3           IRanges_2.32.0              shape_1.4.6                 compiler_4.2.2              tibble_3.2.1                KernSmooth_2.23-20         
 [97] htmltools_0.5.6.1           ggfun_0.1.3                 later_1.3.1                 tzdb_0.4.0                  ggprism_1.0.4               aplot_0.2.2                
[103] lubridate_1.9.3             MASS_7.3-60                 cli_3.6.1                   dotCall64_1.1-0             igraph_1.5.1                GenomicRanges_1.50.2       
[109] forcats_1.0.0               pkgconfig_2.0.3             spatstat.sparse_3.0-3       paletteer_1.5.0             vipor_0.4.5                 XVector_0.38.0             
[115] snakecase_0.11.1            yulab.utils_0.1.0           stringr_1.5.0               digest_0.6.33               RcppAnnoy_0.0.21            janitor_2.2.0              
[121] spatstat.data_3.0-3         rmarkdown_2.25              leiden_0.4.3                tidytree_0.4.5              uwot_0.1.16                 DelayedMatrixStats_1.20.0  
[127] shiny_1.7.5.1               lifecycle_1.0.3             nlme_3.1-163                jsonlite_1.8.7              viridisLite_0.4.2           fansi_1.0.5                
[133] pillar_1.9.0                lattice_0.20-45             ggrastr_1.0.2               fastmap_1.1.1               httr_1.4.7                  survival_3.5-7             
[139] png_0.1-8                   bit_4.0.5                   stringi_1.7.12              rematch2_2.1.2              RcppHNSW_0.5.0              memoise_2.0.1              
[145] irlba_2.3.5.1               future.apply_1.11.0         ape_5.7-1   

Hi @kenneditodd,

I will take a look at it. Just to make sure I can try and replicate your issue, can you confirm if any of the objects are saved via BPCells or whether they are all in memory? What is approximate total number of cells/objects?

Thanks!
Sam

Also do you get the same error if you run this?

test_merge <- merge(obj[[1]], obj[[2:length(obj)]])

Hi @kenneditodd,

Are you still having this issue? Were you able to try code I suggested? If you’re still having issues could you also let me know the answers to my questions in first comment?

Thanks,
Sam

Hi @kenneditodd,

Since I have not heard back I'm going to close this issue for now. If this problem is still present please respond here and see my previous posts above and I reopen the issue and work to solve the issue.

Best,
Sam