SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
Loading...
Searching...
No Matches
policy_affine_gap_recursion_banded.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin
2// SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik
3// SPDX-License-Identifier: BSD-3-Clause
4
10#pragma once
11
13
14namespace seqan3::detail
15{
16
21template <typename alignment_configuration_t>
22class policy_affine_gap_recursion_banded : protected policy_affine_gap_recursion<alignment_configuration_t>
23{
24protected:
27 // Import base types
28 using typename base_t::affine_cell_type;
29 using typename base_t::score_type;
30 using typename base_t::traits_type;
31
32 //Import member types.
35
46
56 explicit policy_affine_gap_recursion_banded(alignment_configuration_t const & config) : base_t{config}
57 {}
59
76 template <typename affine_cell_t>
78 affine_cell_t previous_cell,
79 score_type const sequence_score) const noexcept
80 {
81 diagonal_score += sequence_score;
82 score_type horizontal_score = previous_cell.horizontal_score();
83 diagonal_score = (diagonal_score < horizontal_score) ? horizontal_score : diagonal_score;
84 score_type from_optimal_score = diagonal_score + gap_open_score;
85 horizontal_score += gap_extension_score;
86 horizontal_score = (horizontal_score < from_optimal_score) ? from_optimal_score : horizontal_score;
87 return {diagonal_score, horizontal_score, from_optimal_score};
88 }
89};
90} // namespace seqan3::detail
A proxy for an affine score matrix cell.
Definition affine_cell_proxy.hpp:114
decltype(auto) horizontal_score() &noexcept
Access the horizontal score of the wrapped score matrix cell.
Definition affine_cell_proxy.hpp:210
Implements the alignment recursion function for the banded alignment algorithm using affine gap costs...
Definition policy_affine_gap_recursion_banded.hpp:23
policy_affine_gap_recursion_banded & operator=(policy_affine_gap_recursion_banded &&)=default
Defaulted.
policy_affine_gap_recursion_banded(policy_affine_gap_recursion_banded &&)=default
Defaulted.
affine_cell_type initialise_band_first_cell(score_type diagonal_score, affine_cell_t previous_cell, score_type const sequence_score) const noexcept
Initialises the first cell of a banded column that does not start in the first row of the matrix.
Definition policy_affine_gap_recursion_banded.hpp:77
score_type gap_extension_score
The score for a gap extension.
Definition policy_affine_gap_recursion.hpp:56
typename traits_type::score_type score_type
The configured score type.
Definition policy_affine_gap_recursion.hpp:49
score_type gap_open_score
The score for a gap opening including the gap extension.
Definition policy_affine_gap_recursion.hpp:58
policy_affine_gap_recursion_banded(alignment_configuration_t const &config)
Construction and initialisation using the alignment configuration.
Definition policy_affine_gap_recursion_banded.hpp:56
policy_affine_gap_recursion_banded(policy_affine_gap_recursion_banded const &)=default
Defaulted.
policy_affine_gap_recursion_banded & operator=(policy_affine_gap_recursion_banded const &)=default
Defaulted.
Implements the alignment recursion function for the alignment algorithm using affine gap costs.
Definition policy_affine_gap_recursion.hpp:42
affine_cell_proxy< affine_score_tuple_t > affine_cell_type
The affine cell type returned by the functions.
Definition policy_affine_gap_recursion.hpp:53
score_type gap_extension_score
The score for a gap extension.
Definition policy_affine_gap_recursion.hpp:56
typename traits_type::score_type score_type
The configured score type.
Definition policy_affine_gap_recursion.hpp:49
score_type gap_open_score
The score for a gap opening including the gap extension.
Definition policy_affine_gap_recursion.hpp:58
alignment_configuration_traits< alignment_configuration_t > traits_type
The configuration traits type.
Definition policy_affine_gap_recursion.hpp:45
The internal SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26
Provides seqan3::detail::policy_affine_gap_recursion.
Hide me