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:
@@ -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] {
|
||||
|
||||
Reference in New Issue
Block a user