Skip to content

BUG: SCTransform invoked with do.call fails to finish #10153

@ning-y

Description

@ning-y

Issue Description

Even when the arguments and environment are exactly the same, SCTransform invoked in the form of do.call(SCTransform, list(object=so)) fails to finish, whereas when called directly i.e., SCTransform(object=so) it finishes with no problems.

Reproducing Code Example

# I can't replicate this with pbmc_small. I could only reproduce this with my own
# Seurat object, which has this form:
so
# An object of class Seurat
# 50871 features across 11568 samples within 2 assays
# Active assay: SCT (15385 features, 0 variable features)
#  3 layers present: counts, data, scale.data
#  1 other assay present: RNA

# Then, this works:
SCTransform(object=so, ncells=100)

# But not this:
do.call(SCTransform, list(object=so, ncells=100))

Error Message

Additional Comments

The last message printed before the do.call hangs is:

Running SCTransform on assay: RNA
vst.flavor='v2' set. Using model with fixed slope and excluding poisson genes.
Calculating cell attributes from input UMI matrix: log_umi
Variance stabilizing transformation of count matrix of size 15457 by 6450
Model formula is y ~ log_umi
Get Negative Binomial regression parameters per gene
Using 2000 genes, 100 cells
Found 212 outliers - those will be ignored in fitting/regularization step

Second step: Get residuals using fitted parameters for 15457 genes
Computing corrected count matrix for 15457 genes
Calculating gene attributes
Wall clock passed: Time difference of 13.61948 secs
Determine variable features

Session Info

> sessionInfo()
R version 4.4.3 (2025-02-28)
Platform: x86_64-conda-linux-gnu
Running under: Red Hat Enterprise Linux 9.3 (Plow)

Matrix products: default
BLAS/LAPACK: /data/wanglf/home/e0175719/repos/batwing/.snakemake/conda/13ab51087dfaeaea761357a0ade3a749_/lib/libopenblasp-r0.3.30.so;  LAPACK version 3.12.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] 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   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

time zone: Asia/Singapore
tzcode source: system (glibc)

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

other attached packages:
 [1] lubridate_1.9.4    forcats_1.0.1      stringr_1.5.2      dplyr_1.1.4       
 [5] purrr_1.1.0        readr_2.1.5        tidyr_1.3.1        tibble_3.3.0      
 [9] ggplot2_4.0.0      tidyverse_2.0.0    future_1.67.0      Seurat_5.3.0      
[13] SeuratObject_5.2.0 sp_2.2-0          

loaded via a namespace (and not attached):
  [1] RColorBrewer_1.1-3          jsonlite_2.0.0             
  [3] magrittr_2.0.4              spatstat.utils_3.2-0       
  [5] farver_2.1.2                zlibbioc_1.52.0            
  [7] vctrs_0.6.5                 ROCR_1.0-11                
  [9] DelayedMatrixStats_1.28.0   spatstat.explore_3.5-3     
 [11] S4Arrays_1.6.0              htmltools_0.5.8.1          
 [13] SparseArray_1.6.0           sctransform_0.4.2          
 [15] parallelly_1.45.1           KernSmooth_2.23-26         
 [17] htmlwidgets_1.6.4           ica_1.0-3                  
 [19] plyr_1.8.9                  plotly_4.11.0              
 [21] zoo_1.8-14                  igraph_2.1.4               
 [23] mime_0.13                   lifecycle_1.0.4            
 [25] pkgconfig_2.0.3             Matrix_1.7-4               
 [27] R6_2.6.1                    fastmap_1.2.0              
 [29] GenomeInfoDbData_1.2.13     MatrixGenerics_1.18.0      
 [31] fitdistrplus_1.2-4          shiny_1.11.1               
 [33] digest_0.6.37               patchwork_1.3.1            
 [35] S4Vectors_0.44.0            tensor_1.5.1               
 [37] RSpectra_0.16-2             irlba_2.3.5.1              
 [39] GenomicRanges_1.58.0        progressr_0.16.0           
 [41] spatstat.sparse_3.1-0       timechange_0.3.0           
 [43] httr_1.4.7                  polyclip_1.10-7            
 [45] abind_1.4-8                 compiler_4.4.3             
 [47] withr_3.0.2                 S7_0.2.0                   
 [49] fastDummies_1.7.5           MASS_7.3-65                
 [51] DelayedArray_0.32.0         tools_4.4.3                
 [53] lmtest_0.9-40               httpuv_1.6.16              
 [55] future.apply_1.20.0         goftest_1.2-3              
 [57] glmGamPoi_1.18.0            glue_1.8.0                 
 [59] nlme_3.1-168                promises_1.3.3             
 [61] grid_4.4.3                  Rtsne_0.17                 
 [63] cluster_2.1.8.1             reshape2_1.4.4             
 [65] generics_0.1.4              gtable_0.3.6               
 [67] spatstat.data_3.1-8         tzdb_0.5.0                 
 [69] data.table_1.17.8           hms_1.1.3                  
 [71] XVector_0.46.0              BiocGenerics_0.52.0        
 [73] spatstat.geom_3.6-0         RcppAnnoy_0.0.22           
 [75] ggrepel_0.9.6               RANN_2.6.2                 
 [77] pillar_1.11.1               spam_2.11-1                
 [79] RcppHNSW_0.6.0              later_1.4.4                
 [81] splines_4.4.3               lattice_0.22-7             
 [83] survival_3.8-3              deldir_2.0-4               
 [85] tidyselect_1.2.1            miniUI_0.1.2               
 [87] pbapply_1.7-4               gridExtra_2.3              
 [89] IRanges_2.40.0              SummarizedExperiment_1.36.0
 [91] scattermore_1.2             stats4_4.4.3               
 [93] Biobase_2.66.0              matrixStats_1.5.0          
 [95] stringi_1.8.7               UCSC.utils_1.2.0           
 [97] lazyeval_0.2.2              codetools_0.2-20           
 [99] cli_3.6.5                   uwot_0.2.3                 
[101] xtable_1.8-4                reticulate_1.43.0          
[103] Rcpp_1.1.0                  GenomeInfoDb_1.42.0        
[105] globals_0.18.0              spatstat.random_3.4-2      
[107] png_0.1-8                   spatstat.univar_3.1-4      
[109] parallel_4.4.3              dotCall64_1.2              
[111] sparseMatrixStats_1.18.0    listenv_0.9.1              
[113] viridisLite_0.4.2           scales_1.4.0               
[115] ggridges_0.5.7              crayon_1.5.3               
[117] rlang_1.1.6                 cowplot_1.2.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions