scrnatools.plotting.qc_plotting

scrnatools.plotting.qc_plotting(adata: AnnData, counts_thresholds: Tuple[int, int] = (1000, 30000), genes_thresholds: Tuple[int, int] = (100, 5000), mt_threshold: int = 10, show_thresholds: bool = True, batch_key: str | None = None, show_legend: bool = True, figsize: Tuple[int, int] = (9, 3), dpi: int = 300, save_path: str | None = None)[source]

Creates common preprocessing QC plots for an AnnData object.

Parameters:
  • adata (AnnData) – The dataset containing data to plot

  • counts_thresholds (Tuple[int, int], optional) – The lower and upper thresholds to be used on total counts when filtering cells. Defaults to (1000, 30000).

  • genes_thresholds (Tuple[int, int], optional) – The lower and upper thresholds to be used on number of genes when filtering genes. Defaults to (100, 5000).

  • mt_threshold (int, optional) – The threshold to be used on % mito reads when filtering cells. Defaults to 10.

  • show_thresholds (bool, optional) – Whether to show the thresholds as dashed lines on each plot. Defaults to True.

  • batch_key (str, optional) – A column name in ‘adata.obs’ that annotates different batches of data for separate plotting. If ‘None’ treats all cells as coming from the same batch. Defaults to None.

  • show_legend (bool, optional) – Whether to show the ‘batch_key’ labels as a legend. Defaults to True.

  • figsize (Tuple[int, int], optional) – The size of the figure. Defaults to (9, 3).

  • dpi (int, optional) – The resolution of the figure to save. Defaults to 300.

  • save_path (str, optional) – The path to save the figure to (/path/to/dir/filename). Defaults to None.

Raises:

ValueError – If batch_key is not a valid key in ‘adata.obs.columns’