2424#include < seqan/score.h>
2525#include < seqan/sequence.h>
2626
27+ #include < algorithm>
2728#include < seqan3/alignment/scoring/scoring_scheme_base.hpp>
2829#include < seqan3/alphabet/nucleotide/dna5.hpp>
29- #include < algorithm>
3030
3131enum class bsDirection
3232{
@@ -35,41 +35,46 @@ enum class bsDirection
3535};
3636
3737template <seqan3::arithmetic score_type = int8_t >
38- class bisulfite_scoring_scheme : public seqan3 ::scoring_scheme_base<bisulfite_scoring_scheme<score_type>, seqan3::dna5, score_type>
38+ class bisulfite_scoring_scheme :
39+ public seqan3::scoring_scheme_base<bisulfite_scoring_scheme<score_type>, seqan3::dna5, score_type>
3940{
4041private:
4142 using base_t = seqan3::scoring_scheme_base<bisulfite_scoring_scheme<score_type>, seqan3::dna5, score_type>;
4243 using base_t ::matrix;
44+
4345public:
4446 using base_t ::base_t ;
4547 using typename base_t ::matrix_type;
46- using matrix_size_type = std::remove_const_t <decltype (seqan3::alphabet_size<seqan3::dna5>)>;
48+ using matrix_size_type = std::remove_const_t <decltype (seqan3::alphabet_size<seqan3::dna5>)>;
4749 static constexpr matrix_size_type matrix_size = seqan3::alphabet_size<seqan3::dna5>;
4850
4951 constexpr bisulfite_scoring_scheme () noexcept {}
5052
5153 template <seqan3::arithmetic score_arg_t >
52- constexpr bisulfite_scoring_scheme (seqan3::match_score<score_arg_t > const ms,
53- seqan3::mismatch_score<score_arg_t > const mms, bsDirection const dir = bsDirection::fwd)
54+ constexpr bisulfite_scoring_scheme (seqan3::match_score<score_arg_t > const ms,
55+ seqan3::mismatch_score<score_arg_t > const mms,
56+ bsDirection const dir = bsDirection::fwd)
5457 {
5558 set_bisulfite_scheme (ms, mms, dir);
5659 }
5760
5861 constexpr bisulfite_scoring_scheme (matrix_type const & _matrix) noexcept {}
5962
6063 template <seqan3::arithmetic score_arg_t >
61- constexpr void set_bisulfite_scheme (seqan3::match_score<score_arg_t > const ms,
62- seqan3::mismatch_score<score_arg_t > const mms, bsDirection const dir = bsDirection::fwd)
64+ constexpr void set_bisulfite_scheme (seqan3::match_score<score_arg_t > const ms,
65+ seqan3::mismatch_score<score_arg_t > const mms,
66+ bsDirection const dir = bsDirection::fwd)
6367 {
64- std::conditional_t <std::integral<score_type>, int64_t , double > i_ms = static_cast <score_arg_t >(ms);
68+ std::conditional_t <std::integral<score_type>, int64_t , double > i_ms = static_cast <score_arg_t >(ms);
6569 std::conditional_t <std::integral<score_type>, int64_t , double > i_mms = static_cast <score_arg_t >(mms);
66- if ((i_ms < std::numeric_limits<score_type>::lowest () || i_ms > std::numeric_limits<score_type>::max ()) ||
70+ if ((i_ms < std::numeric_limits<score_type>::lowest () || i_ms > std::numeric_limits<score_type>::max ()) ||
6771 (i_mms < std::numeric_limits<score_type>::lowest () || i_mms > std::numeric_limits<score_type>::max ()))
6872 {
69- throw std::invalid_argument{" You passed a score value to set_bisulfite_scheme that is out of range of the "
70- " scoring scheme's underlying type. Define your scoring scheme with a larger "
71- " template parameter or down-cast you score value beforehand to prevent "
72- " this exception." };
73+ throw std::invalid_argument{
74+ " You passed a score value to set_bisulfite_scheme that is out of range of the "
75+ " scoring scheme's underlying type. Define your scoring scheme with a larger "
76+ " template parameter or down-cast you score value beforehand to prevent "
77+ " this exception." };
7378 }
7479
7580 // Assume query is horizontal sequence
@@ -85,27 +90,28 @@ class bisulfite_scoring_scheme : public seqan3::scoring_scheme_base<bisulfite_sc
8590 }
8691};
8792
88- bisulfite_scoring_scheme () -> bisulfite_scoring_scheme<int8_t>;
93+ bisulfite_scoring_scheme ()-> bisulfite_scoring_scheme<int8_t>;
8994
9095template <seqan3::arithmetic score_arg_type>
91- bisulfite_scoring_scheme (seqan3::match_score<score_arg_type>,
92- seqan3::mismatch_score<score_arg_type>) -> bisulfite_scoring_scheme<int8_t>;
96+ bisulfite_scoring_scheme (seqan3::match_score<score_arg_type>, seqan3::mismatch_score<score_arg_type>)
97+ -> bisulfite_scoring_scheme<int8_t>;
9398
9499template <seqan3::arithmetic score_arg_type>
95100bisulfite_scoring_scheme (std::array<std::array<score_arg_type, 5 >, 5 >) -> bisulfite_scoring_scheme<score_arg_type>;
96101
97102namespace seqan
98103{
99104
100- struct BisulfiteMatrix {};
105+ struct BisulfiteMatrix
106+ {};
101107
102108template <>
103109struct ScoringMatrixData_ <int , Dna5, BisulfiteMatrix>
104110{
105111 enum
106112 {
107113 VALUE_SIZE = ValueSize<Dna5>::VALUE ,
108- TAB_SIZE = VALUE_SIZE * VALUE_SIZE
114+ TAB_SIZE = VALUE_SIZE * VALUE_SIZE
109115 };
110116
111117 static inline int const * getData ()
@@ -122,12 +128,13 @@ struct ScoringMatrixData_<int, Dna5, BisulfiteMatrix>
122128 // clang-format on
123129 return _data;
124130 }
125-
126131};
127132
128133template <typename T>
129- inline void
130- setScoreBisulfiteMatrix (Score<int , ScoreMatrix<Dna5, BisulfiteMatrix> > & sc, T matchScore, T mismatchScore, bsDirection const dir = bsDirection::fwd)
134+ inline void setScoreBisulfiteMatrix (Score<int , ScoreMatrix<Dna5, BisulfiteMatrix>> & sc,
135+ T matchScore,
136+ T mismatchScore,
137+ bsDirection const dir = bsDirection::fwd)
131138{
132139 for (size_t i = 0 ; i < ValueSize<Dna5>::VALUE ; ++i)
133140 {
0 commit comments