Seurat: scaledata under v3.0

Created on 5 Feb 2019  路  4Comments  路  Source: satijalab/seurat

Hi there,

For me to work on a matrix of 30K genes and 1k cells, scaledata is very time-consuming. So I am wondering if you would recommend apply this function to features of variablegenes (from VariableFeatures()); or sample code for parallel computing? Thanks.

Most helpful comment

You can just scale the variable features, this will save some time and RAM. Keep in mind that if you want to plot genes in a heatmap, this uses scaled data by default and you may need to re-scale to ensure all the genes you want to plot are present in the scaled data. We also have multi-threading enabled for ScaleData using the future package (see #1027).

For example:

library(future)
plan(strategy = "multicore", workers = 6)
pbmc_small <- ScaleData(pbmc_small)

All 4 comments

You can just scale the variable features, this will save some time and RAM. Keep in mind that if you want to plot genes in a heatmap, this uses scaled data by default and you may need to re-scale to ensure all the genes you want to plot are present in the scaled data. We also have multi-threading enabled for ScaleData using the future package (see #1027).

For example:

library(future)
plan(strategy = "multicore", workers = 6)
pbmc_small <- ScaleData(pbmc_small)

Thanks for the advice and will test out. Actually when I was using v2.3 (R3.4.2) for the same dataset, scaledata was much faster (I installed v3.0 under R3.5.0), was this behavior as expected?

Note that if your expression matrix is large, it's best to increase future's maximum allowed size of objects to be exported from default of 500 MB. For example:

options(future.globals.maxSize= 2048 * 1024^2)

which sets the maximum at 2 GB. (Trust me you don't wanna see an error after an hour of running the function)

Hi,
I am working on dataset from human cell atlas, and while using SCtransform I get the following error:
Error: cannot allocate vector of size 190.6 Gb

I am using both multicore and increased future's maxsize option:
options(future.globals.maxSize = 2048 * 1024^2)
plan(strategy = "multicore", workers = 6)

Please advise- thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

htc502 picture htc502  路  3Comments

tmccra2 picture tmccra2  路  3Comments

whitleyo picture whitleyo  路  3Comments

igordot picture igordot  路  3Comments

kysbbubbu picture kysbbubbu  路  3Comments