diff --git a/doc/tutorial/pairwise_alignment/configurations.cpp b/doc/tutorial/pairwise_alignment/configurations.cpp index 836589689d0..ee13002df85 100644 --- a/doc/tutorial/pairwise_alignment/configurations.cpp +++ b/doc/tutorial/pairwise_alignment/configurations.cpp @@ -20,7 +20,6 @@ //! [include_result] //! [include_band] -#include #include //! [include_band] @@ -92,7 +91,8 @@ auto cfg = seqan3::align_cfg::result{seqan3::with_score}; //! [band] // Configure a banded alignment. -auto cfg = seqan3::align_cfg::band{seqan3::static_band{seqan3::lower_bound{-4}, seqan3::upper_bound{4}}}; +auto cfg = seqan3::align_cfg::band_fixed_size{seqan3::align_cfg::lower_diagonal{-4}, + seqan3::align_cfg::upper_diagonal{4}}; //! [band] (void) cfg; } diff --git a/doc/tutorial/pairwise_alignment/index.md b/doc/tutorial/pairwise_alignment/index.md index 19188447bd5..17249109d21 100644 --- a/doc/tutorial/pairwise_alignment/index.md +++ b/doc/tutorial/pairwise_alignment/index.md @@ -267,14 +267,14 @@ In many situations it is not necessary to compute the entire alignment matrix bu positive impacts on the performance. To limit the computation space the alignment matrix can be bounded by a band. Thus, only the alignment is computed that fits in this band. Note that this must not be the optimal alignment but in many cases we can give a rough bound on how similar the sequences will be and therefor use the banded alignment. -To do so, you can use a seqan3::static_band. It will be initialised with a seqan3::lower_bound and a -seqan3::upper_bound. To configure the banded alignment you need to use the seqan3::align_cfg::band configuration. +To do so, you can configure the alignment using the seqan3::align_cfg::band_fixed_size option. This configuration +element will be initialised with a seqan3::align_cfg::lower_diagonal and seqan3::align_cfg::upper_diagonal. \snippet doc/tutorial/pairwise_alignment/configurations.cpp include_band \snippet doc/tutorial/pairwise_alignment/configurations.cpp band \assignment{Assignment 5} -Use the example from assignment 4 and compute it in a band with lower bound set to `-3` and upper bound set to `8`. +Use the example from assignment 4 and compute it in a band with lower diagonal set to `-3` and upper diagonal set to `8`. How does the result change? \endassignment diff --git a/doc/tutorial/pairwise_alignment/pairwise_alignment_solution_5.cpp b/doc/tutorial/pairwise_alignment/pairwise_alignment_solution_5.cpp index 87cd7119198..937b6acbae7 100644 --- a/doc/tutorial/pairwise_alignment/pairwise_alignment_solution_5.cpp +++ b/doc/tutorial/pairwise_alignment/pairwise_alignment_solution_5.cpp @@ -1,6 +1,5 @@ #include -#include #include #include #include @@ -20,7 +19,8 @@ int main() seqan3::align_cfg::gap{seqan3::gap_scheme{seqan3::gap_score{-4}}} | seqan3::align_cfg::aligned_ends{seqan3::free_ends_all} | seqan3::align_cfg::result{seqan3::with_alignment} | - seqan3::align_cfg::band{seqan3::static_band{seqan3::lower_bound{-3}, seqan3::upper_bound{8}}}; + seqan3::align_cfg::band_fixed_size{seqan3::align_cfg::lower_diagonal{-3}, + seqan3::align_cfg::upper_diagonal{8}}; for (auto const & res : seqan3::align_pairwise(std::tie(seq1, seq2), config)) { diff --git a/include/seqan3/alignment/all.hpp b/include/seqan3/alignment/all.hpp index 2b81cf81f3e..826839e1a20 100644 --- a/include/seqan3/alignment/all.hpp +++ b/include/seqan3/alignment/all.hpp @@ -81,7 +81,7 @@ * | **Config** | **0** | **1** | **2** | **3** | **4** | **5** | **6** | **7** | **8** | **9** | * | --------------------------------------------------------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------| * | \ref seqan3::align_cfg::aligned_ends "0: Aligned ends" | ❌ | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | - * | \ref seqan3::align_cfg::band "1: Band" | | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | + * | \ref seqan3::align_cfg::band_fixed_size "1: Band" | | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | * | \ref seqan3::align_cfg::gap "2: Gap scheme" | | | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | * | \ref seqan3::global_alignment "3: Global alignment" | | | | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | * | \ref seqan3::local_alignment "4: Local alignment" | | | | | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ | @@ -171,12 +171,12 @@ * * SeqAn offers the computation of banded alignments to reduce the running time of the algorithm. This can be * helpful if the region in which the optimal alignment exists is known a priori. To specify the banded alignment - * the developer can use the seqan3::align_cfg::band option initialised with a seqan3::static_band. - * The seqan3::static_band is constructed with a lower bound and an upper bound. The upper bound must always be greater - * than or equal to the lower bound. To position the band, imagine a rectangle where the first sequence is written on - * top and the second sequence along the left vertical side. A negative bound implies a start of the band within the - * vertical part while a positive bound implies a start within the top part of this rectangle at the respective - * position. + * the developer can use the seqan3::align_cfg::band_fixed_size option. + * This band configuration is initialised with a seqan3::align_cfg::lower_diagonal and an + * seqan3::align_cfg::upper_diagonal. The upper diagonal must always be greater than or equal to the lower diagonal. + * To choose the correct band parameters, imagine a matrix with the first sequence written on top and the second sequence + * along the left vertical side. A negative value reflects a start of the diagonal within the vertical part while a + * positive value implies a start within the top part of this matrix at the respective position. * * ## Global and local alignments * diff --git a/include/seqan3/alignment/configuration/align_config_band.hpp b/include/seqan3/alignment/configuration/align_config_band.hpp index 1498b3228bb..de2045ce53e 100644 --- a/include/seqan3/alignment/configuration/align_config_band.hpp +++ b/include/seqan3/alignment/configuration/align_config_band.hpp @@ -14,51 +14,104 @@ #pragma once #include -#include +#include #include +#include +#include namespace seqan3::align_cfg { -/*!\brief Configuration element for setting the band. +/*!\brief A strong type representing the lower diagonal of the seqan3::align_cfg::band_fixed_size. + * \ingroup alignment_configuration + */ +struct lower_diagonal : public seqan3::detail::strong_type +{ + //!\brief The type of the strong type base class. + using base_t = seqan3::detail::strong_type; + // Import the base class constructors + using base_t::base_t; +}; + +/*!\brief A strong type representing the upper diagonal of the seqan3::align_cfg::band_fixed_size. + * \ingroup alignment_configuration + */ +struct upper_diagonal : public seqan3::detail::strong_type +{ + //!\brief The type of the strong type base class. + using base_t = seqan3::detail::strong_type; + // Import the base class constructors + using base_t::base_t; +}; + +/*!\brief Configuration element for setting a fixed size band. * \ingroup alignment_configuration - * - * \tparam band_t The type of the band. * * \details * - * Configures the banded alignment algorithm. Currently only seqan3::static_band is allowed as argument. - * If no band is configured for the alignment algorithm the full alignment matrix will be computed. - * Before executing the algorithm the band is tested for valid settings, e.g. that the upper bound is not smaller than - * the lower bound, or the band is not shifted out of the alignment matrix. If an invalid setting is detected, a - * seqan3::invalid_alignment_configuration exception will be thrown. + * Configures the banded alignment algorithm. Currently only a fixed size band is allowed. + * The band is given in form of a seqan3::align_cfg::lower_diagonal and a seqan3::align_cfg::upper_diagonal. + * A diagonal represents the cells in the alignment matrix that are not crossed by the alignment either downwards by + * the lower diagonal or rightwards by the upper diagonal. Thus any computed alignment will be inside the area defined + * by the lower and the upper diagonal. + * + * If this configuration is default constructed or not set during the algorithm configuration the full alignment + * matrix will be computed. + * + * During the construction of this configuration element or before the execution of the alignment algorithm the + * band configuration is validated. If the user provided an invalid band, e.g. the upper diagonal is smaller than + * the lower diagonal, the alignment matrix would be ill configured such that the requested alignment method cannot + * be computed (because the global alignment requires the first cell and the last cell of the matrix to be reachable), + * then a seqan3::invalid_alignment_configuration will be thrown. * * ### Example * * \include test/snippet/alignment/configuration/align_cfg_band_example.cpp */ -template -//!\cond - requires std::same_as -//!\endcond -struct band : public pipeable_config_element, band_t> +class band_fixed_size : public pipeable_config_element { +private: + //!\brief The base class type. + using base_t = pipeable_config_element; + +public: + //!\brief The selected lower diagonal. Defaults to `std::%numeric_limits::%lowest()`. + seqan3::align_cfg::lower_diagonal lower_diagonal{std::numeric_limits::lowest()}; + //!\brief The selected upper diagonal. Defaults to `std::%numeric_limits::%max()`. + seqan3::align_cfg::upper_diagonal upper_diagonal{std::numeric_limits::max()}; + + /*!\name Constructor, destructor and assignment + * \{ + */ + constexpr band_fixed_size() = default; //!< Defaulted. + constexpr band_fixed_size(band_fixed_size const &) = default; //!< Defaulted. + constexpr band_fixed_size(band_fixed_size &&) = default; //!< Defaulted. + constexpr band_fixed_size & operator=(band_fixed_size const &) = default; //!< Defaulted. + constexpr band_fixed_size & operator=(band_fixed_size &&) = default; //!< Defaulted. + ~band_fixed_size() = default; //!< Defaulted. + + /*!\brief Initialises the fixed size band by setting the lower and the upper matrix diagonal. + * + * \param lower_diagonal \copybrief seqan3::align_cfg::band_fixed_size::lower_diagonal + * \param upper_diagonal \copybrief seqan3::align_cfg::band_fixed_size::upper_diagonal + * + * \details + * + * The lower diagonal represents the lower bound of the banded matrix, i.e. the alignment cannot pass below this + * diagonal. Similar, the upper diagonal represents the upper bound of the alignment. During the alignment + * configuration and execution the band parameters will be checked and an exception will be thrown in case of + * an invalid configuration. + */ + constexpr band_fixed_size(seqan3::align_cfg::lower_diagonal const lower_diagonal, + seqan3::align_cfg::upper_diagonal const upper_diagonal) : + lower_diagonal{std::move(lower_diagonal)}, + upper_diagonal{std::move(upper_diagonal)} + {} + //!\} + //!\privatesection //!\brief Internal id to check for consistent configuration settings. static constexpr detail::align_config_id id{detail::align_config_id::band}; }; -/*!\name Type deduction guides - * \brief Deduces the template parameter from the argument. - * \relates seqan3::align_cfg::band - * \{ - */ -/*! - * \brief Deduces the underlying band type. - * \tparam band_t The underlying type of the band. - */ -template -band(band_t) -> band; -//!\} - -} // namespace seqan3::detail +} // namespace seqan3::align_cfg diff --git a/include/seqan3/alignment/configuration/detail.hpp b/include/seqan3/alignment/configuration/detail.hpp index 939f50654ed..6d445004afc 100644 --- a/include/seqan3/alignment/configuration/detail.hpp +++ b/include/seqan3/alignment/configuration/detail.hpp @@ -25,7 +25,7 @@ enum struct align_config_id : uint8_t //!\brief ID for the \ref seqan3::align_cfg::alignment_result_capture "alignment_result_capture" option. alignment_result_capture, aligned_ends, //!< ID for the \ref seqan3::align_cfg::aligned_ends "aligned_ends" option. - band, //!< ID for the \ref seqan3::align_cfg::band "band" option. + band, //!< ID for the \ref seqan3::align_cfg::band_fixed_size "band" option. debug, //!< ID for the \ref seqan3::align_cfg::debug "debug" option. gap, //!< ID for the \ref seqan3::align_cfg::gap "gap" option. global, //!< ID for the \ref seqan3::global_alignment "global alignment" option. diff --git a/include/seqan3/alignment/matrix/detail/aligned_sequence_builder.hpp b/include/seqan3/alignment/matrix/detail/aligned_sequence_builder.hpp index 6f1bb6f91f9..f3c19da630b 100644 --- a/include/seqan3/alignment/matrix/detail/aligned_sequence_builder.hpp +++ b/include/seqan3/alignment/matrix/detail/aligned_sequence_builder.hpp @@ -16,7 +16,6 @@ #include #include -#include #include #include #include diff --git a/include/seqan3/alignment/matrix/detail/alignment_score_matrix_one_column_banded.hpp b/include/seqan3/alignment/matrix/detail/alignment_score_matrix_one_column_banded.hpp index 35385b5f45f..bf08352ba18 100644 --- a/include/seqan3/alignment/matrix/detail/alignment_score_matrix_one_column_banded.hpp +++ b/include/seqan3/alignment/matrix/detail/alignment_score_matrix_one_column_banded.hpp @@ -12,7 +12,7 @@ #pragma once -#include +#include #include #include #include @@ -99,7 +99,7 @@ class alignment_score_matrix_one_column_banded : * * \param[in] first The first range. * \param[in] second The second range. - * \param[in] band The seqan3::static_band in which to calculate the alignment. + * \param[in] band The seqan3::align_cfg::band_fixed_size in which to calculate the alignment. * \param[in] initial_value The value to initialise the matrix with. Default initialised if not specified. * * \details @@ -111,14 +111,14 @@ class alignment_score_matrix_one_column_banded : std::ranges::forward_range second_sequence_t> constexpr alignment_score_matrix_one_column_banded(first_sequence_t && first, second_sequence_t && second, - static_band const & band, + align_cfg::band_fixed_size const & band, score_t const initial_value = score_t{}) { matrix_base_t::num_cols = static_cast(std::ranges::distance(first) + 1); matrix_base_t::num_rows = static_cast(std::ranges::distance(second) + 1); - band_col_index = std::min(std::max(band.upper_bound, 0), matrix_base_t::num_cols - 1); - band_row_index = std::min(std::abs(std::min(band.lower_bound, 0)), + band_col_index = std::min(std::max(band.upper_diagonal.get(), 0), matrix_base_t::num_cols - 1); + band_row_index = std::min(std::abs(std::min(band.lower_diagonal.get(), 0)), matrix_base_t::num_rows - 1); band_size = band_col_index + band_row_index + 1; diff --git a/include/seqan3/alignment/matrix/detail/alignment_trace_matrix_full_banded.hpp b/include/seqan3/alignment/matrix/detail/alignment_trace_matrix_full_banded.hpp index a4ecca4f18b..777589f790b 100644 --- a/include/seqan3/alignment/matrix/detail/alignment_trace_matrix_full_banded.hpp +++ b/include/seqan3/alignment/matrix/detail/alignment_trace_matrix_full_banded.hpp @@ -12,7 +12,7 @@ #pragma once -#include +#include #include #include #include @@ -115,7 +115,7 @@ class alignment_trace_matrix_full_banded : * * \param[in] first The first range. * \param[in] second The second range. - * \param[in] band The seqan3::static_band in which to calculate the alignment. + * \param[in] band The seqan3::align_cfg::band_fixed_size in which to calculate the alignment. * \param[in] initial_value The value to initialise the matrix with. Default initialised if not specified. * * \details @@ -127,14 +127,16 @@ class alignment_trace_matrix_full_banded : template constexpr alignment_trace_matrix_full_banded(first_sequence_t && first, second_sequence_t && second, - static_band const & band, + align_cfg::band_fixed_size const & band, [[maybe_unused]] trace_t const initial_value = trace_t{}) { matrix_base_t::num_cols = static_cast(std::ranges::distance(first) + 1); matrix_base_t::num_rows = static_cast(std::ranges::distance(second) + 1); - band_col_index = std::min(std::max(band.upper_bound, 0), matrix_base_t::num_cols - 1); - band_row_index = std::min(std::abs(std::min(band.lower_bound, 0)), matrix_base_t::num_rows - 1); + band_col_index = std::min(std::max(band.upper_diagonal.get(), 0), + matrix_base_t::num_cols - 1); + band_row_index = std::min(std::abs(std::min(band.lower_diagonal.get(), 0)), + matrix_base_t::num_rows - 1); band_size = band_col_index + band_row_index + 1; // Reserve one more cell to deal with last cell in the banded column which needs only the diagonal and up cell. diff --git a/include/seqan3/alignment/pairwise/alignment_algorithm.hpp b/include/seqan3/alignment/pairwise/alignment_algorithm.hpp index 3e392447022..b0ddbced831 100644 --- a/include/seqan3/alignment/pairwise/alignment_algorithm.hpp +++ b/include/seqan3/alignment/pairwise/alignment_algorithm.hpp @@ -291,8 +291,9 @@ class alignment_algorithm : if constexpr (traits_t::is_banded) { + using seqan3::get; // Get the band and check if band configuration is valid. - auto const & band = seqan3::get(*cfg_ptr).value; + auto const & band = get(*cfg_ptr); check_valid_band_parameter(sequence1, sequence2, band); auto && [subsequence1, subsequence2] = this->slice_sequences(sequence1, sequence2, band); // It would be great to use this interface here instead @@ -325,27 +326,27 @@ class alignment_algorithm : template constexpr void check_valid_band_parameter(sequence1_t && sequence1, sequence2_t && sequence2, - static_band const & band) + align_cfg::band_fixed_size const & band) { - static_assert(config_t::template exists(), + static_assert(config_t::template exists(), "The band configuration is required for the banded alignment algorithm."); using diff_type = std::iter_difference_t>; static_assert(std::is_signed_v, "Only signed types can be used to test the band parameters."); - if (static_cast(band.lower_bound) > std::ranges::distance(sequence1)) + if (static_cast(band.lower_diagonal.get()) > std::ranges::distance(sequence1)) { throw invalid_alignment_configuration { - "Invalid band error: The lower bound excludes the whole alignment matrix." + "Invalid band error: The lower diagonal excludes the whole alignment matrix." }; } - if (static_cast(band.upper_bound) < -std::ranges::distance(sequence2)) + if (static_cast(band.upper_diagonal.get()) < -std::ranges::distance(sequence2)) { throw invalid_alignment_configuration { - "Invalid band error: The upper bound excludes the whole alignment matrix." + "Invalid band error: The upper diagonal excludes the whole alignment matrix." }; } } @@ -411,7 +412,7 @@ class alignment_algorithm : //!\overload template - void compute_matrix(sequence1_t & sequence1, sequence2_t & sequence2, static_band const & band) + void compute_matrix(sequence1_t & sequence1, sequence2_t & sequence2, align_cfg::band_fixed_size const & band) //!\cond requires traits_t::is_banded //!\endcond diff --git a/include/seqan3/alignment/pairwise/detail/type_traits.hpp b/include/seqan3/alignment/pairwise/detail/type_traits.hpp index 6158d79c774..dab075c96d4 100644 --- a/include/seqan3/alignment/pairwise/detail/type_traits.hpp +++ b/include/seqan3/alignment/pairwise/detail/type_traits.hpp @@ -112,7 +112,7 @@ struct alignment_configuration_traits //!\brief Flag indicating whether local alignment mode is enabled. static constexpr bool is_local = configuration_t::template exists>(); //!\brief Flag indicating whether banded alignment mode is enabled. - static constexpr bool is_banded = configuration_t::template exists(); + static constexpr bool is_banded = configuration_t::template exists(); //!\brief Flag indicating whether debug mode is enabled. static constexpr bool is_debug = configuration_t::template exists(); diff --git a/include/seqan3/alignment/pairwise/policy/alignment_matrix_policy.hpp b/include/seqan3/alignment/pairwise/policy/alignment_matrix_policy.hpp index 255dec88025..948321b34c3 100644 --- a/include/seqan3/alignment/pairwise/policy/alignment_matrix_policy.hpp +++ b/include/seqan3/alignment/pairwise/policy/alignment_matrix_policy.hpp @@ -15,7 +15,7 @@ #include #include -#include +#include #include #include #include @@ -106,7 +106,7 @@ class alignment_matrix_policy template constexpr void allocate_matrix(sequence1_t && sequence1, sequence2_t && sequence2, - static_band const & band, + align_cfg::band_fixed_size const & band, alignment_algorithm_state const & state) { assert(state.gap_extension_score <= 0); // We expect it to never be positive. @@ -130,7 +130,7 @@ class alignment_matrix_policy * \tparam sequence2_t The type of the second sequence to align; must model std::forward_ranges. * \param[in] sequence1 The first sequence to align. * \param[in] sequence2 The second sequence to align. - * \param[in] band The seqan3::static_band used to limit the alignment space. + * \param[in] band The seqan3::align_cfg::band_fixed_size used to limit the alignment space. * * \details * @@ -140,22 +140,22 @@ class alignment_matrix_policy template constexpr auto slice_sequences(sequence1_t & sequence1, sequence2_t & sequence2, - static_band const & band) const noexcept + align_cfg::band_fixed_size const & band) const noexcept { size_t seq1_size = std::ranges::distance(sequence1); size_t seq2_size = std::ranges::distance(sequence2); auto trim_sequence1 = [&] () constexpr { - size_t begin_pos = std::max(band.lower_bound - 1, 0); - size_t end_pos = std::min(band.upper_bound + seq2_size, seq1_size); + size_t begin_pos = std::max(band.lower_diagonal.get() - 1, 0); + size_t end_pos = std::min(band.upper_diagonal.get() + seq2_size, seq1_size); return sequence1 | views::slice(begin_pos, end_pos); }; auto trim_sequence2 = [&] () constexpr { - size_t begin_pos = std::abs(std::min(band.upper_bound + 1, 0)); - size_t end_pos = std::min(seq1_size - band.lower_bound, seq2_size); + size_t begin_pos = std::abs(std::min(band.upper_diagonal.get() + 1, 0)); + size_t end_pos = std::min(seq1_size - band.lower_diagonal.get(), seq2_size); return sequence2 | views::slice(begin_pos, end_pos); }; diff --git a/test/snippet/alignment/configuration/align_cfg_band_example.cpp b/test/snippet/alignment/configuration/align_cfg_band_example.cpp index 9f89f450435..4c5a6e90522 100644 --- a/test/snippet/alignment/configuration/align_cfg_band_example.cpp +++ b/test/snippet/alignment/configuration/align_cfg_band_example.cpp @@ -1,4 +1,3 @@ -#include #include int main() @@ -6,16 +5,20 @@ int main() try { // A symmetric band around the main diagonal. - seqan3::align_cfg::band band_cfg{seqan3::static_band{seqan3::lower_bound{-4}, seqan3::upper_bound{4}}}; + seqan3::align_cfg::band_fixed_size band_cfg{seqan3::align_cfg::lower_diagonal{-4}, + seqan3::align_cfg::upper_diagonal{4}}; // A band starting with the main diagonal shifted by 3 cells to the right. - seqan3::align_cfg::band band_cfg_hi{seqan3::static_band{seqan3::lower_bound{3}, seqan3::upper_bound{7}}}; + seqan3::align_cfg::band_fixed_size band_cfg_hi{seqan3::align_cfg::lower_diagonal{3}, + seqan3::align_cfg::upper_diagonal{7}}; // A band starting with the main diagonal shifted by 3 cells down. - seqan3::align_cfg::band band_cfg_lo{seqan3::static_band{seqan3::lower_bound{-7}, seqan3::upper_bound{-3}}}; + seqan3::align_cfg::band_fixed_size band_cfg_lo{seqan3::align_cfg::lower_diagonal{-7}, + seqan3::align_cfg::upper_diagonal{-3}}; // An invalid band configuration. - seqan3::align_cfg::band band_cfg_invalid{seqan3::static_band{seqan3::lower_bound{7}, seqan3::upper_bound{3}}}; + seqan3::align_cfg::band_fixed_size band_cfg_invalid{seqan3::align_cfg::lower_diagonal{7}, + seqan3::align_cfg::upper_diagonal{3}}; } catch(...) { diff --git a/test/snippet/core/algorithm/configuration_combine.cpp b/test/snippet/core/algorithm/configuration_combine.cpp index 3662152c684..13a8d9510c3 100644 --- a/test/snippet/core/algorithm/configuration_combine.cpp +++ b/test/snippet/core/algorithm/configuration_combine.cpp @@ -1,4 +1,3 @@ -#include #include #include #include @@ -8,6 +7,6 @@ int main() { // Here we use the global and banded alignment configurations to show how they can be combined. seqan3::configuration my_cfg = seqan3::align_cfg::mode{seqan3::global_alignment} | - seqan3::align_cfg::band{seqan3::static_band{seqan3::lower_bound{-4}, - seqan3::upper_bound{4}}}; + seqan3::align_cfg::band_fixed_size{seqan3::align_cfg::lower_diagonal{-4}, + seqan3::align_cfg::upper_diagonal{4}}; } diff --git a/test/snippet/core/algorithm/configuration_get.cpp b/test/snippet/core/algorithm/configuration_get.cpp index 046880cceaa..74ee17a958d 100644 --- a/test/snippet/core/algorithm/configuration_get.cpp +++ b/test/snippet/core/algorithm/configuration_get.cpp @@ -1,4 +1,3 @@ -#include #include #include #include @@ -12,11 +11,11 @@ int main() seqan3::configuration my_cfg = seqan3::align_cfg::gap{seqan3::gap_scheme{seqan3::gap_score{-1}, seqan3::gap_open_score{-10}}} | - seqan3::align_cfg::band{seqan3::static_band{seqan3::lower_bound{-4}, - seqan3::upper_bound{4}}}; + seqan3::align_cfg::band_fixed_size{seqan3::align_cfg::lower_diagonal{-4}, + seqan3::align_cfg::upper_diagonal{4}}; // my_cfg is now of type configuration - seqan3::debug_stream << get<1>(my_cfg).value.lower_bound << '\n'; // prints -4 - seqan3::debug_stream << get(my_cfg).value.upper_bound << '\n'; // prints 4 - seqan3::debug_stream << get(my_cfg).value.get_gap_score() << '\n'; // prints -1 + seqan3::debug_stream << get<1>(my_cfg).lower_diagonal << '\n'; // prints -4 + seqan3::debug_stream << get(my_cfg).upper_diagonal << '\n'; // prints 4 + seqan3::debug_stream << get(my_cfg).value.get_gap_score() << '\n'; // prints -1 } diff --git a/test/unit/alignment/configuration/align_config_band_test.cpp b/test/unit/alignment/configuration/align_config_band_test.cpp index 497c1dde902..9330645fe32 100644 --- a/test/unit/alignment/configuration/align_config_band_test.cpp +++ b/test/unit/alignment/configuration/align_config_band_test.cpp @@ -12,30 +12,66 @@ #include #include -TEST(align_config_band, config_element_specialisation) +#include "../../core/algorithm/pipeable_config_element_test_template.hpp" + +using test_types = ::testing::Types; + +INSTANTIATE_TYPED_TEST_SUITE_P(band_elements, pipeable_config_element_test, test_types, ); + +TEST(band_fixed_size, config_element_specialisation) { - EXPECT_TRUE((seqan3::detail::config_element_specialisation>)); + EXPECT_TRUE((seqan3::detail::config_element_specialisation)); } -TEST(align_config_band, configuration) +TEST(band_fixed_size, construct) { - { - seqan3::align_cfg::band elem{seqan3::static_band{seqan3::lower_bound{-5}, seqan3::upper_bound{5}}}; - seqan3::configuration cfg{elem}; - EXPECT_EQ((std::is_same_v(cfg).value)>, - seqan3::static_band>), true); - - EXPECT_EQ(seqan3::get(cfg).value.lower_bound, -5); - EXPECT_EQ(seqan3::get(cfg).value.upper_bound, 5); + using seqan3::get; + + constexpr int32_t minus_infinity = std::numeric_limits::lowest(); + constexpr int32_t plus_infinity = std::numeric_limits::max(); + + { // Default construct + seqan3::align_cfg::band_fixed_size band_config{}; + EXPECT_EQ(band_config.lower_diagonal.get(), minus_infinity); + EXPECT_EQ(band_config.upper_diagonal.get(), plus_infinity); } - { - seqan3::configuration cfg{seqan3::align_cfg::band{seqan3::static_band{seqan3::lower_bound{-5}, - seqan3::upper_bound{5}}}}; - EXPECT_EQ((std::is_same_v(cfg).value)>, - seqan3::static_band>), true); + { // Construct with parameter + seqan3::align_cfg::band_fixed_size band_config{seqan3::align_cfg::lower_diagonal{-5}, + seqan3::align_cfg::upper_diagonal{5}}; - EXPECT_EQ(seqan3::get(cfg).value.lower_bound, -5); - EXPECT_EQ(seqan3::get(cfg).value.upper_bound, 5); + EXPECT_EQ(band_config.lower_diagonal.get(), -5); + EXPECT_EQ(band_config.upper_diagonal.get(), 5); } } + +TEST(band_fixed_size, assign) +{ + seqan3::align_cfg::band_fixed_size band_config{}; + + band_config.lower_diagonal = seqan3::align_cfg::lower_diagonal{-5}; + band_config.upper_diagonal = seqan3::align_cfg::upper_diagonal{5}; + + EXPECT_EQ(band_config.lower_diagonal.get(), -5); + EXPECT_EQ(band_config.upper_diagonal.get(), 5); +} + +TEST(band_fixed_size, get_and_assign) +{ + using seqan3::get; + + seqan3::align_cfg::band_fixed_size band_config{seqan3::align_cfg::lower_diagonal{-5}, + seqan3::align_cfg::upper_diagonal{5}}; + seqan3::configuration config{band_config}; + + auto & selected_band_config = get(config); + + EXPECT_EQ(selected_band_config.lower_diagonal.get(), -5); + EXPECT_EQ(selected_band_config.upper_diagonal.get(), 5); + + selected_band_config.lower_diagonal = seqan3::align_cfg::lower_diagonal{-4}; + selected_band_config.upper_diagonal = seqan3::align_cfg::upper_diagonal{8}; + + EXPECT_EQ(get(config).lower_diagonal.get(), -4); + EXPECT_EQ(get(config).upper_diagonal.get(), 8); +} diff --git a/test/unit/alignment/configuration/align_config_common_test.cpp b/test/unit/alignment/configuration/align_config_common_test.cpp index 6ae3d361820..97e1dcedb82 100644 --- a/test/unit/alignment/configuration/align_config_common_test.cpp +++ b/test/unit/alignment/configuration/align_config_common_test.cpp @@ -10,7 +10,6 @@ #include #include -#include #include template @@ -20,7 +19,7 @@ class alignment_configuration_test : public ::testing::Test using alignment_result_t = seqan3::alignment_result>; using test_types = ::testing::Types>, - seqan3::align_cfg::band, + seqan3::align_cfg::band_fixed_size, seqan3::align_cfg::gap>, seqan3::align_cfg::max_error, seqan3::align_cfg::mode, diff --git a/test/unit/alignment/matrix/detail/alignment_matrix_base_test_template.hpp b/test/unit/alignment/matrix/detail/alignment_matrix_base_test_template.hpp index eaa2c2f1595..972b282d349 100644 --- a/test/unit/alignment/matrix/detail/alignment_matrix_base_test_template.hpp +++ b/test/unit/alignment/matrix/detail/alignment_matrix_base_test_template.hpp @@ -7,7 +7,7 @@ #include -#include +#include #include template @@ -19,7 +19,10 @@ struct alignment_matrix_base_test : public ::testing::Test alignment_matrix_base_test() { if constexpr (is_banded) - test_range = matrix_t{first, second, seqan3::static_band{seqan3::lower_bound{-2}, seqan3::upper_bound{2}}}; + test_range = matrix_t{first, + second, + seqan3::align_cfg::band_fixed_size{seqan3::align_cfg::lower_diagonal{-2}, + seqan3::align_cfg::upper_diagonal{2}}}; else test_range = matrix_t{first, second}; } @@ -90,7 +93,8 @@ TYPED_TEST_P(alignment_matrix_base_test, empty_row) if constexpr (TestFixture::is_banded) { - seqan3::static_band band{seqan3::lower_bound{-2}, seqan3::upper_bound{4}}; + seqan3::align_cfg::band_fixed_size band{seqan3::align_cfg::lower_diagonal{-2}, + seqan3::align_cfg::upper_diagonal{4}}; test_matrix_iteration(matrix_type{this->first, std::string{""}, band}, 5, 5); } else @@ -105,7 +109,8 @@ TYPED_TEST_P(alignment_matrix_base_test, empty_col) if constexpr (TestFixture::is_banded) { - seqan3::static_band band{seqan3::lower_bound{-2}, seqan3::upper_bound{2}}; + seqan3::align_cfg::band_fixed_size band{seqan3::align_cfg::lower_diagonal{-2}, + seqan3::align_cfg::upper_diagonal{2}}; test_matrix_iteration(matrix_type{std::string{""}, this->second, band}, 1, 3); } else @@ -120,7 +125,8 @@ TYPED_TEST_P(alignment_matrix_base_test, empty_col_row) if constexpr (TestFixture::is_banded) { - seqan3::static_band band{seqan3::lower_bound{0}, seqan3::upper_bound{2}}; + seqan3::align_cfg::band_fixed_size band{seqan3::align_cfg::lower_diagonal{0}, + seqan3::align_cfg::upper_diagonal{2}}; test_matrix_iteration(matrix_type{std::string{""}, std::string{""}, band}, 1, 1); } else diff --git a/test/unit/alignment/matrix/detail/alignment_score_matrix_one_column_banded_test.cpp b/test/unit/alignment/matrix/detail/alignment_score_matrix_one_column_banded_test.cpp index 2d97fc9605a..e67fa2393d5 100644 --- a/test/unit/alignment/matrix/detail/alignment_score_matrix_one_column_banded_test.cpp +++ b/test/unit/alignment/matrix/detail/alignment_score_matrix_one_column_banded_test.cpp @@ -24,7 +24,11 @@ struct alignment_score_matrix_one_column_banded_test alignment_score_matrix_one_column_banded_test() = default; alignment_score_matrix_one_column_banded_test(std::string f, std::string s) : - matrix{matrix_t{f, s, seqan3::static_band{seqan3::lower_bound{-2}, seqan3::upper_bound{2}}, -100}} + matrix{matrix_t{f, + s, + seqan3::align_cfg::band_fixed_size{seqan3::align_cfg::lower_diagonal{-2}, + seqan3::align_cfg::upper_diagonal{2}}, + -100}} {} // Banded matrix. We write only partial columns to the result. diff --git a/test/unit/alignment/matrix/detail/alignment_trace_matrix_full_banded_test.cpp b/test/unit/alignment/matrix/detail/alignment_trace_matrix_full_banded_test.cpp index 4d0281b80ba..a247662e79a 100644 --- a/test/unit/alignment/matrix/detail/alignment_trace_matrix_full_banded_test.cpp +++ b/test/unit/alignment/matrix/detail/alignment_trace_matrix_full_banded_test.cpp @@ -118,7 +118,10 @@ INSTANTIATE_TYPED_TEST_SUITE_P(banded_trace_matrix_inner_iterator, TEST(trace_matrix, trace_path) { seqan3::detail::alignment_trace_matrix_full_banded - matrix{"acgt", "acgt", seqan3::static_band{seqan3::lower_bound{-3}, seqan3::upper_bound{3}}}; + matrix{"acgt", + "acgt", + seqan3::align_cfg::band_fixed_size{seqan3::align_cfg::lower_diagonal{-3}, + seqan3::align_cfg::upper_diagonal{3}}}; EXPECT_THROW((matrix.trace_path(seqan3::detail::matrix_coordinate{seqan3::detail::row_index_type{7u}, seqan3::detail::column_index_type{4u}})), diff --git a/test/unit/alignment/pairwise/alignment_configurator_test.cpp b/test/unit/alignment/pairwise/alignment_configurator_test.cpp index 70bbb8e82ea..a54bad501f4 100644 --- a/test/unit/alignment/pairwise/alignment_configurator_test.cpp +++ b/test/unit/alignment/pairwise/alignment_configurator_test.cpp @@ -73,8 +73,8 @@ TEST(alignment_configurator, configure_edit_semi) TEST(alignment_configurator, configure_edit_banded) { EXPECT_THROW((run_test(seqan3::align_cfg::edit | - seqan3::align_cfg::band{seqan3::static_band{seqan3::lower_bound{-1}, - seqan3::upper_bound{1}}})), + seqan3::align_cfg::band_fixed_size{seqan3::align_cfg::lower_diagonal{-1}, + seqan3::align_cfg::upper_diagonal{1}})), seqan3::invalid_alignment_configuration); } @@ -138,7 +138,7 @@ TEST(alignment_configurator, configure_affine_global_banded) auto cfg = seqan3::align_cfg::mode{seqan3::global_alignment} | seqan3::align_cfg::scoring{seqan3::nucleotide_scoring_scheme{}} | seqan3::align_cfg::gap{seqan3::gap_scheme{seqan3::gap_score{-1}, seqan3::gap_open_score{-10}}} | - seqan3::align_cfg::band{seqan3::static_band{seqan3::lower_bound{-1}, seqan3::upper_bound{1}}}; + seqan3::align_cfg::band_fixed_size{seqan3::align_cfg::lower_diagonal{-1}, seqan3::align_cfg::upper_diagonal{1}}; EXPECT_EQ(run_test(cfg).score(), 0); } @@ -147,10 +147,10 @@ TEST(alignment_configurator, configure_affine_global_banded) auto cfg_base = seqan3::align_cfg::mode{seqan3::global_alignment} | seqan3::align_cfg::scoring{seqan3::nucleotide_scoring_scheme{}} | seqan3::align_cfg::gap{seqan3::gap_scheme{seqan3::gap_score{-1}, seqan3::gap_open_score{-10}}}; - auto cfg_lower = cfg_base | seqan3::align_cfg::band{seqan3::static_band{seqan3::lower_bound{-10}, - seqan3::upper_bound{-5}}}; - auto cfg_upper = cfg_base | seqan3::align_cfg::band{seqan3::static_band{seqan3::lower_bound{5}, - seqan3::upper_bound{6}}}; + auto cfg_lower = cfg_base | seqan3::align_cfg::band_fixed_size{seqan3::align_cfg::lower_diagonal{-10}, + seqan3::align_cfg::upper_diagonal{-5}}; + auto cfg_upper = cfg_base | seqan3::align_cfg::band_fixed_size{seqan3::align_cfg::lower_diagonal{5}, + seqan3::align_cfg::upper_diagonal{6}}; EXPECT_THROW(run_test(cfg_lower), seqan3::invalid_alignment_configuration); EXPECT_THROW(run_test(cfg_upper), seqan3::invalid_alignment_configuration); @@ -162,7 +162,7 @@ TEST(alignment_configurator, configure_affine_global_banded_with_alignment) auto cfg = seqan3::align_cfg::mode{seqan3::global_alignment} | seqan3::align_cfg::gap{seqan3::gap_scheme{seqan3::gap_score{-1}, seqan3::gap_open_score{-10}}} | seqan3::align_cfg::scoring{seqan3::nucleotide_scoring_scheme{}} | - seqan3::align_cfg::band{seqan3::static_band{seqan3::lower_bound{-1}, seqan3::upper_bound{1}}}; + seqan3::align_cfg::band_fixed_size{seqan3::align_cfg::lower_diagonal{-1}, seqan3::align_cfg::upper_diagonal{1}}; auto cfg_trace = cfg | seqan3::align_cfg::result{seqan3::with_alignment}; auto cfg_begin = cfg | seqan3::align_cfg::result{seqan3::with_front_coordinate}; diff --git a/test/unit/alignment/pairwise/fixture/global_affine_banded.hpp b/test/unit/alignment/pairwise/fixture/global_affine_banded.hpp index c4173f6e8b3..082f0f6599d 100644 --- a/test/unit/alignment/pairwise/fixture/global_affine_banded.hpp +++ b/test/unit/alignment/pairwise/fixture/global_affine_banded.hpp @@ -30,8 +30,8 @@ namespace seqan3::test::alignment::fixture::global::affine::banded inline constexpr auto align_config = seqan3::align_cfg::mode{seqan3::global_alignment} | seqan3::align_cfg::gap{seqan3::gap_scheme{seqan3::gap_score{-1}, seqan3::gap_open_score{-10}}} | - seqan3::align_cfg::band{seqan3::static_band{seqan3::lower_bound{-3}, - seqan3::upper_bound{8}}}; + seqan3::align_cfg::band_fixed_size{seqan3::align_cfg::lower_diagonal{-3}, + seqan3::align_cfg::upper_diagonal{8}}; static auto dna4_01 = []() { // AACCGGTTAACCGGTT diff --git a/test/unit/alignment/pairwise/fixture/local_affine_banded.hpp b/test/unit/alignment/pairwise/fixture/local_affine_banded.hpp index 1249a2ce201..4d4a57127c4 100644 --- a/test/unit/alignment/pairwise/fixture/local_affine_banded.hpp +++ b/test/unit/alignment/pairwise/fixture/local_affine_banded.hpp @@ -48,7 +48,8 @@ static auto dna4_01 = []() "ACGTCTACGTA"_dna4, align_config | seqan3::align_cfg::scoring{seqan3::nucleotide_scoring_scheme{seqan3::match_score{4}, seqan3::mismatch_score{-5}}} - | seqan3::align_cfg::band{seqan3::static_band{seqan3::lower_bound{-2}, seqan3::upper_bound{5}}}, + | seqan3::align_cfg::band_fixed_size{seqan3::align_cfg::lower_diagonal{-2}, + seqan3::align_cfg::upper_diagonal{5}}, 11, "GTTTA", "GTCTA", @@ -101,7 +102,8 @@ static auto dna4_02 = []() "AACCGGTTTAACCGGTT"_dna4, align_config | seqan3::align_cfg::scoring{seqan3::nucleotide_scoring_scheme{seqan3::match_score{4}, seqan3::mismatch_score{-5}}} - | seqan3::align_cfg::band{seqan3::static_band{seqan3::lower_bound{-2}, seqan3::upper_bound{5}}}, + | seqan3::align_cfg::band_fixed_size{seqan3::align_cfg::lower_diagonal{-2}, + seqan3::align_cfg::upper_diagonal{5}}, 8, "AC", "AC", @@ -168,7 +170,8 @@ static auto dna4_03 = []() | seqan3::align_cfg::gap{seqan3::gap_scheme{seqan3::gap_score{0}, seqan3::gap_open_score{0}}} | seqan3::align_cfg::scoring{seqan3::nucleotide_scoring_scheme{seqan3::match_score{2}, seqan3::mismatch_score{-1}}} - | seqan3::align_cfg::band{seqan3::static_band{seqan3::lower_bound{0}, seqan3::upper_bound{0}}}, + | seqan3::align_cfg::band_fixed_size{seqan3::align_cfg::lower_diagonal{0}, + seqan3::align_cfg::upper_diagonal{0}}, 8, "TAAGCGT", "TCAGAGT", @@ -221,7 +224,8 @@ static auto dna4_04 = []() "CCCCCC"_dna4, align_config | seqan3::align_cfg::scoring{seqan3::nucleotide_scoring_scheme{seqan3::match_score{4}, seqan3::mismatch_score{-5}}} - | seqan3::align_cfg::band{seqan3::static_band{seqan3::lower_bound{-2}, seqan3::upper_bound{2}}}, + | seqan3::align_cfg::band_fixed_size{seqan3::align_cfg::lower_diagonal{-2}, + seqan3::align_cfg::upper_diagonal{2}}, 0, "", "", @@ -264,7 +268,8 @@ static auto dna4_05 = []() "CCCCCCTAAAAAA"_dna4, align_config | seqan3::align_cfg::scoring{seqan3::nucleotide_scoring_scheme{seqan3::match_score{4}, seqan3::mismatch_score{-5}}} - | seqan3::align_cfg::band{seqan3::static_band{seqan3::lower_bound{-100}, seqan3::upper_bound{0}}}, + | seqan3::align_cfg::band_fixed_size{seqan3::align_cfg::lower_diagonal{-100}, + seqan3::align_cfg::upper_diagonal{0}}, 24, "AAAAAA", "AAAAAA", @@ -322,7 +327,8 @@ static auto dna4_06 = []() "CCCCCCTAAAAAA"_dna4, align_config | seqan3::align_cfg::scoring{seqan3::nucleotide_scoring_scheme{seqan3::match_score{4}, seqan3::mismatch_score{-5}}} - | seqan3::align_cfg::band{seqan3::static_band{seqan3::lower_bound{0}, seqan3::upper_bound{100}}}, + | seqan3::align_cfg::band_fixed_size{seqan3::align_cfg::lower_diagonal{0}, + seqan3::align_cfg::upper_diagonal{100}}, 24, "CCCCCC", "CCCCCC", @@ -378,7 +384,8 @@ static auto rna5_01 = []() "AAAAAAUUUUNNUUUUCCCCCC"_rna5, "AAAAAACCCCCC"_rna5, align_config | seqan3::align_cfg::scoring{seqan3::nucleotide_scoring_scheme{seqan3::match_score{4}, seqan3::mismatch_score{-5}}} - | seqan3::align_cfg::band{seqan3::static_band{seqan3::lower_bound{-10}, seqan3::upper_bound{10}}}, + | seqan3::align_cfg::band_fixed_size{seqan3::align_cfg::lower_diagonal{-10}, + seqan3::align_cfg::upper_diagonal{10}}, 28, "AAAAAAUUUUNNUUUUCCCCCC", "AAAAAA----------CCCCCC", @@ -433,7 +440,8 @@ static auto aa27_01 = []() "GALORA"_aa27, align_config | seqan3::align_cfg::scoring{aminoacid_scoring_scheme{aminoacid_similarity_matrix::BLOSUM62}} - | seqan3::align_cfg::band{seqan3::static_band{seqan3::lower_bound{-10000}, seqan3::upper_bound{10000}}}, + | seqan3::align_cfg::band_fixed_size{seqan3::align_cfg::lower_diagonal{-10000}, + seqan3::align_cfg::upper_diagonal{10000}}, 13, "GATOR", "GALOR", diff --git a/test/unit/alignment/pairwise/fixture/semi_global_affine_banded.hpp b/test/unit/alignment/pairwise/fixture/semi_global_affine_banded.hpp index 0cd47126e13..6629ca308f0 100644 --- a/test/unit/alignment/pairwise/fixture/semi_global_affine_banded.hpp +++ b/test/unit/alignment/pairwise/fixture/semi_global_affine_banded.hpp @@ -30,8 +30,8 @@ namespace seqan3::test::alignment::fixture::semi_global::affine::banded inline constexpr auto align_config = seqan3::align_cfg::mode{seqan3::global_alignment} | seqan3::align_cfg::gap{seqan3::gap_scheme{seqan3::gap_score{-1}, seqan3::gap_open_score{-10}}} | - seqan3::align_cfg::band{seqan3::static_band{seqan3::lower_bound{-4}, - seqan3::upper_bound{8}}}; + seqan3::align_cfg::band_fixed_size{seqan3::align_cfg::lower_diagonal{-4}, + seqan3::align_cfg::upper_diagonal{8}}; inline constexpr auto align_config_semi_seq1 = align_config | seqan3::align_cfg::aligned_ends{seqan3::free_ends_first}; inline constexpr auto align_config_semi_seq2 = align_config | seqan3::align_cfg::aligned_ends{seqan3::free_ends_second}; diff --git a/test/unit/alignment/pairwise/policy/affine_gap_init_policy_test.cpp b/test/unit/alignment/pairwise/policy/affine_gap_init_policy_test.cpp index d5fbb1cbe9b..7c7cc76730a 100644 --- a/test/unit/alignment/pairwise/policy/affine_gap_init_policy_test.cpp +++ b/test/unit/alignment/pairwise/policy/affine_gap_init_policy_test.cpp @@ -57,10 +57,14 @@ class affine_gap_init_fixture : public ::testing::Test { if constexpr (std::tuple_element_t<2, test_types>::value) { - score_matrix = score_matrix_t{"ACGT"_dna4, "ACGT"_dna4, seqan3::static_band{seqan3::lower_bound{-2}, - seqan3::upper_bound{2}}}; - trace_matrix = trace_matrix_t{"ACGT"_dna4, "ACGT"_dna4, seqan3::static_band{seqan3::lower_bound{-2}, - seqan3::upper_bound{2}}}; + score_matrix = score_matrix_t{"ACGT"_dna4, + "ACGT"_dna4, + seqan3::align_cfg::band_fixed_size{seqan3::align_cfg::lower_diagonal{-2}, + seqan3::align_cfg::upper_diagonal{2}}}; + trace_matrix = trace_matrix_t{"ACGT"_dna4, + "ACGT"_dna4, + seqan3::align_cfg::band_fixed_size{seqan3::align_cfg::lower_diagonal{-2}, + seqan3::align_cfg::upper_diagonal{2}}}; } else { diff --git a/test/unit/alignment/pairwise/policy/affine_gap_policy_test.cpp b/test/unit/alignment/pairwise/policy/affine_gap_policy_test.cpp index 0a547db4268..c3618587760 100644 --- a/test/unit/alignment/pairwise/policy/affine_gap_policy_test.cpp +++ b/test/unit/alignment/pairwise/policy/affine_gap_policy_test.cpp @@ -62,10 +62,14 @@ struct affine_gap_fixture : public ::testing::Test { if constexpr (std::tuple_element_t<2, test_types>::value) { - score_matrix = score_matrix_t{"ACGT"_dna4, "ACGT"_dna4, seqan3::static_band{seqan3::lower_bound{-2}, - seqan3::upper_bound{2}}}; - trace_matrix = trace_matrix_t{"ACGT"_dna4, "ACGT"_dna4, seqan3::static_band{seqan3::lower_bound{-2}, - seqan3::upper_bound{2}}}; + score_matrix = score_matrix_t{"ACGT"_dna4, + "ACGT"_dna4, + seqan3::align_cfg::band_fixed_size{seqan3::align_cfg::lower_diagonal{-2}, + seqan3::align_cfg::upper_diagonal{2}}}; + trace_matrix = trace_matrix_t{"ACGT"_dna4, + "ACGT"_dna4, + seqan3::align_cfg::band_fixed_size{seqan3::align_cfg::lower_diagonal{-2}, + seqan3::align_cfg::upper_diagonal{2}}}; } else {