Struct mzsignal::peak_picker::PeakPicker
source · pub struct PeakPicker {
pub background_intensity: f32,
pub intensity_threshold: f32,
pub signal_to_noise_threshold: f32,
pub fit_type: PeakFitType,
}
Expand description
A peak picker for mass spectra
Fields§
§background_intensity: f32
§intensity_threshold: f32
§signal_to_noise_threshold: f32
§fit_type: PeakFitType
Implementations§
source§impl PeakPicker
impl PeakPicker
sourcepub fn new(
background_intensity: f32,
intensity_threshold: f32,
signal_to_noise_threshold: f32,
fit_type: PeakFitType
) -> Self
pub fn new( background_intensity: f32, intensity_threshold: f32, signal_to_noise_threshold: f32, fit_type: PeakFitType ) -> Self
Create a new peak picker
sourcepub fn discover_peaks(
&self,
mz_array: &[f64],
intensity_array: &[f32],
peak_accumulator: &mut Vec<FittedPeak>
) -> Result<usize, PeakPickerError>
pub fn discover_peaks( &self, mz_array: &[f64], intensity_array: &[f32], peak_accumulator: &mut Vec<FittedPeak> ) -> Result<usize, PeakPickerError>
Pick peaks from mz_array
and intensity_array
, pushing new peaks into peak_accumulator
.
Returns the number of peaks picked if successful.
This is a thin wrapper around PeakPicker::discover_peaks_in_interval
.
sourcepub fn fit_peak(
&self,
index: usize,
mz_array: &[f64],
intensity_array: &[f32],
partial_fit: &PartialPeakFit
) -> f64
pub fn fit_peak( &self, index: usize, mz_array: &[f64], intensity_array: &[f32], partial_fit: &PartialPeakFit ) -> f64
Fit a peak at position index
in mz_array
and intensity_array
.
index
is assumed to be the most intense point along the putative
peak, the “apex”, thus for PeakFitType::Apex
, this function is
simply mz_array[index]
.
Returns the estimated m/z of the “true” peak.
sourcepub fn discover_peaks_in_interval(
&self,
mz_array: &[f64],
intensity_array: &[f32],
peak_accumulator: &mut Vec<FittedPeak>,
start_mz: f64,
stop_mz: f64
) -> Result<usize, PeakPickerError>
pub fn discover_peaks_in_interval( &self, mz_array: &[f64], intensity_array: &[f32], peak_accumulator: &mut Vec<FittedPeak>, start_mz: f64, stop_mz: f64 ) -> Result<usize, PeakPickerError>
Pick peaks from mz_array
and intensity_array
between start_mz
and stop_mz
,
pushing new peaks into peak_accumulator
.
Returns the number of peaks picked if successful
Trait Implementations§
source§impl Clone for PeakPicker
impl Clone for PeakPicker
source§fn clone(&self) -> PeakPicker
fn clone(&self) -> PeakPicker
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 Debug for PeakPicker
impl Debug for PeakPicker
source§impl Default for PeakPicker
impl Default for PeakPicker
source§fn default() -> PeakPicker
fn default() -> PeakPicker
Returns the “default value” for a type. Read more
source§impl From<PeakPickerBuilder> for PeakPicker
impl From<PeakPickerBuilder> for PeakPicker
source§fn from(value: PeakPickerBuilder) -> Self
fn from(value: PeakPickerBuilder) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for PeakPicker
impl RefUnwindSafe for PeakPicker
impl Send for PeakPicker
impl Sync for PeakPicker
impl Unpin for PeakPicker
impl UnwindSafe for PeakPicker
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> 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.