Skip to main content

OpenTFRaw

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 Thermo Fisher .raw mass spectrometry files. It is tested on format versions 63, 64 and 66, from LTQ ion traps through Orbitrap Astral and TSQ Altis (see Known issues and gaps and CORPUS.md).

Documentation: sigilweaver.app/opentfraw/docs

Known issues and gaps

Measured on the public test corpus (291 files from 56 PRIDE datasets).

  • Scan metadata is wrong on 38 of 291 corpus files (13%). On these files the scan event is misread: MS level, polarity, analyzer, activation and precursor fields can be wrong, for example MS2 scans reported as negative-polarity MS1 in a positive-mode run. Peak m/z and intensity values are not affected. Affected: 30 of 52 Orbitrap Fusion Lumos files (PXD007683, PXD025230, PXD037285, PXD064117, PXD067311, PXD070648), 4 of 12 Q Exactive HF-X files (PXD021080), 2 of 2 Orbitrap Ascend files (PXD061791), 1 of 18 Orbitrap Eclipse files (PXD054530) and 1 LTQ file (PXD039587).
  • Activation methods: CID, HCD, ETD and EThcD are identified. ETD and EThcD are read only from format version 66 files (no older ETD file is in the corpus). Other methods (UVPD, ECD, PQD and so on) decode as unknown, and mzML then has no dissociation-method term.
  • Analyzer is not reported for Orbitrap Astral MS2 scans and for TSQ triple-quadrupole scans.
  • SRM data: polarity is always reported as positive and isolation width as 0.7. Decoding of TSQ Vantage (format version 63) SRM files is unreliable: in PXD020246, some scans contain NaN values or peaks outside the scan's m/z range. 4 of its 35,098 scans have a flat-peak record that matches no known layout; they raise an error, and to_mzml(..., skip_unreadable=True) (Python) or the to_mzml example's --skip-unreadable flag writes the other scans and reports how many were left out.
  • Profile spectra with an unrecognised calibration layout have NaN m/z values; mzML reports the count in opentfraw.unconverted_profile_bins.
  • m/z accuracy follows the instrument's stored calibration. In FTMS MS1 scans of 223 corpus files, background ions with known masses (polysiloxanes, diisooctyl phthalate) are within 0.55 ppm of their theoretical m/z at the median and 4.1 ppm at the 95th percentile.
  • Tested files: format versions 63, 64 and 66 only; positive polarity only in the corpus (two negative-mode Q Exactive Plus files back opt-in tests, see CORPUS.md); no GC-Orbitrap, LCQ-family, Orbitrap ID-X, Exactive, TSQ Quantis/Endura/Fortis or single-quadrupole files; no data from non-MS controllers (UV, PDA). Other versions and instruments may open but are untested.

Install

Prefer openmassspec-io with the thermo 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 thermo
pip install openmassspec[thermo]

Standalone:

Rust:

cargo add opentfraw

Python:

pip install opentfraw

Quickstart

Rust:

use std::{fs::File, io::BufReader};
use opentfraw::RawFileReader;

let raw = RawFileReader::open_path("sample.raw")?;
// Buffer the scan reads: an unbuffered File is about 11x slower.
let mut file = BufReader::new(File::open("sample.raw")?);
let info = &raw.run_header.sample_info;
for scan_num in info.first_scan_number..=info.last_scan_number {
    let peaks = raw.read_scan_peaks(&mut file, scan_num)?;
    println!("scan {scan_num}: {} peaks", peaks.len());
}

Python:

import opentfraw

raw = opentfraw.RawFile("run.raw")
mz, intensity = raw.peaks(3)
print(raw.scan(3)["filter_string"])
raw.to_mzml("run.mzML")

See the docs site for the full guide, format specification, and API reference.

Used by

Project Description
Mascope by Karsa Oy Mass spectrometry data analysis platform using OpenTFRaw to ingest Thermo .raw files.

License

Apache-2.0. See LICENSE.

The format specification was developed by binary analysis of public mass-spectrometry datasets (PRIDE accessions). See CORPUS.md and ATTRIBUTION.md.

Metadata

Release files for opentfraw 3.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 opentfraw 3.0.0
File Size Uploaded
opentfraw-3.0.0.tar.gz 124.6 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for opentfraw 3.0.0
File
opentfraw-3.0.0-cp38-abi3-win_amd64.whl CPython 3.8 abi3 Windows x86-64 Details
opentfraw-3.0.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.8 abi3 Linux glibc 2.17+ x86-64 Details
opentfraw-3.0.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.8 abi3 Linux glibc 2.17+ ARM64 Details
opentfraw-3.0.0-cp38-abi3-macosx_11_0_arm64.whl CPython 3.8 abi3 macOS 11.0+ ARM64 Details
opentfraw-3.0.0-cp38-abi3-macosx_10_12_x86_64.whl CPython 3.8 abi3 macOS 10.12+ x86-64 Details

Total release size: 3.3 MB

Release files / opentfraw-3.0.0.tar.gz

Download URL opentfraw-3.0.0.tar.gz
Size 124.6 kB
Tags Source
SHA-256 checksum
How to use checksums
6bd0ce23f18b4113e16da75bff3549337059bee3b6b532b28c55b2a30e94924c
BLAKE2b-256 checksum
How to use checksums
2c28117192bbebb6f408ee813f5fdbc4befddcc5a353383fa19306f2e18e4834
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 11, 2026.

Transparency log

Release files / opentfraw-3.0.0-cp38-abi3-win_amd64.whl

Download URL opentfraw-3.0.0-cp38-abi3-win_amd64.whl
Size 522.0 kB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
3af54564979070c315a6fade99a82c0ad65d9fcdbd69656debee2840b0de092b
BLAKE2b-256 checksum
How to use checksums
ab722d89ff8a81391c2ab75327f887dfca67419a80d707cda76fdde3cf2faa00
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 11, 2026.

Transparency log

Release files / opentfraw-3.0.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL opentfraw-3.0.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 701.7 kB
Tags CPython 3.8 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
0d60241671e340a21d280c493d703b9d9223615c5b4f01128d6cf9b3e24e57e3
BLAKE2b-256 checksum
How to use checksums
b3c0acc4999bc7b49eeff4a2730af9038c79a0e2be89b5b1beaa22200b705a40
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 11, 2026.

Transparency log

Release files / opentfraw-3.0.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL opentfraw-3.0.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 683.3 kB
Tags CPython 3.8 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
cbc81939a2d57c9102f6fcad79dc10d5cf4696520e6ebd378f53e645f1d44e80
BLAKE2b-256 checksum
How to use checksums
d5fb61502eccad584a39b3687746b13a44ce2960abed219a767b41b5736799f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 11, 2026.

Transparency log

Release files / opentfraw-3.0.0-cp38-abi3-macosx_11_0_arm64.whl

Download URL opentfraw-3.0.0-cp38-abi3-macosx_11_0_arm64.whl
Size 628.7 kB
Tags CPython 3.8 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
87a15af606178b6c49a2a1fce1456c43ae9b530375cbd065406bc4e229be0c4a
BLAKE2b-256 checksum
How to use checksums
803420bb23e5402d7f49e7ce2207e1add933375eb1d3e22ba51624fb2dd46cca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 11, 2026.

Transparency log

Release files / opentfraw-3.0.0-cp38-abi3-macosx_10_12_x86_64.whl

Download URL opentfraw-3.0.0-cp38-abi3-macosx_10_12_x86_64.whl
Size 638.7 kB
Tags CPython 3.8 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
a7fead9667cc8a1acc7fb99e80261c2b088c5d792a07794399f2bb6a9f2a81f9
BLAKE2b-256 checksum
How to use checksums
07b6060836f74fa9c5ff58ccb212ba63c7c99835c1744b652fe505c554b75825
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 11, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

3.0.0 This release

6 release files

2.0.0

6 release files

1.6.0

6 release files

1.5.0

6 release files

1.4.1

6 release files

1.4.0

6 release files

1.3.7

6 release files

1.3.6

6 release files

1.3.5

6 release files

1.3.4

6 release files

1.3.3

6 release files

1.3.2

6 release files

1.3.1

6 release files

1.3.0

6 release files

1.2.0

6 release files

1.1.0

6 release files

1.0.6

6 release files

1.0.5

6 release files

1.0.4

6 release files

1.0.3

6 release files

1.0.1

6 release files

1.0.0

6 release files

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