pegasus.qc_metrics

pegasus.qc_metrics(data, mito_prefix='MT-', min_genes=500, max_genes=6000, min_umis=100, max_umis=600000, percent_mito=10.0, percent_cells=0.05)[source]

Generate Quality Control (QC) metrics on the dataset.

Parameters
  • data (anndata.AnnData) – Annotated data matrix with rows for cells and columns for genes.

  • mito_prefix (str, optional, default: "MT-") – Prefix for mitochondrial genes.

  • min_genes (int, optional, default: 500) – Only keep cells with at least min_genes genes.

  • max_genes (int, optional, default: 6000) – Only keep cells with less than max_genes genes.

  • min_umis (int, optional, default: 100) – Only keep cells with at least min_umis UMIs.

  • max_umis (int, optional, default: 600,000) – Only keep cells with less than max_umis UMIs.

  • percent_mito (float, optional, default: 10.0) – Only keep cells with percent mitochondrial genes less than percent_mito % of total counts.

  • percent_cells (float, optional, default: 0.05) – Only assign genes to be robust that are expressed in at least percent_cells % of cells.

Return type

None

Returns

  • None

  • Update data.obs

    • n_genes: Total number of genes for each cell.

    • n_counts: Total number of counts for each cell.

    • percent_mito: Percent of mitochondrial genes for each cell.

    • passed_qc: Boolean type indicating if a cell passes the QC process based on the QC metrics.

  • Update data.var

    • n_cells: Total number of cells in which each gene is measured.

    • percent_cells: Percent of cells in which each gene is measured.

    • robust: Boolean type indicating if a gene is robust based on the QC metrics.

    • highly_variable_features: Boolean type indicating if a gene is a highly variable feature. By default, set all robust genes as highly variable features.

Examples

>>> pg.qcmetrics(adata)