Add_Sample_Meta {scCustomize} | R Documentation |
Add Sample Level Meta Data
Description
Add meta data from ample level data.frame/tibble to cell level seurat @meta.data
slot
Usage
Add_Sample_Meta(
seurat_object,
meta_data,
join_by_seurat,
join_by_meta,
na_ok = FALSE,
overwrite = FALSE
)
Arguments
seurat_object |
object name. |
meta_data |
data.frame/tibble containing meta data or path to file to read. Must be formatted as either data.frame or tibble. |
join_by_seurat |
name of the column in |
join_by_meta |
name of the column in |
na_ok |
logical, is it ok to add NA values to |
overwrite |
logical, if there are shared columns between |
Value
Seurat object with new @meta.data
columns
Examples
## Not run:
# meta_data present in environment
sample_level_meta <- data.frame(...)
obj <- Add_Sample_Meta(seurat_object = obj, meta_data = sample_level_meta,
join_by_seurat = "orig.ident", join_by_meta = "sample_ID")
# from meta data file
obj <- Add_Sample_Meta(seurat_object = obj, meta_data = "meta_data/sample_level_meta.csv",
join_by_seurat = "orig.ident", join_by_meta = "sample_ID")
## End(Not run)