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 in h(simpleError(msg, call)) when I was running SCTransform #81

Closed HuaZou closed 3 years ago

HuaZou commented 3 years ago

Hi, when I was running this code:

for (i in 1:length(split_seurat)) {
  split_seurat[[i]] <- NormalizeData(split_seurat[[i]], verbose = TRUE)
  split_seurat[[i]] <- SCTransform(split_seurat[[i]], verbose = FALSE)
}

it produced an error:

Performing log-normalization
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
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

It happened when I used a small mount of cells (50 cells per dataset) to run the data analysis workflow for practicing, so I wonder whether SCTransform could only be applied on big data? would someone give me some advice?

ChristophH commented 3 years ago

First, why do you call NormalizeData and SCTransform on the same Seurat object? It's unusual - one either wants log-normalization (then you would call NormalizeData) or sctransform normalization (call SCTransform).

Regarding the number of cells, I cannot give you a specific lower bound. You would have to try and carefully explore the results.

You could also try the develop version of the sctransform package to see if the error you are getting is due to one of the known issues that have been fixed. See https://github.com/ChristophH/sctransform/issues/76 for details.