View source: R/Seurat.Utils.Metadata.R
renameSmallCategories | R Documentation |
This function renames categories within a specified identity column of a Seurat object's metadata that have fewer cells than a specified minimum threshold. Categories below this threshold are renamed to a common name, typically "unclear", to clean up small, potentially noisy categories.
renameSmallCategories(
obj,
idents = c("predicted.class", "predicted.cluster", "predicted.subclass"),
min.cells = max(round((ncol(obj))/2000), 10),
new.name = "unclear"
)
obj |
A Seurat object containing the metadata with categories to be cleaned. |
idents |
A character vector specifying the names of the identity columns within
|
min.cells |
An integer specifying the minimum number of cells a category must have to retain its original name. Categories with fewer cells than this threshold will be renamed. Defaults to the greater of the total number of columns divided by 2000 or 10. |
new.name |
A character string specifying the new name to assign to small categories. Defaults to "unclear". |
Returns the Seurat object with renamed categories in the specified metadata columns.
# Assuming obj is a Seurat object with identity columns "ident1" and "ident2":
idents <- c("ident1", "ident2")
obj <- renameSmallCategories(obj, idents = idents)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.