Map_New_Meta: Create new variable from categories in meta.data
Description
Designed for fast variable creation when a new variable is going to be created from existing
variable. For example, mapping multiple samples to experimental condition.
if new_col = NULL returns factor else returns Seurat object with new variable added.
Arguments
seurat_object
name of Seurat object
from
current column in meta.data to map from
new_col
name of new column in meta.data to add new mapped variable. If NULL (default)
will return the variable. If name provided will return Seurat object with new variable added.
...
Mapping criteria, argument names are original existing categories
in the from calumn and values are new categories in the new variable.
References
This function is slightly modified version of LIGER function mapCellMeta
to allow functionality with Seurat objects. https://github.com/welch-lab/liger. (License: GPL-3).