TagCells: Quickly tag cells in a Seurat Object

View source: R/TagCells.R

TagCellsR Documentation

Quickly tag cells in a Seurat Object

Description

This function is a CellSelector wrapper that creates a new metadata column with two levels (TRUE and FALSE by default) and sets it as the new identity. Used as a convenience to track groups of cells across plots particularly during QC.

Usage

TagCells(
  object,
  plot.use = NULL,
  ident.name = "tag",
  ident.levels = c(TRUE, FALSE),
  ...
)

Arguments

object

Seurat object. If using the default plot (DimPlot), a dimension reduction should have been computed, e.g. tsne or umap.

ident.name

character(1) The name of the metadata column that will be filled the tag info.

ident.levels

character(2). The names of the tagged vs other cells. Default: c(TRUE,FALSE)

...

Other parameters passed to DimPlot when applicable.

Value

A Seurat object with an additional metadata column containing the cell type annotations and Idents() set to these annotations.

Examples

SeuratObject <- TagCells(SeuratObject) # By default, tagging on a DimPlot.
SeuratObject[,SO$tag] # Seurat object restricted to the tagged cells
SeuratObject <- TagCells(SeuratObject,FeaturePlot(SeuratObject,"GAPDH")) # Can also pass a custom plot.
SeuratObject <- TagCells(SeuratObject,FeaturePlot(SeuratObject,"GAPDH"),ident.name="SelectedCells",ident.levels=c("Yes","no")) # Custom name for the new metadata column and levels.

nbroguiere/burgertools documentation built on Jan. 30, 2024, 3:48 a.m.