Skip to main content

openmassspec_core/
lib.rs

1//! `openmassspec-core` is the shared foundation for the open Rust mass-spec
2//! parsers (`opentfraw`, `opentimstdf`, `openwraw`).
3//!
4//! It exposes:
5//!
6//! * Vendor-neutral spectrum / chromatogram / run records:
7//!   [`SpectrumRecord`], [`PrecursorInfo`], [`ChromatogramRecord`],
8//!   [`RunMetadata`], [`CvTerm`].
9//! * Shared enums: [`Polarity`], [`ScanMode`], [`Analyzer`], [`MsPower`],
10//!   [`Activation`], [`Compression`].
11//! * A trait every vendor parser implements: [`SpectrumSource`].
12//! * One canonical mzML 1.1.0 writer: [`write_mzml`] and
13//!   [`write_indexed_mzml`] (zlib-compressed binary data arrays by default;
14//!   [`write_mzml_with_compression`]/[`write_indexed_mzml_with_compression`]
15//!   for explicit codec control).
16//! * A streaming profile-to-centroid transform, [`Centroided`], that wraps
17//!   any `SpectrumSource`.
18//!
19//! Each vendor crate is a standalone tool (a user can pull in `opentfraw`
20//! alone and get parsing **and** mzML export); `openmassspec-core` is the
21//! shared vocabulary that keeps the three parsers in lock-step.
22
23mod centroid;
24mod enums;
25mod error;
26mod mzml;
27mod source;
28mod types;
29
30#[cfg(feature = "arrow")]
31pub mod arrow;
32pub mod conformance;
33
34pub use centroid::Centroided;
35pub use enums::{
36    Activation, Analyzer, Compression, MobilityArrayKind, MsPower, Polarity, ScanMode,
37};
38pub use error::{Error, Result};
39pub use mzml::{
40    write_indexed_mzml, write_indexed_mzml_with_compression, write_mzml,
41    write_mzml_with_compression,
42};
43pub use source::SpectrumSource;
44pub use types::{ChromatogramRecord, CvTerm, PrecursorInfo, RunMetadata, SpectrumRecord};
45
46/// Crate version (set from `Cargo.toml`).
47pub const VERSION: &str = env!("CARGO_PKG_VERSION");