Add unitig streaming iterators and estimate CLI subcommand
Introduce `iter_unitigs` methods across the index cache, content layer, MphfLayer, and typed layer to stream whole reconstructed sequences directly from underlying storage without decomposing into k-mers. Add a corresponding low-level streaming iterator in obiskio for thread-safe, lazy reads from memory-mapped files. Include a new CLI subcommand to compute and display approximate false-positive rates based on provided indexing parameters.
This commit is contained in:
1 parent
5048f43eea
commit
fb31a35c76
9 files changed
+124
-1
No files matched your search
@@ -119,6 +119,16 @@ impl<'a> IndexCache<'a> {
|
||||
})
|
||||
}
|
||||
|
||||
/// Iterate over the unitigs of every cached layer, chained — the
|
||||
/// partition/index level of `KmerLayer::iter_unitigs`'s layer/partition/
|
||||
/// index chain, covering whichever scope this cache was opened with
|
||||
/// (one partition, several, or the whole index — see [`new`](Self::new)).
|
||||
/// No extra opening: every layer here is already open, this only
|
||||
/// streams what [`iter`](Self::iter) already gives out.
|
||||
pub fn iter_unitigs(&self) -> impl Iterator<Item = obikseq::Unitig> + '_ {
|
||||
self.iter().flat_map(|l| l.iter_unitigs())
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn hash(&self, partition: usize, layer: usize, kmer: CanonicalKmer) -> Option<usize> {
|
||||
Some(self.get_layer(partition, layer)?.hash(kmer))
|
||||
|
||||
Reference in new issue
Block a user