decoupler.get_pseudobulk

decoupler.get_pseudobulk(adata, sample_col, groups_col, obs=None, layer=None, min_prop=0.2, min_cells=10, min_counts=1000, min_smpls=2)

Generates an unormalized pseudo-bulk profile per sample and group.

Sums the counts of the cells belonging the the same sample and group. Genes that are not expressed in at least a proportion of cells (min_prop) and a number of samples (min_smpls) are ignored. This is done to remove noisy genes.

Parameters:
adataAnnData

Input AnnData object.

sample_colstr

Column of obs where to extract the samples names.

groups_colstr

Column of obs where to extract the groups names.

obspd.DataFrame, None

If provided, meta-data dataframe.

layerstr

If provided, which element of layers to use.

min_propfloat

Minimum proportion of cells with non-zero values.

min_cellsint

Minimum number of cells per sample.

min_countsint

Minimum number of counts per sample.

min_smplsint

Minimum number of samples per feature.

Returns:
Returns new AnnData object with unormalized pseudobulk profiles per sample
and group.