pub struct TimsTofLazyFrameBuilderDIA {
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: TimsTransmissionDIA,
pub fragmentation_settings: TimsTofCollisionEnergyDIA,
pub num_threads: usize,
}Expand description
A lazy frame builder for DIA experiments that only loads data as needed.
Unlike TimsTofSyntheticsFrameBuilderDIA, 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: TimsTransmissionDIADIA transmission settings
fragmentation_settings: TimsTofCollisionEnergyDIADIA fragmentation/collision energy settings
num_threads: usizeNumber of threads for parallel processing
Implementations§
Source§impl TimsTofLazyFrameBuilderDIA
impl TimsTofLazyFrameBuilderDIA
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.
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 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.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TimsTofLazyFrameBuilderDIA
impl RefUnwindSafe for TimsTofLazyFrameBuilderDIA
impl Send for TimsTofLazyFrameBuilderDIA
impl Sync for TimsTofLazyFrameBuilderDIA
impl Unpin for TimsTofLazyFrameBuilderDIA
impl UnwindSafe for TimsTofLazyFrameBuilderDIA
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.