Seurat (version 2.3.4)

CombineIdent: Sets identity class information to be a combination of two object attributes

Description

Combined two attributes to define identity classes. Very useful if, for example, you have multiple cell types and multiple replicates, and you want to group cells based on combinations of both.

Usage

CombineIdent(object, attribute.1 = "ident", attribute.2 = "orig.ident")

Arguments

object

Seurat object

attribute.1

First attribute for combination. Default is "ident"

attribute.2

Second attribute for combination. Default is "orig.ident"

Value

A Seurat object where object@ident has been appropriately modified

Examples

Run this code
# NOT RUN {
groups <- sample(c("group1", "group2", "group3"), size = 80, replace = TRUE)
celltype <- sample(c("celltype1", "celltype2", "celltype3"), size = 80, replace = TRUE)
new.metadata <- data.frame(groups = groups, celltype = celltype)
rownames(new.metadata) <- pbmc_small@cell.names
pbmc_small <- AddMetaData(object = pbmc_small, metadata = new.metadata)
pbmc_small <- CombineIdent(object = pbmc_small, attribute.1 = "celltype", attribute.2 = "groups")
pbmc_small@ident

# }

Run the code above in your browser using DataCamp Workspace