Skip to content

Commit

Permalink
Merge pull request #2045 from smehringer/alignment_configuration_free…
Browse files Browse the repository at this point in the history
…_end_gaps_1

[Alignment Configuration] Change member variables of method_global to booleans.
  • Loading branch information
eseiler authored Aug 25, 2020
2 parents 0d96cea + 78c6942 commit bd5a78e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
16 changes: 8 additions & 8 deletions include/seqan3/alignment/configuration/align_config_method.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,14 @@ struct method_global : public pipeable_config_element<method_global>
{}
//!\}

//!\brief If set to `true`, leading gaps in sequence1 are not penalized when computing the optimal alignment.
seqan3::align_cfg::free_end_gaps_sequence1_leading free_end_gaps_sequence1_leading{false};
//!\brief If set to `true`, leading gaps in sequence2 are not penalized when computing the optimal alignment.
seqan3::align_cfg::free_end_gaps_sequence2_leading free_end_gaps_sequence2_leading{false};
//!\brief If set to `true`, trailing gaps in sequence1 are not penalized when computing the optimal alignment.
seqan3::align_cfg::free_end_gaps_sequence1_trailing free_end_gaps_sequence1_trailing{false};
//!\brief If set to `true`, trailing gaps in sequence2 are not penalized when computing the optimal alignment.
seqan3::align_cfg::free_end_gaps_sequence2_trailing free_end_gaps_sequence2_trailing{false};
//!\brief If set to `true`, leading gaps in sequence1 are not penalised when computing the optimal alignment.
bool free_end_gaps_sequence1_leading{false};
//!\brief If set to `true`, leading gaps in sequence2 are not penalised when computing the optimal alignment.
bool free_end_gaps_sequence2_leading{false};
//!\brief If set to `true`, trailing gaps in sequence1 are not penalised when computing the optimal alignment.
bool free_end_gaps_sequence1_trailing{false};
//!\brief If set to `true`, trailing gaps in sequence2 are not penalised when computing the optimal alignment.
bool free_end_gaps_sequence2_trailing{false};

//!\privatesection
//!\brief An internal id used to check for a valid alignment configuration.
Expand Down
28 changes: 14 additions & 14 deletions test/unit/alignment/configuration/align_config_method_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@ TEST(method_global, access_member_variables)
seqan3::align_cfg::method_global opt{}; // default construction

// all default to false
EXPECT_FALSE(opt.free_end_gaps_sequence1_leading.get());
EXPECT_FALSE(opt.free_end_gaps_sequence2_leading.get());
EXPECT_FALSE(opt.free_end_gaps_sequence1_trailing.get());
EXPECT_FALSE(opt.free_end_gaps_sequence2_trailing.get());

opt.free_end_gaps_sequence1_leading = seqan3::align_cfg::free_end_gaps_sequence1_leading{true};
opt.free_end_gaps_sequence2_leading = seqan3::align_cfg::free_end_gaps_sequence2_leading{true};
opt.free_end_gaps_sequence1_trailing = seqan3::align_cfg::free_end_gaps_sequence1_trailing{true};
opt.free_end_gaps_sequence2_trailing = seqan3::align_cfg::free_end_gaps_sequence2_trailing{true};

EXPECT_TRUE(opt.free_end_gaps_sequence1_leading.get());
EXPECT_TRUE(opt.free_end_gaps_sequence2_leading.get());
EXPECT_TRUE(opt.free_end_gaps_sequence1_trailing.get());
EXPECT_TRUE(opt.free_end_gaps_sequence2_trailing.get());
EXPECT_FALSE(opt.free_end_gaps_sequence1_leading);
EXPECT_FALSE(opt.free_end_gaps_sequence2_leading);
EXPECT_FALSE(opt.free_end_gaps_sequence1_trailing);
EXPECT_FALSE(opt.free_end_gaps_sequence2_trailing);

opt.free_end_gaps_sequence1_leading = true;
opt.free_end_gaps_sequence2_leading = true;
opt.free_end_gaps_sequence1_trailing = true;
opt.free_end_gaps_sequence2_trailing = true;

EXPECT_TRUE(opt.free_end_gaps_sequence1_leading);
EXPECT_TRUE(opt.free_end_gaps_sequence2_leading);
EXPECT_TRUE(opt.free_end_gaps_sequence1_trailing);
EXPECT_TRUE(opt.free_end_gaps_sequence2_trailing);
}

0 comments on commit bd5a78e

Please sign in to comment.