msmu.pp.to_ptm
Summarize peptide-level data to PTM-level data.
Sites are localized from the peptide's own proteins accessions and the attached FASTA, so
this step does not need an inferred protein_group and the resulting site ids do not depend on
any other dataset.
A site's position counts residues only -- the text inside a modification tag is never counted --
so the same peptidoform yields the same site in every notation. Each peptidoform is parsed and
checked against its stripped_peptide; a notation msmu cannot read raises rather than produce
misplaced sites.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mdata
|
MuData
|
|
required |
modi_name
|
str
|
Name of the PTM to summarize (e.g., |
required |
modification
|
str | Sequence[str]
|
The modification tag, exactly as it appears in |
required |
layer
|
str | None
|
Layer to use for quantification aggregation. If |
None
|
agg_method
|
Literal['median', 'mean', 'sum', 'median_polish', 'directlfq']
|
Aggregation method to use. One of |
'median_polish'
|
top_n
|
int | None
|
Number of top features to consider for summarization. If |
None
|
rank_method
|
Literal['median_intensity', 'total_intensity', 'max_intensity', 'mean_intensity']
|
Method to rank features when selecting |
'median_intensity'
|
multisite
|
Multisite
|
What a peptidoform carrying the target modification on several residues
quantifies. |
'combination'
|
Returns:
| Name | Type | Description |
|---|---|---|
MuData |
MuData
|
|
Notes
Adds <modi_name>_site to the supplied MuData in place. Use a copy to preserve the original. Requires peptide data and FASTA-derived protein_info; see to_peptide and attach_fasta.
Examples:
import msmu as mm
# mdata already contains peptide quantification and attached FASTA annotations.
mdata = mm.pp.to_ptm(mdata, modi_name="phospho", modification="(unimod:21)")