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::RawReader;

let r = RawReader::open("sample.raw")?;
println!("{} functions, {} channels", r.functions().len(), r.channels().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 RawReader glues these together; for byte-level access the parsers are also usable individually.

Error handling

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