Skip to main content

TimsDataLoader

Enum TimsDataLoader 

Source
pub enum TimsDataLoader {
    InMemory(TimsInMemoryLoader),
    Lazy(TimsLazyLoder),
}

Variants§

Implementations§

Source§

impl TimsDataLoader

Source

pub fn new_lazy( bruker_lib_path: &str, data_path: &str, use_bruker_sdk: bool, scan_max_index: u32, im_lower: f64, im_upper: f64, tof_max_index: u32, mz_lower: f64, mz_upper: f64, ) -> Self

Source

pub fn new_in_memory( bruker_lib_path: &str, data_path: &str, use_bruker_sdk: bool, scan_max_index: u32, im_lower: f64, im_upper: f64, tof_max_index: u32, mz_lower: f64, mz_upper: f64, ) -> Self

Source

pub fn new_lazy_with_calibration( data_path: &str, bruker_lib_path: &str, tof_max_index: u32, mz_lower: f64, mz_upper: f64, im_lookup: Vec<f64>, ) -> Self

Create a lazy loader with pre-computed ion mobility calibration lookup table.

This method enables accurate ion mobility calibration with fast parallel extraction. The im_lookup table should be pre-computed using the Bruker SDK.

§Arguments
  • data_path - Path to the .d folder
  • bruker_lib_path - Path to the Bruker SDK shared library; used to derive an accurate m/z calibration. Pass “NO_SDK” (or an empty string) to skip and use the 2-point boundary m/z model.
  • tof_max_index - Maximum TOF index (from GlobalMetaData)
  • mz_lower - Minimum m/z value (from GlobalMetaData)
  • mz_upper - Maximum m/z value (from GlobalMetaData)
  • im_lookup - Pre-computed scan→1/K0 lookup table
§Returns

A new TimsDataLoader with LookupIndexConverter

Source

pub fn new_in_memory_with_calibration( data_path: &str, bruker_lib_path: &str, tof_max_index: u32, mz_lower: f64, mz_upper: f64, im_lookup: Vec<f64>, ) -> Self

Create an in-memory loader with pre-computed ion mobility calibration lookup table.

This method enables accurate ion mobility calibration with fast parallel extraction. The im_lookup table should be pre-computed using the Bruker SDK.

§Arguments
  • data_path - Path to the .d folder
  • bruker_lib_path - Path to the Bruker SDK shared library; used to derive an accurate m/z calibration. Pass “NO_SDK” (or an empty string) to skip and use the 2-point boundary m/z model.
  • tof_max_index - Maximum TOF index (from GlobalMetaData)
  • mz_lower - Minimum m/z value (from GlobalMetaData)
  • mz_upper - Maximum m/z value (from GlobalMetaData)
  • im_lookup - Pre-computed scan→1/K0 lookup table
§Returns

A new TimsDataLoader with LookupIndexConverter

Source

pub fn new_lazy_with_bruker_formula( data_path: &str, calibration_frame_id: u32, ) -> Self

Create a lazy loader using the exact SDK-free Bruker calibration formulas.

Builds a BrukerFormulaConverter from the MzCalibration / TimsCalibration tables (frame calibration_frame_id, default 1 — the coefficients are near-constant per run). Needs no Bruker SDK at build or runtime; 1/K0 is machine-exact and m/z is bit-exact for MzCalibration ModelType 1 (~1 ppm for ModelType 2).

Source

pub fn new_in_memory_with_bruker_formula( data_path: &str, calibration_frame_id: u32, ) -> Self

In-memory counterpart of Self::new_lazy_with_bruker_formula.

Source

pub fn new_lazy_with_mz_calibration( data_path: &str, tof_intercept: f64, tof_slope: f64, im_min: f64, im_max: f64, scan_max_index: u32, ) -> Self

Create a lazy loader with full calibration (both m/z and IM).

This method uses regression-derived m/z calibration coefficients instead of the simple boundary model, providing more accurate m/z conversion.

§Arguments
  • data_path - Path to the .d folder
  • tof_intercept - Intercept for sqrt(mz) = intercept + slope * tof
  • tof_slope - Slope for sqrt(mz) = intercept + slope * tof
  • im_min - Minimum 1/K0 value
  • im_max - Maximum 1/K0 value
  • scan_max_index - Maximum scan index
Source

pub fn new_in_memory_with_mz_calibration( data_path: &str, tof_intercept: f64, tof_slope: f64, im_min: f64, im_max: f64, scan_max_index: u32, ) -> Self

Create an in-memory loader with full calibration (both m/z and IM).

This method uses regression-derived m/z calibration coefficients instead of the simple boundary model, providing more accurate m/z conversion.

Source

pub fn get_index_converter(&self) -> &dyn IndexConverter

Source

pub fn get_frame_with_converter( &self, frame_id: u32, conv: &dyn IndexConverter, ) -> TimsFrame

get_frame with an explicit index converter (see TimsLazyLoder::get_frame_with_converter).

Source

pub fn raw_data_path(&self) -> &str

Path of the .d folder this loader reads from.

Source

pub fn sync_index_converter(&self) -> Option<&(dyn IndexConverter + Sync)>

The loader’s own index converter, if it is safe to use from several threads — i.e. everything except the Bruker SDK wrapper, whose tims_index_to_mz must not be called concurrently on one handle.

Source

pub fn sdk_free_converter(&self) -> Option<TimsIndexConverter>

A converter that is safe to use from many threads at once, for readers that want to run in parallel while the dataset itself was opened with the Bruker SDK.

Returns None when the loader’s own converter is already thread-safe (anything but BrukerLib), or when the file carries no calibration tables the SDK-free BrukerFormulaConverter could evaluate — callers must then serialise their reads.

Source

pub fn uses_bruker_sdk(&self) -> bool

Check if the Bruker SDK is being used for index conversion. The Bruker SDK is NOT thread-safe, so parallel operations that call the index converter must be disabled when using the SDK.

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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