pub struct FracMinHash { /* private fields */ }Expand description
Scaled (FracMinHash) sketch for rapid genome comparison.
Keeps all canonical k-mer hash values below u64::MAX / scale. This gives
a predictable sampling fraction regardless of genome size, making containment
estimation more accurate for genomes of different sizes.
Implementations§
Source§impl FracMinHash
impl FracMinHash
Sourcepub fn add_sequence(&mut self, seq: &[u8])
pub fn add_sequence(&mut self, seq: &[u8])
Add k-mers from a DNA sequence to this sketch.
Non-ACGT bases act as k-mer break points.
Sourcepub fn jaccard(&self, other: &FracMinHash) -> Result<f64>
pub fn jaccard(&self, other: &FracMinHash) -> Result<f64>
Estimate Jaccard similarity between this sketch and another.
Jaccard = |A intersect B| / |A union B|, computed exactly over the hashes below the shared threshold.
§Errors
Returns an error if the sketches have different k or scale values.
Sourcepub fn containment(&self, other: &FracMinHash) -> Result<f64>
pub fn containment(&self, other: &FracMinHash) -> Result<f64>
Estimate containment of self in other.
Containment C(A, B) = |A intersect B| / |A|.
§Errors
Returns an error if the sketches have different k or scale values.
Trait Implementations§
Source§impl Clone for FracMinHash
impl Clone for FracMinHash
Source§fn clone(&self) -> FracMinHash
fn clone(&self) -> FracMinHash
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for FracMinHash
impl RefUnwindSafe for FracMinHash
impl Send for FracMinHash
impl Sync for FracMinHash
impl Unpin for FracMinHash
impl UnsafeUnpin for FracMinHash
impl UnwindSafe for FracMinHash
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