Entering edit mode
3.6 years ago
Pratik
★
1.1k
Hey ya'll,
This is the error I am getting:
> scfp3 <- SCTransform(scfp3, method = "glmGamPoi", vars.to.regress = "percent.mt", verbose = FALSE)
Error in density.default(x = genes_log_gmean_step1, bw = "nrd", adjust = 1) :
'x' contains missing values
In addition: Warning message:
In vst(method = "glmGamPoi", umi = new("dgCMatrix", i = c(0L, 2L, :
NaNs produced
I think this error might be because there are zero integers in the expression matrix. For example the data frame looks like this
Could someone help me solve this, please? I have been messing around with changing Na to zeros and vice versa, no solution yet. I will keep trying.
I'd expect the genes with no expression may be messing things up, but the inner workings of SCTranscform are pretty opaque to me. I'd try removing all genes with no reads in any cells.
Thank you very much for responding @jared.andrews07! You've really helped me improve my scRNA-seq skills for sure through answering other questions.
So removing all genes with no reads in any cells helped reduce the size of the data frame.
I reran the commands, but obtained same results : (
I really do think those pesky zero's without decimal places are the problem.
Here's what a sample of the data frame looks like now:
Those zeros (in the W1738 column) are there. I think it has something to do with integer(0), and, I think, that's what those zeros are. Now if I could just find a way to convert them to the way the others zero's are (0.000) are. I think that might be the solution, maybe?
Or perhaps the zero's that are 0.000 have actual numbers in like the millionth place, making them like that.... hmmm
How are you reading in your counts? You might try converting them all to integers:
storage.mode(matrix_object) <- "integer"
I guess this could maybe be from cells that have no counts as well, but I'm guessing you would have already filtered any such offenders.
Thank you again Jared.
I tried:
And got the error:
This is everything up until the error:
scRNA-seq of fetal pancreas 7-10 wpc
Link to datset: https://cells.ucsc.edu/?ds=human-pancreas-dev
Direct Expression Matrix Link: https://cells.ucsc.edu/human-pancreas-dev/fetal-pancreas/exprMatrix.tsv.gz
Direct Meta Data Link: https://cells.ucsc.edu/human-pancreas-dev/fetal-pancreas/meta.tsv
And now for Seurat...
and then lastly:
I guess I should reach out on the Seurat/SCTransform GitHub?
What does
any(is.na(mat))
,any(is.nan(as.matrix(mat)))
, andany(is.null(as.matrix(mat)))
yield? If all of those areFALSE
, then yeah, I'd open an issue. IfTRUE
, then something with your matrix is screwy.All
FALSE
.Opened an issue: https://github.com/satijalab/seurat/issues/4546
Thank you for everything Jared. Hopefully, someone will swoop in there and save the day : )