mojaveazure / loomR

An R-based interface for loom files
61 stars 16 forks source link

how to merge 6 loom file? #74

Open dmsalsgh97 opened 3 years ago

dmsalsgh97 commented 3 years ago

Hi, first of all, thanks for developing Seurat and wrappers! It is awesome.

I'm analyzing 6 samples with Seurat's SCTransform integration method. Now, I'm trying to project velocyto's output on the umap embedding of the SCTransform integrated Seurat obj.

First, I tried to merge 6 individual .loom files generated by scvelo.py CLI on 10x output. BUT, When I tried it following @velocyto-team/velocyto.R#54, it needs huge memory and causes MEM allocation error. (exceeds 100Gb, and I think it is strange...)

sample1 <- ReadVelocity(file = ".../1-sample.loom") sample2 <- ReadVelocity(file = ".../2-sample.loom") bm <- merge(x = sample1, y = sample2, merge.data = TRUE) Error in asMethod(object) : Cholmod error 'out of memory' at file ../Core/cholmod_memory.c, line 146

image

My second thought was to aggregate 6 10x outputs using cellranger-aggr and run scvelo.py CLI on the aggregated 10x output and project it on seurat integrate object's umap.

Thanks,

poddar19 commented 3 years ago

Hi!

It's too late to reply now but providing a solution to this problem in case somebody else faces the same issue in future. You can convert the loom object to Seurat Object and then merge the two files. For example,

sample1 <- ReadVelocity(file = ".../1-sample.loom") sample2 <- ReadVelocity(file = ".../2-sample.loom") sample1_seurat <- as.Seurat(x = sample1) sample2_seurat <- as.Seurat(x = sample2) bm <- merge(x = sample1_seurat, y = sample2_seurat, merge.data = TRUE)

Let me know if this doesn't work.

jordan841220 commented 1 year ago

@poddar19 I am wondering if batch effect in the merged object should be regress out? The thing is that after regressing out batch effect with Seurat Integration process, I lost my spliced and unspliced assays. What do you think?

Thanks in advance!