refactor: improve de Bruijn graph traversal and longtig generation

- Refactored Node representation using compact bitfields for neighbor counts
  and nucleotides; added count_neighbors helper to compute_degrees()
- Introduced StartIter iterator for unitig/longtigu generation with revised
  traversal semantics (e.g., interior node marking)
- Added nucleotide() accessor to Kmer type for 2-bit extraction at position i
- Renamed unitig.rs → longtigs, updated CLI command and output filenames to reflect "long t ig"
- Extended extract_kmers() in scripts/compare.py with duplication statistics
```
This commit is contained in:
Eric Coissac
2026-05-01 23:05:21 +02:00
parent 35840b9d73
commit 86e9cb7026
7 changed files with 669 additions and 107 deletions
+6
View File
@@ -234,6 +234,12 @@ impl CanonicalKmer {
mix64(self.0.0)
}
/// Extract nucleotide i (0-based from 5 end) as a 2-bit value.
#[inline]
pub fn nucleotide(&self, i: usize) -> u8 {
self.0.nucleotide(i)
}
/// Return the four left canonical neighbours (each already canonical).
/// Zero allocation — result lives on the stack.
pub fn left_canonical_neighbors(&self, k: usize) -> [CanonicalKmer; 4] {