Struct rustyms::spectrum::RawSpectrum
source · 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
impl RawSpectrum
sourcepub fn relative_noise_filter(&mut self, filter_threshold: f64)
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.
sourcepub fn absolute_noise_filter(&mut self, filter_threshold: f64)
pub fn absolute_noise_filter(&mut self, filter_threshold: f64)
Filter the spectrum to retain all with an intensity above filter_threshold
.
sourcepub fn top_x_filter(&mut self, window_size: f64, top: usize)
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.
sourcepub fn annotate(
&self,
peptide: ComplexPeptide,
theoretical_fragments: &[Fragment],
model: &Model,
mode: MassMode
) -> AnnotatedSpectrum
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
impl Clone for RawSpectrum
source§fn clone(&self) -> RawSpectrum
fn clone(&self) -> RawSpectrum
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for RawSpectrum
impl Debug for RawSpectrum
source§impl Default for RawSpectrum
impl Default for RawSpectrum
source§impl<'de> Deserialize<'de> for RawSpectrum
impl<'de> Deserialize<'de> for RawSpectrum
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl Extend<RawPeak> for RawSpectrum
impl Extend<RawPeak> for RawSpectrum
source§fn extend<T: IntoIterator<Item = RawPeak>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = RawPeak>>(&mut self, iter: T)
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)source§impl Index<usize> for RawSpectrum
impl Index<usize> for RawSpectrum
source§impl IntoIterator for RawSpectrum
impl IntoIterator for RawSpectrum
source§impl PartialEq for RawSpectrum
impl PartialEq for RawSpectrum
source§fn eq(&self, other: &RawSpectrum) -> bool
fn eq(&self, other: &RawSpectrum) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for RawSpectrum
impl PartialOrd for RawSpectrum
source§fn partial_cmp(&self, other: &RawSpectrum) -> Option<Ordering>
fn partial_cmp(&self, other: &RawSpectrum) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl PeakSpectrum for RawSpectrum
impl PeakSpectrum for RawSpectrum
source§fn binary_search(&self, low: MassOverCharge, high: MassOverCharge) -> &[RawPeak]
fn binary_search(&self, low: MassOverCharge, high: MassOverCharge) -> &[RawPeak]
Return the slice of peaks that is within the given tolerance bounds.