satijalab / sctransform

R package for modeling single cell UMI expression data using regularized negative binomial regression
GNU General Public License v3.0
208 stars 33 forks source link

Error in h(simpleError(msg, call)) #130

Closed jiayiliujiayi closed 2 years ago

jiayiliujiayi commented 2 years ago

Hi,

I'm encountering an error when doing SCTransform--

To reproduce this error (obj.RDS.zip):

## obj.RDS is attached in obj.RDS.zip
obj <- readRDS("./obj.RDS")
obj = SCTransform(obj)

Error & warning message

Calculating cell attributes from input UMI matrix: log_umi
Variance stabilizing transformation of count matrix of size 271 by 200
Model formula is y ~ log_umi
Get Negative Binomial regression parameters per gene
Using 271 genes, 200 cells
  |                                                                                          |   0%
warning: solve(): system is singular; attempting approx solution

warning: solve(): system is singular; attempting approx solution

warning: solve(): system is singular; attempting approx solution
Error in h(simpleError(msg, call)) : 
  error in evaluating the argument 'x' in selecting a method for function 't': missing value where TRUE/FALSE needed

Things I've tried

  1. downgrade "sctransform" package to 0.3.2 --> same error
  2. install the devel version of sctransform --> same error

sessionInfo

R version 4.0.4 (2021-02-15)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.2 LTS
[obj.RDS.zip](https://github.com/satijalab/sctransform/files/8298923/obj.RDS.zip)

Matrix products: default
BLAS/LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.8.so

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

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

other attached packages:
 [1] igraph_1.2.9       magrittr_2.0.1     Seurat_4.0.1       cowplot_1.1.1      ggpubr_0.4.0      
 [6] ggplot2_3.3.3      gridExtra_2.3      reshape2_1.4.4     dplyr_1.0.7        rdist_0.0.5       
[11] GDAtools_1.6       future_1.22.1      SeuratObject_4.0.2 Matrix_1.4-0      

loaded via a namespace (and not attached):
  [1] Rtsne_0.15            colorspace_2.0-2      deldir_0.2-10         ggsignif_0.6.1       
  [5] ellipsis_0.3.2        rio_0.5.26            ggridges_0.5.3        spatstat.data_2.1-0  
  [9] leiden_0.3.7          listenv_0.8.0         ggrepel_0.9.1         DT_0.17              
 [13] fansi_0.5.0           codetools_0.2-18      splines_4.0.4         leaps_3.1            
 [17] polyclip_1.10-0       jsonlite_1.7.2        broom_0.7.9           ica_1.0-2            
 [21] cluster_2.1.0         png_0.1-7             uwot_0.1.10           spatstat.sparse_2.0-0
 [25] shiny_1.6.0           sctransform_0.3.3     compiler_4.0.4        httr_1.4.2           
 [29] backports_1.2.1       lazyeval_0.2.2        assertthat_0.2.1      fastmap_1.1.0        
 [33] later_1.3.0           htmltools_0.5.2       tools_4.0.4           gtable_0.3.0         
 [37] glue_1.4.2            RANN_2.6.1            FactoMineR_2.4        Rcpp_1.0.7           
 [41] scattermore_0.7       wdm_0.2.2             carData_3.0-4         cellranger_1.1.0     
 [45] vctrs_0.3.8           nlme_3.1-152          lmtest_0.9-38         stringr_1.4.0        
 [49] globals_0.14.0        openxlsx_4.2.3        mime_0.12             miniUI_0.1.1.1       
 [53] lifecycle_1.0.1       irlba_2.3.3           goftest_1.2-2         rstatix_0.7.0        
 [57] nleqslv_3.3.2         MASS_7.3-53.1         zoo_1.8-9             scales_1.1.1         
 [61] spatstat.core_2.3-0   spatstat.utils_2.2-0  hms_1.0.0             promises_1.2.0.1     
 [65] RColorBrewer_1.1-2    curl_4.3.2            reticulate_1.18       pbapply_1.4-3        
 [69] rpart_4.1-15          stringi_1.7.5         zip_2.2.0             rlang_0.4.10         
 [73] pkgconfig_2.0.3       matrixStats_0.61.0    lattice_0.20-41       tensor_1.5           
 [77] ROCR_1.0-11           purrr_0.3.4           patchwork_1.1.1       htmlwidgets_1.5.4    
 [81] tidyselect_1.1.1      parallelly_1.28.1     RcppAnnoy_0.0.19      plyr_1.8.6           
 [85] R6_2.5.1              generics_0.1.0        DBI_1.1.1             mgcv_1.8-33          
 [89] pillar_1.6.3          haven_2.3.1           foreign_0.8-81        withr_2.4.2          
 [93] fitdistrplus_1.1-6    survival_3.2-7        scatterplot3d_0.3-41  abind_1.4-5          
 [97] nnet_7.3-15           tibble_3.1.5          future.apply_1.8.1    crayon_1.4.1         
[101] car_3.0-10            KernSmooth_2.23-18    utf8_1.2.2            spatstat.geom_2.2-2  
[105] plotly_4.9.4.1        grid_4.0.4            readxl_1.3.1          data.table_1.14.2    
[109] forcats_0.5.1         digest_0.6.28         flashClust_1.01-2     xtable_1.8-4         
[113] tidyr_1.1.4           httpuv_1.5.5          munsell_0.5.0         viridisLite_0.4.0   

Is there other solutions to address this? Thanks in advance!

Best, Jiayi

saketkc commented 2 years ago

You can install glmGamPoi and retry with:

if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager")

BiocManager::install("glmGamPoi")
obj <- SCTransform(obj, vst.flavor="v2")

Feel free to reopen if you have any other issues.

jiayiliujiayi commented 2 years ago

You can install glmGamPoi and retry with:

if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager")

BiocManager::install("glmGamPoi")
obj <- SCTransform(obj, vst.flavor="v2")

Feel free to reopen if you have any other issues.

Solved! Thank you!!