This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Merge really large amount of Seurat objects

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

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.

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

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

0 answers

No answers yet.

Log in to answer this question.