pub struct Ebwt { /* private fields */ }Expand description
Extended Burrows-Wheeler Transform (FM-index)
This is the main data structure used by RustAlign for ultrafast sequence alignment. It is memory-mapped from .rai index files.
Implementations§
Source§impl Ebwt
impl Ebwt
Sourcepub fn load<P: AsRef<Path>>(path_base: P) -> AlignResult<Self>
pub fn load<P: AsRef<Path>>(path_base: P) -> AlignResult<Self>
Sourcepub fn load_large<P: AsRef<Path>>(path_base: P) -> AlignResult<Self>
pub fn load_large<P: AsRef<Path>>(path_base: P) -> AlignResult<Self>
Load a “large” index variant
Sourcepub fn params(&self) -> &EbwtParams
pub fn params(&self) -> &EbwtParams
Get the index parameters
Sourcepub fn get_offset(&self, row: u64) -> AlignResult<u64>
pub fn get_offset(&self, row: u64) -> AlignResult<u64>
Convert a BWT row to a genome offset using suffix array samples and LF-mapping.
This implements RustAlign’s getOffset() algorithm:
- If row is zOff, return 0
- If row is at a sampled position, return the sampled offset
- Otherwise, walk back using LF-mapping until hitting zOff or a sampled row
Sourcepub fn joined_to_text_off(
&self,
qlen: u64,
off: u64,
fw: bool,
) -> AlignResult<(u32, u64, u64)>
pub fn joined_to_text_off( &self, qlen: u64, off: u64, fw: bool, ) -> AlignResult<(u32, u64, u64)>
Convert a genome offset to chromosome index and position.
This implements RustAlign’s joinedToTextOff() algorithm using binary search on the rstarts array.
Returns (chromosome_index, position_in_chromosome, chromosome_length)
Sourcepub fn resolve_position(
&self,
row: u64,
qlen: u64,
fw: bool,
) -> AlignResult<(String, u64, u64)>
pub fn resolve_position( &self, row: u64, qlen: u64, fw: bool, ) -> AlignResult<(String, u64, u64)>
Resolve a BWT row to chromosome name and position.
This combines getOffset() and joinedToTextOff() to convert a BWT row directly to a chromosome name and position.
Returns (chromosome_name, position, chromosome_length)
Trait Implementations§
Source§impl FmIndex for Ebwt
impl FmIndex for Ebwt
Source§fn exact_match(&self, pattern: &[Nuc]) -> AlignResult<Vec<usize>>
fn exact_match(&self, pattern: &[Nuc]) -> AlignResult<Vec<usize>>
Exact match search using backward search on FM-index
This implements the classic FM-index backward search algorithm:
- Initialize range using ftab for the last ftabChars nucleotides
- Extend left through remaining characters using LF-mapping
- Return all positions in the final range