TimsDatasetDDA

Struct TimsDatasetDDA 

Source
pub struct TimsDatasetDDA {
    pub loader: TimsDataLoader,
    pub pasef_meta: Vec<PasefMsMsMeta>,
}

Fields§

§loader: TimsDataLoader§pasef_meta: Vec<PasefMsMsMeta>

Implementations§

Source§

impl TimsDatasetDDA

Source

pub fn new( bruker_lib_path: &str, data_path: &str, in_memory: bool, use_bruker_sdk: bool, ) -> Self

Source

pub fn new_with_calibration( data_path: &str, in_memory: bool, im_lookup: Vec<f64>, ) -> Self

Create a new DDA dataset with pre-computed ion mobility calibration lookup table.

This enables accurate ion mobility calibration with fast parallel extraction. The im_lookup table should be pre-computed using the Bruker SDK.

§Arguments
  • data_path - Path to the .d folder
  • in_memory - Whether to load all data into memory
  • im_lookup - Pre-computed scan→1/K0 lookup table from Bruker SDK
§Returns

A new TimsDatasetDDA with LookupIndexConverter (thread-safe, accurate)

Source

pub fn new_with_mz_calibration( data_path: &str, in_memory: bool, tof_intercept: f64, tof_slope: f64, ) -> Self

Create a DDA dataset with regression-derived m/z calibration.

This method uses externally-provided m/z calibration coefficients (e.g., from linear regression on precursor data) instead of the simple boundary model.

§Arguments
  • data_path - Path to the .d folder
  • in_memory - Whether to load all data into memory
  • tof_intercept - Intercept for sqrt(mz) = intercept + slope * tof
  • tof_slope - Slope for sqrt(mz) = intercept + slope * tof
§Returns

A new TimsDatasetDDA with CalibratedIndexConverter (thread-safe, accurate)

Source

pub fn uses_bruker_sdk(&self) -> bool

Check if the Bruker SDK is being used for index conversion. Returns false for both Simple and Lookup converters (which are thread-safe).

Source

pub fn get_selected_precursors(&self) -> Vec<DDAPrecursor>

Source

pub fn get_precursor_frames( &self, min_intensity: f64, max_num_peaks: usize, num_threads: usize, ) -> Vec<TimsFrame>

Source

pub fn extract_precursor_ms1_signals( &self, precursor_coords: Vec<PrecursorCoord>, rt_window_sec: f64, mz_tol_ppm: f64, im_window: f64, n_isotopes: usize, num_threads: usize, ) -> Vec<PrecursorMS1Signal>

Extract MS1 precursor signals for a batch of precursors in parallel.

For each precursor, extracts:

  • XIC (chromatographic profile) from MS1 frames in RT window
  • Mobilogram (IM profile)
  • Isotope envelope
  • Statistical moments (mean, variance, skewness, apex, FWHM) for each dimension

Uses batched processing to avoid loading all MS1 frames at once.

§Arguments
  • precursor_coords - Vector of precursor coordinates (id, mz, rt_sec, mobility, charge)
  • rt_window_sec - RT window in seconds (total width)
  • mz_tol_ppm - m/z tolerance in ppm
  • im_window - IM window in 1/K0 units (total width)
  • n_isotopes - Number of isotope peaks to extract
  • num_threads - Number of threads for parallel processing
§Returns

Vector of PrecursorMS1Signal, one per input precursor

Source

pub fn get_pasef_frame_ms_ms_info(&self) -> Vec<PasefMsMsMeta>

Source

pub fn get_pasef_fragments(&self, num_threads: usize) -> Vec<PASEFDDAFragment>

Get the fragment spectra for all PASEF selected precursors

Source

pub fn get_pasef_fragments_for_precursors( &self, precursor_ids: Option<&[u32]>, num_threads: usize, ) -> Vec<PASEFDDAFragment>

Get fragment spectra for specific precursor IDs only. If precursor_ids is None, returns all fragments (same as get_pasef_fragments). This is more memory-efficient for batched processing.

Source

pub fn get_preprocessed_pasef_fragments( &self, dataset_name: &str, config: SpectrumProcessingConfig, num_threads: usize, ) -> Vec<PreprocessedSpectrum>

Get preprocessed PASEF fragments ready for database search. This method performs parallel processing of all fragment spectra, including:

  • Flattening frames across ion mobility dimension
  • Deisotoping (optional)
  • Filtering to top N peaks
  • Computing inverse mobility along scan marginal
§Arguments
  • dataset_name - Name of the dataset for generating spec_ids
  • config - Spectrum processing configuration
  • num_threads - Number of threads to use for parallel processing
§Returns

Vector of preprocessed spectra ready for Sage search

Source

pub fn sample_pasef_fragment_random( &self, target_scan_apex: i32, experiment_max_scan: i32, ) -> TimsFrame

Source

pub fn sample_pasef_fragments_random( &self, target_scan_apex_values: Vec<i32>, experiment_max_scan: i32, ) -> TimsFrame

Source

pub fn sample_precursor_signal( &self, num_frames: usize, max_intensity: f64, take_probability: f64, ) -> TimsFrame

Trait Implementations§

Source§

impl IndexConverter for TimsDatasetDDA

Source§

fn tof_to_mz(&self, frame_id: u32, tof_values: &Vec<u32>) -> Vec<f64>

Source§

fn mz_to_tof(&self, frame_id: u32, mz_values: &Vec<f64>) -> Vec<u32>

Source§

fn scan_to_inverse_mobility( &self, frame_id: u32, scan_values: &Vec<u32>, ) -> Vec<f64>

Source§

fn inverse_mobility_to_scan( &self, frame_id: u32, inverse_mobility_values: &Vec<f64>, ) -> Vec<u32>

Source§

impl TimsData for TimsDatasetDDA

Source§

fn get_frame(&self, frame_id: u32) -> TimsFrame

Source§

fn get_raw_frame(&self, frame_id: u32) -> RawTimsFrame

Source§

fn get_slice(&self, frame_ids: Vec<u32>, num_threads: usize) -> TimsSlice

Source§

fn get_acquisition_mode(&self) -> AcquisitionMode

Source§

fn get_frame_count(&self) -> i32

Source§

fn get_data_path(&self) -> &str

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> 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V