diff --git a/Cargo.toml b/Cargo.toml index af6c122..c7fd851 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "awry" -version = "0.2.2" +version = "0.3.0" description = "Library for creating FM-indexes from FASTA/FASTQ files. AWRY is able to search at lightning speed by leveraging SIMD vectorization and multithreading over collections of queries." license = "BSD-3-Clause" homepage = "https://github.com/UM-Applied-Algorithms-Lab/AWRY_Index" diff --git a/src/fm_index.rs b/src/fm_index.rs index d9817cc..800407c 100644 --- a/src/fm_index.rs +++ b/src/fm_index.rs @@ -367,6 +367,23 @@ impl FmIndex { &self.prefix_sums } + /// Gets the initial search range for the given character. + /// + /// # Example + /// ```no_run + /// use awry::fm_index::{FmIndex, FmBuildArgs}; + /// use awry::alphabet::SymbolAlphabet; + /// use std::path::Path; + /// use awry::search::SearchRange; + /// use awry::alphabet::Symbol; + /// + /// let fm_index = FmIndex::load(&Path::new("test.awry")).expect("unable to load fm index from file"); + /// let initial_search_range = fm_index.initial_search_range(Symbol::new_ascii(SymbolAlphabet::Nucleotide, 'A')); + /// ``` + pub fn initial_search_range(&self, s:Symbol)->SearchRange{ + return SearchRange::new(self, s); + } + /// Gets a reference to the compressed suffix array. pub(crate) fn sampled_suffix_array(&self) -> &CompressedSuffixArray { &self.sampled_suffix_array