Skip to main content

mzML export

OpenARaw writes mzML via openmassspec_core::write_mzml, the same writer every reader in the OpenMassSpec stack uses, so output is consistent across vendors.

cargo run --release --example to_mzml -- path/to/sample.d output.mzML

Or from your own code:

use openaraw::reader::Reader;
use openmassspec_core::write_mzml;

let mut reader = Reader::open("sample.d")?;
let mut out = std::fs::File::create("output.mzML")?;
write_mzml(&mut reader, &mut out)?;

write_mzml iterates the reader's spectra via SpectrumSource (the same stream described in Reader and Scan data) and emits PSI-MS CV-annotated mzML - MS:1002846 (Agilent MassHunter format) as the source-file format term, with per-spectrum polarity, scan mode, analyzer, and precursor information carried through where the reader populated it.