Skip to main content

OpenTimsTDF

CI DOI crates.io PyPI docs.rs License: Apache-2.0 Rust MSRV

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 MzCalibration table. 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 MzCalibration table (for example ModelType = 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 the opentimstdf.mz_calibration run metadata key report which model was used. See the calibration notes.
  • Missing frame data is an error. A frame whose block in analysis.tdf_bin is missing, truncated or does not hold the peaks Frames lists is an Err item when iterating spectra, and write_mzml stops at the first one. A bundle with an empty analysis.tdf_bin (an incomplete upload) fails on its first frame.
  • PRM-PASEF frames are not converted to spectra. MsMsType = 10 frames are skipped by iter_spectra and 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 warning opentimstdf.frames_not_projected with the count (and TdfSource::projection_gaps() returns it), and the warning opentimstdf.prm_chromatogram_gaps counts prm-PASEF frames with no PrmFrameMsMsInfo row and targets with no PrmTargets row. The same warning counts diaPASEF frames with no window group and PASEF frames with no PasefFrameMsMsInfo row. See #13.
  • Collision energy is one value in eV per spectrum. PasefFrameMsMsInfo and DiaFrameMsMsWindows carry the collision energy without a unit column. The bundle's own PropertyDefinitions table gives eV as the dimension of every collision-energy setting, and the stored values fall inside the acquisition's collision-energy ramp, so records state ev. 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.Parent names the MS1 frame a precursor was selected from, and the record's spectrumRef points at that frame's spectrum. When that frame is not in the output (it failed to decode while the writer skips bad records, or Parent names no MS1 frame), Core's mzML writer reports a dangling precursor reference. Check name dangling_precursor_ref: WriteOptions::with_leniency with Check::DanglingPrecursorRef writes 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 scanWindowList holds the stated MzAcqRangeLower to MzAcqRangeUpper from the bundle's GlobalMetadata, 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 by Bruker 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)

Source distribution for opentimstdf 4.0.0
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)

Table of built distributions (wheels) for opentimstdf 4.0.0
File Actions
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 log

Release 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 log

Release 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 log

Release 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 log

Release 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 log

Release 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 log

Security 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.

Select from 6 files

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 log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page