pub struct TimsTofLazyFrameBuilderDDA {
pub db_path: String,
pub frames: Vec<FramesSim>,
pub scans: Vec<ScansSim>,
pub precursor_frame_id_set: HashSet<u32>,
pub frame_to_rt: BTreeMap<u32, f32>,
pub scan_to_mobility: BTreeMap<u32, f32>,
pub transmission_settings: TimsTransmissionDDA,
pub num_threads: usize,
}Expand description
A lazy frame builder for DDA experiments that only loads data as needed.
Unlike TimsTofSyntheticsFrameBuilderDDA, this struct does not load all peptides,
ions, and fragment ions into memory at construction time. Instead, it stores only
the static metadata (frame info, scan info, transmission settings) and loads
peptide/ion data on-demand for each batch of frames being built.
This can significantly reduce memory usage for large simulations.
Fields§
§db_path: StringPath to the SQLite database
frames: Vec<FramesSim>Frame metadata (id, time, ms_type)
scans: Vec<ScansSim>Scan metadata (scan_id, mobility)
precursor_frame_id_set: HashSet<u32>Set of precursor frame IDs for quick lookup
frame_to_rt: BTreeMap<u32, f32>Map from frame_id to retention_time
scan_to_mobility: BTreeMap<u32, f32>Map from scan_id to mobility
transmission_settings: TimsTransmissionDDADDA transmission settings (includes PASEF metadata with collision energies)
num_threads: usizeNumber of threads for parallel processing
Implementations§
Source§impl TimsTofLazyFrameBuilderDDA
impl TimsTofLazyFrameBuilderDDA
Sourcepub fn new(path: &Path, num_threads: usize) -> Result<Self>
pub fn new(path: &Path, num_threads: usize) -> Result<Self>
Create a new lazy frame builder for DDA.
Only loads static metadata (frames, scans, transmission settings). Peptides, ions, and fragment ions are NOT loaded here.
§Arguments
path- Path to the SQLite databasenum_threads- Number of threads for parallel operations
§Returns
Result containing the lazy frame builder
Sourcepub fn build_frames_lazy(
&self,
frame_ids: Vec<u32>,
fragmentation: bool,
mz_noise_precursor: bool,
uniform: bool,
precursor_noise_ppm: f64,
mz_noise_fragment: bool,
fragment_noise_ppm: f64,
right_drag: bool,
) -> Vec<TimsFrame>
pub fn build_frames_lazy( &self, frame_ids: Vec<u32>, fragmentation: bool, mz_noise_precursor: bool, uniform: bool, precursor_noise_ppm: f64, mz_noise_fragment: bool, fragment_noise_ppm: f64, right_drag: bool, ) -> Vec<TimsFrame>
Build frames for a range of frame IDs.
This method loads only the data needed for the specified frames, builds the frames, and then releases the loaded data.
§Arguments
frame_ids- Vector of frame IDs to buildfragmentation- Whether to include fragmentationmz_noise_precursor- Whether to add m/z noise to precursor ionsuniform- Whether to use uniform noise distributionprecursor_noise_ppm- Precursor noise in ppmmz_noise_fragment- Whether to add m/z noise to fragment ionsfragment_noise_ppm- Fragment noise in ppmright_drag- Whether to use right drag for noise
§Returns
Vector of built TimsFrame instances
Sourcepub fn get_collision_energy(&self, frame_id: i32, scan_id: i32) -> f64
pub fn get_collision_energy(&self, frame_id: i32, scan_id: i32) -> f64
Get collision energy for a frame/scan combination from PASEF metadata.
Sourcepub fn num_frames(&self) -> usize
pub fn num_frames(&self) -> usize
Get the total number of frames.
Sourcepub fn precursor_frame_ids(&self) -> Vec<u32>
pub fn precursor_frame_ids(&self) -> Vec<u32>
Get precursor frame IDs.
Sourcepub fn fragment_frame_ids(&self) -> Vec<u32>
pub fn fragment_frame_ids(&self) -> Vec<u32>
Get fragment frame IDs.
Auto Trait Implementations§
impl Freeze for TimsTofLazyFrameBuilderDDA
impl RefUnwindSafe for TimsTofLazyFrameBuilderDDA
impl Send for TimsTofLazyFrameBuilderDDA
impl Sync for TimsTofLazyFrameBuilderDDA
impl Unpin for TimsTofLazyFrameBuilderDDA
impl UnwindSafe for TimsTofLazyFrameBuilderDDA
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.