diff --git a/include/seqan3/alignment/pairwise/detail/policy_affine_gap_recursion.hpp b/include/seqan3/alignment/pairwise/detail/policy_affine_gap_recursion.hpp index d0fc862c57..2404527a52 100644 --- a/include/seqan3/alignment/pairwise/detail/policy_affine_gap_recursion.hpp +++ b/include/seqan3/alignment/pairwise/detail/policy_affine_gap_recursion.hpp @@ -98,9 +98,9 @@ class policy_affine_gap_recursion gap_open_score = static_cast(selected_gap_scheme.get_gap_open_score()) + gap_extension_score; } - auto align_ends_config = config.get_or(align_cfg::aligned_ends{free_ends_none}).value; - first_row_is_free = align_ends_config[0]; - first_column_is_free = align_ends_config[2]; + auto method_global_config = config.get_or(align_cfg::method_global{}); + first_row_is_free = method_global_config.free_end_gaps_sequence1_leading; + first_column_is_free = method_global_config.free_end_gaps_sequence2_leading; } //!\} diff --git a/include/seqan3/alignment/pairwise/detail/policy_alignment_matrix.hpp b/include/seqan3/alignment/pairwise/detail/policy_alignment_matrix.hpp index 3ab995b345..a162f701e8 100644 --- a/include/seqan3/alignment/pairwise/detail/policy_alignment_matrix.hpp +++ b/include/seqan3/alignment/pairwise/detail/policy_alignment_matrix.hpp @@ -100,23 +100,20 @@ class policy_alignment_matrix bool invalid_band = upper_diagonal < lower_diagonal; std::string error_cause = (invalid_band) ? " The upper diagonal is smaller than the lower diagonal." : ""; - if constexpr (traits_t::with_free_end_gaps) + + if constexpr (traits_t::is_global) { - auto aligned_ends_config = seqan3::get(config).value; - bool first_row_is_free = aligned_ends_config[0]; - bool first_column_is_free = aligned_ends_config[2]; + auto method_global_config = get(config); + + bool first_row_is_free = method_global_config.free_end_gaps_sequence1_leading; + bool first_column_is_free = method_global_config.free_end_gaps_sequence2_leading; - last_row_is_free = aligned_ends_config[1]; - last_column_is_free = aligned_ends_config[3]; + last_row_is_free = method_global_config.free_end_gaps_sequence1_trailing; + last_column_is_free = method_global_config.free_end_gaps_sequence2_trailing; // band starts in first column without free gaps or band starts in first row without free gaps. invalid_band |= (upper_diagonal < 0 && !first_column_is_free) || (lower_diagonal > 0 && !first_row_is_free); error_cause += " The band starts in a region without free gaps."; } - else if constexpr (traits_t::is_global) - { - invalid_band |= (upper_diagonal < 0 || lower_diagonal > 0); - error_cause += " The first cell of the matrix is not enclosed by the band."; - } if (invalid_band) throw invalid_alignment_configuration{"The selected band [" + std::to_string(lower_diagonal) + ":" + @@ -193,18 +190,14 @@ class policy_alignment_matrix bool invalid_band = false; std::string error_cause{}; - if constexpr (traits_t::with_free_end_gaps) + + if constexpr (traits_t::is_global) { // band ends in last column without free gaps or band ends in last row without free gaps. invalid_band |= (lower_diagonal_ends_behind_last_cell && !last_column_is_free) || (upper_diagonal_ends_before_last_cell && !last_row_is_free); error_cause = "The band ends in a region without free gaps."; } - else if constexpr (traits_t::is_global) - { - invalid_band |= (upper_diagonal_ends_before_last_cell || lower_diagonal_ends_behind_last_cell); - error_cause = "The last cell of the matrix is not enclosed by the band."; - } if (invalid_band) throw invalid_alignment_configuration{"The selected band [" + std::to_string(lower_diagonal) + ":" + diff --git a/include/seqan3/alignment/pairwise/detail/policy_optimum_tracker.hpp b/include/seqan3/alignment/pairwise/detail/policy_optimum_tracker.hpp index 6a0dfa7c2a..953a56fd1b 100644 --- a/include/seqan3/alignment/pairwise/detail/policy_optimum_tracker.hpp +++ b/include/seqan3/alignment/pairwise/detail/policy_optimum_tracker.hpp @@ -133,14 +133,14 @@ class policy_optimum_tracker * * \details * - * Reads the state of seqan3::align_cfg::aligned_ends and enables the tracking of the last row or column if + * Reads the state of seqan3::align_cfg::method_global and enables the tracking of the last row or column if * requested. Otherwise, only the last cell will be tracked. */ policy_optimum_tracker(alignment_configuration_t const & config) { - auto align_ends_config = config.get_or(align_cfg::aligned_ends{free_ends_none}).value; - test_last_row_cell = align_ends_config[1]; - test_last_column_cell = align_ends_config[3]; + auto method_global_config = config.get_or(align_cfg::method_global{}); + test_last_row_cell = method_global_config.free_end_gaps_sequence1_trailing; + test_last_column_cell = method_global_config.free_end_gaps_sequence2_trailing; } //!\}