SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
|
An alignment traceback matrix storing the entire traceback matrix. More...
#include <seqan3/alignment/matrix/detail/alignment_trace_matrix_full.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 ()=default |
Defaulted. | |
constexpr | alignment_trace_matrix_full (alignment_trace_matrix_full const &)=default |
Defaulted. | |
constexpr | alignment_trace_matrix_full (alignment_trace_matrix_full &&)=default |
Defaulted. | |
constexpr alignment_trace_matrix_full & | operator= (alignment_trace_matrix_full const &)=default |
Defaulted. | |
constexpr alignment_trace_matrix_full & | operator= (alignment_trace_matrix_full &&)=default |
Defaulted. | |
~alignment_trace_matrix_full ()=default | |
Defaulted. | |
template<std::ranges::forward_range first_sequence_t, std::ranges::forward_range second_sequence_t> | |
constexpr | alignment_trace_matrix_full (first_sequence_t &&first, second_sequence_t &&second, trace_t const initial_value=trace_t{}) |
Construction from two ranges. | |
Public Member Functions inherited from seqan3::detail::alignment_matrix_column_major_range_base< derived_t > | |
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< 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 | |
Protected Member Functions inherited from seqan3::detail::alignment_matrix_column_major_range_base< derived_t > | |
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. | |
Protected Attributes inherited from seqan3::detail::alignment_trace_matrix_base< trace_t > | |
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 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 traceback matrix using quadratic memory. 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 view 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.
|
protected |
The view over the current alignment-column; must model std::ranges::view and std::ranges::input_range.
using seqan3::detail::alignment_trace_matrix_full< trace_t, coordinate_only >::iterator = typename range_base_t::iterator |
The type of the iterator.
using seqan3::detail::alignment_trace_matrix_full< trace_t, coordinate_only >::sentinel = typename range_base_t::sentinel |
The type of sentinel.
The proxy type of an alignment matrix.
|
inlineconstexpr |
Construction from two ranges.
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] | 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. If coordinate_only
is set to true
, nothing will be allocated.
|
inlineconstexprprivatenoexcept |
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.
|
inlineconstexprprivatenoexcept |
Creates the proxy value returned when dereferencing the alignment-column-iterator.
[in] | host_iter | The wrapped iterator to the actual memory storage. |
|
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. |