mscore::data::spectrum

Trait ToResolution

Source
pub trait ToResolution {
    // Required method
    fn to_resolution(&self, resolution: i32) -> Self;
}
Expand description

Represents a vectorized mass spectrum.

Required Methods§

Source

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§

Source§

impl ToResolution for MzSpectrumAnnotated

Source§

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);
Source§

impl ToResolution for MzSpectrum