.summarize_overlapping_peptides
- proteopy.pp.summarize_overlapping_peptides(adata, group_by='protein_id', layer=None, func='sum', zero_to_na=False, fill_na=None, skip_na=True, inplace=True)[source]
Aggregate intensities across overlapping peptides.
Calls
extract_peptide_groups()internally to identify overlapping (substring-contained) peptides, then aggregates intensities within each group.Uses the longest
peptide_idin each group as the new var_name.Keeps both the representative
peptide_idas a column and index.Retains the grouping key as
'peptide_group_id'.Concatenates differing
.varannotations using';'.
- Parameters:
adata (AnnData) –
AnnDatawith peptide-level data.group_by (str or None, optional) – Column in
adata.varto partition peptides before grouping. Passed toextract_peptide_groups(). When set (e.g.'protein_id'), substring containment is only evaluated among peptides sharing the same value in this column. WhenNone, all peptides are grouped globally.layer (str, optional) – Key in
adata.layersspecifying which matrix to aggregate; defaults to.X.func ({'sum', 'mean', 'median', 'max'} or Callable) – Aggregation applied across peptides in each group.
zero_to_na (bool, optional) – If True, replace zeros with
np.nanbefore aggregation.fill_na (float or int, optional) – Replace
np.nanvalues with this constant before aggregation.skip_na (bool, optional) – If True, ignore
np.nanduring aggregation. If False, anynp.nanin a group producesnp.nanin the result.inplace (bool, optional) – If True, modifies adata in place. Otherwise returns a new AnnData.
- Returns:
Aggregated AnnData if inplace=False, else modifies in place.
- Return type:
AnnData | None