pymzdata
pymzdata provides Python bindings for mzdata,
a fast Rust library for reading mass spectrometry data files.
Supported formats
MZReader supports mzML and indexed mzML, MGF, Bruker TDF, and imzML files.
IMMZReader provides ion-mobility frame access for compatible mzML and Bruker TDF
files. Thermo RAW is also supported when its native runtime dependencies are
available on the host system.
Installation
pip install pymzdata
Python 3.9 or later is required. NumPy is installed automatically and is used for the peak arrays returned by the reader.
Quickstart
import pymzdata
with pymzdata.MZReader("example.mzML") as reader:
print(f"{len(reader)} spectra")
for spectrum in reader:
print(spectrum.id, spectrum.ms_level, spectrum.start_time)
mz = spectrum.mz_array()
intensity = spectrum.intensity_array()
if mz is not None:
print(f" {len(mz)} peaks")
MZReader supports iteration and random access with get_by_index, get_by_id,
and get_by_time (retention time in minutes). Spectrum metadata, precursor
information, and decoded NumPy peak arrays are available from each Spectrum.
For Bruker ion-mobility data, use IMMZReader directly or convert an open
MZReader with into_frame_reader() to access ion-mobility frames.
Development
To build the bindings from a checkout, install maturin and run:
cd crates/pymzdata
maturin develop
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pymzdata-0.66.6.tar.gz.
File metadata
- Download URL: pymzdata-0.66.6.tar.gz
- Upload date:
- Size: 815.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
maturin/1.15.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
167d903d95c617b2ad44bed560fe2e88e7ad7a5f5f303b5503029f6eb064ae0b
|
|
| MD5 |
4a972f1c5978639acbe1c11befea46b0
|
|
| BLAKE2b-256 |
a605d607de356fc77706b22243ec108b9d61b9e2bb86f19acdc3f42a50bc64a3
|
File details
Details for the file pymzdata-0.66.6-cp39-abi3-win_amd64.whl.
File metadata
- Download URL: pymzdata-0.66.6-cp39-abi3-win_amd64.whl
- Upload date:
- Size: 4.5 MB
- Tags: CPython 3.9+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
maturin/1.15.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0a584d3bb199de25cc1c2c161857e9e6453a2aef5c9d1e36067a3c1dd5f42a7
|
|
| MD5 |
2757a3dec4e194dddfc3272796c6c358
|
|
| BLAKE2b-256 |
b61f5225ebb21a26bef66e4ae61791617ba3ae561868c258b719175e75221b8d
|
File details
Details for the file pymzdata-0.66.6-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: pymzdata-0.66.6-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 4.4 MB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
maturin/1.15.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ae1b07d2991e58914855a8851ba4b33a3aece138731ab5c626cc1ce4c49bf19
|
|
| MD5 |
df78975928e955bb14b333aa73696e28
|
|
| BLAKE2b-256 |
dacd64be68882c9133e5aad879e876d247db24b553d2cc181be4dd263f1f2f77
|
File details
Details for the file pymzdata-0.66.6-cp39-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: pymzdata-0.66.6-cp39-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 4.2 MB
- Tags: CPython 3.9+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
maturin/1.15.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
71fd9503b33bcd1cd6e04b1431da7814a5b82a9f1d05c8cbad70174d2eb2249b
|
|
| MD5 |
f6a2505250169ec2dfd75f0ae0c4349e
|
|
| BLAKE2b-256 |
e4f2001ada858953f932b55d84fcb93da9bf79fd3293070f4863b1acb49d4cfb
|
File details
Details for the file pymzdata-0.66.6-cp39-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: pymzdata-0.66.6-cp39-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 4.4 MB
- Tags: CPython 3.9+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
maturin/1.15.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
914ab9ea8ec3bec2e83a0cc8bc4ebd6f7efe658cc83b543bd2940e5d37ccd21a
|
|
| MD5 |
84cc6827f8c29af56a0e916d705dcc3c
|
|
| BLAKE2b-256 |
28db29fde3e4c6d9da717f67630fa6a479d7cef19078a9ea6f9190abebde7904
|