TimsDatasetDIA

Struct TimsDatasetDIA 

Source
pub struct TimsDatasetDIA {
    pub loader: TimsDataLoader,
    pub global_meta_data: GlobalMetaData,
    pub meta_data: Vec<FrameMeta>,
    pub dia_ms_ms_info: Vec<DiaMsMisInfo>,
    pub dia_ms_ms_windows: Vec<DiaMsMsWindow>,
    pub dia_index: DiaIndex,
}

Fields§

§loader: TimsDataLoader§global_meta_data: GlobalMetaData§meta_data: Vec<FrameMeta>§dia_ms_ms_info: Vec<DiaMsMisInfo>§dia_ms_ms_windows: Vec<DiaMsMsWindow>§dia_index: DiaIndex

Implementations§

Source§

impl TimsDatasetDIA

Source

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

Source

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

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

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

Source

pub fn program_for_group(&self, g: u32) -> Ms2GroupProgram

Source

pub fn program_slices_for_group(&self, group: u32) -> Vec<ProgramSlice>

Collect all program slices for a window group from DiaFrameMsMsWindows. Isolation window: [isolation_mz - width/2, isolation_mz + width/2]

Source

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

Source

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

Source

pub fn dia_window_groups(&self) -> Vec<u32>

All DIA window_group IDs present in the file (sorted unique).

Source

pub fn window_groups_for_precursor( &self, prec_mz: f32, im_apex: f32, ) -> Vec<u32>

Source

pub fn fragment_frame_ids_and_times_for_group_core( &self, window_group: u32, ) -> (Vec<u32>, Vec<f32>)

RT-sorted fragment frames for a given DIA group.

Source

pub fn scan_unions_for_window_group_core( &self, window_group: u32, ) -> Option<Vec<(usize, usize)>>

Merged, sorted global scan unions for this DIA group, from DiaFrameMsMsWindows. Returns None if there are no window rows for this group.

Source

pub fn mz_bounds_for_window_group_core( &self, window_group: u32, ) -> Option<(f32, f32)>

m/z unions (min..max) for the group from DiaFrameMsMsWindows (wide clamp).

Source

pub fn make_rt_frames_for_group( &self, window_group: u32, tof_step: i32, ) -> RtFrames

RT-sorted FRAGMENT frames + times for a DIA group, converted into FrameBinView rows. tof_step controls TOF granularity of CSR binning.

Source

pub fn make_rt_frames_for_precursor(&self, tof_step: i32) -> RtFrames

RT-sorted PRECURSOR frames (ms_ms_type == 0) into FrameBinView rows. tof_step controls TOF granularity of CSR binning.

Source

pub fn tof_scale_for_group(&self, window_group: u32, tof_step: i32) -> TofScale

Build a TOF-based scale for a DIA group. tof_step = 1 → max TOF resolution; larger steps downsample.

Source

pub fn tof_scale_from_frames_scan( &self, frame_ids: &[u32], tof_step: i32, ) -> Option<TofScale>

Conservative: derive a TOF scale by scanning actual frame data.

Source

pub fn evaluate_specs_1d_threads( &self, rt_frames: &RtFrames, specs: &[ClusterSpec1D], opts: &Eval1DOpts, num_threads: usize, ) -> Vec<ClusterResult1D>

Evaluate a batch of 1D cluster specs on the given RtFrames.

  • Runs spec evaluation (marginals + moment fits) in parallel.
  • Optionally attaches raw points using the finalized TOF-bin window and the spec’s IM/RT windows.
  • num_threads == 0 => use rayon’s global pool.
Source

pub fn clusters_for_group( &self, window_group: u32, tof_step: i32, im_peaks: &[ImPeak1D], rt_params: RtExpandParams, build_opts: &BuildSpecOpts, eval_opts: &Eval1DOpts, require_rt_overlap: bool, num_threads: usize, ) -> Vec<ClusterResult1D>

Source

pub fn clusters_for_precursor( &self, tof_step: i32, im_peaks: &[ImPeak1D], rt_params: RtExpandParams, build_opts: &BuildSpecOpts, eval_opts: &Eval1DOpts, require_rt_overlap: bool, num_threads: usize, ) -> Vec<ClusterResult1D>

Source

pub fn build_pseudo_spectra_from_clusters_geom( &self, ms1: &[ClusterResult1D], ms2: &[ClusterResult1D], features: Option<&[SimpleFeature]>, cand_opts: &CandidateOpts, score_opts: &ScoreOpts, pseudo_opts: &PseudoSpecOpts, ) -> PseudoBuildResult

End-to-end DIA → pseudo-DDA builder (geometric scoring).

Thin wrapper around build_pseudo_spectra_end_to_end.

Source

pub fn build_pseudo_spectra_from_clusters_xic( &self, ms1: &[ClusterResult1D], ms2: &[ClusterResult1D], features: Option<&[SimpleFeature]>, cand_opts: &CandidateOpts, xic_opts: &XicScoreOpts, pseudo_opts: &PseudoSpecOpts, ) -> PseudoBuildResult

End-to-end DIA → pseudo-DDA builder (XIC-based scoring).

Thin wrapper around build_pseudo_spectra_end_to_end_xic.

Source

pub fn build_pseudo_spectra_all_pairs_from_clusters( &self, ms1: &[ClusterResult1D], ms2: &[ClusterResult1D], features: Option<&[SimpleFeature]>, pseudo_opts: &PseudoSpecOpts, ) -> PseudoBuildResult

Naive “all pairs” builder stays as-is, still returning Vec.

Source

pub fn clusters_for_group_opts( &self, window_group: u32, im_peaks: &[ImPeak1D], opts: &ClusterExtractionOpts, ) -> Vec<ClusterResult1D>

Extract clusters for a DIA window group using options struct.

Source

pub fn clusters_for_precursor_opts( &self, im_peaks: &[ImPeak1D], opts: &ClusterExtractionOpts, ) -> Vec<ClusterResult1D>

Extract clusters for precursor (MS1) frames using options struct.

Source

pub fn tof_rt_grid_precursor(&self, tof_step: i32) -> TofRtGrid

Dense TOF×RT grid for all PRECURSOR (MS1) frames. tof_step controls TOF bin granularity (1 = full resolution).

Source

pub fn tof_rt_grid_for_group( &self, window_group: u32, tof_step: i32, ) -> TofRtGrid

Dense TOF×RT grid for FRAGMENT frames in a DIA window group. tof_step controls TOF bin granularity (1 = full resolution).

Source

pub fn debug_extract_raw_for_clusters( &self, clusters: &[ClusterResult1D], window_group: Option<u32>, tof_step: i32, max_points: Option<usize>, num_threads: usize, ) -> Vec<RawPoints>

Debug helper: for a bunch of clusters that all live on the same DIA grid (either MS1 or one MS2 window_group), extract RawPoints per cluster.

  • clusters: precursor or fragment clusters. All must have the same ms_level.
  • window_group: if you pass Some(g), we treat them as MS2 clusters on that DIA group. If None and ms_level == 2, we try to infer g from the first cluster’s window_group.
  • tof_step: must be the same as used during clustering.
  • max_points: optional thinning cap per cluster.
  • num_threads: used for get_slice in the raw extractor.

Trait Implementations§

Source§

impl IndexConverter for TimsDatasetDIA

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 TimsDatasetDIA

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