.quantify_proteoforms
- proteopy.pp.quantify_proteoforms(adata, *, group_by='proteoform_id', layer=None, func='sum', proteodata_target_level='protein', inplace=True)
Aggregate intensities in
adata.X(or selected layer) by.var[group_col], aggregate annotations inadata.varby concatenating unique values with';', and setgroup_colas the new index (var_names).- Parameters:
adata (AnnData) – Input AnnData with .X (obs x vars) and .var annotations.
group_by (str) – Column in adata.var to group by (e.g. ‘protein_id’).
layer (str, optional) – Key in
adata.layers; when set, quantification uses that layer instead ofadata.X.func ({'sum', 'median', 'max'} | Callable) – Aggregation to apply across grouped variables.
proteodata_target_level ({'protein', 'peptide'} or None, optional) – Set the proteodata level of the output. When
Nonethe data level and columns are left as is. When'protein', aprotein_idcolumn matching the new var index is added so the result satisfies protein-level proteodata requirements; any pre-existingprotein_idcolumn is renamed toprotein_id_oldand anypeptide_idcolumn is removed. When'peptide', apeptide_idcolumn matching the new var index is added so the result satisfies peptide-level proteodata requirements; aprotein_idcolumn must already exist in the inherited annotations.inplace (bool) – If True, modify adata in place; else return a new AnnData.
- Returns:
Aggregated AnnData if inplace=False; otherwise None.
- Return type:
AnnData | None