RelabelSmallCategories | R Documentation |
Relabels small categories in a specified metadata column of a Seurat object. Categories with cell counts less than a minimum count are relabeled to a specified label. The function adds a new metadata column with the updated labels.
RelabelSmallCategories(
obj,
col_in,
backup_col_name = ppp(col_in, "orig"),
min_count = 100,
small_label = "Other",
v = TRUE
)
obj |
Seurat object. The Seurat object containing the metadata. |
col_in |
Character string. Name of the metadata column to process. |
backup_col_name |
Character string. Name of the new metadata column where to backup the original values.
Default: |
min_count |
Numeric. Minimum number of cells required for a category to be retained. Categories with counts less than this number will be relabeled. Default: 100 |
small_label |
Character string. Label to assign to small categories. Default: "Other". |
v |
Logical. If |
Seurat object. The modified Seurat object with the new metadata column added.
# Assuming 'seurat_obj' is your Seurat object
seurat_obj <- RelabelSmallCategories(
obj = seurat_obj,
col_in = "cell_type",
min_count = 50,
small_label = "MinorType",
v = TRUE
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.