Struct mzsignal::reprofile::PeakShapeModel

source ·
pub struct PeakShapeModel<'lifespan> {
    pub peak: Cow<'lifespan, FittedPeak>,
    pub shape: PeakShape,
}
Expand description

A model for predicting the signal shape given a fitted peak as a set of model parameters

Fields§

§peak: Cow<'lifespan, FittedPeak>§shape: PeakShape

Implementations§

source§

impl<'lifespan> PeakShapeModel<'lifespan>

source

pub fn from_centroid( mz: f64, intensity: f32, full_width_at_half_max: f32, shape: PeakShape ) -> PeakShapeModel<'lifespan>

source

pub fn new(peak: Cow<'lifespan, FittedPeak>, shape: PeakShape) -> Self

source

pub fn gaussian(peak: &FittedPeak) -> PeakShapeModel<'_>

source

pub fn predict(&self, mz: &f64) -> f32

Estimate the intensity of this peak at mz, relative to the position of the model peak

source

pub fn shape(&self, dx: f64) -> (Vec<f64>, Vec<f32>)

Generate a theoretical peak shape signal with m/z and intensity arrays

source

pub fn shape_in(&self, mz_array: &[f64], intensity_array: &mut [f32])

Generate a theoretical peak shape signal with m/z arrays in mz_array and adds the theoretical intensity to intensity_array

source

pub fn area(&self, dx: f64) -> f32

Calculate the area of the peak shape estimated with an m/z spacing of dx

source

pub fn center(&self) -> f64

source

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

Approximate the lower and upper m/zs at which this peak no longer detectable

Trait Implementations§

source§

impl<'lifespan> Clone for PeakShapeModel<'lifespan>

source§

fn clone(&self) -> PeakShapeModel<'lifespan>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'lifespan> CoordinateLike<MZ> for PeakShapeModel<'lifespan>

source§

fn coordinate(&self) -> f64

The trait method for accessing the coordinate of the object on coordinate system T
source§

impl<'lifespan> Debug for PeakShapeModel<'lifespan>

source§

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

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

impl<'lifespan> From<&'lifespan FittedPeak> for PeakShapeModel<'lifespan>

source§

fn from(peak: &'lifespan FittedPeak) -> PeakShapeModel<'lifespan>

Converts to this type from the input type.
source§

impl From<FittedPeak> for PeakShapeModel<'static>

source§

fn from(value: FittedPeak) -> Self

Converts to this type from the input type.
source§

impl<'lifespan> IndexedCoordinate<MZ> for PeakShapeModel<'lifespan>

source§

fn get_index(&self) -> IndexType

source§

fn set_index(&mut self, _index: IndexType)

source§

impl<'lifespan> IntensityMeasurement for PeakShapeModel<'lifespan>

source§

fn intensity(&self) -> f32

source§

impl<'lifespan> Ord for PeakShapeModel<'lifespan>

source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl<'lifespan> PartialEq for PeakShapeModel<'lifespan>

source§

fn eq(&self, other: &PeakShapeModel<'lifespan>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'lifespan> PartialOrd for PeakShapeModel<'lifespan>

source§

fn partial_cmp(&self, other: &PeakShapeModel<'lifespan>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<'a> Eq for PeakShapeModel<'a>

Auto Trait Implementations§

§

impl<'lifespan> Freeze for PeakShapeModel<'lifespan>

§

impl<'lifespan> RefUnwindSafe for PeakShapeModel<'lifespan>

§

impl<'lifespan> Send for PeakShapeModel<'lifespan>

§

impl<'lifespan> Sync for PeakShapeModel<'lifespan>

§

impl<'lifespan> Unpin for PeakShapeModel<'lifespan>

§

impl<'lifespan> UnwindSafe for PeakShapeModel<'lifespan>

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> CentroidLike for T

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> MZLocated for T
where T: CoordinateLike<MZ>,

source§

fn mz(&self) -> f64

source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.
source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,