View source: R/Utilities_Objects.R
| Map_New_Meta | R Documentation |
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.
Map_New_Meta(seurat_object, from, new_col = NULL, ...)
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 |
if new_col = NULL returns factor else returns Seurat object with new variable added.
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).
## Not run:
seurat_object <- Map_New_Meta(seurat_object, from = "orig.ident", new_col = "Treatment",
"1" = "Ctrl", "2" = "Treated", "3" = "Treated", "4" = "Ctrl")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.