scdynomics.utils.pp.qc

For filtering low quality cells

author: jy

Functions

filter_multimodal_adata(adata[, layers, ...])

Two QC filters to pre-process the multimodal adata.

qc_metrics([adata, min_genes, percent_top, ...])

QC with controling on n_genes and mt genes.

scdynomics.utils.pp.qc.filter_multimodal_adata(adata: anndata.AnnData, layers: list = [None], min_genes: int = 200, min_cells: int = None, percent_top: int = 20, remove_outliers: bool = True, log1p: bool = True, remove_mono: bool = False) anndata.AnnData

Two QC filters to pre-process the multimodal adata.

Parameters:
adata: ad.AnnData

The multimodal annotated data matrix to be filtered.

layers: list (default: [None])

List of layers in the AnnData object corresponding to different modalities.

min_genes: int (default: 200)

Minimum number of genes expressed required for a cell to pass filtering per modality.

min_cells: int (default: None)

Minimum number of cells required for a gene to be retained.

percent_top: int (default: 20)

Proportions of counts in top-expressed genes to calculate.

remove_outliers: bool (default: True)

If True, removes identified outlier cells based on MADs.

log1p: bool (default: True)

If True, computes log1p transformed metrics.

remove_mono: bool (default: False)

If True, removes cells that only express data in a single modality.

Returns: ad.AnnData

The filtered multimodal AnnData object.

scdynomics.utils.pp.qc.qc_metrics(adata: anndata.AnnData = None, min_genes: int = 200, percent_top: int = 20, remove_outliers: bool = True, log1p: bool = True) anndata.AnnData

QC with controling on n_genes and mt genes.

Refering to: sc-best-practices.org/preprocessing_visualization/quality_control.html

Parameters:
adata: ad.AnnData (default: None)

The annotated data matrix to be filtered.

min_genes: int (default: 200)

Minimum number of genes expressed required for a cell to pass filtering.

percent_top: int (default: 20)

Proportions of counts in top-expressed genes to calculate as a QC metric.

remove_outliers: bool (default: True)

If True, removes identified outlier cells based on median absolute deviation (MAD).

log1p: bool (default: True)

If True, computes log1p transformed metrics during the QC process.

Returns: ad.AnnData

The quality-controlled AnnData object.