Push pvqkqxlkkwry #17
@@ -116,20 +116,14 @@ fn kmers_from_unitigs(unitigs: &[Unitig]) -> Vec<CanonicalKmer> {
|
||||
|
||||
#[test]
|
||||
fn unitig_roundtrip_linear() {
|
||||
// AAAAAGGGC with k=5 → 5 distinct k-mers, all in direct canonical form,
|
||||
// forming a clean linear chain with no orientation flips.
|
||||
// Non-repetitive sequence: all k-mers must be recovered across unitigs.
|
||||
let k = 5;
|
||||
set_k(k);
|
||||
let seq = b"AAAAAGGGC";
|
||||
let seq = b"ACCTGGCTA";
|
||||
let g = graph_from_ascii(seq);
|
||||
g.compute_degrees_and_mark_starts();
|
||||
let unitigs: Vec<Unitig> = collect_unitigs(&g);
|
||||
assert_eq!(
|
||||
unitigs.len(),
|
||||
1,
|
||||
"linear chain → exactly one unitig {:?}",
|
||||
unitigs
|
||||
);
|
||||
assert!(!unitigs.is_empty());
|
||||
assert_eq!(
|
||||
kmers_from_unitigs(&unitigs),
|
||||
canonical_kmers(seq),
|
||||
|
||||
Reference in New Issue
Block a user