AddMetaData: Add in metadata associated with either cells or features.

Description Usage Arguments Value Examples

View source: R/generics.R

Description

Adds additional data to the object. Can be any piece of information associated with a cell (examples include read depth, alignment rate, experimental batch, or subpopulation identity) or feature (ENSG name, variance). To add cell level information, add to the Seurat object. If adding feature-level metadata, add to the Assay object (e.g. object[["RNA"]]))

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
AddMetaData(object, metadata, col.name = NULL)

## S3 method for class 'Assay'
AddMetaData(object, metadata, col.name = NULL)

## S3 method for class 'Seurat'
AddMetaData(object, metadata, col.name = NULL)

## S4 replacement method for signature 'Assay'
x[[i, j, ...]] <- value

## S4 replacement method for signature 'Seurat'
x[[i, j, ...]] <- value

Arguments

x, object

An object

i, col.name

Name to store metadata or object as

j

Ignored

...

Arguments passed to other methods

value, metadata

Metadata or object to add

Value

An object with metadata or and object added

Examples

1
2
3
4
5
6
7
8
cluster_letters <- LETTERS[Idents(object = pbmc_small)]
names(cluster_letters) <- colnames(x = pbmc_small)
pbmc_small <- AddMetaData(
  object = pbmc_small,
  metadata = cluster_letters,
  col.name = 'letter.idents'
)
head(x = pbmc_small[[]])

Seurat documentation built on Jan. 13, 2021, 7:11 p.m.