Skip to main content

Crate openreadout_thermo

Crate openreadout_thermo 

Source
Expand description

Clean-room reader for Thermo Fisher .raw mass-spectrometry files.

Derived from public corpus files (MetaboLights, PRIDE) compared against the depositors’ own mzML/mzXML conversions, plus the permissively licensed or public format notes listed in docs/provenance/thermo-raw.md. No vendor library is used, linked or consulted.

Layout and vocabulary: docs/formats/thermo-raw.md.

§Example

Every reader implements openreadout_core::FormatReader: descriptor says what it reads, sniff recognises a file from its first bytes, and open returns a openreadout_core::Dataset with a header-only info() summary and lazy data access.

use openreadout_core::FormatReader;
use openreadout_thermo::ThermoRawReader;

let format = ThermoRawReader.descriptor();
assert_eq!(format.id, openreadout_thermo::FORMAT_ID);
println!("{} ({}): .{}", format.name, format.family, format.extensions.join(", ."));

Reading a file:

use std::path::Path;

use openreadout_core::FormatReader;
use openreadout_thermo::ThermoRawReader;

let mut dataset = ThermoRawReader.open(Path::new("run.raw"))?;
let info = dataset.info()?; // headers only
let run = &info.spectra[0];
println!("{} spectra, MS levels {:?}", run.scan_count, run.ms_levels);
// Spectrum 0 of run 0: parallel m/z and intensity arrays.
let spectrum = dataset.read_spectrum(0, 0)?;
println!("MS{} at {:?} s: {} points", spectrum.ms_level, spectrum.rt_s, spectrum.mz.len());

Applications that accept any instrument file usually register every reader in an openreadout_core::Registry and let it detect the format; that is what the openreadout command-line tool does.

§API stability

The supported API is what this page documents. The parser modules are public only so that tests and fuzz targets can reach them: they are hidden from this documentation and may change in any release.

Structs§

ThermoRawReader
The Thermo .raw format reader.

Constants§

FORMAT_ID
Format id used on the command line and in JSON.
SIGNATURE
First 18 bytes of every .raw file: 01 A1 then Finnigan in UTF-16LE.