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

Trace matrix for the pairwise alignment using the full trace matrix. More...

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

+ Inheritance diagram for seqan3::detail::trace_matrix_full< trace_t >:

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_fulloperator= (trace_matrix_full const &)=default
 Defaulted.
 
trace_matrix_fulloperator= (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.
 

Detailed Description

template<typename trace_t>
requires std::same_as<trace_t, trace_directions>
class seqan3::detail::trace_matrix_full< trace_t >

Trace matrix for the pairwise alignment using the full trace matrix.

Template Parameters
trace_tThe 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.

Range interface

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.

Member Function Documentation

◆ resize()

template<typename trace_t >
template<std::integral column_index_t, std::integral row_index_t>
void seqan3::detail::trace_matrix_full< trace_t >::resize ( column_index_type< column_index_t > const  column_count,
row_index_type< row_index_t > const  row_count 
)
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.

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.

Complexity

In worst case column_count times row_count memory is allocated.

Exception

Basic exception guarantee. Might throw std::bad_alloc on resizing the internal matrices.

◆ trace_path()

template<typename trace_t >
auto seqan3::detail::trace_matrix_full< trace_t >::trace_path ( matrix_coordinate const &  trace_begin) const
inline

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

Parameters
[in]trace_beginA seqan3::matrix_coordinate pointing to the begin 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