SeqAn3  3.0.3
The Modern C++ library for sequence analysis.
aminoacid_scoring_scheme.hpp
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------------------------------
2 // Copyright (c) 2006-2021, Knut Reinert & Freie Universität Berlin
3 // Copyright (c) 2016-2021, Knut Reinert & MPI für molekulare Genetik
4 // This file may be used, modified and/or redistributed under the terms of the 3-clause BSD-License
5 // shipped with this file and also available at: https://github.com/seqan/seqan3/blob/master/LICENSE.md
6 // -----------------------------------------------------------------------------------------------------
7 
14 #pragma once
15 
16 #include <seqan3/std/algorithm>
17 
20 
21 namespace seqan3
22 {
23 
36 {
37  //ATTENTION: when you change this, also update set_similarity_matrix() below
42  blosum30,
47  blosum45,
52  blosum62,
57  blosum80,
58 
59 #ifdef SEQAN3_DEPRECATED_310
60  // deprecated uppercase:
65 #endif // SEQAN3_DEPRECATED_310
66 };
67 
81 template <arithmetic score_type = int8_t>
82 class aminoacid_scoring_scheme : public scoring_scheme_base<aminoacid_scoring_scheme<score_type>, aa27, score_type>
83 {
84 private:
87 
89  using base_t::matrix;
90 
92  friend base_t;
93 
94 public:
97  using typename base_t::matrix_type;
99 
104  constexpr aminoacid_scoring_scheme() noexcept = default;
106  template <arithmetic score_arg_t>
107  constexpr aminoacid_scoring_scheme(match_score<score_arg_t> const ms, mismatch_score<score_arg_t> const mms)
108  : base_t{ms, mms}
109  {}
111  constexpr aminoacid_scoring_scheme(matrix_type const & matrix) noexcept
112  : base_t{matrix}
113  {}
114 
118  {
119  set_similarity_matrix(matrix_id);
120  }
122 
130  constexpr void set_similarity_matrix(aminoacid_similarity_matrix const matrix_id)
131  {
132  switch (matrix_id)
133  {
134  case aminoacid_similarity_matrix::blosum30: std::ranges::copy(blosum30, begin(matrix)); break;
135  case aminoacid_similarity_matrix::blosum45: std::ranges::copy(blosum45, begin(matrix)); break;
136  case aminoacid_similarity_matrix::blosum62: std::ranges::copy(blosum62, begin(matrix)); break;
137  case aminoacid_similarity_matrix::blosum80: std::ranges::copy(blosum80, begin(matrix)); break;
138  default:
139  throw std::invalid_argument{"ERROR in set_similarity_matrix(), matrix_id has no matrix."};
140  }
141  }
143 
144 private:
146  static constexpr matrix_type blosum30
147  {{
149  //A B C D E F G H I J K L M N O P Q R S T U V W X, Y Z *
150  { 4, 0, -3, 0, 0, -2, 0, -2, 0, -1, 0, -1, 1, 0, 0, -1, 1, -1, 1, 1, 0, 1, -5, 0, -4, 0, -7},//A
151  { 0, 5, -2, 5, 0, -3, 0, -2, -2, -2, 0, -1, -2, 4, -1, -2, -1, -2, 0, 0, -1, -2, -5, -1, -3, 0, -7},//B
152  {-3, -2, 17, -3, 1, -3, -4, -5, -2, -1, -3, 0, -2, -1, -2, -3, -2, -2, -2, -2, -2, -2, -2, -2, -6, 0, -7},//C
153  { 0, 5, -3, 9, 1, -5, -1, -2, -4, -3, 0, -1, -3, 1, -1, -1, -1, -1, 0, -1, -1, -2, -4, -1, -1, 0, -7},//D
154  { 0, 0, 1, 1, 6, -4, -2, 0, -3, -2, 2, -1, -1, -1, -1, 1, 2, -1, 0, -2, -1, -3, -1, -1, -2, 5, -7},//E
155  {-2, -3, -3, -5, -4, 10, -3, -3, 0, 1, -1, 2, -2, -1, -1, -4, -3, -1, -1, -2, -1, 1, 1, -1, 3, -4, -7},//F
156  { 0, 0, -4, -1, -2, -3, 8, -3, -1, -2, -1, -2, -2, 0, -1, -1, -2, -2, 0, -2, -1, -3, 1, -1, -3, -2, -7},//G
157  {-2, -2, -5, -2, 0, -3, -3, 14, -2, -2, -2, -1, 2, -1, -1, 1, 0, -1, -1, -2, -1, -3, -5, -1, 0, 0, -7},//H
158  { 0, -2, -2, -4, -3, 0, -1, -2, 6, 4, -2, 2, 1, 0, 0, -3, -2, -3, -1, 0, 0, 4, -3, 0, -1, -3, -7},//I
159  {-1, -2, -1, -3, -2, 1, -2, -2, 4, 4, -2, 3, 2, -1, 0, -3, -2, -3, -2, 0, 0, 3, -3, 0, 1, -2, -7},//J
160  { 0, 0, -3, 0, 2, -1, -1, -2, -2, -2, 4, -2, 2, 0, 0, 1, 0, 1, 0, -1, 0, -2, -2, 0, -1, 1, -7},//K
161  {-1, -1, 0, -1, -1, 2, -2, -1, 2, 3, -2, 4, 2, -2, 0, -3, -2, -2, -2, 0, 0, 1, -2, 0, 3, -1, -7},//L
162  { 1, -2, -2, -3, -1, -2, -2, 2, 1, 2, 2, 2, 6, 0, 0, -4, -1, 0, -2, 0, 0, 0, -3, 0, -1, -1, -7},//M
163  { 0, 4, -1, 1, -1, -1, 0, -1, 0, -1, 0, -2, 0, 8, 0, -3, -1, -2, 0, 1, 0, -2, -7, 0, -4, -1, -7},//N
164  { 0, -1, -2, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, -1, -1, 0, -1, 0, 0, -1, 0, -2, -1, -1, 0, -7},//O
165  {-1, -2, -3, -1, 1, -4, -1, 1, -3, -3, 1, -3, -4, -3, -1, 11, 0, -1, -1, 0, -1, -4, -3, -1, -2, 0, -7},//P
166  { 1, -1, -2, -1, 2, -3, -2, 0, -2, -2, 0, -2, -1, -1, 0, 0, 8, 3, -1, 0, 0, -3, -1, 0, -1, 4, -7},//Q
167  {-1, -2, -2, -1, -1, -1, -2, -1, -3, -3, 1, -2, 0, -2, -1, -1, 3, 8, -1, -3, -1, -1, 0, -1, 0, 0, -7},//R
168  { 1, 0, -2, 0, 0, -1, 0, -1, -1, -2, 0, -2, -2, 0, 0, -1, -1, -1, 4, 2, 0, -1, -3, 0, -2, -1, -7},//S
169  { 1, 0, -2, -1, -2, -2, -2, -2, 0, 0, -1, 0, 0, 1, 0, 0, 0, -3, 2, 5, 0, 1, -5, 0, -1, -1, -7},//T
170  { 0, -1, -2, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, -1, -1, 0, -1, 0, 0, -1, 0, -2, -1, -1, 0, -7},//U
171  { 1, -2, -2, -2, -3, 1, -3, -3, 4, 3, -2, 1, 0, -2, 0, -4, -3, -1, -1, 1, 0, 5, -3, 0, 1, -3, -7},//V
172  {-5, -5, -2, -4, -1, 1, 1, -5, -3, -3, -2, -2, -3, -7, -2, -3, -1, 0, -3, -5, -2, -3, 20, -2, 5, -1, -7},//W
173  { 0, -1, -2, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, -1, -1, 0, -1, 0, 0, -1, 0, -2, -1, -1, 0, -7},//X
174  {-4, -3, -6, -1, -2, 3, -3, 0, -1, 1, -1, 3, -1, -4, -1, -2, -1, 0, -2, -1, -1, 1, 5, -1, 9, -2, -7},//Y
175  { 0, 0, 0, 0, 5, -4, -2, 0, -3, -2, 1, -1, -1, -1, 0, 0, 4, 0, -1, -1, 0, -3, -1, 0, -2, 4, -7},//Z
176  {-7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, 1} //*
178  }};
179 
181  static constexpr matrix_type blosum45
182  {{
184  //A B C D E F G H I J K L M N O P Q R S T U V W X, Y Z *
185  { 5, -1, -1, -2, -1, -2, 0, -2, -1, -1, -1, -1, -1, -1, 0, -1, -1, -2, 1, 0, 0, 0, -2, 0, -2, -1, -5},//A
186  {-1, 4, -2, 5, 1, -3, -1, 0, -3, -3, 0, -3, -2, 4, -1, -2, 0, -1, 0, 0, -1, -3, -4, -1, -2, 2, -5},//B
187  {-1, -2, 12, -3, -3, -2, -3, -3, -3, -3, -3, -2, -2, -2, -2, -4, -3, -3, -1, -1, -2, -1, -5, -2, -3, -3, -5},//C
188  {-2, 5, -3, 7, 2, -4, -1, 0, -4, -4, 0, -3, -3, 2, -1, -1, 0, -1, 0, -1, -1, -3, -4, -1, -2, 1, -5},//D
189  {-1, 1, -3, 2, 6, -3, -2, 0, -3, -3, 1, -2, -2, 0, -1, 0, 2, 0, 0, -1, -1, -3, -3, -1, -2, 4, -5},//E
190  {-2, -3, -2, -4, -3, 8, -3, -2, 0, 1, -3, 1, 0, -2, -1, -3, -4, -2, -2, -1, -1, 0, 1, -1, 3, -3, -5},//F
191  { 0, -1, -3, -1, -2, -3, 7, -2, -4, -4, -2, -3, -2, 0, -1, -2, -2, -2, 0, -2, -1, -3, -2, -1, -3, -2, -5},//G
192  {-2, 0, -3, 0, 0, -2, -2, 10, -3, -3, -1, -2, 0, 1, -1, -2, 1, 0, -1, -2, -1, -3, -3, -1, 2, 0, -5},//H
193  {-1, -3, -3, -4, -3, 0, -4, -3, 5, 4, -3, 2, 2, -2, -1, -2, -2, -3, -2, -1, -1, 3, -2, -1, 0, -3, -5},//I
194  {-1, -3, -3, -4, -3, 1, -4, -3, 4, 4, -3, 4, 2, -3, -1, -3, -2, -3, -3, -1, -1, 2, -2, -1, 0, -3, -5},//J
195  {-1, 0, -3, 0, 1, -3, -2, -1, -3, -3, 5, -3, -1, 0, -1, -1, 1, 3, -1, -1, -1, -2, -2, -1, -1, 1, -5},//K
196  {-1, -3, -2, -3, -2, 1, -3, -2, 2, 4, -3, 5, 2, -3, -1, -3, -2, -2, -3, -1, -1, 1, -2, -1, 0, -2, -5},//L
197  {-1, -2, -2, -3, -2, 0, -2, 0, 2, 2, -1, 2, 6, -2, -1, -2, 0, -1, -2, -1, -1, 1, -2, -1, 0, -1, -5},//M
198  {-1, 4, -2, 2, 0, -2, 0, 1, -2, -3, 0, -3, -2, 6, -1, -2, 0, 0, 1, 0, -1, -3, -4, -1, -2, 0, -5},//N
199  { 0, -1, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, -1, -2, -1, -1, -1, -5},//O
200  {-1, -2, -4, -1, 0, -3, -2, -2, -2, -3, -1, -3, -2, -2, -1, 9, -1, -2, -1, -1, -1, -3, -3, -1, -3, -1, -5},//P
201  {-1, 0, -3, 0, 2, -4, -2, 1, -2, -2, 1, -2, 0, 0, -1, -1, 6, 1, 0, -1, -1, -3, -2, -1, -1, 4, -5},//Q
202  {-2, -1, -3, -1, 0, -2, -2, 0, -3, -3, 3, -2, -1, 0, -1, -2, 1, 7, -1, -1, -1, -2, -2, -1, -1, 0, -5},//R
203  { 1, 0, -1, 0, 0, -2, 0, -1, -2, -3, -1, -3, -2, 1, 0, -1, 0, -1, 4, 2, 0, -1, -4, 0, -2, 0, -5},//S
204  { 0, 0, -1, -1, -1, -1, -2, -2, -1, -1, -1, -1, -1, 0, 0, -1, -1, -1, 2, 5, 0, 0, -3, 0, -1, -1, -5},//T
205  { 0, -1, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, -1, -2, -1, -1, -1, -5},//U
206  { 0, -3, -1, -3, -3, 0, -3, -3, 3, 2, -2, 1, 1, -3, -1, -3, -3, -2, -1, 0, -1, 5, -3, -1, -1, -3, -5},//V
207  {-2, -4, -5, -4, -3, 1, -2, -3, -2, -2, -2, -2, -2, -4, -2, -3, -2, -2, -4, -3, -2, -3, 15, -2, 3, -2, -5},//W
208  { 0, -1, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, -1, -2, -1, -1, -1, -5},//X
209  {-2, -2, -3, -2, -2, 3, -3, 2, 0, 0, -1, 0, 0, -2, -1, -3, -1, -1, -2, -1, -1, -1, 3, -1, 8, -2, -5},//Y
210  {-1, 2, -3, 1, 4, -3, -2, 0, -3, -3, 1, -2, -1, 0, -1, -1, 4, 0, 0, -1, -1, -3, -2, -1, -2, 4, -5},//Z
211  {-5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, 1} //*
213  }};
214 
216  static constexpr matrix_type blosum62
217  {{
219  //A B C D E F G H I J K L M N O P Q R S T U V W X Y Z *
220  { 4, -2, 0, -2, -1, -2, 0, -2, -1, -1, -1, -1, -1, -2, 0, -1, -1, -1, 1, 0, 0, 0, -3, 0, -2, -1, -4},//A
221  {-2, 4, -3, 4, 1, -3, -1, 0, -3, -4, 0, -4, -3, 3, -1, -2, 0, -1, 0, -1, -1, -3, -4, -1, -3, 1, -4},//B
222  { 0, -3, 9, -3, -4, -2, -3, -3, -1, -1, -3, -1, -1, -3, -2, -3, -3, -3, -1, -1, -2, -1, -2, -2, -2, -3, -4},//C
223  {-2, 4, -3, 6, 2, -3, -1, -1, -3, -4, -1, -4, -3, 1, -1, -1, 0, -2, 0, -1, -1, -3, -4, -1, -3, 1, -4},//D
224  {-1, 1, -4, 2, 5, -3, -2, 0, -3, -3, 1, -3, -2, 0, -1, -1, 2, 0, 0, -1, -1, -2, -3, -1, -2, 4, -4},//E
225  {-2, -3, -2, -3, -3, 6, -3, -1, 0, 0, -3, 0, 0, -3, -1, -4, -3, -3, -2, -2, -1, -1, 1, -1, 3, -3, -4},//F
226  { 0, -1, -3, -1, -2, -3, 6, -2, -4, -4, -2, -4, -3, 0, -1, -2, -2, -2, 0, -2, -1, -3, -2, -1, -3, -2, -4},//G
227  {-2, 0, -3, -1, 0, -1, -2, 8, -3, -3, -1, -3, -2, 1, -1, -2, 0, 0, -1, -2, -1, -3, -2, -1, 2, 0, -4},//H
228  {-1, -3, -1, -3, -3, 0, -4, -3, 4, 3, -3, 2, 1, -3, -1, -3, -3, -3, -2, -1, -1, 3, -3, -1, -1, -3, -4},//I
229  {-1, -4, -1, -4, -3, 0, -4, -3, 3, 3, -3, 3, 2, -3, -1, -3, -3, -3, -2, -1, -1, 2, -3, -1, -1, -3, -4},//J
230  {-1, 0, -3, -1, 1, -3, -2, -1, -3, -3, 5, -2, -1, 0, -1, -1, 1, 2, 0, -1, -1, -2, -3, -1, -2, 1, -4},//K
231  {-1, -4, -1, -4, -3, 0, -4, -3, 2, 3, -2, 4, 2, -3, -1, -3, -2, -2, -2, -1, -1, 1, -2, -1, -1, -3, -4},//L
232  {-1, -3, -1, -3, -2, 0, -3, -2, 1, 2, -1, 2, 5, -2, -1, -2, 0, -1, -1, -1, -1, 1, -1, -1, -1, -1, -4},//M
233  {-2, 3, -3, 1, 0, -3, 0, 1, -3, -3, 0, -3, -2, 6, -1, -2, 0, 0, 1, 0, -1, -3, -4, -1, -2, 0, -4},//N
234  { 0, -1, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, -1, -1, 0, 0, -1, -1, -2, -1, -1, -1, -4},//O
235  {-1, -2, -3, -1, -1, -4, -2, -2, -3, -3, -1, -3, -2, -2, -2, 7, -1, -2, -1, -1, -2, -2, -4, -2, -3, -1, -4},//P
236  {-1, 0, -3, 0, 2, -3, -2, 0, -3, -3, 1, -2, 0, 0, -1, -1, 5, 1, 0, -1, -1, -2, -2, -1, -1, 3, -4},//Q
237  {-1, -1, -3, -2, 0, -3, -2, 0, -3, -3, 2, -2, -1, 0, -1, -2, 1, 5, -1, -1, -1, -3, -3, -1, -2, 0, -4},//R
238  { 1, 0, -1, 0, 0, -2, 0, -1, -2, -2, 0, -2, -1, 1, 0, -1, 0, -1, 4, 1, 0, -2, -3, 0, -2, 0, -4},//S
239  { 0, -1, -1, -1, -1, -2, -2, -2, -1, -1, -1, -1, -1, 0, 0, -1, -1, -1, 1, 5, 0, 0, -2, 0, -2, -1, -4},//T
240  { 0, -1, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, -1, -1, 0, 0, -1, -1, -2, -1, -1, -1, -4},//U
241  { 0, -3, -1, -3, -2, -1, -3, -3, 3, 2, -2, 1, 1, -3, -1, -2, -2, -3, -2, 0, -1, 4, -3, -1, -1, -2, -4},//V
242  {-3, -4, -2, -4, -3, 1, -2, -2, -3, -3, -3, -2, -1, -4, -2, -4, -2, -3, -3, -2, -2, -3, 11, -2, 2, -3, -4},//W
243  { 0, -1, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, -1, -1, 0, 0, -1, -1, -2, -1, -1, -1, -4},//X
244  {-2, -3, -2, -3, -2, 3, -3, 2, -1, -1, -2, -1, -1, -2, -1, -3, -1, -2, -2, -2, -1, -1, 2, -1, 7, -2, -4},//Y
245  {-1, 1, -3, 1, 4, -3, -2, 0, -3, -3, 1, -3, -1, 0, -1, -1, 3, 0, 0, -1, -1, -2, -3, -1, -2, 4, -4},//Z
246  {-4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, 1} //*
248  }};
249 
251  static constexpr matrix_type blosum80
252  {{
254  //A B C D E F G H I J K L M N O P Q R S T U V W X, Y Z *
255  { 7, -3, -1, -3, -2, -4, 0, -3, -3, -3, -1, -3, -2, -3, -1, -1, -2, -3, 2, 0, -1, -1, -5, -1, -4, -2, -8},//A
256  {-3, 6, -6, 6, 1, -6, -2, -1, -6, -7, -1, -7, -5, 5, -3, -4, -1, -2, 0, -1, -3, -6, -8, -3, -5, 0, -8},//B
257  {-1, -6, 13, -7, -7, -4, -6, -7, -2, -3, -6, -3, -3, -5, -4, -6, -5, -6, -2, -2, -4, -2, -5, -4, -5, -7, -8},//C
258  {-3, 6, -7, 10, 2, -6, -3, -2, -7, -7, -2, -7, -6, 2, -3, -3, -1, -3, -1, -2, -3, -6, -8, -3, -6, 1, -8},//D
259  {-2, 1, -7, 2, 8, -6, -4, 0, -6, -6, 1, -6, -4, -1, -2, -2, 3, -1, -1, -2, -2, -4, -6, -2, -5, 6, -8},//E
260  {-4, -6, -4, -6, -6, 10, -6, -2, -1, -1, -5, 0, 0, -6, -3, -6, -5, -5, -4, -4, -3, -2, 0, -3, 4, -6, -8},//F
261  { 0, -2, -6, -3, -4, -6, 9, -4, -7, -7, -3, -7, -5, -1, -3, -5, -4, -4, -1, -3, -3, -6, -6, -3, -6, -4, -8},//G
262  {-3, -1, -7, -2, 0, -2, -4, 12, -6, -6, -1, -5, -4, 1, -2, -4, 1, 0, -2, -3, -2, -5, -4, -2, 3, 0, -8},//H
263  {-3, -6, -2, -7, -6, -1, -7, -6, 7, 5, -5, 2, 2, -6, -2, -5, -5, -5, -4, -2, -2, 4, -5, -2, -3, -6, -8},//I
264  {-3, -7, -3, -7, -6, -1, -7, -6, 5, 5, -5, 4, 3, -6, -2, -5, -5, -5, -4, -3, -2, 3, -5, -2, -3, -6, -8},//J
265  {-1, -1, -6, -2, 1, -5, -3, -1, -5, -5, 8, -4, -3, 0, -2, -2, 2, 3, -1, -1, -2, -4, -6, -2, -4, 1, -8},//K
266  {-3, -7, -3, -7, -6, 0, -7, -5, 2, 4, -4, 6, 3, -6, -2, -5, -4, -4, -4, -3, -2, 1, -4, -2, -2, -5, -8},//L
267  {-2, -5, -3, -6, -4, 0, -5, -4, 2, 3, -3, 3, 9, -4, -2, -4, -1, -3, -3, -1, -2, 1, -3, -2, -3, -3, -8},//M
268  {-3, 5, -5, 2, -1, -6, -1, 1, -6, -6, 0, -6, -4, 9, -2, -4, 0, -1, 1, 0, -2, -5, -7, -2, -4, -1, -8},//N
269  {-1, -3, -4, -3, -2, -3, -3, -2, -2, -2, -2, -2, -2, -2, -2, -3, -2, -2, -1, -1, -2, -2, -5, -2, -3, -1, -8},//O
270  {-1, -4, -6, -3, -2, -6, -5, -4, -5, -5, -2, -5, -4, -4, -3, 12, -3, -3, -2, -3, -3, -4, -7, -3, -6, -2, -8},//P
271  {-2, -1, -5, -1, 3, -5, -4, 1, -5, -5, 2, -4, -1, 0, -2, -3, 9, 1, -1, -1, -2, -4, -4, -2, -3, 5, -8},//Q
272  {-3, -2, -6, -3, -1, -5, -4, 0, -5, -5, 3, -4, -3, -1, -2, -3, 1, 9, -2, -2, -2, -4, -5, -2, -4, 0, -8},//R
273  { 2, 0, -2, -1, -1, -4, -1, -2, -4, -4, -1, -4, -3, 1, -1, -2, -1, -2, 7, 2, -1, -3, -6, -1, -3, -1, -8},//S
274  { 0, -1, -2, -2, -2, -4, -3, -3, -2, -3, -1, -3, -1, 0, -1, -3, -1, -2, 2, 8, -1, 0, -5, -1, -3, -2, -8},//T
275  {-1, -3, -4, -3, -2, -3, -3, -2, -2, -2, -2, -2, -2, -2, -2, -3, -2, -2, -1, -1, -2, -2, -5, -2, -3, -1, -8},//U
276  {-1, -6, -2, -6, -4, -2, -6, -5, 4, 3, -4, 1, 1, -5, -2, -4, -4, -4, -3, 0, -2, 7, -5, -2, -3, -4, -8},//V
277  {-5, -8, -5, -8, -6, 0, -6, -4, -5, -5, -6, -4, -3, -7, -5, -7, -4, -5, -6, -5, -5, -5, 16, -5, 3, -5, -8},//W
278  {-1, -3, -4, -3, -2, -3, -3, -2, -2, -2, -2, -2, -2, -2, -2, -3, -2, -2, -1, -1, -2, -2, -5, -2, -3, -1, -8},//X
279  {-4, -5, -5, -6, -5, 4, -6, 3, -3, -3, -4, -2, -3, -4, -3, -6, -3, -4, -3, -3, -3, -3, 3, -3, 11, -4, -8},//Y
280  {-2, 0, -7, 1, 6, -6, -4, 0, -6, -6, 1, -5, -3, -1, -1, -2, 5, 0, -1, -2, -1, -4, -5, -1, -4, 6, -8},//Z
281  {-8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, -8, 1} //*
283  }};
284 
285  //TODO(h-2): add more matrixes
286 };
287 
295 
299 template <arithmetic score_arg_type>
302 
304 template <arithmetic score_arg_type>
306 
312 
313 } // namespace seqan3
Provides seqan3::aa27, container aliases and string literals.
Adaptations of algorithms from the Ranges TS.
The twenty-seven letter amino acid alphabet.
Definition: aa27.hpp:46
A data structure for managing and computing the score of two amino acids.
Definition: aminoacid_scoring_scheme.hpp:83
constexpr void set_similarity_matrix(aminoacid_similarity_matrix const matrix_id)
Set the similarity matrix scheme (e.g. blosum62).
Definition: aminoacid_scoring_scheme.hpp:130
constexpr aminoacid_scoring_scheme() noexcept=default
The default constructor (delegates to set_hamming_distance()).
aminoacid_scoring_scheme(aminoacid_similarity_matrix) -> aminoacid_scoring_scheme< int8_t >
Attention: This guide does not actually deduce from the underlying type, but always defaults to int8_...
aminoacid_scoring_scheme() -> aminoacid_scoring_scheme< int8_t >
Default constructed objects deduce to int8_t.
constexpr aminoacid_scoring_scheme(matrix_type const &matrix) noexcept
Constructor for a custom scheme (delegates to set_custom_matrix()).
Definition: aminoacid_scoring_scheme.hpp:111
aminoacid_scoring_scheme(match_score< score_arg_type >, mismatch_score< score_arg_type >) -> aminoacid_scoring_scheme< int8_t >
Attention: This guide does not actually deduce from the underlying type, but always defaults to int8_...
aminoacid_scoring_scheme(std::array< std::array< score_arg_type, 27 >, 27 >) -> aminoacid_scoring_scheme< score_arg_type >
Deduce the score type from the provided matrix.
constexpr aminoacid_scoring_scheme(aminoacid_similarity_matrix const matrix_id)
Construct for seqan3::aminoacid_similarity_matrix.
Definition: aminoacid_scoring_scheme.hpp:117
A CRTP base class for scoring schemes.
Definition: scoring_scheme_base.hpp:100
std::array< std::array< score_type, matrix_size >, matrix_size > matrix_type
Type of the internal matrix (a two-dimensional array).
Definition: scoring_scheme_base.hpp:120
score_t score_type
Type of the score values.
Definition: scoring_scheme_base.hpp:106
aminoacid_similarity_matrix
Identifiers for amino acid similarity matrixes.
Definition: aminoacid_scoring_scheme.hpp:36
@ BLOSUM80
Please use the field name in lower case.
@ BLOSUM62
Please use the field name in lower case.
@ blosum80
The blosum80 matrix for closely related proteins.
@ blosum30
The blosum30 matrix for very distantly related proteins.
@ BLOSUM30
Please use the field name in lower case.
@ blosum45
The blosum45 matrix for distantly related proteins.
@ blosum62
The blosum62 matrix recommended for most use-cases.
@ BLOSUM45
Please use the field name in lower case.
A type that satisfies std::is_arithmetic_v<t>.
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:29
#define SEQAN3_DEPRECATED_310
Deprecation message for SeqAn 3.1.0 release.
Definition: platform.hpp:203
Provides seqan3::scoring_scheme_base.
A strong type of underlying type score_type that represents the score of two matching characters.
Definition: scoring_scheme_base.hpp:41
A strong type of underlying type score_type that represents the score two different characters.
Definition: scoring_scheme_base.hpp:66