sctk.clusterwise_qc

sctk.clusterwise_qc(ad, threshold=0.5, clus_key='qc_cluster', cell_qc_key='cell_passed_qc', key_added='cluster_passed_qc') None

Find good quality control (QC) clusters in an AnnData object.

This function finds good quality control (QC) clusters in an AnnData object by identifying clusters that have a high proportion of cells that pass the QC filter.

Parameters:
  • ad – AnnData object to find good QC clusters in. Needs qc_cluster present in obs.

  • threshold – Clusters featuring at least this fraction of good QC cells will be deemed good QC clusters.

  • clus_key – Key to use to retrieve the QC clusters from obs in the AnnData.

  • cell_qc_key – Key to use to retrieve per-cell QC calls from obs in the AnnData.

  • key_added – Key to use for storing the results in the AnnData obs object.

Returns:

None.

Raises:

None.

Examples

>>> import scanpy as sc
>>> import sctk
>>> adata = sc.datasets.pbmc3k()
>>> sctk.calculate_qc(adata)
>>> metrics_list = ["n_counts", "n_genes", "percent_mito", "percent_ribo", "percent_hb"]
>>> sctk.generate_qc_clusters(adata, metrics=metrics_list)
>>> sctk.cellwise_qc(adata)
>>> sctk.clusterwise_qc(adata)