pub struct TimsTofSyntheticsDataHandle {
pub connection: Connection,
}Fields§
§connection: ConnectionImplementations§
Source§impl TimsTofSyntheticsDataHandle
impl TimsTofSyntheticsDataHandle
pub fn new(path: &Path) -> Result<Self>
pub fn read_frames(&self) -> Result<Vec<FramesSim>>
pub fn read_scans(&self) -> Result<Vec<ScansSim>>
pub fn read_peptides(&self) -> Result<Vec<PeptidesSim>>
pub fn read_ions(&self) -> Result<Vec<IonSim>>
pub fn read_window_group_settings(&self) -> Result<Vec<WindowGroupSettingsSim>>
pub fn read_frame_to_window_group(&self) -> Result<Vec<FrameToWindowGroupSim>>
pub fn read_pasef_meta(&self) -> Result<Vec<PASEFMeta>>
Sourcepub fn read_peptides_for_frame_range(
&self,
frame_min: u32,
frame_max: u32,
) -> Result<Vec<PeptidesSim>>
pub fn read_peptides_for_frame_range( &self, frame_min: u32, frame_max: u32, ) -> Result<Vec<PeptidesSim>>
Read peptides that are present in the given frame range. A peptide is included if its frame range overlaps with [frame_min, frame_max].
Sourcepub fn read_ions_for_peptides(&self, peptide_ids: &[u32]) -> Result<Vec<IonSim>>
pub fn read_ions_for_peptides(&self, peptide_ids: &[u32]) -> Result<Vec<IonSim>>
Read ions for specific peptide IDs. Uses batched queries for efficiency with large peptide ID lists.
Sourcepub fn read_fragment_ions_for_peptides(
&self,
peptide_ids: &[u32],
) -> Result<Vec<FragmentIonSim>>
pub fn read_fragment_ions_for_peptides( &self, peptide_ids: &[u32], ) -> Result<Vec<FragmentIonSim>>
Read fragment ions for specific peptide IDs. Uses batched queries for efficiency with large peptide ID lists.
pub fn read_fragment_ions(&self) -> Result<Vec<FragmentIonSim>>
pub fn get_transmission_dia(&self) -> TimsTransmissionDIA
pub fn get_transmission_dda(&self) -> TimsTransmissionDDA
pub fn get_collision_energy_dia(&self) -> TimsTofCollisionEnergyDIA
pub fn get_transmitted_ions( &self, num_threads: usize, dda_mode: bool, ) -> (Vec<i32>, Vec<i32>, Vec<String>, Vec<i8>, Vec<f32>)
Sourcepub fn get_transmitted_ions_for_frame_range(
&self,
frame_min: u32,
frame_max: u32,
num_threads: usize,
dda_mode: bool,
) -> (Vec<i32>, Vec<i32>, Vec<String>, Vec<i8>, Vec<f32>)
pub fn get_transmitted_ions_for_frame_range( &self, frame_min: u32, frame_max: u32, num_threads: usize, dda_mode: bool, ) -> (Vec<i32>, Vec<i32>, Vec<String>, Vec<i8>, Vec<f32>)
Lazy version of get_transmitted_ions that only loads data for a specific frame range. This reduces memory usage by only loading peptides and ions that are relevant to the specified frame range instead of all data from the database.
§Arguments
frame_min- Minimum frame ID to include (inclusive)frame_max- Maximum frame ID to include (inclusive)num_threads- Number of threads to use for parallel processingdda_mode- If true, use DDA transmission; if false, use DIA transmission
§Returns
Tuple of (peptide_ids, ion_ids, sequences, charges, collision_energies) for transmitted ions
Sourcepub fn build_peptide_to_ion_map(
ions: &Vec<IonSim>,
) -> BTreeMap<u32, Vec<IonSim>>
pub fn build_peptide_to_ion_map( ions: &Vec<IonSim>, ) -> BTreeMap<u32, Vec<IonSim>>
Method to build a map from peptide id to ions
Sourcepub fn build_peptide_map(
peptides: &Vec<PeptidesSim>,
) -> BTreeMap<u32, PeptidesSim>
pub fn build_peptide_map( peptides: &Vec<PeptidesSim>, ) -> BTreeMap<u32, PeptidesSim>
Method to build a map from peptide id to events (absolute number of events in the simulation)
Sourcepub fn build_precursor_frame_id_set(frames: &Vec<FramesSim>) -> HashSet<u32>
pub fn build_precursor_frame_id_set(frames: &Vec<FramesSim>) -> HashSet<u32>
Method to build a set of precursor frame ids, can be used to check if a frame is a precursor frame
pub fn build_peptide_to_events( peptides: &Vec<PeptidesSim>, ) -> BTreeMap<u32, f32>
pub fn build_frame_to_rt(frames: &Vec<FramesSim>) -> BTreeMap<u32, f32>
pub fn build_scan_to_mobility(scans: &Vec<ScansSim>) -> BTreeMap<u32, f32>
pub fn build_frame_to_abundances( peptides: &Vec<PeptidesSim>, ) -> BTreeMap<u32, (Vec<u32>, Vec<f32>)>
pub fn build_peptide_to_ions( ions: &Vec<IonSim>, ) -> BTreeMap<u32, (Vec<f32>, Vec<Vec<u32>>, Vec<Vec<f32>>, Vec<i8>, Vec<MzSpectrum>)>
pub fn build_fragment_ions( peptides_sim: &BTreeMap<u32, PeptidesSim>, fragment_ions: &Vec<FragmentIonSim>, num_threads: usize, ) -> BTreeMap<(u32, i8, i32), (PeptideProductIonSeriesCollection, Vec<MzSpectrum>)>
pub fn build_fragment_ions_annotated( peptides_sim: &BTreeMap<u32, PeptidesSim>, fragment_ions: &Vec<FragmentIonSim>, num_threads: usize, ) -> BTreeMap<(u32, i8, i32), (PeptideProductIonSeriesCollection, Vec<MzSpectrumAnnotated>)>
Sourcepub fn build_fragment_ions_with_transmission_data(
peptides_sim: &BTreeMap<u32, PeptidesSim>,
fragment_ions: &Vec<FragmentIonSim>,
num_threads: usize,
) -> BTreeMap<(u32, i8, i32), FragmentIonsWithComplementary>
pub fn build_fragment_ions_with_transmission_data( peptides_sim: &BTreeMap<u32, PeptidesSim>, fragment_ions: &Vec<FragmentIonSim>, num_threads: usize, ) -> BTreeMap<(u32, i8, i32), FragmentIonsWithComplementary>
Build fragment ions with complementary isotope distribution data.
This variant calculates both the fragment isotope distribution and the complementary fragment isotope distribution, which are needed for quad-selection dependent isotope transmission calculations.
§Arguments
peptides_sim- Map of peptide_id to PeptidesSimfragment_ions- Vector of FragmentIonSimnum_threads- Number of threads for parallel processing
§Returns
BTreeMapmapping (peptide_id, charge, collision_energy) to (PeptideProductIonSeriesCollection, fragment spectra, fragment distributions, complementary distributions) Build fragment ions with transmission data for both precursor scaling and per-fragment modes.
This function calculates:
- Precursor isotope distribution (for PrecursorScaling mode)
- Per-fragment isotope distributions with their complementary distributions (for PerFragment mode)
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for TimsTofSyntheticsDataHandle
impl !RefUnwindSafe for TimsTofSyntheticsDataHandle
impl Send for TimsTofSyntheticsDataHandle
impl !Sync for TimsTofSyntheticsDataHandle
impl Unpin for TimsTofSyntheticsDataHandle
impl !UnwindSafe for TimsTofSyntheticsDataHandle
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.