TagCells | R Documentation |
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.
TagCells(
object,
plot.use = NULL,
ident.name = "tag",
ident.levels = c(TRUE, FALSE),
...
)
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. |
A Seurat object with an additional metadata column containing the cell type annotations and Idents() set to these annotations.
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.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.