pub struct RawSpectrum {
Show 16 fields pub title: String, pub num_scans: u64, pub rt: Time, pub charge: Charge, pub mass: Mass, pub intensity: Option<f64>, pub sequence: Option<String>, pub raw_file: Option<String>, pub raw_scan_number: Option<usize>, pub raw_index: Option<usize>, pub sample: Option<usize>, pub period: Option<usize>, pub cycle: Option<usize>, pub experiment: Option<usize>, pub controller_type: Option<usize>, pub controller_number: Option<usize>, /* private fields */
}
Expand description

A raw spectrum (meaning not annotated yet)

Fields§

§title: String

The title (as used in MGF)

§num_scans: u64

The number of scans

§rt: Time

The retention time

§charge: Charge

The found precursor charge

§mass: Mass

The found precursor mass

§intensity: Option<f64>

The found precursor intensity

§sequence: Option<String>

MGF: if present the SEQUENCE line

§raw_file: Option<String>

MGF TITLE: if present the raw file where this mgf was made from

§raw_scan_number: Option<usize>

MGF TITLE: if present the raw file scan number

§raw_index: Option<usize>

MGF TITLE: index number

§sample: Option<usize>

MGF TITLE: sample number

§period: Option<usize>

MGF TITLE: period number

§cycle: Option<usize>

MGF TITLE: cycle number

§experiment: Option<usize>

MGF TITLE: experiment number

§controller_type: Option<usize>

MGF TITLE: controllerType number

§controller_number: Option<usize>

MGF TITLE: controllerNumber number

Implementations§

source§

impl RawSpectrum

source

pub fn relative_noise_filter(&mut self, filter_threshold: f64)

Filter the spectrum to retain all with an intensity above filter_threshold times the maximal intensity.

§Panics

It panics if any peaks has an intensity that is NaN.

source

pub fn absolute_noise_filter(&mut self, filter_threshold: f64)

Filter the spectrum to retain all with an intensity above filter_threshold.

source

pub fn top_x_filter(&mut self, window_size: f64, top: usize)

Filter a spectrum by dividing it in windows and within each window only retain the top number of peaks.

source

pub fn annotate( &self, peptide: ComplexPeptide, theoretical_fragments: &[Fragment], model: &Model, mode: MassMode ) -> AnnotatedSpectrum

Annotate this spectrum with the given peptide and given fragments see crate::ComplexPeptide::generate_theoretical_fragments.

§Panics

If any fragment does not have a defined m/z

Trait Implementations§

source§

impl Clone for RawSpectrum

source§

fn clone(&self) -> RawSpectrum

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 Debug for RawSpectrum

source§

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

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

impl Default for RawSpectrum

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for RawSpectrum

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Extend<RawPeak> for RawSpectrum

source§

fn extend<T: IntoIterator<Item = RawPeak>>(&mut self, iter: T)

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl Index<usize> for RawSpectrum

§

type Output = RawPeak

The returned type after indexing.
source§

fn index(&self, index: usize) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
source§

impl IntoIterator for RawSpectrum

§

type Item = RawPeak

The type of the elements being iterated over.
§

type IntoIter = IntoIter<RawPeak>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl PartialEq for RawSpectrum

source§

fn eq(&self, other: &RawSpectrum) -> 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 PartialOrd for RawSpectrum

source§

fn partial_cmp(&self, other: &RawSpectrum) -> 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 PeakSpectrum for RawSpectrum

Return the slice of peaks that is within the given tolerance bounds.

§

type PeakType = RawPeak

The type of peaks this spectrum contains
§

type Iter<'a> = Iter<'a, <RawSpectrum as PeakSpectrum>::PeakType>

The type of spectrum iterator this spectrum generates
source§

fn spectrum(&self) -> Self::Iter<'_>

Get the full spectrum
source§

fn add_peak(&mut self, item: Self::PeakType)

Add a single peak
source§

impl Serialize for RawSpectrum

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl StructuralPartialEq for RawSpectrum

Auto Trait Implementations§

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> 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<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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,