sctk.cellwise_qc
- sctk.cellwise_qc(adata, metrics=None, cell_qc_key='cell_passed_qc', **kwargs)
Filter cells in an AnnData object based on quality control metrics. The object is modified in-place.
This function filters cells in an AnnData object based on quality control metrics. The metrics used for filtering can be specified using the metrics argument. By default, the function uses a set of default metrics, but these can be overridden by passing a list/tuple of metric names or a dictionary of metric names and their corresponding parameters.
- Parameters:
adata – AnnData object to filter cells from.
metrics – Optional list/tuple of metric names or dictionary of metric names and their corresponding parameters. If not provided, the function uses a set of default metrics. For defaults and an explanation, please refer to the QC workflow demo notebook.
cell_qc_key – Obs column in the object to store the per-cell QC calls in.
**kwargs – Additional keyword arguments to pass to the
fit_gaussian()
function.
- Returns:
None.
- Raises:
ValueError – If metrics is not a list/tuple of metric names or a dictionary of metric names and their corresponding parameters.
Examples
>>> import scanpy as sc >>> import sctk >>> adata = sc.datasets.pbmc3k() >>> sctk.calculate_qc(adata) >>> sctk.cellwise_qc(adata)