pub struct AlignIndex<const STEPS: u16, Source> { /* private fields */ }Expand description
An alignment index to store a collection of sequences to do alignment against with one or more other sequences. This improves performance because it can cache some intermediate results.
Implementations§
Source§impl<const STEPS: u16, Source: HasPeptidoform<SimpleLinear> + Clone> AlignIndex<STEPS, Source>
impl<const STEPS: u16, Source: HasPeptidoform<SimpleLinear> + Clone> AlignIndex<STEPS, Source>
Sourcepub fn new(sequences: impl IntoIterator<Item = Source>, mode: MassMode) -> Self
pub fn new(sequences: impl IntoIterator<Item = Source>, mode: MassMode) -> Self
Create a new index for alignments
Sourcepub fn align_one<'a, Other: HasPeptidoform<SimpleLinear> + Clone + 'a>(
&'a self,
other: Other,
scoring: AlignScoring<'a>,
align_type: AlignType,
) -> impl ExactSizeIterator<Item = Alignment<Source, Other>>
pub fn align_one<'a, Other: HasPeptidoform<SimpleLinear> + Clone + 'a>( &'a self, other: Other, scoring: AlignScoring<'a>, align_type: AlignType, ) -> impl ExactSizeIterator<Item = Alignment<Source, Other>>
Align a single peptidoform to the index
Sourcepub fn align_one_filtered<'a, Other: HasPeptidoform<SimpleLinear> + Clone + 'a>(
&'a self,
other: Other,
filter: impl Fn(&Source) -> bool + 'a,
scoring: AlignScoring<'a>,
align_type: AlignType,
) -> impl Iterator<Item = Alignment<Source, Other>>
pub fn align_one_filtered<'a, Other: HasPeptidoform<SimpleLinear> + Clone + 'a>( &'a self, other: Other, filter: impl Fn(&Source) -> bool + 'a, scoring: AlignScoring<'a>, align_type: AlignType, ) -> impl Iterator<Item = Alignment<Source, Other>>
Align a single peptidoform to the index but only for the source sequences that match the given filter.
Sourcepub fn align<'a, Other: HasPeptidoform<SimpleLinear> + Clone + 'a>(
&'a self,
others: impl IntoIterator<Item = Other>,
scoring: AlignScoring<'a>,
align_type: AlignType,
) -> impl Iterator<Item = impl ExactSizeIterator<Item = Alignment<Source, Other>>>
pub fn align<'a, Other: HasPeptidoform<SimpleLinear> + Clone + 'a>( &'a self, others: impl IntoIterator<Item = Other>, scoring: AlignScoring<'a>, align_type: AlignType, ) -> impl Iterator<Item = impl ExactSizeIterator<Item = Alignment<Source, Other>>>
Align multiple peptides to this index
Source§impl<const STEPS: u16, Source: HasPeptidoform<SimpleLinear> + Clone + Sync + Send> AlignIndex<STEPS, Source>
impl<const STEPS: u16, Source: HasPeptidoform<SimpleLinear> + Clone + Sync + Send> AlignIndex<STEPS, Source>
Sourcepub fn par_align_one<'a, Other: HasPeptidoform<SimpleLinear> + Clone + 'a + Send + Sync>(
&'a self,
other: Other,
scoring: AlignScoring<'a>,
align_type: AlignType,
) -> impl ParallelIterator<Item = Alignment<Source, Other>>
pub fn par_align_one<'a, Other: HasPeptidoform<SimpleLinear> + Clone + 'a + Send + Sync>( &'a self, other: Other, scoring: AlignScoring<'a>, align_type: AlignType, ) -> impl ParallelIterator<Item = Alignment<Source, Other>>
Align a single peptidoform to the index in parallel
Sourcepub fn par_align_one_filtered<'a, Other: HasPeptidoform<SimpleLinear> + Clone + 'a + Send + Sync>(
&'a self,
other: Other,
filter: impl Fn(&Source) -> bool + Sync + Send + 'a,
scoring: AlignScoring<'a>,
align_type: AlignType,
) -> impl ParallelIterator<Item = Alignment<Source, Other>>
pub fn par_align_one_filtered<'a, Other: HasPeptidoform<SimpleLinear> + Clone + 'a + Send + Sync>( &'a self, other: Other, filter: impl Fn(&Source) -> bool + Sync + Send + 'a, scoring: AlignScoring<'a>, align_type: AlignType, ) -> impl ParallelIterator<Item = Alignment<Source, Other>>
Align a single peptidoform to the index in parallel but only for the source sequences that match the given filter.
Source§impl<const STEPS: u16, Source: HasPeptidoform<SimpleLinear> + Clone + Sync> AlignIndex<STEPS, Source>
impl<const STEPS: u16, Source: HasPeptidoform<SimpleLinear> + Clone + Sync> AlignIndex<STEPS, Source>
Sourcepub fn par_align<'a, Other: HasPeptidoform<SimpleLinear> + Clone + 'a + Sync + Send>(
&'a self,
others: impl IntoParallelIterator<Item = Other>,
scoring: AlignScoring<'a>,
align_type: AlignType,
) -> impl ParallelIterator<Item = impl ExactSizeIterator<Item = Alignment<Source, Other>>>
pub fn par_align<'a, Other: HasPeptidoform<SimpleLinear> + Clone + 'a + Sync + Send>( &'a self, others: impl IntoParallelIterator<Item = Other>, scoring: AlignScoring<'a>, align_type: AlignType, ) -> impl ParallelIterator<Item = impl ExactSizeIterator<Item = Alignment<Source, Other>>>
Align multiple peptides to this index in parallel
Trait Implementations§
Auto Trait Implementations§
impl<const STEPS: u16, Source> Freeze for AlignIndex<STEPS, Source>
impl<const STEPS: u16, Source> !RefUnwindSafe for AlignIndex<STEPS, Source>
impl<const STEPS: u16, Source> Send for AlignIndex<STEPS, Source>where
Source: Send,
impl<const STEPS: u16, Source> Sync for AlignIndex<STEPS, Source>where
Source: Sync,
impl<const STEPS: u16, Source> Unpin for AlignIndex<STEPS, Source>where
Source: Unpin,
impl<const STEPS: u16, Source> !UnwindSafe for AlignIndex<STEPS, Source>
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
Mutably borrows from an owned value. Read more
Source§impl<T> HighestOf<T> for T
impl<T> HighestOf<T> for T
Source§type HighestLevel = T
type HighestLevel = T
This is the highest complexity level out of Self and the type parameter
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>
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 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>
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