refactor: pass Unitig objects directly instead of raw byte slices
Refactored `try_for_each_unitig` and related pipelines across `obidebruinj` and `obikpartitionner` to accept `Unitig` instances directly. This eliminates manual `Unitig::from_nucleotides()` conversions, simplifies the data flow, and reduces unnecessary allocation overhead.
This commit is contained in:
@@ -107,8 +107,8 @@ impl KmerPartition {
|
||||
fs::create_dir_all(&layer_dir)?;
|
||||
|
||||
let mut uw = Layer::<()>::unitig_writer(&layer_dir).map_err(olm_to_sk)?;
|
||||
g.try_for_each_unitig(|nucs| {
|
||||
uw.write(&obikseq::unitig::Unitig::from_nucleotides(nucs))
|
||||
g.try_for_each_unitig(|unitig| {
|
||||
uw.write(unitig)
|
||||
})?;
|
||||
uw.close()?;
|
||||
|
||||
|
||||
@@ -307,8 +307,8 @@ impl KmerPartition {
|
||||
g.compute_degrees_and_mark_starts();
|
||||
fs::create_dir_all(&new_layer_dir)?;
|
||||
let mut uw = Layer::<()>::unitig_writer(&new_layer_dir).map_err(olm_to_sk)?;
|
||||
g.try_for_each_unitig(|nucs| {
|
||||
uw.write(&obikseq::unitig::Unitig::from_nucleotides(nucs))
|
||||
g.try_for_each_unitig(|unitig| {
|
||||
uw.write(unitig)
|
||||
})?;
|
||||
uw.close()?;
|
||||
let n = g.len();
|
||||
|
||||
@@ -168,8 +168,8 @@ impl KmerPartition {
|
||||
fs::create_dir_all(&dst_layer_dir)?;
|
||||
|
||||
let mut uw = Layer::<()>::unitig_writer(&dst_layer_dir).map_err(olm_to_sk)?;
|
||||
g.try_for_each_unitig(|nucs| {
|
||||
uw.write(&obikseq::unitig::Unitig::from_nucleotides(nucs))
|
||||
g.try_for_each_unitig(|unitig| {
|
||||
uw.write(unitig)
|
||||
})?;
|
||||
uw.close()?;
|
||||
drop(g);
|
||||
|
||||
Reference in New Issue
Block a user