From 8799ea52940854fe85c6a4040a41ca0693456d7f Mon Sep 17 00:00:00 2001 From: Tim Anderson Date: Tue, 14 Jan 2025 13:43:27 -0700 Subject: [PATCH 1/2] update version string --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 732aa80..c7fd851 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "awry" -version = "0.2.0" +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" From 17c676d4d50e4d1d37939a93cc00e6192ebf8058 Mon Sep 17 00:00:00 2001 From: Tim Anderson Date: Tue, 14 Jan 2025 13:52:40 -0700 Subject: [PATCH 2/2] add public feature to create initial search range. --- src/fm_index.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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