Skip to content

Commit

Permalink
[FIX] Fixes #1867 - Alignment scores should be signed
Browse files Browse the repository at this point in the history
Signed-off-by: Lydia Buntrock <lydia.buntrock@fu-berlin.de>
  • Loading branch information
Irallia committed Jun 10, 2020
1 parent 2e0eaaf commit caf0a2d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ Note that 3.1.0 will be the first API stable release and interfaces in this rele
* When invoking the alignment algorithm with a user defined thread count using the `seqan3::align_cfg::parallel`
configuration element, `std::thread::hardware_concurrency()` many threads were always spawned. This is now fixed and
only the specified number of threads will be spawned ([\#1854](https://github.com/seqan/seqan3/pull/1854)).
* Using an unsigned `score_type` throws a static assert, since gaps and mismatches have negative scores and thus need a
signed score type ([\#...](https://github.com/seqan/seqan3/pull/...)).

### Argument Parser

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ class result : public pipeable_config_element<result<alignment_result_tag_t, sco
public:
//!\brief The score type of the alignment result.
using score_type = score_t;
static_assert(std::is_unsigned_v<score_type>,
"The alignment algorithm cannot be computed with an unsigned type as the score type. If you "
"explicitly want an unsigned type as the score type, please submit a feature request explaining the "
"proposed use case on our github page.");

/*!\name Constructors, destructor and assignment
* \{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ int main()
// You can also change the score type:

// Compute only the score given a specific score_type.
seqan3::align_cfg::result cfg_score_uint16{seqan3::with_score, seqan3::using_score_type<uint16_t>};
seqan3::align_cfg::result cfg_score_uint16{seqan3::with_score, seqan3::using_score_type<int16_t>};

// Compute the score given a specific score_type and the back coordinate.
seqan3::align_cfg::result cfg_end_double{seqan3::with_back_coordinate, seqan3::using_score_type<double>};
Expand Down

0 comments on commit caf0a2d

Please sign in to comment.