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
- adata
AnnData The object to pseudobulk, must have the desired expression space in
.X.- obs_to_bulklist of
str Column names in
.obsto use to construct the pseudobulks. A pseudobulk will be constructed for each unique value combination of the columns. Will be present as.obscolumns in the resulting object.- sep
str, optional (default:":") The
.obs_namesof the resulting pseudobulk will be the unique value combinations ofobs_to_bulkgoing into making the pseudobulk, matching the provided order and separated bysep.- compute_mean
bool, optional (default:False) If
True, will return the mean of the.Xfor each of the pseudobulks. IfFalse, will return the sum instead.
- adata