pub trait ToResolution {
// Required method
fn to_resolution(&self, resolution: i32) -> Self;
}
Expand description
Represents a vectorized mass spectrum.
Required Methods§
fn to_resolution(&self, resolution: i32) -> Self
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
impl ToResolution for MzSpectrumAnnotated
impl ToResolution for TimsFrame
Convert a given TimsFrame to a vector of TimsSpectrum.
§Arguments
resolution
- The resolution to which the m/z values should be rounded.
§Examples
use mscore::data::spectrum::MsType;
use mscore::timstof::frame::TimsFrame;
use mscore::timstof::spectrum::TimsSpectrum;
use mscore::data::spectrum::IndexedMzSpectrum;
use mscore::data::spectrum::ToResolution;
let frame = TimsFrame::new(1, MsType::Precursor, 100.0, vec![1, 2], vec![0.1, 0.2], vec![1000, 2000], vec![100.5, 200.5], vec![50.0, 60.0]);
let low_res_frame = frame.to_resolution(1);