Expand description
openmassspec-core is the shared foundation for the open Rust mass-spec
parsers (opentfraw, opentimstdf, openwraw, openaraw, opensxraw,
openszraw).
It exposes:
- Vendor-neutral spectrum / chromatogram / run records:
SpectrumRecord,PrecursorInfo,ChromatogramRecord,RunMetadata,CvTerm. All are#[non_exhaustive]and built with constructors pluswith_*setters. - Shared enums:
Polarity,ScanMode,Analyzer,MsPower,Activation,Compression,MobilityArrayKind. - A trait every vendor parser implements:
SpectrumSource. Its iterators yieldResultitems, so decode errors reach the consumer. - One canonical mzML 1.1.0 writer:
write_mzmlandwrite_indexed_mzml(zlib-compressed binary data arrays, stop at the first record error), withWriteOptionsfor codec andRecordErrorPolicycontrol. Each call returns aWriteSummary. - Typed PSI-MS / UO terms generated from
psi-ms.obo:cv. - A streaming profile-to-centroid transform,
Centroided, that wraps anySpectrumSource. - A conformance harness for parser test suites:
conformance.
The Apache Arrow bridge lives in the separate openmassspec-arrow crate.
Each vendor crate is a standalone tool (a user can pull in opentfraw
alone and get parsing and mzML export); openmassspec-core is the
shared vocabulary that keeps the parsers in lock-step.
Modules§
- conformance
- Conformance checks for any
crate::SpectrumSource. - cv
- Typed PSI-MS and UO controlled-vocabulary terms used by the mzML writer.
Structs§
- Centroided
- Wraps a
SpectrumSource, centroiding every profile-mode spectrum it yields. Spectra already taggedScanMode::Centroidpass through unchanged (idempotent). - Chromatogram
Record - A chromatogram trace (TIC, BPC, SRM/MRM transition).
- CvTerm
- A PSI-MS controlled-vocabulary term.
- Precursor
Info - Precursor metadata for an MS2+ spectrum.
- RunMetadata
- Run-level metadata.
- Spectrum
Record - One fully-decoded spectrum.
- Write
Options - Options for
write_mzml_with_optionsandwrite_indexed_mzml_with_options. - Write
Summary - What a successful write produced.
Enums§
- Activation
- Activation method used for MSn fragmentation.
- Analyzer
- Detector / mass analyzer family.
- Compression
- Compression codec applied to a
<binaryDataArray>’s<binary>payload by the mzML writer. - Error
- Stack-wide error type.
- Mobility
Array Kind - Unit + meaning of a per-peak ion mobility array.
- MsPower
- MSn order (MS1, MS2, …).
- Polarity
- Scan polarity.
- Record
Error Policy - What the writer does when the source yields an
Errrecord. - Scan
Mode - Whether a spectrum holds centroided peak picks or the raw profile signal.
Constants§
- VERSION
- Crate version (set from
Cargo.toml).
Traits§
- Spectrum
Source - A source of decoded mass spectra.
Functions§
- write_
indexed_ mzml - Write the source’s spectra as indexed mzML 1.1.0 (with
<indexList>and<fileChecksum>trailer) with defaultWriteOptions: zlib-compressed arrays, stop at the first record error. - write_
indexed_ mzml_ with_ options - Write the source’s spectra as indexed mzML 1.1.0 (with
<indexList>and<fileChecksum>trailer) with explicitWriteOptions. - write_
mzml - Write the source’s spectra as mzML 1.1.0 (un-indexed) with default
WriteOptions: zlib-compressed arrays, stop at the first record error. - write_
mzml_ with_ options - Write the source’s spectra as mzML 1.1.0 (un-indexed) with explicit
WriteOptions.
Type Aliases§
- Chromatogram
Iter - Boxed, fallible chromatogram iterator returned by
SpectrumSource::iter_chromatograms. - Result
- Convenience alias.
- Spectrum
Iter - Boxed, fallible spectrum iterator returned by
SpectrumSource::iter_spectra.