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
Metadata
Release files for pymzdata 0.67.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pymzdata-0.67.4.tar.gz | 847.9 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| pymzdata-0.67.4-cp39-abi3-win_amd64.whl | CPython 3.9 | abi3 | Windows x86-64 | Details |
| pymzdata-0.67.4-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.9 | abi3 | Linux glibc 2.17+ x86-64 | Details |
| pymzdata-0.67.4-cp39-abi3-macosx_11_0_arm64.whl | CPython 3.9 | abi3 | macOS 11.0+ ARM64 | Details |
| pymzdata-0.67.4-cp39-abi3-macosx_10_12_x86_64.whl | CPython 3.9 | abi3 | macOS 10.12+ x86-64 | Details |
Total release size: 18.4 MB
Release files / pymzdata-0.67.4.tar.gz
| Download URL | pymzdata-0.67.4.tar.gz |
|---|---|
| Size | 847.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9b173291a4a0d2b598455d31c3fd914516368e87a9c5db635feb41d98b8303ea
|
|
BLAKE2b-256 checksum How to use checksums |
1b46f660f2a3661624a93b55328360452a888f936628f07ed5cd25fdc01a6fb4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.15.0
|
Release files / pymzdata-0.67.4-cp39-abi3-win_amd64.whl
| Download URL | pymzdata-0.67.4-cp39-abi3-win_amd64.whl |
|---|---|
| Size | 4.5 MB |
| Tags | CPython 3.9 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
237e9a729ab07ed68bfada03777691ee7fac4a4a13e4dc24120e0bc5ebbd35df
|
|
BLAKE2b-256 checksum How to use checksums |
b7e961b35a8fc292e59ce81325e253523d33b62899fdc897bc16c255f3a2ca7b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.15.0
|
Release files / pymzdata-0.67.4-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | pymzdata-0.67.4-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 4.4 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
d895c232d2a9cc8c4f8d6fb4546b4d2d149427556eeae918f11914682645e66b
|
|
BLAKE2b-256 checksum How to use checksums |
689f223bbf1a8992f28845b1c44c5221d404e90810b801c9c08dab44cf35b516
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.15.0
|
Release files / pymzdata-0.67.4-cp39-abi3-macosx_11_0_arm64.whl
| Download URL | pymzdata-0.67.4-cp39-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 4.2 MB |
| Tags | CPython 3.9 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
12bce5e8e1b048b65684d986d408691ac3403c8a00215f4c4b1c4ce60a641360
|
|
BLAKE2b-256 checksum How to use checksums |
9c4266eea89c6369a5da8ffac545b0633a96c0f42bddf3f3260e90168eb2aabb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.15.0
|
Release files / pymzdata-0.67.4-cp39-abi3-macosx_10_12_x86_64.whl
| Download URL | pymzdata-0.67.4-cp39-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 4.4 MB |
| Tags | CPython 3.9 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
b0f6643fc138a4b754dd58e8bb068690a116a3b319a71a7026b51b91bb44c039
|
|
BLAKE2b-256 checksum How to use checksums |
aa7fe09cd719ab7b8140f62a85afc1fe3c384d4a640d00faf5a36858188e0da9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
maturin/1.15.0
|