pub struct SpectrumRecord {Show 20 fields
pub index: usize,
pub scan_number: u32,
pub native_id: String,
pub ms_level: u32,
pub polarity: Option<Polarity>,
pub scan_mode: Option<ScanMode>,
pub analyzer: Option<Analyzer>,
pub filter: Option<String>,
pub retention_time_sec: f64,
pub total_ion_current: Option<f64>,
pub base_peak_mz: Option<f64>,
pub base_peak_intensity: Option<f64>,
pub low_mz: Option<f64>,
pub high_mz: Option<f64>,
pub ion_injection_time_ms: Option<f64>,
pub inv_mobility: Option<f64>,
pub precursor: Option<PrecursorInfo>,
pub mz: Vec<f64>,
pub intensity: Vec<f32>,
pub inv_mobility_per_peak: Option<Vec<f32>>,
}Expand description
One fully-decoded spectrum.
Retention time is stored in seconds (the mzML preferred unit). Vendors that natively store minutes (e.g. Thermo) convert at the boundary.
mz is f64 and intensity is f32 because that is what the PSI-MS CV
64-bit float / 32-bit float defaults are and what every downstream
search engine expects. Vendors that decode lower-precision arrays should
widen to these types.
Fields§
§index: usizeZero-based position in the source file (used as mzML index=).
scan_number: u32One-based, source-stable scan number. For Bruker bundles this is a running counter assigned by the iterator (since PASEF frames produce many spectra per frame).
native_id: StringVerbatim mzML native ID for this spectrum. Vendors populate this with
the appropriate controllerType=..., frame=... scan=..., or
function=... process=... scan=... literal.
ms_level: u32§polarity: Option<Polarity>§scan_mode: Option<ScanMode>§analyzer: Option<Analyzer>§filter: Option<String>Thermo-style scan filter (or vendor-equivalent). Optional; populated by parsers that have a meaningful filter string.
retention_time_sec: f64Retention time in seconds.
total_ion_current: Option<f64>Total ion current. If None, the mzML writer computes it from
intensity.
base_peak_mz: Option<f64>Base-peak m/z. If None, the mzML writer computes it from mz /
intensity.
base_peak_intensity: Option<f64>Base-peak intensity. If None, the mzML writer computes it from
intensity.
low_mz: Option<f64>Lowest observed m/z. If None, the writer uses mz.first().
high_mz: Option<f64>Highest observed m/z. If None, the writer uses mz.last().
ion_injection_time_ms: Option<f64>§inv_mobility: Option<f64>Mean inverse reduced ion mobility (1/K0) for the spectrum, when applicable (Bruker timsTOF, Waters TWIMS).
precursor: Option<PrecursorInfo>§mz: Vec<f64>§intensity: Vec<f32>§inv_mobility_per_peak: Option<Vec<f32>>Per-peak inverse reduced ion mobility, parallel to mz / intensity,
when an IMS-resolved parser opts to preserve it. Length must equal
mz.len() when present.
Implementations§
Source§impl SpectrumRecord
impl SpectrumRecord
Sourcepub fn effective_tic(&self) -> f64
pub fn effective_tic(&self) -> f64
Total ion current, computed from intensity when not pre-populated.
Sourcepub fn effective_base_peak(&self) -> Option<(f64, f64)>
pub fn effective_base_peak(&self) -> Option<(f64, f64)>
Base-peak (mz, intensity), computed from the arrays when not
pre-populated. Returns None when the spectrum has no peaks.
Sourcepub fn effective_mz_range(&self) -> Option<(f64, f64)>
pub fn effective_mz_range(&self) -> Option<(f64, f64)>
(low_mz, high_mz), falling back to the first/last entries in mz
when not pre-populated. Returns None for empty spectra.
Trait Implementations§
Source§impl Clone for SpectrumRecord
impl Clone for SpectrumRecord
Source§fn clone(&self) -> SpectrumRecord
fn clone(&self) -> SpectrumRecord
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more