merge_anndata: Merge 'anndata' objects

View source: R/merge_anndata.R

merge_anndataR Documentation

Merge anndata objects

Description

Merge a list of Seurat objects efficiently.

Usage

merge_anndata(
  obj_list,
  axis = 0L,
  join = "outer",
  merge = NULL,
  uns_merge = NULL,
  label = NULL,
  keys = NULL,
  index_unique = NULL,
  fill_value = NULL,
  pairwise = FALSE,
  verbose = TRUE
)

Arguments

obj_list

A named list of AnnData objects, or paths to AnnData objects saved to disk as .h5ad files.

axis

Which axis to concatenate along.

join

How to align values when concatenating. If "outer", the union of the other axis is taken. If "inner", the intersection. See concatenation for more.

merge

How elements not aligned to the axis being concatenated along are selected. Currently implemented strategies include: * NULL: No elements are kept. * "same": Elements that are the same in each of the objects. * "unique": Elements for which there is only one possible value. * "first": The first element seen at each from each position. * "only": Elements that show up in only one of the objects.

uns_merge

How the elements of .uns are selected. Uses the same set of strategies as the merge argument, except applied recursively.

label

Column in axis annotation (i.e. .obs or .var) to place batch information in. If it's NULL, no column is added.

keys

Names for each object being added. These values are used for column values for label or appended to the index if index_unique is not NULL. Defaults to incrementing integer labels.

index_unique

Whether to make the index unique by using the keys. If provided, this is the delimeter between "orig_idxindex_uniquekey". When NULL, the original indices are kept.

fill_value

When join="outer", this is the value that will be used to fill the introduced indices. By default, sparse arrays are padded with zeros, while dense arrays and DataFrames are padded with missing values.

pairwise

Whether pairwise elements along the concatenated dimension should be included. This is FALSE by default, since the resulting arrays are often not meaningful.

verbose

Print messages.

Value

A merged AnnData object.

Examples

obj <- example_obj("anndata")
obj_list <- Seurat::SplitObject(obj,split.by = "groups")
obj2 <- merge_seurat(obj_list)

bschilder/scKirby documentation built on April 22, 2024, 12:13 a.m.