Spectrum

Struct Spectrum 

Source
pub struct Spectrum { /* private fields */ }
Expand description

Spectrum captures both binary data and metadata associated with a mass spectrum.

Implementations§

Source§

impl Spectrum

Source

pub fn new(id: &str, index: u64, default_array_length: i64) -> Self

Create a new Spectrum with the specified unique identifier, index in the list of spectra and default array length (default number of data points per spectrum)

Source

pub fn representation(&self) -> Option<Representation>

Returns the spectrum representation (centroid, profile)

Source

pub fn polarity(&self) -> Option<Polarity>

Returns the polarity (positive, negative) used when recording the spectrum

Source

pub fn total_ion_current(&self) -> Option<f64>

Return the total ion current stored in the (i)mzML. If this is not present, then it is not calculated from the data and None is returned.

Source

pub fn lowest_mz(&self) -> Option<f64>

Return the lowest m/z value stored in the (i)mzML. If this is not present, then it is not calculated from the data and None is returned.

Source

pub fn highest_mz(&self) -> Option<f64>

Return the highest m/z value stored in the (i)mzML. If this is not present, then it is not calculated from the data and None is returned.

Source

pub fn base_peak_mz(&self) -> Option<f64>

Return the base peak m/z value stored in the (i)mzML. If this is not present, then it is not calculated from the data and None is returned.

Source

pub fn base_peak_intensity(&self) -> Option<f64>

Return the base peak intensity stored in the (i)mzML. If this is not present, then it is not calculated from the data and None is returned.

Source

pub fn add_binary_data_array(&mut self, binary_data_array: BinaryDataArray)

Add a BinaryDataArray to the spectrum

Source

pub fn set_scan_list(&mut self, scan_list: ScanList)

Sets the ScanList for the spectrum, overriding the existing ScanList

Source

pub fn scan_list_mut(&mut self) -> &mut ScanList

Returns mutable access to the ScanList

Source

pub fn set_data_processing_ref( &mut self, data_processing_ref: DataProcessingRef, )

Set the DataProcessingRef, describing any data processing applied to this spectrum.

Source

pub fn set_source_file_ref(&mut self, source_file_ref: SourceFileRef)

Set the SourceFileRef, describing the origin of the spectrum (which file it came from)

Source

pub fn set_spot_id(&mut self, spot_id: &str)

Set the spot id for the spectrum (usually only in mzML data as in imaging the pixel coordinates differentate location)

Source

pub fn mz_array(&self) -> Option<&BinaryDataArray>

Returns the BinaryDataArray that captures the m/z values

Source

pub fn mz_array_mut(&mut self) -> Option<&mut BinaryDataArray>

Returns mutable access to the BinaryDataArray that captures the m/z values

Source

pub fn intensity_array(&self) -> Option<&BinaryDataArray>

Returns the BinaryDataArray that captures the intensity values of the spectrum

Source

pub fn intensity_array_mut(&mut self) -> Option<&mut BinaryDataArray>

Returns mutable access to the BinaryDataArray that captures the intensity values of the spectrum

Source

pub fn id(&self) -> &str

Get the ID associated with the spectrum

Source

pub fn x_position(&self) -> Option<u32>

Returns the x coordinate (if one exists) associated with the spectrum

Source

pub fn y_position(&self) -> Option<u32>

Returns the y coordinate (if one exists) associated with the spectrum

Source

pub fn z_position(&self) -> Option<u32>

Returns the z coordinate (if one exists) associated with the spectrum

Source

pub fn set_x_position(&mut self, x: u32)

Sets the x coordinate associated with the spectrum

Source

pub fn set_y_position(&mut self, y: u32)

Sets the y coordinate associated with the spectrum

Source

pub fn scan_list(&self) -> &ScanList

Returns the scan list

Source

pub fn product_list(&self) -> &Vec<Product>

Returns the product list

Source

pub fn precursor_list(&self) -> Option<&Vec<Precursor>>

Returns the precursor list

Source

pub fn binary_data_array_list(&self) -> &Vec<BinaryDataArray>

Returns the binary data array list. This contains the binary data

Trait Implementations§

Source§

impl Clone for Spectrum

Source§

fn clone(&self) -> Self

Returns a duplicate 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 Spectrum

Source§

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

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

impl HasCVParams for Spectrum

Source§

fn add_cv_param(&mut self, param: CVParam)

Add a cvParam to the tag.
Source§

fn cv_params(&self) -> &Vec<CVParam>

Return access to the list of cvParams currently associated with the tag.
Source§

fn cv_params_mut(&mut self) -> &mut Vec<CVParam>

Return mutable access to the list of cvParams currently associated with the tag.
Source§

fn add_user_param(&mut self, param: UserParam)

Add a userParam to the tag.
Source§

fn user_params(&self) -> &Vec<UserParam>

Return access to all userParams.
Source§

fn clone_params(&self) -> Vec<CVParam>

Clone the current parameters into a Vec<CVParam<'a>>.
Source§

fn remove_children_of(&mut self, ontology: &Ontology, parent_id: &str)

Remove any cvParam which has a term that is the child of the of the supplied term (parent_id).
Source§

fn children_of(&self, ontology: &Ontology, parent_id: &str) -> Vec<&CVParam>

Return all cvParams which have a term that is the child of the of the supplied term (parent_id).
Source§

fn search_cv_params(&self, accession: &str) -> Option<&CVParam>

Return cvParam with supplied term (accession) if present, None otherwise.
Source§

fn write_params_xml<W: Write>( &self, writer: &mut Writer<W>, ) -> Result<(), Error>

Write the params (cvParam and userParam) as XML to the supplied writer.
Source§

impl HasParamGroupRefs for Spectrum

Source§

fn add_param_group_ref(&mut self, param_group_ref: ReferenceableParamGroupRef)

Add a referenceableParamGroupRef to the tag.
Source§

fn param_group_refs(&self) -> &Vec<ReferenceableParamGroupRef>

Returns a reference to list of referenceableParamGroupRef
Source§

fn clone_params_with_groups(&self) -> Vec<CVParam>

Returns a Vec containing cloned versions of all cvParams
Source§

fn search_param_groups(&self, accession: &str) -> Option<&CVParam>

Search param groups for
Source§

fn write_ref_param_groups_xml<W: Write>( &self, writer: &mut Writer<W>, ) -> Result<(), Error>

Write the references (referenceableParamGroupRef) as XML to the supplied writer.
Source§

impl MzMLTag for Spectrum

Source§

fn parse_start_tag<B: BufRead>( parser: &mut MzMLReader<B>, start_event: &BytesStart<'_>, ) -> Result<Option<Self>, FatalParseError>
where Self: Sized,

Parse the start tag (capture any attributes, noting any missing or extra as errors).
Source§

fn parse_xml<B: BufRead>( &mut self, parser: &mut MzMLReader<B>, buffer: &mut Vec<u8>, ) -> Result<(), FatalParseError>

Parse the child tags (if necessary). This is only called if there are expected to be child tags.
Source§

fn tag() -> Tag

Returns the tag being described
Source§

fn write_xml<W: Write>(&self, writer: &mut Writer<W>) -> Result<(), Error>

Write the tag in XML format.

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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

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.
Source§

impl<T> ErasedDestructor for T
where T: 'static,