pub struct MinimizerIterator { /* private fields */ }Expand description
Iterator that extracts minimizers from k-mers using the “re-scan” method
This is an efficient minimizer extraction algorithm that:
- Rescans the window when the minimum falls out
- Performs single comparisons for sliding updates
- Tracks the position of the minimum within the k-mer window
§Example
use sshash_lib::kmer::Kmer;
use sshash_lib::minimizer::MinimizerIterator;
// Create iterator for k-mer size 31, minimizer size 13
let mut iter = MinimizerIterator::new(31, 13, 0);
// Process a k-mer and extract minimizer
let kmer: Kmer<31> = Kmer::from_str("ACGTACGTACGTACGTACGTACGTACGTACG").unwrap();
let mini = iter.next(kmer);
println!("Minimizer at position {} in k-mer, global position {}",
mini.pos_in_kmer, mini.position);Implementations§
Source§impl MinimizerIterator
impl MinimizerIterator
Sourcepub fn with_seed(k: usize, m: usize, seed: u64) -> Self
pub fn with_seed(k: usize, m: usize, seed: u64) -> Self
Create a new minimizer iterator with a seeded hasher
§Arguments
k- k-mer size (must be >= m)m- minimizer size (must be <= k)seed- seed for the hash function (for deterministic results)
Sourcepub fn new(k: usize, m: usize, _position: u64) -> Self
pub fn new(k: usize, m: usize, _position: u64) -> Self
Create a new minimizer iterator (defaults to seed=1)
§Arguments
k- k-mer size (must be >= m)m- minimizer size (must be <= k)_position- (deprecated parameter for API compatibility)
Sourcepub fn set_position(&mut self, position: u64)
pub fn set_position(&mut self, position: u64)
Set a new starting position
Auto Trait Implementations§
impl Freeze for MinimizerIterator
impl RefUnwindSafe for MinimizerIterator
impl Send for MinimizerIterator
impl Sync for MinimizerIterator
impl Unpin for MinimizerIterator
impl UnsafeUnpin for MinimizerIterator
impl UnwindSafe for MinimizerIterator
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, U> CastableInto<U> for Twhere
U: CastableFrom<T>,
impl<T, U> CastableInto<U> for Twhere
U: CastableFrom<T>,
Source§impl<T> DowncastableFrom<T> for T
impl<T> DowncastableFrom<T> for T
Source§fn downcast_from(value: T) -> T
fn downcast_from(value: T) -> T
Truncate the current UnsignedInt to a possibly smaller size
Source§impl<T, U> DowncastableInto<U> for Twhere
U: DowncastableFrom<T>,
impl<T, U> DowncastableInto<U> for Twhere
U: DowncastableFrom<T>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> UpcastableFrom<T> for T
impl<T> UpcastableFrom<T> for T
Source§fn upcast_from(value: T) -> T
fn upcast_from(value: T) -> T
Extend the current UnsignedInt to a possibly bigger size.