opentfraw 1.0.3

Rust parser for Thermo Fisher RAW mass spectrometry files.
Documentation

OpenTFRaw

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

Rust and Python reader for Thermo Fisher .raw mass spectrometry files, covering format versions 8 through 66 (LCQ Classic through Orbitrap Astral and modern TSQ).

Documentation: sigilweaver.app/opentfraw/docs

Install

Rust:

cargo add opentfraw

Python:

pip install opentfraw

Quickstart

Rust:

use opentfraw::RawFileReader;

let raw = RawFileReader::open_path("sample.raw")?;
let mut file = std::fs::File::open("sample.raw")?;
for scan_num in 1..=raw.num_scans {
    let peaks = raw.read_scan_peaks(&mut file, scan_num)?;
    println!("scan {scan_num}: {} peaks", peaks.mz.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.

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.