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 make_cell_attr(umi, cell_attr, latent_var, batch_var, latent_var_nonreg, : cell attributes cannot contain any NA, NaN, or infinite values #86

Open connorhknight opened 3 years ago

connorhknight commented 3 years ago

Hi, I am analysing the 4 pancreas samples after applying decontX from the celda package. Some of the samples are processing correctly. However, randomly and inconsistently i receive this error:

Error in make_cell_attr(umi, cell_attr, latent_var, batch_var, latent_var_nonreg, : cell attributes cannot contain any NA, NaN, or infinite values

Why could this be happening?

ChristophH commented 3 years ago

Do all input cells have at least one count? Please provide the exact steps to reproduce the problem.

RajneeshSrivastava commented 3 years ago

Any luck resolving this issue?

ChristophH commented 3 years ago

sctransform::vst makes some basic assumptions about the input data. The error message mentioned above suggests that either the input umi matrix was not made up of non-negative counts, or there were cells (columns) that did not sum up to a value > 0 (total number of counts <= 0). Please check your input and make sure that those assumptions are met.

smaniatis commented 3 years ago

I'm getting this on Visium array .h5 output from spaceranger and loaded into Seurat via Load10X_Spatial(). as far as I can see, the counts matrices do not violate the assumptions above. Any advice?

ChristophH commented 3 years ago

@smaniatis I would need the data to figure out what exactly the problem is. If you share the exact commands you used and the input (.h5 file or counts matrix) I will have a look.

zhiiiyang commented 3 years ago

I encountered the same error too but solved it by filtering those genes with all zero counts.

rocketeer1998 commented 2 years ago

I encountered the same error too but solved it by filtering those genes with all zero counts.

I agree. With sample<- subset(sample, subset = nCount_Spatial > 0) command.

ATpoint commented 2 years ago

A reason can be that QC was not done properly and you try to run the function on cells without any counts, meaning all gene in that cell are zero. You can check that with colSums() on your count matrix, removing those with all-zeros.

troysgit commented 2 years ago

Would it be worthwhile amending the error message to include, "a high % of zeroes in some columns" or similar?

lucygarner commented 1 year ago

I got this error as well, but I think it was caused by genes that had zero counts rather than cells. Is this possible?

IoannisKonstantinidis commented 11 months ago

min(obj$nFeature_RNA) [1] 739 min(obj$nCount_RNA) [1] 335 max(obj$nFeature_RNA) [1] 34139 max(obj$nCount_RNA) [1] 95475 obj <- SCTransform(obj, verbose = FALSE) Error in make_cell_attr(umi, cell_attr, latent_var, batch_var, latent_var_nonreg, : cell attribute "log_umi" contains NA, NaN, or infinite value

This seurat object was created from the output of cellranger-arc aggr. It contains both snATAC and snRNA data from 4 biological samples. Any idea why I am getting this error?