Refactor MPHF layer logic and evidence handling
This commit implements core lookup functionality for MPHF layers, including `hash` and `find_strict` methods. It introduces support for different evidence types (Exact, Hybrid, Approximate) within layers, clarifying lookup behavior and improving partition calculation logic in the cache. Additionally, dead code is removed and dependencies are updated.
This commit is contained in:
1 parent
f9edefd135
commit
12afbe819c
10 files changed
+26
-794
No files matched your search
@@ -188,11 +188,6 @@ impl IndexCache {
|
||||
self.iter().flat_map(|l| l.iter_unitigs())
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn hash(&self, partition: usize, layer: usize, kmer: CanonicalKmer) -> Option<usize> {
|
||||
Some(self.get_layer(partition, layer)?.hash(kmer))
|
||||
}
|
||||
|
||||
pub fn n_kmer(&self, partition: usize, layer: usize) -> Option<usize> {
|
||||
Some(self.get_layer(partition, layer)?.n())
|
||||
}
|
||||
@@ -228,20 +223,6 @@ impl IndexCache {
|
||||
None
|
||||
}
|
||||
|
||||
/// Membership-checked lookup — routes `kmer` straight to its one
|
||||
/// possible partition (`CanonicalKmer::partition`, the same
|
||||
/// minimizer-hash rule every k-mer was scattered by when the index was
|
||||
/// built) instead of scanning every cached partition: a k-mer can only
|
||||
/// ever live in the partition it hashes to, so anywhere else is not
|
||||
/// worth even asking. Uses `self.index().n_partitions()` — the index's
|
||||
/// real total, not [`n_partition`](Self::n_partition) (this cache's own
|
||||
/// count, which can be a subset — see [`new`](Self::new)). `None` if
|
||||
/// that partition isn't cached or doesn't carry `kmer`.
|
||||
pub fn find(&self, kmer: CanonicalKmer) -> Option<(usize, usize, usize)> {
|
||||
let partition = kmer.partition(self.raw_index.n_partitions());
|
||||
self.find_in_partition(partition, kmer)
|
||||
}
|
||||
|
||||
/// Parallel map-reduce over every cached `KmerLayer` (across every
|
||||
/// cached partition), bounded to `max_concurrent` layers scanned at
|
||||
/// once — a cap on how many layers are actively being mapped
|
||||
|
||||
Reference in new issue
Block a user