Skip to content

Commit

Permalink
[MISC] automatic linting
Browse files Browse the repository at this point in the history
  • Loading branch information
seqan-actions committed Jul 16, 2024
1 parent 11564cb commit 0f0ec94
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 20 deletions.
3 changes: 2 additions & 1 deletion include/seqan3/alignment/pairwise/alignment_algorithm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,8 @@ class alignment_algorithm :
res.end_positions = alignment_coordinate_t{column_index_type{this->alignment_state.optimum.column_index},
row_index_type{this->alignment_state.optimum.row_index}};
// At some point this needs to be refactored so that it is not necessary to adapt the coordinate.
if constexpr (traits_t::is_banded) {
if constexpr (traits_t::is_banded)
{
res.end_positions.second += res.end_positions.first - this->trace_matrix.band_col_index;
res.end_positions.first = this->to_original_sequence1_position(res.end_positions.first);
res.end_positions.second = this->to_original_sequence2_position(res.end_positions.second);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,8 @@ class alignment_matrix_policy
* band starts in the origin and ends in the sink.
*/
template <typename sequence1_t, typename sequence2_t>
constexpr auto slice_sequences(sequence1_t & sequence1,
sequence2_t & sequence2,
align_cfg::band_fixed_size const & band) noexcept
constexpr auto
slice_sequences(sequence1_t & sequence1, sequence2_t & sequence2, align_cfg::band_fixed_size const & band) noexcept
{
size_t seq1_size = std::ranges::distance(sequence1);
size_t seq2_size = std::ranges::distance(sequence2);
Expand Down Expand Up @@ -200,7 +199,8 @@ class alignment_matrix_policy
*
* Only changes the position if the sequence was sliced due to band configuration.
*/
constexpr size_t to_original_sequence1_position(size_t position) const noexcept {
constexpr size_t to_original_sequence1_position(size_t position) const noexcept
{
return position + seq1_slice_offset;
}

Expand All @@ -212,7 +212,8 @@ class alignment_matrix_policy
*
* Only changes the position if the sequence was sliced due to band configuration.
*/
constexpr size_t to_original_sequence2_position(size_t position) const noexcept {
constexpr size_t to_original_sequence2_position(size_t position) const noexcept
{
return position + seq2_slice_offset;
}

Expand Down
25 changes: 11 additions & 14 deletions test/unit/alignment/pairwise/global_affine_banded_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <gtest/gtest.h>

#include <seqan3/alignment/pairwise/align_pairwise.hpp>

#include <seqan3/core/debug_stream.hpp>

#include "fixture/global_affine_banded.hpp"
Expand Down Expand Up @@ -76,22 +75,20 @@ TEST(banded_alignment_issue3266_test, wrong_begin_and_end_position)
using namespace seqan3;
using namespace seqan3::literals;

const auto configGeneral =
align_cfg::scoring_scheme{nucleotide_scoring_scheme{match_score{1}, mismatch_score{-1}}} |
align_cfg::gap_cost_affine{align_cfg::open_score{0}, align_cfg::extension_score{-1}} |
align_cfg::method_global{
align_cfg::free_end_gaps_sequence1_leading{true},
align_cfg::free_end_gaps_sequence2_leading{true},
align_cfg::free_end_gaps_sequence1_trailing{true},
align_cfg::free_end_gaps_sequence2_trailing{true}};
auto const configGeneral = align_cfg::scoring_scheme{nucleotide_scoring_scheme{match_score{1}, mismatch_score{-1}}}
| align_cfg::gap_cost_affine{align_cfg::open_score{0}, align_cfg::extension_score{-1}}
| align_cfg::method_global{align_cfg::free_end_gaps_sequence1_leading{true},
align_cfg::free_end_gaps_sequence2_leading{true},
align_cfg::free_end_gaps_sequence1_trailing{true},
align_cfg::free_end_gaps_sequence2_trailing{true}};

const auto configBanded = configGeneral | align_cfg::band_fixed_size{align_cfg::lower_diagonal{-40},
align_cfg::upper_diagonal{-20}};
auto const configBanded =
configGeneral | align_cfg::band_fixed_size{align_cfg::lower_diagonal{-40}, align_cfg::upper_diagonal{-20}};

//0 1 2 3 4
//01234567890123456789012345678901234567890
//0 1 2 3 4
//01234567890123456789012345678901234567890
std::pair p{"CGTCTA"_dna4, "AAACCCGGGTTTAAACCCGGGTTTCGTGTACCCCCCCCCCC"_dna4};
// CGTCTA
// CGTCTA

auto general_results = align_pairwise(p, configGeneral);
auto general_res = *std::ranges::begin(general_results);
Expand Down

0 comments on commit 0f0ec94

Please sign in to comment.