FACSPy.subset_gate#
- FACSPy.subset_gate(adata, gate, as_view=False, copy=False)#
Subsets the dataset to a specific population.
- Parameters:
adata (
AnnData) – The anndata object of shape n_obs x n_vars where rows correspond to cells and columns to the channels.gate (
str) – The gate to be subset to. Can be passed as a population name (e.g. ‘CD45+’), a partial gate path (e.g. ‘live/CD45+’) or a complete gate path (e.g. ‘root/cells/live/CD45+’)as_view (
bool) – If True, returns an AnnDataView object.copy (
bool) – Whether to copy the dataset.
- Return type:
AnnDataor None, depending on copy.
Examples
>>> import FACSPy as fp >>> dataset = fp.create_dataset(...) >>> fp.subset_gate(dataset, "CD45+")
>>> import FACSPy as fp >>> dataset = fp.create_dataset(...) >>> fp.subset_gate(dataset, 'live/CD45+')
>>> import FACSPy as fp >>> dataset = fp.create_dataset(...) >>> fp.subset_gate(dataset, 'root/cells/live/CD45+')