Skip to main content

SpectrumLike

Trait SpectrumLike 

Source
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§

Source

fn description(&self) -> &SpectrumDescription

The method to access the spectrum description itself, which supplies the data for most other methods on this trait.

Source

fn description_mut(&mut self) -> &mut SpectrumDescription

The method to access the spectrum descript itself, mutably.

Source

fn peaks(&self) -> RefPeakDataLevel<'_, C, D>

Retrieve the most processed representation of the mass spectrum’s signal

Source

fn into_peaks_and_description( self, ) -> (PeakDataLevel<C, D>, SpectrumDescription)

Consume the spectrum, decomposing it into the SpectrumDescription and an owning PeakDataLevel.

§See also

SpectrumLike::peaks SpectrumLike::description

Source

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§

Source

fn acquisition(&self) -> &Acquisition

Access the acquisition information for this spectrum.

Source

fn precursor(&self) -> Option<&Precursor>

Access the (first) precursor information, if it exists.

Source

fn precursor_iter(&self) -> impl Iterator<Item = &Precursor> + ExactSizeIterator

Iterate over all precursors of the spectrum

Source

fn precursor_count(&self) -> usize

The number of precursor levels recorded

Source

fn precursor_mut(&mut self) -> Option<&mut Precursor>

Mutably access the (first) precursor information, if it exists

Source

fn precursor_iter_mut( &mut self, ) -> impl Iterator<Item = &mut Precursor> + ExactSizeIterator

Iterate over all precursors of the spectrum mutably

Source

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.

Source

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.

Source

fn start_time(&self) -> f64

A shortcut method to retrieve the scan start time of a spectrum

Source

fn ms_level(&self) -> u8

Access the MS exponentiation level

Source

fn id(&self) -> &str

Access the native ID string for the spectrum

Source

fn index(&self) -> usize

Access the index of the spectrum in the source file

Source

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.

Source

fn polarity(&self) -> ScanPolarity

Access a description of the spectrum polarity

Source

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.

Source

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.

Source

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.

Source

fn has_ion_mobility_class(&self) -> HasIonMobility

A single point of entry for checking if ion mobility is present.

Source

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.

Source

fn set_spectrum_type(&mut self, spectrum_type: SpectrumType)

Set the kind of spectrum represented.

Source

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.

Uses RefPeakDataLevel::fetch_summaries

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§