Struct block_aligner::scan_block::Block
source · Expand description
Data structure storing the settings for block aligner.
Implementations
sourceimpl<const TRACE: bool, const X_DROP: bool> Block<{ TRACE }, { X_DROP }>
impl<const TRACE: bool, const X_DROP: bool> Block<{ TRACE }, { X_DROP }>
sourcepub fn new(query_len: usize, reference_len: usize, max_size: usize) -> Self
pub fn new(query_len: usize, reference_len: usize, max_size: usize) -> Self
Allocate a block aligner instance with an upper bound query length, reference length, and max block size.
A block aligner instance can be reused for multiple alignments as long as the aligned sequence lengths and block sizes do not exceed the specified upper bounds.
sourcepub fn align<M: Matrix>(
&mut self,
query: &PaddedBytes,
reference: &PaddedBytes,
matrix: &M,
gaps: Gaps,
size: RangeInclusive<usize>,
x_drop: i32
)
pub fn align<M: Matrix>(
&mut self,
query: &PaddedBytes,
reference: &PaddedBytes,
matrix: &M,
gaps: Gaps,
size: RangeInclusive<usize>,
x_drop: i32
)
Align two sequences with block aligner.
If TRACE is true, then information for computing the traceback will be stored.
After alignment, the traceback CIGAR string can then be computed.
This will slow down alignment and use a lot more memory.
If X_DROP is true, then the alignment process will be terminated early when
the max score in the current block drops by x_drop below the max score encountered
so far. If X_DROP is false, then global alignment is done.
Since larger scores are better, gap and mismatches penalties must be negative.
The minimum and maximum sizes of the block must be powers of 2 that are greater than the number of 16-bit lanes in a SIMD vector.
The block aligner algorithm will dynamically shift a block down or right and grow its size to efficiently calculate the alignment between two strings. This is fast, but it may be slightly less accurate than computing the entire the alignment dynamic programming matrix. Growing the size of the block allows larger gaps and other potentially difficult regions to be handled correctly. The algorithm also allows shrinking the block size for greater efficiency when handling regions in the sequences with no gaps. 16-bit deltas and 32-bit offsets are used to ensure that accurate scores are computed, even when the the strings are long.
When aligning sequences q against r, this algorithm computes cells in the DP matrix
with |q| rows and |r| columns.
X-drop alignment with ByteMatrix is not supported.
sourcepub fn align_profile<P: Profile>(
&mut self,
query: &PaddedBytes,
profile: &P,
size: RangeInclusive<usize>,
x_drop: i32
)
pub fn align_profile<P: Profile>(
&mut self,
query: &PaddedBytes,
profile: &P,
size: RangeInclusive<usize>,
x_drop: i32
)
Align a sequence to a profile with block aligner.
If TRACE is true, then information for computing the traceback will be stored.
After alignment, the traceback CIGAR string can then be computed.
This will slow down alignment and use a lot more memory.
If X_DROP is true, then the alignment process will be terminated early when
the max score in the current block drops by x_drop below the max score encountered
so far. If X_DROP is false, then global alignment is done.
Since larger scores are better, gap and mismatches penalties must be negative.
The minimum and maximum sizes of the block must be powers of 2 that are greater than the number of 16-bit lanes in a SIMD vector.
The block aligner algorithm will dynamically shift a block down or right and grow its size to efficiently calculate the alignment between two strings. This is fast, but it may be slightly less accurate than computing the entire the alignment dynamic programming matrix. Growing the size of the block allows larger gaps and other potentially difficult regions to be handled correctly. The algorithm also allows shrinking the block size for greater efficiency when handling regions in the sequences with no gaps. 16-bit deltas and 32-bit offsets are used to ensure that accurate scores are computed, even when the the strings are long.
When aligning sequence q against profile p, this algorithm computes cells in the DP matrix
with |q| rows and |p| columns.
sourcepub fn res(&self) -> AlignResult
pub fn res(&self) -> AlignResult
Get the resulting score and ending location of the alignment.