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>
impl<'lifespan> PeakShapeModel<'lifespan>
pub fn from_centroid( mz: f64, intensity: f32, full_width_at_half_max: f32, shape: PeakShape ) -> PeakShapeModel<'lifespan>
pub fn new(peak: Cow<'lifespan, FittedPeak>, shape: PeakShape) -> Self
sourcepub fn gaussian(peak: &FittedPeak) -> PeakShapeModel<'_>
pub fn gaussian(peak: &FittedPeak) -> PeakShapeModel<'_>
Create a PeakShape::Gaussian
PeakShapeModel
sourcepub fn predict(&self, mz: &f64) -> f32
pub fn predict(&self, mz: &f64) -> f32
Estimate the intensity of this peak at mz
, relative to the
position of the model peak
sourcepub fn shape(&self, dx: f64) -> (Vec<f64>, Vec<f32>)
pub fn shape(&self, dx: f64) -> (Vec<f64>, Vec<f32>)
Generate a theoretical peak shape signal with m/z and intensity arrays
sourcepub fn shape_in(&self, mz_array: &[f64], intensity_array: &mut [f32])
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
sourcepub fn area(&self, dx: f64) -> f32
pub fn area(&self, dx: f64) -> f32
Calculate the area of the peak shape estimated with an m/z spacing of dx
pub fn center(&self) -> f64
Trait Implementations§
source§impl<'lifespan> Clone for PeakShapeModel<'lifespan>
impl<'lifespan> Clone for PeakShapeModel<'lifespan>
source§fn clone(&self) -> PeakShapeModel<'lifespan>
fn clone(&self) -> PeakShapeModel<'lifespan>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<'lifespan> CoordinateLike<MZ> for PeakShapeModel<'lifespan>
impl<'lifespan> CoordinateLike<MZ> for PeakShapeModel<'lifespan>
source§fn coordinate(&self) -> f64
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>
impl<'lifespan> Debug for PeakShapeModel<'lifespan>
source§impl<'lifespan> From<&'lifespan FittedPeak> for PeakShapeModel<'lifespan>
impl<'lifespan> From<&'lifespan FittedPeak> for PeakShapeModel<'lifespan>
source§fn from(peak: &'lifespan FittedPeak) -> PeakShapeModel<'lifespan>
fn from(peak: &'lifespan FittedPeak) -> PeakShapeModel<'lifespan>
Converts to this type from the input type.
source§impl From<FittedPeak> for PeakShapeModel<'static>
impl From<FittedPeak> for PeakShapeModel<'static>
source§fn from(value: FittedPeak) -> Self
fn from(value: FittedPeak) -> Self
Converts to this type from the input type.
source§impl<'lifespan> IndexedCoordinate<MZ> for PeakShapeModel<'lifespan>
impl<'lifespan> IndexedCoordinate<MZ> for PeakShapeModel<'lifespan>
source§impl<'lifespan> IntensityMeasurement for PeakShapeModel<'lifespan>
impl<'lifespan> IntensityMeasurement for PeakShapeModel<'lifespan>
source§impl<'lifespan> Ord for PeakShapeModel<'lifespan>
impl<'lifespan> Ord for PeakShapeModel<'lifespan>
source§impl<'lifespan> PartialEq for PeakShapeModel<'lifespan>
impl<'lifespan> PartialEq for PeakShapeModel<'lifespan>
source§fn eq(&self, other: &PeakShapeModel<'lifespan>) -> bool
fn eq(&self, other: &PeakShapeModel<'lifespan>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<'lifespan> PartialOrd for PeakShapeModel<'lifespan>
impl<'lifespan> PartialOrd for PeakShapeModel<'lifespan>
source§fn partial_cmp(&self, other: &PeakShapeModel<'lifespan>) -> Option<Ordering>
fn partial_cmp(&self, other: &PeakShapeModel<'lifespan>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
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 moreimpl<'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> 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
source§impl<T> CentroidLike for T
impl<T> CentroidLike for T
fn as_centroid(&self) -> CentroidPeak
source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
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
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
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.