seurat
seurat copied to clipboard
Seurat V2 ScaleData error:Error in if (class(x = data.use) == "dgCMatrix" | class(x = data.use) == : the condition has length > 1
PBMC <- ScaleData(object = PBMC, vars.to.regress = c('nUMI_raw'), model.use = 'linear', use.umi = FALSE) NormalizeData has not been run, therefore ScaleData is running on non-normalized values. Recommended workflow is to run NormalizeData first. ScaleData is running on non-normalized values. Recommended workflow is to run NormalizeData first. Regressing out: nUMI_raw |=======================================================================================| 100% Time Elapsed: 3.84120058218638 mins Scaling data matrix | | 0% Error in if (class(x = data.use) == "dgCMatrix" | class(x = data.use) == : the condition has length > 1
how to fix it, thank you.
closing as duplicate #7742
sorry closing first and reopening here as more informative error message.
Hi,
Not member of dev team but hopefully can be helpful. Can you provide the full code you are running up to the point where error occurs and the output of sessionInfo()
?
Thanks! Sam
Hi,
Not member of dev team but hopefully can be helpful. Can you provide the full code you are running up to the point where error occurs and the output of
sessionInfo()
?Thanks! Sam
Hi Sam,
I have this problem too. Is it related to the Rcpp package dependency? Because Seurat V2 is 6 years old. I cannot perform the ScaleData function normally. error output:
pbmc <- ScaleData(object = pbmc, vars.to.regress = c("nUMI")) Regressing out: nUMI |======================================================================| 100% Time Elapsed: 24.5039319992065 secs Scaling data matrix | | 0%Error in if (class(x = data.use) == "dgCMatrix" | class(x = data.use) == : the condition has length > 1
Best, Mingxuan
Hi,
This is a very old Seurat object so it likely does not work with our current Seurat codebase. Can you please update try running UpdateSeuratObject()
on your object, or re-make the object from the counts matrix? Thanks and sorry for our slow response.