TimsTofLazyFrameBuilderDIA

Struct TimsTofLazyFrameBuilderDIA 

Source
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: String

Path 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: TimsTransmissionDIA

DIA transmission settings

§fragmentation_settings: TimsTofCollisionEnergyDIA

DIA fragmentation/collision energy settings

§num_threads: usize

Number of threads for parallel processing

Implementations§

Source§

impl TimsTofLazyFrameBuilderDIA

Source

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 database
  • num_threads - Number of threads for parallel operations
§Returns

Result containing the lazy frame builder

Source

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 build
  • fragmentation - Whether to include fragmentation
  • mz_noise_precursor - Whether to add m/z noise to precursor ions
  • uniform - Whether to use uniform noise distribution
  • precursor_noise_ppm - Precursor noise in ppm
  • mz_noise_fragment - Whether to add m/z noise to fragment ions
  • fragment_noise_ppm - Fragment noise in ppm
  • right_drag - Whether to use right drag for noise
§Returns

Vector of built TimsFrame instances

Source

pub fn num_frames(&self) -> usize

Get the total number of frames.

Source

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

Get all frame IDs.

Source

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

Get precursor frame IDs.

Source

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

Get fragment frame IDs.

Trait Implementations§

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