SeqAn3 3.4.0-rc.4
The Modern C++ library for sequence analysis.
|
An alignment traceback matrix storing the entire banded traceback matrix. More...
#include <seqan3/alignment/matrix/detail/alignment_trace_matrix_full_banded.hpp>
Public Types | |
Associated types | |
using | value_type = alignment_trace_matrix_proxy< coordinate_type, std::conditional_t< coordinate_only, detail::ignore_t const, trace_t > > |
The proxy type of an alignment matrix. | |
using | reference = value_type |
Same as value type. | |
using | iterator = typename range_base_t::iterator |
The type of the iterator. | |
using | sentinel = typename range_base_t::sentinel |
The type of sentinel. | |
using | size_type = size_t |
The size type. | |
Public Member Functions | |
auto | trace_path (matrix_coordinate const &trace_begin) |
Returns a trace path starting from the given coordinate and ending in the cell with seqan3::detail::trace_directions::none. | |
Constructors, destructor and assignment | |
constexpr | alignment_trace_matrix_full_banded ()=default |
Defaulted. | |
constexpr | alignment_trace_matrix_full_banded (alignment_trace_matrix_full_banded const &)=default |
Defaulted. | |
constexpr | alignment_trace_matrix_full_banded (alignment_trace_matrix_full_banded &&)=default |
Defaulted. | |
constexpr alignment_trace_matrix_full_banded & | operator= (alignment_trace_matrix_full_banded const &)=default |
Defaulted. | |
constexpr alignment_trace_matrix_full_banded & | operator= (alignment_trace_matrix_full_banded &&)=default |
Defaulted. | |
~alignment_trace_matrix_full_banded ()=default | |
Defaulted. | |
template<std::ranges::forward_range first_sequence_t, std::ranges::forward_range second_sequence_t> | |
constexpr | alignment_trace_matrix_full_banded (first_sequence_t &&first, second_sequence_t &&second, align_cfg::band_fixed_size const &band, trace_t const initial_value=trace_t{}) |
Construction from two ranges and a band. | |
![]() | |
constexpr iterator | begin () noexcept |
Returns an iterator to the first column of the matrix. | |
constexpr iterator | begin () const noexcept=delete |
Deleted begin for const-qualified alignment matrix. | |
constexpr sentinel | end () noexcept |
Returns a sentinel marking the end of the matrix. | |
constexpr sentinel | end () const noexcept=delete |
Deleted end for const-qualified alignment matrix. | |
Private Types | |
using | matrix_base_t = alignment_trace_matrix_base< trace_t > |
The base class for data storage. | |
using | range_base_t = alignment_matrix_column_major_range_base< alignment_trace_matrix_full_banded< trace_t, coordinate_only > > |
The base class for iterating over the matrix. | |
Private Member Functions | |
constexpr alignment_column_type | initialise_column (size_type const column_index) noexcept |
Returns the current alignment-column at the given column_index . | |
template<std::random_access_iterator iter_t> | |
constexpr value_type | make_proxy (iter_t host_iter) noexcept |
Creates the proxy value returned when dereferencing the alignment-column-iterator. | |
Private Attributes | |
friend | range_base_t |
Befriend the range base class. | |
Additional Inherited Members | |
![]() | |
constexpr iterator | begin () noexcept |
Returns an iterator to the first column of the matrix. | |
constexpr iterator | begin () const noexcept=delete |
Deleted begin for const-qualified alignment matrix. | |
constexpr sentinel | end () noexcept |
Returns a sentinel marking the end of the matrix. | |
constexpr sentinel | end () const noexcept=delete |
Deleted end for const-qualified alignment matrix. | |
![]() | |
std::vector< element_type, allocator_type > | cache_left {} |
Internal cache for the trace values to the left. | |
element_type | cache_up {} |
Internal cache for the last trace value above. | |
pool_type | data {} |
The linearised matrix storing the trace data in column-major-order. | |
size_type | num_cols {} |
The number of columns. | |
size_type | num_rows {} |
The number of num_rows. | |
An alignment traceback matrix storing the entire banded traceback matrix.
trace_t | The type of the trace directions. |
coordinate_only | A boolean flag indicating if only a seqan3::detail::advanceable_alignment_coordinate should be generated. |
This implementation allocates the full banded traceback matrix using k*m
memory, where k
is the band size and m
the number of columns to store. The matrix allows access to the underlying values through a range based interface. An iterator over the traceback matrix iterates in column-major-order over the traceback matrix. Dereferencing an iterator returns a slice over the current matrix column. The value type is a pair over a seqan3::detail::advanceable_alignment_coordinate and the seqan3::detail::alignment_trace_matrix_proxy, which gives a unified access to the respective matrix cells as needed by the standard alignment algorithm. The matrix is modelled as std::ranges::input_range since the alignment algorithm iterates only once over the complete matrix to calculate the values.
Sometimes it is desired to only get access to the alignment coordinates. This can be achieved by setting coordinate_only = true
. In this case no memory will be allocated and only an internal state is maintained to generate the alignment coordinates. The coordinates are relative to the banded matrix, i.e. they do not represent the corresponding row indices of the actual (unbanded) matrix.
|
no-apiprotected |
The view over the current alignment-column; must model std::ranges::view and std::ranges::input_range.
| no-api |
The type of the iterator.
| no-api |
The type of sentinel.
The proxy type of an alignment matrix.
|
no-apiinlineconstexpr |
Construction from two ranges and a band.
first_sequence_t | The first range type; must model std::ranges::forward_range. |
second_sequence_t | The second range type; must model std::ranges::forward_range. |
[in] | first | The first range. |
[in] | second | The second range. |
[in] | band | The seqan3::align_cfg::band_fixed_size in which to calculate the alignment. |
[in] | initial_value | The value to initialise the matrix with. Default initialised if not specified. |
Obtains the sizes of the passed ranges in order to allocate the traceback matrix. Only allocates memory to store the banded matrix. If coordinate_only
is set to true
, nothing will be allocated.
|
no-apiinlineconstexprprivatenoexcept |
Returns the current alignment-column at the given column_index
.
[in] | column_index | The current column position of the outer matrix iterator. |
Creates a new seqan3::detail::alignment_matrix_column_major_range_base::alignment_column_type
initialised with the current column of the alignment matrix depending on the given column_index
. The alignment_column_type
stores a column view as defined by the derived class using the seqan3::detail::alignment_matrix_column_major_range_base::column_data_view_type type definition.
|
no-apiinlineconstexprprivatenoexcept |
Creates the proxy value returned when dereferencing the alignment-column-iterator.
[in] | host_iter | The wrapped iterator to the actual memory storage. |
|
no-apiinline |
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. |