pyMzLib¶
mzLib for Python. mzLib is a mass-spectrometry and proteomics library written in C#, developed in the Smith lab at UW–Madison. pyMzLib makes it callable from Python.
Not on PyPI yet
pyMzLib has not had its first release. Until it does, install a wheel from the Actions artifacts or build from source. The command above is what release day looks like, not what today looks like.
That is the entire installation. No .NET to install, no runtime to configure, no version to reconcile — and no third-party Python dependencies, so pyMzLib cannot conflict with anything already in your environment.
import pymzlib
files = pymzlib.pride.list_files("PXD000001")
print(f"{len(files)} files, {pymzlib.pride.total_size_bytes(files) / 1e9:.2f} GB")
pymzlib.pride.download("PXD000001", "downloads", category="RAW")
Why this exists¶
A great deal of computational proteomics happens in Python. mzLib holds a decade of carefully tested proteomics machinery — chemistry, spectra, digestion, deconvolution, repository access — and until now none of it was reachable from a Python prompt. The result is that Python users reimplement things mzLib already does correctly.
The hard part was never the calling convention. It was making the result frictionless: a wrapper that asks you to install a .NET runtime, match a Python version, or resolve a dependency conflict has failed, however complete its API. So that constraint drove the design, and the measure of success is the two commands above.
What's covered¶
Coverage is deliberately partial and grows by demand — the same way pyOpenMS grew.
| Area | Status |
|---|---|
| PRIDE Archive — list a project's files, filtered download | available |
| Peptidoforms — digest an annotated protein, apply its modifications, fragment every peptide | available |
| FlashLFQ — label-free quantification across mzML runs, with match-between-runs | available |
| Readers — identify any of 29 result-file formats and read the ones with a uniform record view | available |
| Everything else in mzLib | not yet — tell us what you need |
If there is something in mzLib you want from Python, opening an issue is genuinely the fastest path. The extension recipe is short, and requests are how we decide what to cover next.
Where to go next¶
-
Getting started Install it and run something, written for people who don't live in Python.
-
PRIDE guide The first covered area, end to end.
-
API reference Generated from the source, so it cannot drift.
-
How it works What's actually happening when you call it, and why it was built this way.
Citing¶
pyMzLib does not yet have a paper. Cite mzLib and MetaMorpheus for the underlying science; a release DOI will appear here once the first version ships.