Skip to main content

Reader

Loading a .raw directory parses the metadata files (_HEADER.TXT, _extern.inf, _FUNCTNS.INF, _CHROMS.INF) and indexes every MS function and chromatogram. Spectrum data is read on demand from the corresponding _FUNCnnn.DAT files.

use openwraw::Reader;

let r = Reader::open("sample.raw")?;
println!("{} functions", r.functions.len());

Public types live under openwraw::raw:

ModulePurpose
header_HEADER.TXT - metadata + calibration
extern_inf_extern.inf - instrument geometry
functions_inf_FUNCTNS.INF - function descriptors
index_FUNCnnn.IDX - scan index (Variant A / B)
data_FUNCnnn.DAT - spectrum decoders
chroms_CHROMS.INF + _CHROnnnn.DAT

The high-level Reader glues functions and their spectrum data together; chromatogram channels are a separate concern accessed directly through the chroms module (see Chromatograms). For byte-level access the parsers under openwraw::raw are also usable individually.

Note: the Python bindings expose this same reader as openwraw.RawReader (see Quickstart) - the "Raw" prefix is a Python-side naming choice, not the Rust type name.

Error handling

Public functions return openwraw::Result<T>. The error type (openwraw::Error) reports the failing file and the underlying cause.