pub struct DeconvolutedSpectrumType<D: DeconvolutedCentroidLike> {
pub description: SpectrumDescription,
pub deconvoluted_peaks: MassPeakSetType<D>,
}Expand description
Represents a spectrum that has been centroided, deisotoped, and charge state deconvolved.
This type of spectrum represents data in exactly one format.
Fields§
§description: SpectrumDescriptionThe spectrum metadata describing acquisition conditions and details.
deconvoluted_peaks: MassPeakSetType<D>The deisotoped and charge state deconvolved peaks, sorted by neutral mass in a fast searchable structure.
Implementations§
Source§impl<D: DeconvolutedCentroidLike> DeconvolutedSpectrumType<D>
impl<D: DeconvolutedCentroidLike> DeconvolutedSpectrumType<D>
pub fn new( description: SpectrumDescription, deconvoluted_peaks: MassPeakSetType<D>, ) -> Self
Sourcepub fn into_spectrum<C>(
self,
) -> Result<MultiLayerSpectrum<C, D>, SpectrumConversionError>where
C: CentroidLike,
pub fn into_spectrum<C>(
self,
) -> Result<MultiLayerSpectrum<C, D>, SpectrumConversionError>where
C: CentroidLike,
Convert a spectrum into a MultiLayerSpectrum on D, but preserve all information
associated with this spectrum as-is.
Sourcepub fn reinterpret<C1, D1>(self) -> MultiLayerSpectrum<C1, D1>where
C1: CentroidLike + BuildArrayMapFrom + BuildFromArrayMap,
D1: DeconvolutedCentroidLike + BuildArrayMapFrom + BuildFromArrayMap,
D: BuildArrayMapFrom,
pub fn reinterpret<C1, D1>(self) -> MultiLayerSpectrum<C1, D1>where
C1: CentroidLike + BuildArrayMapFrom + BuildFromArrayMap,
D1: DeconvolutedCentroidLike + BuildArrayMapFrom + BuildFromArrayMap,
D: BuildArrayMapFrom,
Convert a CentroidSpectrumType into a MultiLayerSpectrum over any peak type, but
recode the peak list as DataArray, potentially losing information if the new peak types
do not re-use the same ArrayType during peak reconstruction.
Trait Implementations§
Source§impl<D: Clone + DeconvolutedCentroidLike> Clone for DeconvolutedSpectrumType<D>
impl<D: Clone + DeconvolutedCentroidLike> Clone for DeconvolutedSpectrumType<D>
Source§impl<D: Debug + DeconvolutedCentroidLike> Debug for DeconvolutedSpectrumType<D>
impl<D: Debug + DeconvolutedCentroidLike> Debug for DeconvolutedSpectrumType<D>
Source§impl<D: DeconvolutedCentroidLike> Default for DeconvolutedSpectrumType<D>
impl<D: DeconvolutedCentroidLike> Default for DeconvolutedSpectrumType<D>
Source§impl<D: DeconvolutedPeakAdapting> Index<usize> for DeconvolutedSpectrumType<D>
impl<D: DeconvolutedPeakAdapting> Index<usize> for DeconvolutedSpectrumType<D>
Source§impl<D: DeconvolutedCentroidLike> ParamDescribed for DeconvolutedSpectrumType<D>
impl<D: DeconvolutedCentroidLike> ParamDescribed for DeconvolutedSpectrumType<D>
Source§fn params_mut(&mut self) -> &mut ParamList
fn params_mut(&mut self) -> &mut ParamList
Obtain an mutable slice over the encapsulated
Param listSource§fn extend_params(&mut self, it: impl IntoIterator<Item = Param>)
fn extend_params(&mut self, it: impl IntoIterator<Item = Param>)
Add all parameters from an iterator of
Param to the entitySource§fn get_param_by_name(&self, name: &str) -> Option<&Param>
fn get_param_by_name(&self, name: &str) -> Option<&Param>
Find the first
Param whose name matches nameSource§impl<D: DeconvolutedPeakAdapting> PeakCollection<D, Mass> for DeconvolutedSpectrumType<D>where
MassPeakSetType<D>: PeakCollection<D, Mass>,
<MassPeakSetType<D> as Index<usize>>::Output: CoordinateLike<Mass>,
impl<D: DeconvolutedPeakAdapting> PeakCollection<D, Mass> for DeconvolutedSpectrumType<D>where
MassPeakSetType<D>: PeakCollection<D, Mass>,
<MassPeakSetType<D> as Index<usize>>::Output: CoordinateLike<Mass>,
fn get_slice(&self, i: Range<usize>) -> &[D]
Source§fn search_by(&self, query: f64) -> Result<usize, usize>
fn search_by(&self, query: f64) -> Result<usize, usize>
Most basic method for coordinate search, find the
index in this collection whose coordinate value is nearest
to
query. The return signature is identical to
slice::binary_search_byfn iter<'a>(&'a self) -> impl Iterator<Item = &'a D>where
D: 'a,
Source§unsafe fn get_item_unchecked(&self, i: usize) -> &T
unsafe fn get_item_unchecked(&self, i: usize) -> &T
Implement index access without bounds checking. Read more
Source§fn _earliest_peak(
&self,
query: f64,
error_tolerance: Tolerance,
i: usize,
) -> Option<usize>
fn _earliest_peak( &self, query: f64, error_tolerance: Tolerance, i: usize, ) -> Option<usize>
Implementation details of
PeakCollection::_search_earliestSource§fn _latest_peak(
&self,
query: f64,
error_tolerance: Tolerance,
i: usize,
) -> Option<usize>
fn _latest_peak( &self, query: f64, error_tolerance: Tolerance, i: usize, ) -> Option<usize>
Implementation details of
PeakCollection::_search_latestSource§fn _search_earliest(
&self,
query: f64,
error_tolerance: Tolerance,
) -> Option<usize>
fn _search_earliest( &self, query: f64, error_tolerance: Tolerance, ) -> Option<usize>
Find the first index for
query within error_tolerance in
this peak collection, or None.Source§fn _search_latest(
&self,
query: f64,
error_tolerance: Tolerance,
) -> Option<usize>
fn _search_latest( &self, query: f64, error_tolerance: Tolerance, ) -> Option<usize>
Find the last index for
query within error_tolerance in
this peak collection, or None.fn _closest_peak( &self, query: f64, error_tolerance: Tolerance, i: usize, ) -> Option<usize>
Source§fn most_intense_peak_for(
&self,
query: f64,
error_tolerance: Tolerance,
i: usize,
) -> Option<usize>where
T: IntensityMeasurement,
fn most_intense_peak_for(
&self,
query: f64,
error_tolerance: Tolerance,
i: usize,
) -> Option<usize>where
T: IntensityMeasurement,
Find the peak for
query that satisfies error_tolerance with the
maximum intensity, starting from index i.fn total_ion_current(&self) -> f32where
T: IntensityMeasurement,
fn base_peak(&self) -> Option<&T>where
T: IntensityMeasurement,
Source§fn search(&self, query: f64, error_tolerance: Tolerance) -> Option<usize>
fn search(&self, query: f64, error_tolerance: Tolerance) -> Option<usize>
Find the nearest index for
query within error_tolerance in
this peak collection, or None.Source§fn has_peak(&self, query: f64, error_tolerance: Tolerance) -> Option<&T>
fn has_peak(&self, query: f64, error_tolerance: Tolerance) -> Option<&T>
Return the peak nearest to
query within error_tolerance in
this peak collection, or None.Source§fn between(&self, low: f64, high: f64, error_tolerance: Tolerance) -> &[T]
fn between(&self, low: f64, high: f64, error_tolerance: Tolerance) -> &[T]
Return a slice containing all peaks between
low and high coordinates within
error_tolerance.Source§fn all_peaks_for(&self, query: f64, error_tolerance: Tolerance) -> &[T]
fn all_peaks_for(&self, query: f64, error_tolerance: Tolerance) -> &[T]
Find all peaks which could match
query within error_tolerance unitsSource§fn search_sorted_all_indices<Q>(
&self,
queries: &[Q],
error_tolerance: Tolerance,
) -> Vec<(usize, usize)>where
Q: CoordinateLike<C>,
fn search_sorted_all_indices<Q>(
&self,
queries: &[Q],
error_tolerance: Tolerance,
) -> Vec<(usize, usize)>where
Q: CoordinateLike<C>,
Given a sorted list of
query values that are on the same coordinate system C, find
the pairs of indices from query to self within error_tolerance units of error. Read moreSource§fn search_sorted_all_indices_iter<'a, Q>(
&'a self,
queries: &'a [Q],
error_tolerance: Tolerance,
) -> SearchSortedIter<'a, C, T, Self, Q> ⓘwhere
Q: CoordinateLike<C>,
Self: Sized,
fn search_sorted_all_indices_iter<'a, Q>(
&'a self,
queries: &'a [Q],
error_tolerance: Tolerance,
) -> SearchSortedIter<'a, C, T, Self, Q> ⓘwhere
Q: CoordinateLike<C>,
Self: Sized,
This alternative implementation of
PeakCollection::search_sorted_all_indices that uses
an iterator instead of creating intermediate storage. It should be equivalent in behavior
but touch the heap less.Source§impl<D: DeconvolutedCentroidLike> SpectrumLike<CentroidPeak, D> for DeconvolutedSpectrumType<D>
DeconvolutedSpectrumType implements SpectrumLike for D.
impl<D: DeconvolutedCentroidLike> SpectrumLike<CentroidPeak, D> for DeconvolutedSpectrumType<D>
DeconvolutedSpectrumType implements SpectrumLike for D.
Source§fn 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.
Source§fn description_mut(&mut self) -> &mut SpectrumDescription
fn description_mut(&mut self) -> &mut SpectrumDescription
The method to access the spectrum descript itself, mutably.
Source§fn peaks(&self) -> RefPeakDataLevel<'_, CentroidPeak, D>
fn peaks(&self) -> RefPeakDataLevel<'_, CentroidPeak, D>
Retrieve the most processed representation of the mass spectrum’s signal
Source§fn 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.Source§fn into_peaks_and_description(
self,
) -> (PeakDataLevel<CentroidPeak, D>, SpectrumDescription)
fn into_peaks_and_description( self, ) -> (PeakDataLevel<CentroidPeak, D>, SpectrumDescription)
Consume the spectrum, decomposing it into the
SpectrumDescription and an owning
PeakDataLevel. Read moreSource§fn acquisition(&self) -> &Acquisition
fn acquisition(&self) -> &Acquisition
Access the acquisition information for this spectrum.
Source§fn precursor(&self) -> Option<&Precursor>
fn precursor(&self) -> Option<&Precursor>
Access the (first) precursor information, if it exists.
Source§fn precursor_iter(&self) -> impl Iterator<Item = &Precursor> + ExactSizeIterator
fn precursor_iter(&self) -> impl Iterator<Item = &Precursor> + ExactSizeIterator
Iterate over all precursors of the spectrum
Source§fn precursor_count(&self) -> usize
fn precursor_count(&self) -> usize
The number of precursor levels recorded
Source§fn precursor_mut(&mut self) -> Option<&mut Precursor>
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
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)
fn add_precursor(&mut self, precursor: Precursor)
Add a precursor to the list of precursors for this spectrum. Read more
Source§fn 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. Read moreSource§fn start_time(&self) -> f64
fn start_time(&self) -> f64
A shortcut method to retrieve the scan start time of a spectrum
Source§fn 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.
Source§fn polarity(&self) -> ScanPolarity
fn polarity(&self) -> ScanPolarity
Access a description of the spectrum polarity
Source§fn 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.
Source§fn 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.
Source§fn 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.
Source§fn 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.
Source§fn spectrum_type(&self) -> Option<SpectrumType>
fn spectrum_type(&self) -> Option<SpectrumType>
Find the type of spectrum described. Read more
Source§fn set_spectrum_type(&mut self, spectrum_type: SpectrumType)
fn set_spectrum_type(&mut self, spectrum_type: SpectrumType)
Set the kind of spectrum represented.
Source§fn 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. Read more
Source§impl<C, D> TryFrom<MultiLayerSpectrum<C, D>> for DeconvolutedSpectrumType<D>where
C: BuildFromArrayMap + BuildArrayMapFrom + CentroidLike,
D: BuildFromArrayMap + BuildArrayMapFrom + DeconvolutedCentroidLike,
impl<C, D> TryFrom<MultiLayerSpectrum<C, D>> for DeconvolutedSpectrumType<D>where
C: BuildFromArrayMap + BuildArrayMapFrom + CentroidLike,
D: BuildFromArrayMap + BuildArrayMapFrom + DeconvolutedCentroidLike,
Source§type Error = SpectrumConversionError
type Error = SpectrumConversionError
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl<D> Freeze for DeconvolutedSpectrumType<D>
impl<D> RefUnwindSafe for DeconvolutedSpectrumType<D>
impl<D> Send for DeconvolutedSpectrumType<D>
impl<D> Sync for DeconvolutedSpectrumType<D>
impl<D> Unpin for DeconvolutedSpectrumType<D>
impl<D> UnsafeUnpin for DeconvolutedSpectrumType<D>
impl<D> UnwindSafe for DeconvolutedSpectrumType<D>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more