cell2home.category_pseudobulker

cell2home.category_pseudobulker(adata, obs_to_bulk, sep=':', compute_mean=False)

Compute the pseudobulks of an AnnData object based on unique value combinations of specified observations. The number of cells that went into each pseudobulk will be reported in .obs["cell_count"] of the resulting object.

Input

adataAnnData

The object to pseudobulk, must have the desired expression space in .X.

obs_to_bulklist of str

Column names in .obs to use to construct the pseudobulks. A pseudobulk will be constructed for each unique value combination of the columns. Will be present as .obs columns in the resulting object.

sepstr, optional (default: ":")

The .obs_names of the resulting pseudobulk will be the unique value combinations of obs_to_bulk going into making the pseudobulk, matching the provided order and separated by sep.

compute_meanbool, optional (default: False)

If True, will return the mean of the .X for each of the pseudobulks. If False, will return the sum instead.