Store minorant flag in family mask to avoid costly k-mer reconstruction
Transition the minorant flag from a derived value to a stored field within the family mask, resolving a performance regression where on-the-fly reconstruction consumed significant query time. This change introduces O(1) k-mer reconstruction APIs, shifts minorant computation to the index build phase, and enables direct annex-based statistics. Supporting updates include adopting shared ownership for partition caches and refactoring batch processing pipelines.
This commit is contained in:
@@ -157,6 +157,16 @@ impl UnitigFileReader {
|
||||
canonical_raw(self.raw_kmer(i, j), self.k) == query.raw()
|
||||
}
|
||||
|
||||
/// Canonical raw k-mer at position `j` of chunk `i` — [`raw_kmer`](Self::raw_kmer)
|
||||
/// reduced to its canonical (`min(raw, revcomp)`) form. The reconstruction
|
||||
/// half of [`verify_canonical_kmer`](Self::verify_canonical_kmer): that
|
||||
/// method computes the same value internally just to compare it away: use
|
||||
/// this one when the caller wants the k-mer itself, not a yes/no answer.
|
||||
#[inline]
|
||||
pub fn canonical_raw_kmer(&self, i: usize, j: usize) -> u64 {
|
||||
canonical_raw(self.raw_kmer(i, j), self.k)
|
||||
}
|
||||
|
||||
// ── Sequential iterators (O(n) running-offset cursor) ─────────────────────
|
||||
|
||||
pub(crate) fn iter_chunks_sequential(&self) -> impl Iterator<Item = (usize, Unitig)> + '_ {
|
||||
|
||||
Reference in New Issue
Block a user