OpenTimsTDF
Part of the OpenMassSpec stack for mass spectrometry raw-file access.
Rust and Python reader for timsTOF .d/ (TDF) acquisition bundles -
the SQLite analysis.tdf metadata file and the analysis.tdf_bin
binary frame stream. Runs on Linux, macOS, and Windows.
Documentation: sigilweaver.app/opentimstdf/docs
Install
Prefer openmassspec-io
with the bruker feature/extra unless you need this parser standalone
(minimal dependencies, or building your own abstraction) - the umbrella
gives you format auto-detection, mzML conversion, and Arrow streaming
across all wired-in vendors for free:
cargo add openmassspec-io --features bruker
pip install openmassspec[bruker]
Standalone:
Rust:
cargo add opentimstdf
Python:
pip install opentimstdf
Quickstart
Rust:
use opentimstdf::Reader;
let reader = Reader::open("my_bundle.d")?;
let calib = reader.calibration()?;
let frame = reader.frame(1)?;
for peak in reader.decode_peaks(&frame)? {
let mz = calib.tof_to_mz(peak.tof);
let im = calib.scan_to_inv_mobility(peak.scan);
println!("scan={} mz={:.4} 1/K0={:.4} i={}", peak.scan, mz, im, peak.intensity);
}
Python:
import opentimstdf
reader = opentimstdf.Reader("my_bundle.d")
calib = reader.calibration()
frame = reader.frame(1)
for peak in reader.decode_peaks(frame):
mz = calib.tof_to_mz(peak.tof)
print(peak.scan, mz, peak.intensity)
See the docs site for the full quickstart, guide, and format specification.
Known issues and gaps
- m/z accuracy is limited to the bundle's stored calibration. m/z is
computed from the bundle's
MzCalibrationtable. On the public test corpus (9 bundles), calibrant and siloxane ions read about 1.9 ppm from their true m/z (median), 10.4 ppm at the 95th percentile and 16 ppm at most; on some bundles the error grows toward high m/z. Against the precursor m/z values the acquisition software stored in each bundle the median is about 0.8 ppm, which shows the decoder reproduces the instrument's own calibration, not that the calibration is accurate. No temperature correction is applied. For accurate-mass work below about 5 ppm, recalibrate against known masses. - Bundles without a usable
MzCalibrationtable (for exampleModelType = 2) use a range-based fallback model. On PXD035173, the one such bundle in the corpus, it reads 14 to 31 ppm off; applied to bundles that do have tables, its median error ranged from 2 to about 200 ppm.Reader::mz_calibration_status()and theopentimstdf.mz_calibrationrun metadata key report which model was used. See the calibration notes. - Missing frame data is an error. A frame whose block in
analysis.tdf_binis missing, truncated or does not hold the peaksFrameslists is anErritem when iterating spectra, andwrite_mzmlstops at the first one. A bundle with an emptyanalysis.tdf_bin(an incomplete upload) fails on its first frame. - PRM-PASEF frames are not converted to spectra.
MsMsType = 10frames are skipped byiter_spectraand mzML; they feed only the SRM chromatograms. The corpus has PRM-PASEF metadata but no frame data. The frames are counted: the run carries the warningopentimstdf.frames_not_projectedwith the count (andTdfSource::projection_gaps()returns it), and the warningopentimstdf.prm_chromatogram_gapscounts prm-PASEF frames with noPrmFrameMsMsInforow and targets with noPrmTargetsrow. The same warning counts diaPASEF frames with no window group and PASEF frames with noPasefFrameMsMsInforow. See #13. - Collision energy is one value in eV per spectrum.
PasefFrameMsMsInfoandDiaFrameMsMsWindowscarry the collision energy without a unit column. The bundle's ownPropertyDefinitionstable giveseVas the dimension of every collision-energy setting, and the stored values fall inside the acquisition's collision-energy ramp, so records stateev.CollisionEnergySweepingInfo(stepped sweeps) is not read; no public bundle has rows in it. - A PASEF spectrum whose parent MS1 frame is not written is rejected.
Precursors.Parentnames the MS1 frame a precursor was selected from, and the record'sspectrumRefpoints at that frame's spectrum. When that frame is not in the output (it failed to decode while the writer skips bad records, orParentnames no MS1 frame), Core's mzML writer reports a dangling precursor reference. Check namedangling_precursor_ref:WriteOptions::with_leniencywithCheck::DanglingPrecursorRefwrites the spectrum without the reference and adds a warning. - Spectra with no peaks are written empty and flagged. A mobility range
or frame with no decoded peaks (664 of 23,293 MS2 spectra in the CI bundle)
carries Core's warning
empty_spectrum, and declares no base peak or m/z range. - Observed m/z can lie outside the scan window. Every spectrum's
scanWindowListholds the statedMzAcqRangeLowertoMzAcqRangeUpperfrom the bundle'sGlobalMetadata, as stored; it is not widened and not checked against the peaks. The stated range does not bound them: in the three public bundles (all recorded byBruker otofControl), observed m/z reaches up to 5.0 beyond the limits on both sides. Spectra with a peak outside the window: PXD036417 5,086 of 24,425 (window 300 to 1600), PXD031833 10,934 of 34,287 (300 to 1600) and PXD025576 63,768 of 83,525 (99.992696 to 1700). Do not use the scan window as a filter or as the limit of the observed m/z range; read the peaks themselves. A bundle without the keys has no scan window. - Only TDF bundles are read. TSF bundles (TIMS off, MALDI) and BAF bundles are not supported.
- Tested data: timsTOF Pro, Pro 2 and SCP, DDA-PASEF and diaPASEF, acquired 2019 to 2022, positive mode only. timsTOF HT and Ultra, data from 2023 onward (newer acquisition software), negative mode and MALDI acquisitions are untested. CI runs against one DDA-PASEF bundle (PXD036417); diaPASEF, codec 1 and the range-fallback model are tested only against the local corpus.
License
Apache-2.0. See LICENSE.
The TDF format was worked out from public sample data (PRIDE accessions). See ATTRIBUTION.md. Codec 1 decoding is ported from AlphaTims and the codec 2 decode loop follows OpenTIMS; see THIRD-PARTY-NOTICES.
Metadata
Release files for opentimstdf 4.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| opentimstdf-4.0.0.tar.gz | 81.2 kB | With provenance | Details for opentimstdf-4.0.0.tar.gz |
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| opentimstdf-4.0.0-cp310-abi3-win_amd64.whl | CPython 3.10 | abi3 | Windows x86-64 | Details for opentimstdf-4.0.0-cp310-abi3-win_amd64.whl |
| opentimstdf-4.0.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ x86-64 | Details for opentimstdf-4.0.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
| opentimstdf-4.0.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ ARM64 | Details for opentimstdf-4.0.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl |
| opentimstdf-4.0.0-cp310-abi3-macosx_11_0_arm64.whl | CPython 3.10 | abi3 | macOS 11.0+ ARM64 | Details for opentimstdf-4.0.0-cp310-abi3-macosx_11_0_arm64.whl |
| opentimstdf-4.0.0-cp310-abi3-macosx_10_12_x86_64.whl | CPython 3.10 | abi3 | macOS 10.12+ x86-64 | Details for opentimstdf-4.0.0-cp310-abi3-macosx_10_12_x86_64.whl |
Total release size: 8.3 MB
Release files / opentimstdf-4.0.0.tar.gz
| Download URL | opentimstdf-4.0.0.tar.gz |
|---|---|
| Size | 81.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f726f758f8d0cca97149f71e9c73bc843ddc1189c92983600c5236d46028623b
|
|
BLAKE2b-256 checksum How to use checksums |
05a7db34a0bd559347e96351d6ac307b17b036e5e93208e9365c5c77b281daec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.
Transparency logRelease files / opentimstdf-4.0.0-cp310-abi3-win_amd64.whl
| Download URL | opentimstdf-4.0.0-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
d8964c39bf376f24c1378492aaec7d68b6e5e2447abad376767e9e3d5f841fa2
|
|
BLAKE2b-256 checksum How to use checksums |
09f4bd01ec06c2a46d095ffbcb01f07ad0a758b3766539057ec1a493aaa74dd1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.
Transparency logRelease files / opentimstdf-4.0.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | opentimstdf-4.0.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 1.8 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
3eface8b1b2a91faae00cd68b62c1bcd40d8d8ad33f5c60cfe2608c92fc67c9f
|
|
BLAKE2b-256 checksum How to use checksums |
73990f8f53e5f778e3dd1f53de2350800bfcd6dc9820642f526803ad781d703c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.
Transparency logRelease files / opentimstdf-4.0.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
| Download URL | opentimstdf-4.0.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
ba6f366415eb5d8ea6894b2c3bad07987c988098003a3864d3d83d09a7f8db5c
|
|
BLAKE2b-256 checksum How to use checksums |
07bb7b913a786ab2e74f6ff866c3b9b6b31e12073221c8ad0c96f05f4386db46
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.
Transparency logRelease files / opentimstdf-4.0.0-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | opentimstdf-4.0.0-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
797c423fb2c1fb8a4ff5c3093e4ea264ffde68edbe8981f639d2866cd0028e19
|
|
BLAKE2b-256 checksum How to use checksums |
d4a45b5a1279c9ce00ac5b5c27779f6785eb69f53732db65c7b95361e98d5e88
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.
Transparency logRelease files / opentimstdf-4.0.0-cp310-abi3-macosx_10_12_x86_64.whl
| Download URL | opentimstdf-4.0.0-cp310-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 1.7 MB |
| Tags | CPython 3.10 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
d752fa70c5a68b63a0d0514ad250e59f15a29fdd05ee488b4b844d2b0e7a53b4
|
|
BLAKE2b-256 checksum How to use checksums |
a5b952f900ce24487a8ecc5fa0834a44415eb90e8fe9e6fc5e69fbf6c949ff2f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.
Transparency logSecurity for opentimstdf 4.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 6 files in this release have been uploaded with provenance metadata.
Attestation for opentimstdf-4.0.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.