scmorph.pp.aggregate#
- scmorph.pp.aggregate(adata, group_keys, method='median', progress=True)[source]#
Aggregate single-cell measurements into well-level profiles
- Parameters:
- adata
AnnData Annotated data matrix
- group_keys
str|list[str] Column names to group by, e.g. “Well” or “PlateID”
- method
str(default:'median') Which aggregation to perform. Must be one of ‘mean’, ‘median’, ‘std’, ‘var’, ‘sem’, ‘mad’, and ‘mad_scaled’ (i.e. median/mad)
- progress
bool(default:True) Whether to show a progress bar
- adata
Note
If this function produces warnings about dividing by zero, this means that at least one group had a median absolute deviation of 0 for a feature. This means that this feature is constant in that group. However, this will produce missing values. Before proceeding, you should therefore use
drop_na()withfeature_threshold=1andcell_threshold=0to remove features with missing values.- Return type:
- Returns:
Aggregated annotated data matrix