SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
Loading...
Searching...
No Matches
seqan3::detail::affine_gap_policy< alignment_algorithm_t, score_t, align_local_t > Class Template Reference

The CRTP-policy that computes a single cell in the alignment matrix. More...

#include <seqan3/alignment/pairwise/policy/affine_gap_policy.hpp>

Private Types

using alignment_state_t = alignment_algorithm_state< score_t >
 The state of the alignment algorithm for affine gaps.
 

Private Member Functions

template<typename cell_t >
constexpr void compute_cell (cell_t &&current_cell, alignment_algorithm_state< score_t > &cache, score_t const score) const noexcept
 Computes the score of the current cell.
 
template<typename cell_t >
constexpr void compute_first_band_cell (cell_t &&current_cell, alignment_algorithm_state< score_t > &cache, score_t const score) const noexcept
 Computes the score of the first cell within the band.
 
template<typename alignment_configuration_t >
constexpr void initialise_alignment_state (alignment_configuration_t const &config) noexcept
 Initialise the alignment state for affine gap computation.
 
Constructors, destructor and assignment

Defaulted all standard constructor.

constexpr affine_gap_policy () noexcept=default
 Defaulted.
 
constexpr affine_gap_policy (affine_gap_policy const &) noexcept=default
 Defaulted.
 
constexpr affine_gap_policy (affine_gap_policy &&) noexcept=default
 Defaulted.
 
constexpr affine_gap_policyoperator= (affine_gap_policy const &) noexcept=default
 Defaulted.
 
constexpr affine_gap_policyoperator= (affine_gap_policy &&) noexcept=default
 Defaulted.
 
 ~affine_gap_policy () noexcept=default
 Defaulted.
 
template<typename configuration_t >
 affine_gap_policy (configuration_t const &)
 Initialise the policy.
 

Private Attributes

friend alignment_algorithm_t
 Befriends the derived class to grant it access to the private members.
 
alignment_state_t alignment_state {}
 The internal alignment state tracking the current alignment optimum.
 

Detailed Description

template<typename alignment_algorithm_t, typename score_t, typename align_local_t = std::false_type>
class seqan3::detail::affine_gap_policy< alignment_algorithm_t, score_t, align_local_t >

The CRTP-policy that computes a single cell in the alignment matrix.

Template Parameters
alignment_algorithm_tThe derived type (seqan3::detail::alignment_algorithm) to be augmented with this CRTP-policy.
score_tThe score type of the dynamic programming matrix; must model seqan3::arithmetic.
align_local_tA std::bool_constant to switch between local and global alignment.

This CRTP-policy implements the recursion for the alignment algorithm with affine gaps. See Osamu Gotoh, Optimal sequence alignment allowing for long gaps, Bulletin of Mathematical Biology, Volume 52, Issue 3, 1990, Pages 359-373, ISSN 0092-8240, https://doi.org/10.1007/BF02458577 for more information.

Remarks
The template parameters of this CRTP-policy are selected in the seqan3::detail::alignment_configurator::select_gap_policy when selecting the alignment for the given configuration.

Member Function Documentation

◆ compute_cell()

template<typename alignment_algorithm_t , typename score_t , typename align_local_t = std::false_type>
template<typename cell_t >
constexpr void seqan3::detail::affine_gap_policy< alignment_algorithm_t, score_t, align_local_t >::compute_cell ( cell_t &&  current_cell,
alignment_algorithm_state< score_t > &  cache,
score_t const  score 
) const
inlineconstexprprivatenoexcept

Computes the score of the current cell.

Template Parameters
cell_tThe type of the current cell [for detailed information on the type see below].
Parameters
[in,out]current_cellThe current cell in the dynamic programming matrix.
[in,out]cacheThe cache storing hot helper variables.
[in]scoreThe score of comparing the respective letters of the first and the second sequence.

cell_t is the result type of dereferencing the zipped iterator over the respective alignment score matrix and the alignment trace matrix used inside of the seqan3::detail::alignment_matrix_policy. The first parameter stored in the zipped tuple is the seqan3::detail::alignment_score_matrix_proxy and the second value is the seqan3::detail::alignment_trace_matrix_proxy.

◆ compute_first_band_cell()

template<typename alignment_algorithm_t , typename score_t , typename align_local_t = std::false_type>
template<typename cell_t >
constexpr void seqan3::detail::affine_gap_policy< alignment_algorithm_t, score_t, align_local_t >::compute_first_band_cell ( cell_t &&  current_cell,
alignment_algorithm_state< score_t > &  cache,
score_t const  score 
) const
inlineconstexprprivatenoexcept

Computes the score of the first cell within the band.

Template Parameters
cell_tThe type of the current cell [for detailed information on the type see below].
Parameters
[in,out]current_cellThe current cell in the dynamic programming matrix.
[in,out]cacheThe cache storing hot helper variables.
[in]scoreThe score of comparing the respective letters of the first and the second sequence.

cell_t is the result type of dereferencing the zipped iterator over the respective alignment score matrix and the alignment trace matrix used inside of the seqan3::detail::alignment_matrix_policy. The first parameter stored in the zipped tuple is the seqan3::detail::alignment_score_matrix_proxy and the second value is the seqan3::detail::alignment_trace_matrix_proxy.

◆ initialise_alignment_state()

template<typename alignment_algorithm_t , typename score_t , typename align_local_t = std::false_type>
template<typename alignment_configuration_t >
constexpr void seqan3::detail::affine_gap_policy< alignment_algorithm_t, score_t, align_local_t >::initialise_alignment_state ( alignment_configuration_t const &  config)
inlineconstexprprivatenoexcept

Initialise the alignment state for affine gap computation.

Template Parameters
alignment_configuration_tThe type of alignment configuration.
Parameters
[in]configThe alignment configuration.

Gets the stored gap scheme from the configuration or uses a default gap scheme if not set and initialises the alignment algorithm state with the respective gap extension and gap open costs. If the gap scheme was not specified by the user the following defaults are used:

  • -1 for the gap extension score, and
  • -10 for the gap open score.

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