Skip to main content

Crate openmassspec_io

Crate openmassspec_io 

Source
Expand description

openmassspec-io is the umbrella crate that ties together the open Rust mass-spec parsers (opentfraw, opentimstdf, openwraw, openaraw, opensxraw, openszraw) behind a uniform vendor-detection + mzML-conversion API.

Each vendor parser is gated behind a Cargo feature (thermo, bruker, waters, agilent, sciex, shimadzu) and re-exported under vendor. The all meta-feature pulls in every supported vendor.

Even with no features enabled, detect_format is available so callers can probe a path without paying the compile-time cost of a parser they will not use.

collect, convert_to_mzml, and convert_to_mzml_writer each have a _centroided sibling that centroids every profile-mode spectrum first via openmassspec_core::Centroided; this is always opt-in, never the default.

Re-exports§

pub use openmassspec_core as core;

Modules§

vendor
Re-exports of each vendor parser, gated by feature.

Structs§

Detected
Result of probing a filesystem path for a supported vendor format.
VecSource
A trivial in-memory openmassspec_core::SpectrumSource backed by a Vec<SpectrumRecord> + a openmassspec_core::RunMetadata. Hand it to openmassspec_core::write_mzml when you already have the records in hand and just want to emit mzML.

Enums§

Error
Errors produced by the umbrella openmassspec-io API.
VendorFormat
Detected on-disk vendor / format family.

Functions§

collect
Open the appropriate vendor source for detected, collect every spectrum into a Vec, and return both the records and the run-level metadata. Used by tools that need a second pass over the data (conformance validation, info summaries, Arrow batching).
collect_centroided
Like collect, but every profile-mode spectrum is centroided first via openmassspec_core::Centroided. Already-centroided spectra pass through unchanged. min_intensity, when Some, discards picked peaks below that noise floor.
convert_to_mzml
Convert a detected vendor file to mzML at output. Picks the correct vendor crate’s write_mzml (or write_indexed_mzml) based on indexed.
convert_to_mzml_centroided
Like convert_to_mzml, but every profile-mode spectrum is centroided first via openmassspec_core::Centroided. min_intensity, when Some, discards picked peaks below that noise floor.
convert_to_mzml_writer
Like convert_to_mzml but writes to an arbitrary writer instead of a path. Useful for streaming output to gzip, stdout, or any other sink.
convert_to_mzml_writer_centroided
Like convert_to_mzml_writer, but every profile-mode spectrum is centroided first via openmassspec_core::Centroided. min_intensity, when Some, discards picked peaks below that noise floor.
detect_format
Inspect path (file or directory) and return the matching vendor format, or None when none of the supported signatures match.
metadata_only
Return only the run-level metadata for detected, without decoding any spectra. Metadata (instrument, source file format, native ID format, software name/version) is already available as soon as the vendor source is opened, so callers that only need it - like the Python binding’s run_info - can skip the decode pass entirely instead of going through collect and discarding the records.
stream
Like collect, but visits each spectrum through on_spectrum as soon as it is decoded instead of buffering the whole run into a Vec first. Memory use is bounded by whatever on_spectrum itself retains, not by the acquisition size - the mzML/Arrow writers already stream this way internally; this gives callers that need their own second pass (Arrow batching, conformance checks, summaries) the same property instead of going through collect.
stream_centroided
Like stream, but every profile-mode spectrum is centroided first via openmassspec_core::Centroided. Already-centroided spectra pass through unchanged. min_intensity, when Some, discards picked peaks below that noise floor.

Type Aliases§

Result
Convenience alias mirroring the vendor crates.