frac_pos

besca.pp.frac_pos(adata, threshold=0)[source]

Calculate the fraction of cells positive for expression of a gene.

Calculates for each gene the fraction of cells that show a gene expression above the indicated threshold. The fraction of positive cells is added to adata.var

Parameters:
  • adata (AnnData) – The annotated data matrix.

  • threshold (int | default = 0) – Integer defining the value above which a gene is deemed as being expressed.

Returns:

updates the:class:~anndata.AnnData object adding frac_pos to adata.var.

Return type:

None

Example

>>> import besca as bc
>>> adata = bc.datasets.simulated_pbmc3k_raw()
>>> bc.pp.frac_pos(adata)