cellspec.tl.compute_callable_sites

cellspec.tl.compute_callable_sites#

cellspec.tl.compute_callable_sites(adata, min_depth, max_depth=None, key='callable', show_progress=False)#

Compute the number of callable sites per cell/sample.

A site is “callable” if it has adequate sequencing depth. This is used for rate normalization: mutations per callable site.

Parameters:
  • adata (ad.AnnData) – AnnData object with variants

  • min_depth (int) – Minimum depth for a site to be callable

  • max_depth (int, optional) – Maximum depth (exclude PCR artifacts)

  • key (str, default 'callable') – Key for storing in adata.obs

  • show_progress (bool, default False) – Show progress bar

Return type:

Series

Returns:

pd.Series Number of callable sites per cell/sample Also stored in adata.obs[f’{key}_sites’]

Examples

>>> import cellspec as spc
>>> callable = spc.tl.compute_callable_sites(adata, min_depth=10, max_depth=200)
>>> print(callable.head())

Notes

This counts how many variants have adequate depth in each cell/sample, which serves as the denominator for mutation rate calculations.