pub struct Spectrum { /* private fields */ }Expand description
Spectrum captures both binary data and metadata associated with a mass spectrum.
Implementations§
Source§impl Spectrum
impl Spectrum
Sourcepub fn new(id: &str, index: u64, default_array_length: i64) -> Self
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)
Sourcepub fn representation(&self) -> Option<Representation>
pub fn representation(&self) -> Option<Representation>
Returns the spectrum representation (centroid, profile)
Sourcepub fn polarity(&self) -> Option<Polarity>
pub fn polarity(&self) -> Option<Polarity>
Returns the polarity (positive, negative) used when recording the spectrum
Sourcepub fn total_ion_current(&self) -> Option<f64>
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.
Sourcepub fn lowest_mz(&self) -> Option<f64>
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.
Sourcepub fn highest_mz(&self) -> Option<f64>
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.
Sourcepub fn base_peak_mz(&self) -> Option<f64>
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.
Sourcepub fn base_peak_intensity(&self) -> Option<f64>
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.
Sourcepub fn add_binary_data_array(&mut self, binary_data_array: BinaryDataArray)
pub fn add_binary_data_array(&mut self, binary_data_array: BinaryDataArray)
Add a BinaryDataArray to the spectrum
Sourcepub fn set_scan_list(&mut self, scan_list: ScanList)
pub fn set_scan_list(&mut self, scan_list: ScanList)
Sets the ScanList for the spectrum, overriding the existing ScanList
Sourcepub fn scan_list_mut(&mut self) -> &mut ScanList
pub fn scan_list_mut(&mut self) -> &mut ScanList
Returns mutable access to the ScanList
Sourcepub fn set_data_processing_ref(
&mut self,
data_processing_ref: DataProcessingRef,
)
pub fn set_data_processing_ref( &mut self, data_processing_ref: DataProcessingRef, )
Set the DataProcessingRef, describing any data processing applied to this spectrum.
Sourcepub fn set_source_file_ref(&mut self, source_file_ref: SourceFileRef)
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)
Sourcepub fn set_spot_id(&mut self, spot_id: &str)
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)
Sourcepub fn mz_array(&self) -> Option<&BinaryDataArray>
pub fn mz_array(&self) -> Option<&BinaryDataArray>
Returns the BinaryDataArray that captures the m/z values
Sourcepub fn mz_array_mut(&mut self) -> Option<&mut BinaryDataArray>
pub fn mz_array_mut(&mut self) -> Option<&mut BinaryDataArray>
Returns mutable access to the BinaryDataArray that captures the m/z values
Sourcepub fn intensity_array(&self) -> Option<&BinaryDataArray>
pub fn intensity_array(&self) -> Option<&BinaryDataArray>
Returns the BinaryDataArray that captures the intensity values of the spectrum
Sourcepub fn intensity_array_mut(&mut self) -> Option<&mut BinaryDataArray>
pub fn intensity_array_mut(&mut self) -> Option<&mut BinaryDataArray>
Returns mutable access to the BinaryDataArray that captures the intensity values of the spectrum
Sourcepub fn x_position(&self) -> Option<u32>
pub fn x_position(&self) -> Option<u32>
Returns the x coordinate (if one exists) associated with the spectrum
Sourcepub fn y_position(&self) -> Option<u32>
pub fn y_position(&self) -> Option<u32>
Returns the y coordinate (if one exists) associated with the spectrum
Sourcepub fn z_position(&self) -> Option<u32>
pub fn z_position(&self) -> Option<u32>
Returns the z coordinate (if one exists) associated with the spectrum
Sourcepub fn set_x_position(&mut self, x: u32)
pub fn set_x_position(&mut self, x: u32)
Sets the x coordinate associated with the spectrum
Sourcepub fn set_y_position(&mut self, y: u32)
pub fn set_y_position(&mut self, y: u32)
Sets the y coordinate associated with the spectrum
Sourcepub fn product_list(&self) -> &Vec<Product>
pub fn product_list(&self) -> &Vec<Product>
Returns the product list
Sourcepub fn precursor_list(&self) -> Option<&Vec<Precursor>>
pub fn precursor_list(&self) -> Option<&Vec<Precursor>>
Returns the precursor list
Sourcepub fn binary_data_array_list(&self) -> &Vec<BinaryDataArray>
pub fn binary_data_array_list(&self) -> &Vec<BinaryDataArray>
Returns the binary data array list. This contains the binary data
Trait Implementations§
Source§impl HasCVParams for Spectrum
impl HasCVParams for Spectrum
Source§fn add_cv_param(&mut self, param: CVParam)
fn add_cv_param(&mut self, param: CVParam)
Source§fn cv_params(&self) -> &Vec<CVParam>
fn cv_params(&self) -> &Vec<CVParam>
Source§fn cv_params_mut(&mut self) -> &mut Vec<CVParam>
fn cv_params_mut(&mut self) -> &mut Vec<CVParam>
Source§fn add_user_param(&mut self, param: UserParam)
fn add_user_param(&mut self, param: UserParam)
Source§fn user_params(&self) -> &Vec<UserParam>
fn user_params(&self) -> &Vec<UserParam>
Source§fn clone_params(&self) -> Vec<CVParam>
fn clone_params(&self) -> Vec<CVParam>
Vec<CVParam<'a>>.