View source: R/Seurat.Utils.Metadata.R
renameAzimuthColumns | R Documentation |
Dynamically renames specified metadata columns in a Seurat object, particularly those prefixed with "predicted." and the "mapping.score" column, by applying a new prefix that combines a user-defined prefix and a reference name.
renameAzimuthColumns(
obj,
ref = c("humancortexref", "fetusref")[1],
prefix = "azi",
azim_cols = CodeAndRoll2::grepv(x = tail(colnames(obj@meta.data), 10), pattern =
"predicted.")
)
obj |
A Seurat object containing metadata in |
ref |
A character string specifying the reference; defaults to "humancortexref". The "ref" part of the string will be removed in the new column names. |
prefix |
A character string to prefix to the column names, defaulting to "azi".
This prefix is combined with the modified |
azim_cols |
Azimuth columns |
Returns the Seurat object with renamed metadata columns.
# Assuming `obj` is a Seurat object with metadata columns following the "predicted." pattern:
obj <- renameAzimuthColumns(obj, ref = "humancortexref", prefix = "azi")
# This will rename columns like "predicted.class" to "azi.humancortex.class"
# and include "mapping.score" as "azi.humancortex.mapping.score"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.