pub struct FragmentIndex { /* private fields */ }Implementations§
Source§impl FragmentIndex
impl FragmentIndex
pub fn ms2_slice(&self) -> &[ClusterResult1D]
pub fn get_ms2_by_index(&self, idx: usize) -> Option<&ClusterResult1D>
pub fn get_ms2_by_cluster_id(&self, cid: u64) -> Option<&ClusterResult1D>
Sourcepub fn metadata(&self) -> FragmentMetadata
pub fn metadata(&self) -> FragmentMetadata
Get pre-computed MS2 metadata.
Sourcepub fn storage(&self) -> FragmentStorage
pub fn storage(&self) -> FragmentStorage
Get storage wrapper for cluster access.
Sourcepub fn group_index(&self, group: u32) -> Option<&FragmentGroupIndex>
pub fn group_index(&self, group: u32) -> Option<&FragmentGroupIndex>
Get group index for a specific window group.
Sourcepub fn count_valid(&self) -> usize
pub fn count_valid(&self) -> usize
Count valid (kept) MS2 clusters.
pub fn from_parquet_file( dia_index: Arc<DiaIndex>, parquet_path: impl AsRef<Path>, opts: &CandidateOpts, ) -> Result<Self>
Sourcepub fn from_parquet_dir(
dia_index: Arc<DiaIndex>,
dir: impl AsRef<Path>,
opts: &CandidateOpts,
) -> Result<Self>
pub fn from_parquet_dir( dia_index: Arc<DiaIndex>, dir: impl AsRef<Path>, opts: &CandidateOpts, ) -> Result<Self>
Your requested builder: read all .parquet files in a directory and merge.
Sourcepub fn from_slice(
dia_index: Arc<DiaIndex>,
ms2: &[ClusterResult1D],
opts: &CandidateOpts,
) -> Self
pub fn from_slice( dia_index: Arc<DiaIndex>, ms2: &[ClusterResult1D], opts: &CandidateOpts, ) -> Self
Backwards-compatible: build from a borrowed slice (one copy into Arc).
Sourcepub fn from_owned(
dia_index: Arc<DiaIndex>,
ms2: Vec<ClusterResult1D>,
opts: &CandidateOpts,
) -> Self
pub fn from_owned( dia_index: Arc<DiaIndex>, ms2: Vec<ClusterResult1D>, opts: &CandidateOpts, ) -> Self
Preferred: build from an owned Vec.
pub fn query_precursor( &self, prec: &ClusterResult1D, groups: Option<&[u32]>, opts: &FragmentQueryOpts, ) -> Vec<u64>
Sourcepub fn query_precursors_par(
&self,
precursors: &[ClusterResult1D],
opts: &FragmentQueryOpts,
num_threads: usize,
) -> Vec<Vec<u64>>
pub fn query_precursors_par( &self, precursors: &[ClusterResult1D], opts: &FragmentQueryOpts, num_threads: usize, ) -> Vec<Vec<u64>>
Parallel batch query: for each precursor, return a Vec of MS2 cluster_ids.
Sourcepub fn enumerate_candidates_for_precursor_thin(
&self,
prec: &ThinPrecursor,
window_groups: Option<&[u32]>,
opts: &FragmentQueryOpts,
) -> Vec<usize>
pub fn enumerate_candidates_for_precursor_thin( &self, prec: &ThinPrecursor, window_groups: Option<&[u32]>, opts: &FragmentQueryOpts, ) -> Vec<usize>
Enumerate candidate MS2 indices for a thin precursor.
Returns indices into self.ms2.
Sourcepub fn enumerate_candidates_for_feature(
&self,
feat: &SimpleFeature,
opts: &FragmentQueryOpts,
) -> Vec<usize>
pub fn enumerate_candidates_for_feature( &self, feat: &SimpleFeature, opts: &FragmentQueryOpts, ) -> Vec<usize>
Enumerate candidate MS2 indices for a given SimpleFeature.
Uses the representative member cluster (highest raw_sum) of the feature and reuses the standard precursor enumeration logic.
Returns indices into self.ms2.
pub fn query_precursor_scored( &self, prec: &ClusterResult1D, window_groups: Option<&[u32]>, opts: &FragmentQueryOpts, mode: MatchScoreMode, geom_opts: &ScoreOpts, xic_opts: &XicScoreOpts, min_score: f32, ) -> Vec<ScoredHit>
pub fn query_precursors_scored_par( &self, precs: &[ClusterResult1D], opts: &FragmentQueryOpts, mode: MatchScoreMode, geom_opts: &ScoreOpts, xic_opts: &XicScoreOpts, min_score: f32, ) -> Vec<Vec<ScoredHit>>
Sourcepub fn query_feature_scored(
&self,
feat: &SimpleFeature,
opts: &FragmentQueryOpts,
mode: MatchScoreMode,
geom_opts: &ScoreOpts,
xic_opts: &XicScoreOpts,
min_score: f32,
) -> Vec<ScoredHit>
pub fn query_feature_scored( &self, feat: &SimpleFeature, opts: &FragmentQueryOpts, mode: MatchScoreMode, geom_opts: &ScoreOpts, xic_opts: &XicScoreOpts, min_score: f32, ) -> Vec<ScoredHit>
Score a single SimpleFeature precursor against all physically plausible fragment candidates, as determined internally by the FragmentIndex.
This is the feature twin of query_precursor_scored, but it does not
require the caller to pass window groups or candidate indices.
Sourcepub fn query_features_scored_par(
&self,
feats: &[SimpleFeature],
opts: &FragmentQueryOpts,
mode: MatchScoreMode,
geom_opts: &ScoreOpts,
xic_opts: &XicScoreOpts,
min_score: f32,
) -> Vec<Vec<ScoredHit>>
pub fn query_features_scored_par( &self, feats: &[SimpleFeature], opts: &FragmentQueryOpts, mode: MatchScoreMode, geom_opts: &ScoreOpts, xic_opts: &XicScoreOpts, min_score: f32, ) -> Vec<Vec<ScoredHit>>
Parallel scoring for many SimpleFeatures.
- Candidate enumeration is done inside the index.
feats[i]is scored against the MS2 candidates inferred for feat i.
Sourcepub fn make_thin_precursor(
&self,
prec: &ClusterResult1D,
) -> Option<ThinPrecursor>
pub fn make_thin_precursor( &self, prec: &ClusterResult1D, ) -> Option<ThinPrecursor>
Build a thin precursor representation used for candidate enumeration.
This folds all the “how do we get RT apex / m/z apex / IM apex?” logic into one place and drops everything else (raw points, axes, …).
Trait Implementations§
Source§impl Clone for FragmentIndex
impl Clone for FragmentIndex
Source§fn clone(&self) -> FragmentIndex
fn clone(&self) -> FragmentIndex
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for FragmentIndex
impl RefUnwindSafe for FragmentIndex
impl Send for FragmentIndex
impl Sync for FragmentIndex
impl Unpin for FragmentIndex
impl UnwindSafe for FragmentIndex
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.