Skip to content

msmu.tl.compute_precursor_isolation_purity_from_mzml

Calculate precursor isolation purity for MS2 scans in local mzML files.

Parameters:

Name Type Description Default
mzml_paths str | Path | list

One local mzML path or a list of paths; files must exist.

required
tolerance float

Mass tolerance for matching precursor isotopes; default 20.

20.0
unit_ppm bool

True interprets tolerance in ppm; False uses absolute mass tolerance (Da).

True

Returns:

Type Description
PurityResult

A PurityResult object, not a DataFrame. .to_df() returns columns purity, scan_num, and filename; .hist() and .box() return plotly figures.

Notes

Requires pyopenms (Röst et al., 2014) at execution time. Input files are read, not modified. To attach results to PSM data, use compute_precursor_isolation_purity.

Examples:

import msmu as mm
result = mm.tl.compute_precursor_isolation_purity_from_mzml("sample.mzML")
table = result.to_df()
fig = result.hist()
fig.show()
References

Röst, H. L., Schmitt, U., Aebersold, R., and Malmström, L. pyOpenMS: a Python-based interface to the OpenMS mass-spectrometry algorithm library. Proteomics 14(1), 74–77 (2014). https://doi.org/10.1002/pmic.201300246.