Struct bio::pattern_matching::myers::Myers
source · Expand description
Myers algorithm.
Implementations
sourceimpl<T: BitVec> Myers<T>
impl<T: BitVec> Myers<T>
sourcepub fn new<'a, C, P>(pattern: P) -> Selfwhere
C: Borrow<u8>,
P: IntoIterator<Item = C>,
P::IntoIter: ExactSizeIterator,
pub fn new<'a, C, P>(pattern: P) -> Selfwhere
C: Borrow<u8>,
P: IntoIterator<Item = C>,
P::IntoIter: ExactSizeIterator,
Create a new instance of Myers algorithm for a given pattern.
sourcepub fn distance<C, I>(&self, text: I) -> T::DistTypewhere
C: Borrow<u8>,
I: IntoIterator<Item = C>,
pub fn distance<C, I>(&self, text: I) -> T::DistTypewhere
C: Borrow<u8>,
I: IntoIterator<Item = C>,
Calculate the global distance of the pattern to the given text.
sourcepub fn find_all_end<C, I>(
&self,
text: I,
max_dist: T::DistType
) -> Matches<'_, T, C, I::IntoIter> ⓘwhere
C: Borrow<u8>,
I: IntoIterator<Item = C>,
pub fn find_all_end<C, I>(
&self,
text: I,
max_dist: T::DistType
) -> Matches<'_, T, C, I::IntoIter> ⓘwhere
C: Borrow<u8>,
I: IntoIterator<Item = C>,
Finds all matches of pattern in the given text up to a given maximum distance. Matches are returned as an iterator over pairs of end position and distance.
sourcepub fn find_best_end<C, I>(&self, text: I) -> (usize, T::DistType)where
C: Borrow<u8>,
I: IntoIterator<Item = C>,
pub fn find_best_end<C, I>(&self, text: I) -> (usize, T::DistType)where
C: Borrow<u8>,
I: IntoIterator<Item = C>,
Find the best match of the pattern in the given text. if multiple end positions have the same distance, the first is returned.
sourcepub fn find_all<'a, C, I>(
&'a mut self,
text: I,
max_dist: T::DistType
) -> FullMatches<'a, T, C, I::IntoIter> ⓘwhere
C: Borrow<u8>,
I: IntoIterator<Item = C>,
I::IntoIter: ExactSizeIterator,
pub fn find_all<'a, C, I>(
&'a mut self,
text: I,
max_dist: T::DistType
) -> FullMatches<'a, T, C, I::IntoIter> ⓘwhere
C: Borrow<u8>,
I: IntoIterator<Item = C>,
I::IntoIter: ExactSizeIterator,
Finds all matches of pattern in the given text up to a given maximum distance.
In contrast to find_all_end
, matches are returned as an iterator over ranges
of (start, end, distance)
. Note that the end coordinate is not included in the
range and thus and thus greater by one compared to the end index returned by
find_all_end()
.
sourcepub fn find_all_lazy<'a, C, I>(
&'a mut self,
text: I,
max_dist: T::DistType
) -> LazyMatches<'a, T, C, I::IntoIter> ⓘwhere
C: Borrow<u8>,
I: IntoIterator<Item = C>,
I::IntoIter: ExactSizeIterator,
pub fn find_all_lazy<'a, C, I>(
&'a mut self,
text: I,
max_dist: T::DistType
) -> LazyMatches<'a, T, C, I::IntoIter> ⓘwhere
C: Borrow<u8>,
I: IntoIterator<Item = C>,
I::IntoIter: ExactSizeIterator,
As find_all_end
, this function returns an iterator over tuples of (end, distance)
.
Additionally, it keeps the data necessary for later obtaining the starting positions and/or
the alignment path at any position that was already searched.