sctransform icon indicating copy to clipboard operation
sctransform copied to clipboard

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

Open connorhknight opened this issue 5 years ago • 11 comments

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?

connorhknight avatar Dec 16 '20 18:12 connorhknight

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

ChristophH avatar Dec 16 '20 20:12 ChristophH

Any luck resolving this issue?

RajneeshSrivastava avatar Jan 26 '21 20:01 RajneeshSrivastava

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.

ChristophH avatar Jan 27 '21 09:01 ChristophH

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?

smaniatis avatar Feb 08 '21 21:02 smaniatis

@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.

ChristophH avatar Feb 09 '21 07:02 ChristophH

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

zhiiiyang avatar Feb 27 '21 05:02 zhiiiyang

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.

rocketeer1998 avatar Apr 11 '22 03:04 rocketeer1998

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.

ATpoint avatar Jul 18 '22 17:07 ATpoint

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

troysgit avatar Jul 26 '22 04:07 troysgit

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

lucygarner avatar Oct 27 '22 11:10 lucygarner