1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
//! The data structures and components that represent a mass spectrum and how
//! to access their data.
//!
//! A mass spectrum is made up of multiple components, the spectrum's signal data
//! itself, plus all the metadata that describes how that data was acquired by
//! the instrument.
//!
//! # Components
//! - [`bindata`] includes structures for dealing with raw binary data arrays that may or may not
//! be byte-encoded but not strongly typed, though it does not include signal processing as that
//! is outside the scope of this crate.
//!
//! # Spectra
//!
//! Represent the collection of attributes and data that compose a single mass spectrum.
//!
//! Because a mass spectrum may be obtained from sources with varying levels of detail,
//! several alternative structures are provided with a common set of trait-based methods
//! to unify access:
//!
//! 1. [`RawSpectrum`] for representing a spectrum that has not been decoded into distinct
//! peaks yet, but whose data may be continuous or discrete.
//! 2. [`CentroidSpectrum`] for representing spectra from sources which are guaranteed to
//! be pre-centroided, like those from MGF files or other simple text representations.
//! 3. [`MultiLayerSpectrum`] for representing a multi-layer representation of a spectrum where both
//! raw data and a distinct peak list are available.
//! 4. [`DeconvolutedSpectrum`] for representing spectra from sources which are guaranteed to be
//! pre-centroided, deisotoped and charge state deconvoluted.
//!
//! These structures all implement the [`SpectrumLike`] trait
//!
//! The [`SpectrumLike`] trait is included in the crate prelude, and gives the caller
//! read-only access to components that describe a spectrum's metadata.
//!
//! ```rust
//! use mzpeaks::Tolerance;
//! use mzdata::MzMLReader;
//! use mzdata::prelude::*;
//! use mzdata::spectrum::SignalContinuity;
//!
//! let reader = MzMLReader::open_path("./test/data/small.mzML").unwrap();
//! for spectrum in reader {
//! println!("Scan {} => BP {}", spectrum.id(), spectrum.peaks().base_peak().mz);
//!
//! if spectrum.signal_continuity() < SignalContinuity::Profile {
//! let peak_picked = spectrum.into_centroid().unwrap();
//! println!("Matches for 579.155: {:?}",
//! peak_picked.peaks.all_peaks_for(
//! 579.155, Tolerance::Da(0.02)));
//! }
//! }
//! ```
//!
//! More examples can be found in the [spectrum tutorial](crate::tutorial::spectrum).
pub
pub
pub
pub
pub
pub
pub use crate;
pub use crate;
pub use crate*;
pub use crate;
pub use crate;
pub use HasIonMobility;
pub use ;
pub use ;
pub use ;