Closed davemcg closed 4 years ago
data: http://hpc.nih.gov/~mcgaugheyd/scEiaD/2020_08_13/scEiaD_droplet_seurat_v3.Rdata
load('scEiaD_droplet_seurat_v3.Rdata')
library(tidyverse)
library(singleCellHaystack)
library(Seurat)
library(Matrix)
library(tictoc)
detect <- ( integrated_obj@assays$RNA@counts > 0)
scvi <- Embeddings(integrated_obj, reduction = 'scVI')#[cells,]
cts <- ( integrated_obj@assays$RNA@counts) #[,cells])
gd <- colSums(detect)
rm(integrated_obj)
tic()
scH <- haystack(x = scvi , detection = detect, use.advanced.sampling = gd)
toc()
Hi David. Thank you for letting us know. We have followed your suggestion and replaced those apply
instances by Matrix::rowSums
. I have pushed those changes to the sparse branch. On my (far smaller) sparse matrix datasets this seems to work, but if you run into other issues please let us know.
Running with 985k cells and 500GB of memory
I suggest you use
Matrix::colSums
andMatrix::rowSum
instead ofapply
to do sum operations asapply
transforms the sparse matrix into a full matrix.