pub struct Dictionary { /* private fields */ }Expand description
The main dictionary structure
Note: Serialization support is limited due to underlying types. Use custom save/load methods instead.
Implementations§
Source§impl Dictionary
impl Dictionary
Sourcepub fn new(
spss: SpectrumPreservingStringSet,
control_map: MinimizersControlMap,
index: SparseAndSkewIndex,
k: usize,
m: usize,
canonical: bool,
) -> Self
pub fn new( spss: SpectrumPreservingStringSet, control_map: MinimizersControlMap, index: SparseAndSkewIndex, k: usize, m: usize, canonical: bool, ) -> Self
Create a new dictionary from components
Sourcepub fn lookup<const K: usize>(&self, kmer: &Kmer<K>) -> u64
pub fn lookup<const K: usize>(&self, kmer: &Kmer<K>) -> u64
Look up a k-mer’s position in the dictionary.
Sourcepub fn query<const K: usize>(&self, kmer: &Kmer<K>) -> LookupResult
pub fn query<const K: usize>(&self, kmer: &Kmer<K>) -> LookupResult
Query a k-mer and return a full LookupResult.
Sourcepub fn query_from_str<const K: usize>(&self, kmer_str: &str) -> LookupResult
pub fn query_from_str<const K: usize>(&self, kmer_str: &str) -> LookupResult
Query a k-mer given as a DNA string.
Sourcepub fn debug_has_control_map_mphf(&self) -> bool
pub fn debug_has_control_map_mphf(&self) -> bool
Debug: check if control map MPHF is present
Sourcepub fn debug_control_map_lookup(&self, minimizer: u64) -> bool
pub fn debug_control_map_lookup(&self, minimizer: u64) -> bool
Debug: check if a minimizer exists in the control map
Sourcepub fn debug_extract_minimizer<const K: usize>(
&self,
kmer: &Kmer<K>,
) -> MinimizerInfo
pub fn debug_extract_minimizer<const K: usize>( &self, kmer: &Kmer<K>, ) -> MinimizerInfo
Debug: extract minimizer info for a k-mer
Sourcepub fn debug_bucket_info<const K: usize>(
&self,
kmer: &Kmer<K>,
) -> Option<(u64, u64, u64)>
pub fn debug_bucket_info<const K: usize>( &self, kmer: &Kmer<K>, ) -> Option<(u64, u64, u64)>
Debug: get bucket and locate info for a k-mer
Sourcepub fn lookup_with_orientation<const K: usize>(
&self,
kmer: &Kmer<K>,
) -> (u64, i8)
pub fn lookup_with_orientation<const K: usize>( &self, kmer: &Kmer<K>, ) -> (u64, i8)
Look up a k-mer and return position + orientation
Sourcepub fn access<const K: usize>(&self, kmer: &Kmer<K>) -> bool
pub fn access<const K: usize>(&self, kmer: &Kmer<K>) -> bool
Check if a k-mer exists in the dictionary
Sourcepub fn create_streaming_query<const K: usize>(
&self,
) -> StreamingQueryEngine<'_, K>
pub fn create_streaming_query<const K: usize>( &self, ) -> StreamingQueryEngine<'_, K>
Create a streaming query engine for this dictionary
Sourcepub fn spss(&self) -> &SpectrumPreservingStringSet
pub fn spss(&self) -> &SpectrumPreservingStringSet
Get a reference to the underlying SPSS
Sourcepub fn control_map_ref(&self) -> &MinimizersControlMap
pub fn control_map_ref(&self) -> &MinimizersControlMap
Get a reference to the control map
Sourcepub fn index_ref(&self) -> &SparseAndSkewIndex
pub fn index_ref(&self) -> &SparseAndSkewIndex
Get a reference to the sparse and skew index
Sourcepub fn num_strings(&self) -> u64
pub fn num_strings(&self) -> u64
Get the number of strings in the SPSS
Sourcepub fn string_length(&self, string_id: u64) -> usize
pub fn string_length(&self, string_id: u64) -> usize
Get the length of a specific string in bases
Sourcepub fn locate_string(&self, absolute_pos: u64) -> Option<(u64, u64)>
pub fn locate_string(&self, absolute_pos: u64) -> Option<(u64, u64)>
Locate which string contains a given absolute position.
Sourcepub fn access_kmer<const K: usize>(&self, string_id: u64, pos: usize) -> Kmer<K>
pub fn access_kmer<const K: usize>(&self, string_id: u64, pos: usize) -> Kmer<K>
Access a k-mer at a given position within a string
Sourcepub fn kmer_at_pos<const K: usize>(&self, absolute_base_pos: usize) -> Kmer<K>
pub fn kmer_at_pos<const K: usize>(&self, absolute_base_pos: usize) -> Kmer<K>
Decode the k-mer at an absolute base position in the SPSS.
Sourcepub fn num_minimizers(&self) -> u64
pub fn num_minimizers(&self) -> u64
Get the number of unique minimizers
Sourcepub fn print_space_breakdown(&self)
pub fn print_space_breakdown(&self)
Print a detailed space breakdown of the index
Sourcepub fn save<P: AsRef<Path>>(&self, path: P) -> SerializationResult<()>
pub fn save<P: AsRef<Path>>(&self, path: P) -> SerializationResult<()>
Serialize the dictionary to files
Sourcepub fn load<P: AsRef<Path>>(path: P) -> SerializationResult<Self>
pub fn load<P: AsRef<Path>>(path: P) -> SerializationResult<Self>
Deserialize a dictionary from files
Auto Trait Implementations§
impl Freeze for Dictionary
impl RefUnwindSafe for Dictionary
impl Send for Dictionary
impl Sync for Dictionary
impl Unpin for Dictionary
impl UnsafeUnpin for Dictionary
impl UnwindSafe for Dictionary
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T, U> CastableInto<U> for Twhere
U: CastableFrom<T>,
impl<T, U> CastableInto<U> for Twhere
U: CastableFrom<T>,
Source§impl<T> DowncastableFrom<T> for T
impl<T> DowncastableFrom<T> for T
Source§fn downcast_from(value: T) -> T
fn downcast_from(value: T) -> T
Source§impl<T, U> DowncastableInto<U> for Twhere
U: DowncastableFrom<T>,
impl<T, U> DowncastableInto<U> for Twhere
U: DowncastableFrom<T>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more