besca.get_means

besca.get_means(adata, mycat, condition=None)[source]
Calculates average and fraction expression per category in adata.obs

Based on an AnnData object and an annotation category (e.g. louvain) returns geometric mean expression if .raw values are log as it simply calculates mean of whatever values are stored in .raw. Also returns fraction cells expressing gene per category.

u parameters
adata: AnnData

an AnnData object

mycat: str

the category for stratification (e.g. donor, experiment)

condition: str

the category to be later compared (e.g. treatment, timepoint)

average_obs

average gene expression per category

fraction_obs

fraction cells expressing a gene per category