satijalab / sctransform

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

error from signalConditions #73

Closed jliu678 closed 3 years ago

jliu678 commented 3 years ago

Hi there,

"bugmtx.rds" containing the matrix "bugmtx" and the txt file that prints the "err trackback" have been attached in the zip file,and

S <- CreateSeuratObject(counts = bugmtx, min.features = 1,min.cells = 1) S<- subset(x = S, subset = nFeature_RNA > 200) S<- SCTransform(S, verbose = T,return.only.var.genes=F, min_cells = 1)

gives err message in console:

Calculating cell attributes from input UMI matrix: log_umi Variance stabilizing transformation of count matrix of size 11743 by 255 Model formula is y ~ log_umi Get Negative Binomial regression parameters per gene Using 2000 genes, 255 cells |===================== | 25% warning: solve(): system seems 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 In addition: There were 50 or more warnings (use warnings() to see the first 50) Called from: signalConditions(obj, exclude = getOption("future.relay.immediate", "immediateCondition"), resignal = resignal, ...)

session info:

R version 4.0.3 (2020-10-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17134)

Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     
other attached packages:
[1] sctransform_0.3.1 Seurat_3.2.2 

hope to hear your advice soon

thanks

data file and err traceback.zip

ChristophH commented 3 years ago

Thank your for the bug report! And thanks for including the data and the traceback. This is likely a duplicate of https://github.com/ChristophH/sctransform/issues/71.

Could you try the current version of sctransform in the develop branch?

remotes::install_github("ChristophH/sctransform@develop")

jliu678 commented 3 years ago

Thank your for the bug report! And thanks for including the data and the traceback. This is likely a duplicate of #71.

Could you try the current version of sctransform in the develop branch?

remotes::install_github("ChristophH/sctransform@develop")

still not working... attached is the traceback and session info. it looks the same as previously except attached "sctransform" was development version now.

By the way, I think it is about the update made in the newest version compared with version 0.3, which running well.

1.txt

ChristophH commented 3 years ago

You are setting min_cells = 1 which means that sctransform is keeping all genes that are detected (non-zero count) in at least one cell. We do not advice doing so, and here it breaks the parameter estimation.

I would argue that genes that are detected in just one cell are not going to have a large influence on the downstream analysis and can safely be dropped. In your case, setting min_cells = 2 or higher seems to be sufficient for the parameter estimation to pass.

The default value for min_cells is 5, and we should probably issue a warning when this parameter is set lower than that.