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: DiaIndexImplementations§
Source§impl TimsDatasetDIA
impl TimsDatasetDIA
pub fn new( bruker_lib_path: &str, data_path: &str, in_memory: bool, use_bruker_sdk: bool, ) -> Self
Sourcepub fn new_with_mz_calibration(
data_path: &str,
in_memory: bool,
tof_intercept: f64,
tof_slope: f64,
) -> Self
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.
pub fn program_for_group(&self, g: u32) -> Ms2GroupProgram
Sourcepub fn program_slices_for_group(&self, group: u32) -> Vec<ProgramSlice>
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]
pub fn sample_precursor_signal( &self, num_frames: usize, max_intensity: f64, take_probability: f64, ) -> TimsFrame
pub fn sample_fragment_signal( &self, num_frames: usize, window_group: u32, max_intensity: f64, take_probability: f64, ) -> TimsFrame
Sourcepub fn dia_window_groups(&self) -> Vec<u32>
pub fn dia_window_groups(&self) -> Vec<u32>
All DIA window_group IDs present in the file (sorted unique).
pub fn window_groups_for_precursor( &self, prec_mz: f32, im_apex: f32, ) -> Vec<u32>
Sourcepub fn fragment_frame_ids_and_times_for_group_core(
&self,
window_group: u32,
) -> (Vec<u32>, Vec<f32>)
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.
Sourcepub fn scan_unions_for_window_group_core(
&self,
window_group: u32,
) -> Option<Vec<(usize, usize)>>
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.
Sourcepub fn mz_bounds_for_window_group_core(
&self,
window_group: u32,
) -> Option<(f32, f32)>
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).
Sourcepub fn make_rt_frames_for_group(
&self,
window_group: u32,
tof_step: i32,
) -> RtFrames
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.
Sourcepub fn make_rt_frames_for_precursor(&self, tof_step: i32) -> RtFrames
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.
Sourcepub fn tof_scale_for_group(&self, window_group: u32, tof_step: i32) -> TofScale
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.
Sourcepub fn tof_scale_from_frames_scan(
&self,
frame_ids: &[u32],
tof_step: i32,
) -> Option<TofScale>
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.
Sourcepub fn evaluate_specs_1d_threads(
&self,
rt_frames: &RtFrames,
specs: &[ClusterSpec1D],
opts: &Eval1DOpts,
num_threads: usize,
) -> Vec<ClusterResult1D>
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.
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>
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>
Sourcepub 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
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.
Sourcepub 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
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.
Sourcepub fn build_pseudo_spectra_all_pairs_from_clusters(
&self,
ms1: &[ClusterResult1D],
ms2: &[ClusterResult1D],
features: Option<&[SimpleFeature]>,
pseudo_opts: &PseudoSpecOpts,
) -> PseudoBuildResult
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
Sourcepub fn clusters_for_group_opts(
&self,
window_group: u32,
im_peaks: &[ImPeak1D],
opts: &ClusterExtractionOpts,
) -> Vec<ClusterResult1D>
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.
Sourcepub fn clusters_for_precursor_opts(
&self,
im_peaks: &[ImPeak1D],
opts: &ClusterExtractionOpts,
) -> Vec<ClusterResult1D>
pub fn clusters_for_precursor_opts( &self, im_peaks: &[ImPeak1D], opts: &ClusterExtractionOpts, ) -> Vec<ClusterResult1D>
Extract clusters for precursor (MS1) frames using options struct.
Sourcepub fn tof_rt_grid_precursor(&self, tof_step: i32) -> TofRtGrid
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).
Sourcepub fn tof_rt_grid_for_group(
&self,
window_group: u32,
tof_step: i32,
) -> TofRtGrid
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).
Sourcepub 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>
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 samems_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’swindow_group.tof_step: must be the same as used during clustering.max_points: optional thinning cap per cluster.num_threads: used forget_slicein the raw extractor.
Trait Implementations§
Source§impl IndexConverter for TimsDatasetDIA
impl IndexConverter for TimsDatasetDIA
fn tof_to_mz(&self, frame_id: u32, tof_values: &Vec<u32>) -> Vec<f64>
fn mz_to_tof(&self, frame_id: u32, mz_values: &Vec<f64>) -> Vec<u32>
fn scan_to_inverse_mobility( &self, frame_id: u32, scan_values: &Vec<u32>, ) -> Vec<f64>
fn inverse_mobility_to_scan( &self, frame_id: u32, inverse_mobility_values: &Vec<f64>, ) -> Vec<u32>
Source§impl TimsData for TimsDatasetDIA
impl TimsData for TimsDatasetDIA
fn get_frame(&self, frame_id: u32) -> TimsFrame
fn get_raw_frame(&self, frame_id: u32) -> RawTimsFrame
fn get_slice(&self, frame_ids: Vec<u32>, num_threads: usize) -> TimsSlice
fn get_acquisition_mode(&self) -> AcquisitionMode
fn get_frame_count(&self) -> i32
fn get_data_path(&self) -> &str
Auto Trait Implementations§
impl Freeze for TimsDatasetDIA
impl RefUnwindSafe for TimsDatasetDIA
impl Send for TimsDatasetDIA
impl Sync for TimsDatasetDIA
impl Unpin for TimsDatasetDIA
impl UnwindSafe for TimsDatasetDIA
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.