Skip to main content

Centroided

Struct Centroided 

Source
pub struct Centroided<S: SpectrumSource> { /* private fields */ }
Expand description

Wraps a SpectrumSource, centroiding every profile-mode spectrum it yields. Spectra already tagged ScanMode::Centroid pass through unchanged (idempotent).

Implementations§

Source§

impl<S: SpectrumSource> Centroided<S>

Source

pub fn new(inner: S) -> Self

Wrap inner, picking every local-maximum peak regardless of height.

Source

pub fn with_min_intensity(self, min_intensity: f32) -> Self

Discard picked peaks below min_intensity (a simple noise floor).

Trait Implementations§

Source§

impl<S: SpectrumSource> SpectrumSource for Centroided<S>

Source§

fn run_metadata(&self) -> RunMetadata

Run-level metadata. Cheap to call; vendors typically build this once.
Source§

fn iter_spectra<'a>( &'a mut self, ) -> Box<dyn Iterator<Item = SpectrumRecord> + 'a>

Iterate every spectrum the file contains. Spectra the parser cannot decode should be skipped silently; the writer trusts whatever the iterator yields. Read more
Source§

fn iter_chromatograms<'a>( &'a mut self, ) -> Box<dyn Iterator<Item = ChromatogramRecord> + 'a>

Iterate chromatogram traces (TIC, BPC, SRM). Defaults to an empty iterator; most parsers do not synthesize chromatograms.
Source§

fn spectrum_count_hint(&self) -> Option<usize>

Total number of spectra the source will yield, when known cheaply. Used by the mzML writer to populate <spectrumList count="...">. If None, the writer falls back to buffering spectrum offsets and patching the count at the end.

Auto Trait Implementations§

§

impl<S> Freeze for Centroided<S>
where S: Freeze,

§

impl<S> RefUnwindSafe for Centroided<S>
where S: RefUnwindSafe,

§

impl<S> Send for Centroided<S>
where S: Send,

§

impl<S> Sync for Centroided<S>
where S: Sync,

§

impl<S> Unpin for Centroided<S>
where S: Unpin,

§

impl<S> UnsafeUnpin for Centroided<S>
where S: UnsafeUnpin,

§

impl<S> UnwindSafe for Centroided<S>
where S: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

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

Source§

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>,

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.