refactor: optimize unitig iteration and graph traversal

Switches unitig processing to a lazy, fallible `try_for_each_unitig` API across partitioner layers, reducing intermediate allocations and enabling proper error propagation. Refactors de Bruijn graph traversal into a two-pass algorithm with explicit node flags, named constants, and diagnostic logging. Introduces parallel chain processing and staged performance profiling for the unitig command, and adds a memory-efficient `FromIterator` implementation for packed nucleotide sequences.
This commit is contained in:
Eric Coissac
2026-06-05 18:31:52 +02:00
parent ea2c594c86
commit 27088ab810
6 changed files with 511 additions and 274 deletions
+4 -3
View File
@@ -154,9 +154,10 @@ impl KmerPartition {
fs::create_dir_all(&dst_layer_dir)?;
let mut uw = Layer::<()>::unitig_writer(&dst_layer_dir).map_err(olm_to_sk)?;
for unitig in g.iter_unitig() {
uw.write(&unitig)?;
}
g.try_for_each_unitig(|nuc_iter| {
let unitig: obikseq::unitig::Unitig = nuc_iter.collect();
uw.write(&unitig)
})?;
uw.close()?;
drop(g);