Skip to main content

PeakDataLevel

Enum PeakDataLevel 

Source
pub enum PeakDataLevel<C: CentroidLike = CentroidPeak, D: DeconvolutedCentroidLike = DeconvolutedPeak> {
    Missing,
    RawData(BinaryArrayMap),
    Centroid(MZPeakSetType<C>),
    Deconvoluted(MassPeakSetType<D>),
}
Expand description

Represent an owned representation of one the kinds of peak data that a SpectrumLike instance might otherwise carry.

§See also

RefPeakDataLevel for borrowed version.

Variants§

§

Missing

No signal data is present

§

RawData(BinaryArrayMap)

Raw BinaryArrayMap exists

§

Centroid(MZPeakSetType<C>)

A m/z centroid peak list exists

§

Deconvoluted(MassPeakSetType<D>)

A neutral mass peak list exists

Implementations§

Source§

impl<C: CentroidLike, D: DeconvolutedCentroidLike> PeakDataLevel<C, D>

Source

pub fn iter(&self) -> PeakDataIterDispatch<'_, C, D> ⓘ

Iterate over MZPoint data encoded in the peak data.

NOTE: Values are produced in the order they are stored, so the data are not guaranteed to be ordered by m/z.

Source§

impl<C: CentroidLike, D: DeconvolutedCentroidLike> PeakDataLevel<C, D>

Source

pub fn base_peak(&self) -> CentroidPeak

Compute the base peak of a spectrum

Source

pub fn mz_range(&self) -> (f64, f64)

Find the minimum and maximum m/z values of a spectrum

Source

pub fn tic(&self) -> f32

Compute the total ion current for a spectrum

Source

pub fn search(&self, query: f64, error_tolerance: Tolerance) -> Option<usize>

Iterate over MZPoint data encoded in the peak data.

NOTE: The Self::Deconvoluted layer uses the neutral mass coordinate system compared to the others, it should be explicitly tested against.

Source

pub fn len(&self) -> usize

Find the number of points in a profile spectrum, or the number of peaks for a centroid spectrum

Source

pub fn get(&self, i: usize) -> Option<MZPoint>

Get the ith point in the peak data.

NOTE: There is no guarantee that values are stored in m/z order.

Source

pub fn fetch_summaries(&self) -> SpectrumSummary

Compute summary information about the peak data’s m/z range, base peak, total ion current, and number of data points

Source

pub fn is_empty(&self) -> bool

Check if the collection is empty

Trait Implementations§

Source§

impl<C: Debug + CentroidLike, D: Debug + DeconvolutedCentroidLike> Debug for PeakDataLevel<C, D>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<C: CentroidLike + BuildFromArrayMap, D: DeconvolutedCentroidLike + BuildFromArrayMap> TryFrom<&BinaryArrayMap> for PeakDataLevel<C, D>

Source§

type Error = ArrayRetrievalError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &BinaryArrayMap) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

§

impl<C, D> Freeze for PeakDataLevel<C, D>

§

impl<C, D> RefUnwindSafe for PeakDataLevel<C, D>

§

impl<C, D> Send for PeakDataLevel<C, D>
where PeakSetVec<C, MZ>: Send, PeakSetVec<D, Mass>: Send,

§

impl<C, D> Sync for PeakDataLevel<C, D>
where PeakSetVec<C, MZ>: Sync, PeakSetVec<D, Mass>: Sync,

§

impl<C, D> Unpin for PeakDataLevel<C, D>

§

impl<C, D> UnsafeUnpin for PeakDataLevel<C, D>

§

impl<C, D> UnwindSafe for PeakDataLevel<C, D>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.