Files
obikmer/src/obiskbuilder/src/lib.rs
T
Eric Coissac ea914bb536 feat: implement per-k-mer sibling counts and central neighbor generation
Introduce the siblingannex module in obicompactvec to store per-slot minorant flags and sibling counts in a memory-mapped annex file. Add a scatter-gather pipeline in obikindex to compute these values across index layers and write them to .psib files. Implement central_canonical_neighbors in obikseq for generating strand-aware k-mer variants around the middle base. Expose rolling statistics in obiskbuilder and update dependency graphs accordingly.
2026-08-10 15:01:59 +02:00

44 lines
1.0 KiB
Rust

//! Super-kmer construction pipeline.
//!
//! Consumes normalised rope chunks from `obiread` and produces
//! `(minimizer, SuperKmer)` pairs ready for scatter routing.
#![deny(missing_docs)]
pub mod iter;
pub mod stream_iter;
mod scratch;
pub(crate) mod encoding;
#[allow(missing_docs)]
pub mod rolling_stat;
pub use iter::SuperKmerIter;
pub use scratch::SuperKmerScratch;
pub use stream_iter::SuperKmerStreamIter;
use obiread::NucPage;
use obikrope::Rope;
use obikseq::RoutableSuperKmer;
/// Collect all super-kmers from a normalised [`NucPage`].
pub fn build_superkmers_page(
page: NucPage,
k: usize,
level_max: usize,
theta: f64,
) -> Vec<RoutableSuperKmer> {
let cursor = page.cursor();
SuperKmerStreamIter::new(cursor, k, level_max, theta).collect()
}
/// Collect all super-kmers from a normalised rope chunk.
pub fn build_superkmers(
rope: Rope,
k: usize,
level_max: usize,
theta: f64,
) -> Vec<RoutableSuperKmer> {
SuperKmerIter::new(&rope, k, level_max, theta).collect()
}