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

sctransform batch_var error #110

Open
lo2811 opened this issue Sep 3, 2021 · 2 comments
Open

sctransform batch_var error #110

lo2811 opened this issue Sep 3, 2021 · 2 comments

Comments

@lo2811
Copy link

lo2811 commented Sep 3, 2021

Hi Christoph,

I am running SCTransform with batch_var and encounter this error: "Error in while ((it <- it + 1) < limit && abs(del) > eps) { :
missing value where TRUE/FALSE needed". Here is the full error:

epi <- SCTransform(epi, batch_var="dataset")
Calculating cell attributes from input UMI matrix: log_umi
Variance stabilizing transformation of count matrix of size 47902 by 150006
Model formula is y ~ (log_umi) : dataset + dataset + 0
Get Negative Binomial regression parameters per gene
Using 2000 genes, 5000 cells
| | 0%
warning: solve(): system is singular; attempting approx solution
|============================ | 25%
warning: solve(): system is singular; attempting approx solution
Error in while ((it <- it + 1) < limit && abs(del) > eps) { :
missing value where TRUE/FALSE needed

I was able to use this same code to run on the same object in April/May this year. Now I need to regenerate the Seurat object and run into this error. I'm using the development sctransform, just reinstalled it on my machine this week using: remotes::install_github("ChristophH/sctransform@develop").

The error goes away if I increase the n_cells to 10,000, but I would prefer to keep everything consistent with the previous times (n_cells=5000). It is strange that I have this error now, since I'm running the exact same code on the same samples.

Thank you!
Linh

@ChristophH
Copy link
Collaborator

Are you using the same version of Seurat as before? That could also be a reason why the same code is not working anymore.

In any case, without a reproducible example I cannot say what the problem is exactly. If you are sure changes in the sctransform package are the cause, you can also try to install an older version, i.e. a specific commit. For example remotes::install_github("ChristophH/sctransform@73e2e3e") would install the develop version as of 30. March 2021

Other commits to the develop branch are listed here

Another option is to change the parameter estimation method that sctransform is using. E.g.

if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager")
BiocManager::install("glmGamPoi")
epi <- SCTransform(epi, batch_var="dataset", method = "glmGamPoi")

@lo2811
Copy link
Author

lo2811 commented Sep 8, 2021

Thank you Christoph. I tried glmGamPoi before and it worked, but will try installing the specific sctransform and Seurat version as well.

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