pub trait SpectrumLike<C: CentroidLike = CentroidPeak, D: DeconvolutedCentroidLike = DeconvolutedPeak>: ParamDescribed {
Show 26 methods
// Required methods
fn description(&self) -> &SpectrumDescription;
fn description_mut(&mut self) -> &mut SpectrumDescription;
fn peaks(&self) -> RefPeakDataLevel<'_, C, D>;
fn into_peaks_and_description(
self,
) -> (PeakDataLevel<C, D>, SpectrumDescription);
fn raw_arrays(&self) -> Option<&BinaryArrayMap>;
// Provided methods
fn acquisition(&self) -> &Acquisition { ... }
fn precursor(&self) -> Option<&Precursor> { ... }
fn precursor_iter(
&self,
) -> impl Iterator<Item = &Precursor> + ExactSizeIterator { ... }
fn precursor_count(&self) -> usize { ... }
fn precursor_mut(&mut self) -> Option<&mut Precursor> { ... }
fn precursor_iter_mut(
&mut self,
) -> impl Iterator<Item = &mut Precursor> + ExactSizeIterator { ... }
fn add_precursor(&mut self, precursor: Precursor) { ... }
fn remove_precursor(&mut self, index: usize) -> Precursor { ... }
fn start_time(&self) -> f64 { ... }
fn ms_level(&self) -> u8 { ... }
fn id(&self) -> &str { ... }
fn index(&self) -> usize { ... }
fn signal_continuity(&self) -> SignalContinuity { ... }
fn polarity(&self) -> ScanPolarity { ... }
fn ion_mobility(&self) -> Option<f64> { ... }
fn has_ion_mobility(&self) -> bool { ... }
fn has_ion_mobility_dimension(&self) -> bool { ... }
fn has_ion_mobility_class(&self) -> HasIonMobility { ... }
fn spectrum_type(&self) -> Option<SpectrumType> { ... }
fn set_spectrum_type(&mut self, spectrum_type: SpectrumType) { ... }
fn update_summaries(&mut self) { ... }
}Expand description
A trait for providing a uniform delegated access to spectrum metadata
Required Methods§
Sourcefn description(&self) -> &SpectrumDescription
fn description(&self) -> &SpectrumDescription
The method to access the spectrum description itself, which supplies the data for most other methods on this trait.
Sourcefn description_mut(&mut self) -> &mut SpectrumDescription
fn description_mut(&mut self) -> &mut SpectrumDescription
The method to access the spectrum descript itself, mutably.
Sourcefn peaks(&self) -> RefPeakDataLevel<'_, C, D>
fn peaks(&self) -> RefPeakDataLevel<'_, C, D>
Retrieve the most processed representation of the mass spectrum’s signal
Sourcefn into_peaks_and_description(
self,
) -> (PeakDataLevel<C, D>, SpectrumDescription)
fn into_peaks_and_description( self, ) -> (PeakDataLevel<C, D>, SpectrumDescription)
Consume the spectrum, decomposing it into the SpectrumDescription and an owning
PeakDataLevel.
§See also
Sourcefn raw_arrays(&self) -> Option<&BinaryArrayMap>
fn raw_arrays(&self) -> Option<&BinaryArrayMap>
Obtain a reference to the BinaryArrayMap if one is available for the peak
information. This may not be the most refined version of the peak signal if
it has been processed further.
Provided Methods§
Sourcefn acquisition(&self) -> &Acquisition
fn acquisition(&self) -> &Acquisition
Access the acquisition information for this spectrum.
Sourcefn precursor(&self) -> Option<&Precursor>
fn precursor(&self) -> Option<&Precursor>
Access the (first) precursor information, if it exists.
Sourcefn precursor_iter(&self) -> impl Iterator<Item = &Precursor> + ExactSizeIterator
fn precursor_iter(&self) -> impl Iterator<Item = &Precursor> + ExactSizeIterator
Iterate over all precursors of the spectrum
Sourcefn precursor_count(&self) -> usize
fn precursor_count(&self) -> usize
The number of precursor levels recorded
Sourcefn precursor_mut(&mut self) -> Option<&mut Precursor>
fn precursor_mut(&mut self) -> Option<&mut Precursor>
Mutably access the (first) precursor information, if it exists
Sourcefn precursor_iter_mut(
&mut self,
) -> impl Iterator<Item = &mut Precursor> + ExactSizeIterator
fn precursor_iter_mut( &mut self, ) -> impl Iterator<Item = &mut Precursor> + ExactSizeIterator
Iterate over all precursors of the spectrum mutably
Sourcefn add_precursor(&mut self, precursor: Precursor)
fn add_precursor(&mut self, precursor: Precursor)
Add a precursor to the list of precursors for this spectrum.
Precursors beyond the first one correspond to lower exponentiated spectra, e.g. for an MS3 spectrum the first precursor is the MS2 product ion that was selected, and the second precursor corresponds to the original MS1 ion that was chosen for MS2.
Higher order precursors may be accessed with SpectrumLike::precursor_iter.
Sourcefn remove_precursor(&mut self, index: usize) -> Precursor
fn remove_precursor(&mut self, index: usize) -> Precursor
Remove the precursor entry at index in the precursor list.
Care should be taken if you are attempting to re-order precursors.
It may be simpler to use SpectrumLike::precursor_iter_mut to
re-arrange entries.
Sourcefn start_time(&self) -> f64
fn start_time(&self) -> f64
A shortcut method to retrieve the scan start time of a spectrum
Sourcefn signal_continuity(&self) -> SignalContinuity
fn signal_continuity(&self) -> SignalContinuity
Access a description of how raw the signal is, whether a profile spectrum is available or only centroids are present.
Sourcefn polarity(&self) -> ScanPolarity
fn polarity(&self) -> ScanPolarity
Access a description of the spectrum polarity
Sourcefn ion_mobility(&self) -> Option<f64>
fn ion_mobility(&self) -> Option<f64>
Access the point measure of ion mobility associated with the scan if present. This is distinct from having a frame-level scan across the ion mobility dimension.
Sourcefn has_ion_mobility(&self) -> bool
fn has_ion_mobility(&self) -> bool
Check if this spectrum has a point measure of ion mobility. This is distinct from having a frame-level scan across the ion mobility dimension.
Sourcefn has_ion_mobility_dimension(&self) -> bool
fn has_ion_mobility_dimension(&self) -> bool
Check if this spectrum has an ion mobility dimension/array. This is distinct from having a scan-level point measure of ion mobility.
Sourcefn has_ion_mobility_class(&self) -> HasIonMobility
fn has_ion_mobility_class(&self) -> HasIonMobility
A single point of entry for checking if ion mobility is present.
Sourcefn spectrum_type(&self) -> Option<SpectrumType>
fn spectrum_type(&self) -> Option<SpectrumType>
Find the type of spectrum described.
A spectrum in mzdata is usually a mass spectrum of some sort,
but that’s not guaranteed to be the case. mzdata can handle non-MS spectra,
but little of the signal processing machinery it provides currently supports
those other kinds of data.
Sourcefn set_spectrum_type(&mut self, spectrum_type: SpectrumType)
fn set_spectrum_type(&mut self, spectrum_type: SpectrumType)
Set the kind of spectrum represented.
Sourcefn update_summaries(&mut self)
fn update_summaries(&mut self)
Compute and update the the total ion current, base peak, and m/z range for the spectrum based upon its current peak data.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl<C: CentroidLike, D: DeconvolutedCentroidLike> SpectrumLike<C, D> for MultiLayerSpectrum<C, D>
impl<C: CentroidLike, D: DeconvolutedCentroidLike> SpectrumLike<C, D> for RawSpectrum
impl<C: CentroidLike> SpectrumLike<C> for CentroidSpectrumType<C>
CentroidSpectrumType implements SpectrumLike for C.
impl<D: DeconvolutedCentroidLike> SpectrumLike<CentroidPeak, D> for DeconvolutedSpectrumType<D>
DeconvolutedSpectrumType implements SpectrumLike for D.