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

sctransform error: Vector Memory Exceeded and/or methods to integrate replicates w/o using sctransform #61

Closed agurgis closed 4 years ago

agurgis commented 4 years ago

Hi,

I have a dataset of 2 replicates that I would like to run the sctransform function on, and then go on to integrate them with the following code:

example1.data <- Read10X_h5(filename = "file1name_here") example2.data <- Read10X_h5(filename = "file2name_here")

example_1 <- CreateSeuratObject(counts = example1.data, project = "MyProject1", min.cells = 3, min.features = 200) example_2 <- CreateSeuratObject(counts = example2.data, project = "MyProject2", min.cells = 3, min.features = 200)

example_1 <- SCTransform(example_1, verbose = FALSE) example_2 <- SCTransform(example_2, verbose = FALSE)

example.list <- list(example_1, example_2) example.features <- SelectIntegrationFeatures(object.list = example.list, nfeatures = 3000) example.list <- PrepSCTIntegration(object.list = example.list, anchor.features = example.features)

example.anchors <- FindIntegrationAnchors(object.list = example.list, normalization.method = "SCT", anchor.features = example.features) example.combined <- IntegrateData(anchorset = example.anchors, normalization.method = "SCT")

I have been able to do this successfully in the past, but when I try it on these files (file 1 is 84.2 MB, file 2 is 12.9 MB ), I keep getting the following error and can't move forward:

Error: vector memory exhausted (limit reached?)

What is causing this error? Is there anyway I can fix it?

Alternatively, if I can't adjust/fix some error to make sctransform work, I was planning on running NormalizeData, FindVariableFeatures, and ScaleData successively as an alternative to the above, but am not sure what the implications would be. Would this change the number of PC used for clustering, or have any other significant effects I'm missing? And moving forward with those assays, what would be the best way to then integrate them, since I can't use the anchors or integration features like I would have before?

I am new to both Seurat and R, so I apologize if this is something quite basic. I really appreciate any advice or wisdom you can share!

Thanks so much for all of the wonderful resources.

ChristophH commented 4 years ago

The IntegrateData function is part of the Seurat package, so I suggest you ask there. When asking there, try to provide a minimal reproducible example (i.e. the input that triggers the error).