Learn R Programming

Seurat (version 3.1.1)

merge.Assay: Merge Seurat Objects

Description

Merge two or more objects.

Usage

# S3 method for Assay
merge(x = NULL, y = NULL, add.cell.ids = NULL,
  merge.data = TRUE, ...)

# S3 method for Seurat merge(x = NULL, y = NULL, add.cell.ids = NULL, merge.data = TRUE, project = "SeuratProject", ...)

Arguments

x

Object

y

Object (or a list of multiple objects)

add.cell.ids

A character vector of length(x = c(x, y)). Appends the corresponding values to the start of each objects' cell names.

merge.data

Merge the data slots instead of just merging the counts (which requires renormalization). This is recommended if the same normalization approach was applied to all objects.

...

Arguments passed to other methods

project

Sets the project name for the Seurat object.

Value

Merged object

Details

When merging Seurat objects, the merge procedure will merge the Assay level counts and potentially the data slots (depending on the merge.data parameter). It will also merge the cell-level meta data that was stored with each object and preserve the cell identities that were active in the objects pre-merge. The merge will not preserve reductions, graphs, logged commands, or feature-level metadata that were present in the original objects. If add.cell.ids isn't specified and any cell names are duplicated, cell names will be appended with _X, where X is the numeric index of the object in c(x, y).

Examples

Run this code
# NOT RUN {
# merge two objects
merge(x = pbmc_small, y = pbmc_small)
# to merge more than two objects, pass one to x and a list of objects to y
merge(x = pbmc_small, y = c(pbmc_small, pbmc_small))

# }

Run the code above in your browser using DataLab