Merge really large amount of Seurat objects
0
0
Entering edit mode
16 months ago
Andy ▴ 120

Good afternoon,

I meet a problem to merge a large amount of Seurat objects together, when I use merge function I encountered an error message that

Error: vector::reserve

My code is:

merge<-merge(x=object[[1]], y=object[-1])

I was thinking probably there is something wrong with the data, however, I randomly pick some objects and run same code, then they successfully merged. Then I suspicious if the merge function has limit? I am wondering what is the solution to merge my objects, and run following analysis.

Best
Andy

Seurat • 3.6k views
ADD COMMENT
0
Entering edit mode

Moreover, the error message said:

Error: vector::reserve
In addition: Warning message:
In CheckDuplicateCellNames(object.list = objects) :
  Some cell names are duplicated across objects provided. Renaming to enforce unique cell names.
ADD REPLY
2
Entering edit mode

if you have different Seurat objects and the sample are processed in different batches, you may have cells with the same barcode across samples. You may need to prefix the barcode with the sample name.

for (i in names(seurat_object_list)) {
  seurat_object_list[[i]] <- RenameCells(seurat_object_list[[i]],
                                         add.cell.id = i)
}

# merge all the objects in the list
merged_combined <- reduce(seurat_object_list,
                          MergeSeurat,
                          do.normalize = FALSE)

or you can use https://samuel-marsh.github.io/scCustomize/reference/Merge_Seurat_List.html

ADD REPLY
0
Entering edit mode

The merge_seurat_list worked for my data! Thanks a lot for your answer!

ADD REPLY

Login before adding your answer.

Traffic: 858 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6