addTranslatedMetadata: Add Translated Metadata to a Seurat Object

View source: R/Seurat.Utils.Metadata.R

addTranslatedMetadataR Documentation

Add Translated Metadata to a Seurat Object

Description

This function translates a specified metadata vector in a Seurat object using a named vector of old and new values and adds it to the Seurat object with a specified suffix. The function also generates UMAP plots for the new metadata.

Usage

addTranslatedMetadata(
  obj = combined.obj,
  orig.ident = "RNA_snn_res.0.4",
  translation_as_named_vec,
  new_col_name = substitute_deparse(translation_as_named_vec),
  suffix = NULL,
  plot = F,
  ...
)

Arguments

obj

A Seurat object to be updated. Default: combined.obj.

orig.ident

A character string specifying the original metadata to be translated. Default: "RNA_snn_res.0.4".

translation_as_named_vec

A named vector where names are old values and values are new translations. Default: None.

new_col_name

A character string specifying the name of the new metadata column. Default: "translation_as_named_vec".

suffix

A character string specifying the suffix for the new metadata column name. Default: ".".

plot

A logical indicating whether to plot the UMAP for the new metadata. Default: FALSE.

Value

An updated Seurat object.


vertesy/Seurat.utils documentation built on Dec. 4, 2024, 5:20 p.m.