Keep only selected metadata columns in a Seurat object
Usage
metadata_keep(
seu,
...,
cols = NULL,
select = NULL,
drop_na = FALSE,
ignore_missing = FALSE
)Arguments
- seu
Seurat object.
- ...
Bare metadata names or strings (e.g., cell_anno, "cell_anno").
- cols
Optional character vector of metadata column names to keep.
- select
A tidyselect expression (e.g., starts_with("predicted")).
- drop_na
Logical; if TRUE, drop cells with NA in the kept columns.
- ignore_missing
Logical; if TRUE, ignore missing columns and notify.