SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
|
Trace matrix for the pairwise alignment using the full trace matrix. More...
#include <seqan3/alignment/matrix/detail/trace_matrix_full.hpp>
Classes | |
class | iterator |
Trace matrix iterator for the pairwise alignment using the full trace matrix. More... | |
Public Member Functions | |
template<std::integral column_index_t, std::integral row_index_t> | |
void | resize (column_index_type< column_index_t > const column_count, row_index_type< row_index_t > const row_count) |
Resizes the matrix. | |
auto | trace_path (matrix_coordinate const &trace_begin) const |
Returns a trace path starting from the given coordinate and ending in the cell with seqan3::detail::trace_directions::none. | |
Constructors, destructor and assignment | |
trace_matrix_full ()=default | |
Defaulted. | |
trace_matrix_full (trace_matrix_full const &)=default | |
Defaulted. | |
trace_matrix_full (trace_matrix_full &&)=default | |
Defaulted. | |
trace_matrix_full & | operator= (trace_matrix_full const &)=default |
Defaulted. | |
trace_matrix_full & | operator= (trace_matrix_full &&)=default |
Defaulted. | |
~trace_matrix_full ()=default | |
Defaulted. | |
Iterators | |
iterator | begin () |
Returns the iterator pointing to the first column. | |
iterator | begin () const =delete |
This score matrix is not const-iterable. | |
iterator | end () |
Returns the iterator pointing behind the last column. | |
iterator | end () const =delete |
This score matrix is not const-iterable. | |
Private Types | |
using | matrix_t = two_dimensional_matrix< trace_t, aligned_allocator< trace_t, sizeof(trace_t)>, matrix_major_order::column > |
The type to store the complete trace matrix. | |
using | physical_column_t = std::vector< trace_t > |
The type of the score column which allocates memory for the entire column. | |
using | virtual_column_t = decltype(views::repeat_n(trace_t{}, 1)) |
The type of the virtual score column which only stores one value. | |
Private Attributes | |
size_t | column_count {} |
The number of columns for this matrix. | |
matrix_t | complete_matrix {} |
The full trace matrix. | |
physical_column_t | horizontal_column {} |
The column over the horizontal traces. | |
size_t | row_count {} |
The number of rows for this matrix. | |
virtual_column_t | vertical_column {} |
The virtual column over the vertical traces. | |
Trace matrix for the pairwise alignment using the full trace matrix.
trace_t | The type of the trace; must be the same as seqan3::detail::trace_directions. |
In the default trace back implementation we allocate the entire matrix using one byte per cell to store the seqan3::detail::trace_directions.
The matrix offers an input range interface over the columns of the matrix. Dereferencing the iterator will return another range which represents the actual trace column in memory. The returned range is a seqan3::views::zip view over the current column referencing the best trace, as well as the horizontal and vertical trace column.
|
inline |
Resizes the matrix.
column_index_t | The column index type; must model std::integral. |
row_index_t | The row index type; must model std::integral. |
[in] | column_count | The number of columns for this matrix. |
[in] | row_count | The number of rows for this matrix. |
Resizes the entire trace matrix storing the best trace path and the horizontal trace column. Note the trace matrix requires the number of columns and rows to be one bigger than the size of sequence1, respectively sequence2 for the initialisation of the matrix. Reallocation happens only if the new column size exceeds the current capacity of the underlying trace matrix.
In worst case column_count
times row_count
memory is allocated.
Basic exception guarantee. Might throw std::bad_alloc on resizing the internal matrices.
|
inline |
Returns a trace path starting from the given coordinate and ending in the cell with seqan3::detail::trace_directions::none.
[in] | trace_begin | A seqan3::matrix_coordinate pointing to the begin of the trace to follow. |
std::invalid_argument | if the specified coordinate is out of range. |