SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
Loading...
Searching...
No Matches
seqan3::detail::combined_score_and_trace_matrix< score_matrix_t, trace_matrix_t > Class Template Reference

An alignment matrix that combines a score matrix with a trace matrix into a common interface. More...

#include <seqan3/alignment/matrix/detail/combined_score_and_trace_matrix.hpp>

+ Inheritance diagram for seqan3::detail::combined_score_and_trace_matrix< score_matrix_t, trace_matrix_t >:

Classes

class  iterator
 Combined score and trace matrix iterator for the pairwise sequence alignment. More...
 
class  sentinel
 The sentinel type for the seqan3::detail::combined_score_and_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, score_type const initial_score=score_type{})
 Resizes the matrix.
 
auto trace_path (matrix_coordinate const &from_coordinate) 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
 combined_score_and_trace_matrix ()=default
 Defaulted.
 
 combined_score_and_trace_matrix (combined_score_and_trace_matrix const &)=default
 Defaulted.
 
 combined_score_and_trace_matrix (combined_score_and_trace_matrix &&)=default
 Defaulted.
 
combined_score_and_trace_matrixoperator= (combined_score_and_trace_matrix const &)=default
 Defaulted.
 
combined_score_and_trace_matrixoperator= (combined_score_and_trace_matrix &&)=default
 Defaulted.
 
 ~combined_score_and_trace_matrix ()=default
 Defaulted.
 
Iterators
iterator begin ()
 Returns the iterator pointing to the first alignment column.
 
iterator begin () const =delete
 This score matrix is not const-iterable.
 
sentinel end ()
 Returns the sentinel pointing behind the last alignment column.
 
sentinel end () const =delete
 This alignment matrix is not const-iterable.
 

Private Types

using score_type = std::remove_cvref_t< std::tuple_element_t< 0, range_innermost_value_t< score_matrix_t > > >
 The score type extracted from the score matrix. (TODO: make this less complicated by exposing the score type).
 

Private Attributes

score_matrix_t score_matrix {}
 The underlying score matrix.
 
trace_matrix_t trace_matrix {}
 The underlying trace matrix.
 

Detailed Description

template<std::ranges::input_range score_matrix_t, std::ranges::input_range trace_matrix_t>
requires (std::ranges::input_range<std::ranges::range_reference_t<score_matrix_t>> && std::ranges::input_range<std::ranges::range_reference_t<trace_matrix_t>>)
class seqan3::detail::combined_score_and_trace_matrix< score_matrix_t, trace_matrix_t >

An alignment matrix that combines a score matrix with a trace matrix into a common interface.

Template Parameters
score_matrix_tThe type of the score matrix; must model std::ranges::input_range (for more requirements see details section).
trace_matrix_tThe type of the trace matrix; must model std::ranges::input_range (for more requirements see details section).

To compute the actual, alignment an additional trace matrix is required. It stores the trace directions to the previous cells for any computed cell within the alignment matrix. The following matrix combines a given score with a trace matrix into a complete alignment matrix. The iterator increments over the columns of each underlying matrix and combines them into a zip view, i.e. the combined alignment matrix is a range over ranges with the inner range also modelling std::ranges::input_range. To provide a uniform interface to the alignment algorithm, the returned zip view is further transformed such that its reference type is a seqan3::detail::affine_cell_proxy.

Member Function Documentation

◆ resize()

template<std::ranges::input_range score_matrix_t, std::ranges::input_range trace_matrix_t>
template<std::integral column_index_t, std::integral row_index_t>
void seqan3::detail::combined_score_and_trace_matrix< score_matrix_t, trace_matrix_t >::resize ( column_index_type< column_index_t > const  column_count,
row_index_type< row_index_t > const  row_count,
score_type const  initial_score = score_type{} 
)
inline

Resizes the matrix.

Template Parameters
column_index_tThe column index type; must model std::integral.
row_index_tThe row index type; must model std::integral.
Parameters
[in]column_countThe number of columns for this matrix.
[in]row_countThe number of rows for this matrix.
[in]initial_scoreThe initial score used to initialise the score matrix.

Resizes the underlying score and trace matrix to the given dimensions.

Complexity

The complexity depends on the resize complexity of the underlying score and trace matrix.

Exception

Strong exception guarantee. Might throw std::bad_alloc.

◆ trace_path()

template<std::ranges::input_range score_matrix_t, std::ranges::input_range trace_matrix_t>
auto seqan3::detail::combined_score_and_trace_matrix< score_matrix_t, trace_matrix_t >::trace_path ( matrix_coordinate const &  from_coordinate) const
inline

Returns a trace path starting from the given coordinate and ending in the cell with seqan3::detail::trace_directions::none.

Parameters
[in]from_coordinateA seqan3::matrix_coordinate pointing to the start of the trace to follow.
Returns
A std::ranges::subrange over the corresponding trace path.
Exceptions
std::invalid_argumentif the specified coordinate is out of range.

The documentation for this class was generated from the following file:
Hide me