SeqAn3  3.0.1
The Modern C++ library for sequence analysis.
aminoacid_scoring_scheme.hpp
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------------------------------
2 // Copyright (c) 2006-2020, Knut Reinert & Freie Universität Berlin
3 // Copyright (c) 2016-2020, 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 <range/v3/algorithm/copy.hpp>
17 
21 #include <seqan3/std/algorithm>
22 
23 namespace seqan3
24 {
25 
38 {
39  //ATTENTION: when you change this, also update set_similarity_matrix() below
44  BLOSUM30,
49  BLOSUM45,
54  BLOSUM62,
59  BLOSUM80
60 };
61 
75 template <arithmetic score_type = int8_t>
76 class aminoacid_scoring_scheme : public scoring_scheme_base<aminoacid_scoring_scheme<score_type>, aa27, score_type>
77 {
78 private:
81 
83  using base_t::matrix;
84 
86  friend base_t;
87 
88 public:
91  using typename base_t::matrix_type;
93 
97  constexpr aminoacid_scoring_scheme() noexcept = default;
100  template <arithmetic score_arg_t>
102  : base_t{ms, mms}
103  {}
105  constexpr aminoacid_scoring_scheme(matrix_type const & matrix) noexcept
106  : base_t{matrix}
107  {}
108 
112  {
113  set_similarity_matrix(matrix_id);
114  }
116 
124  constexpr void set_similarity_matrix(aminoacid_similarity_matrix const matrix_id)
125  {
126  switch (matrix_id)
127  {
128  case aminoacid_similarity_matrix::BLOSUM30: std::ranges::copy(blosum30, begin(matrix)); break;
129  case aminoacid_similarity_matrix::BLOSUM45: std::ranges::copy(blosum45, begin(matrix)); break;
130  case aminoacid_similarity_matrix::BLOSUM62: std::ranges::copy(blosum62, begin(matrix)); break;
131  case aminoacid_similarity_matrix::BLOSUM80: std::ranges::copy(blosum80, begin(matrix)); break;
132  default:
133  throw std::invalid_argument{"ERROR in set_similarity_matrix(), matrix_id has no matrix."};
134  }
135  }
137 
138 private:
140  static constexpr matrix_type blosum30
141  {{
143  //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 *
144  { 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
145  { 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
146  {-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
147  { 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
148  { 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
149  {-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
150  { 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
151  {-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
152  { 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
153  {-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
154  { 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
155  {-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
156  { 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
157  { 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
158  { 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
159  {-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
160  { 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
161  {-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
162  { 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
163  { 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
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},//U
165  { 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
166  {-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
167  { 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
168  {-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
169  { 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
170  {-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} //*
172  }};
173 
175  static constexpr matrix_type blosum45
176  {{
178  //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 *
179  { 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
180  {-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
181  {-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
182  {-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
183  {-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
184  {-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
185  { 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
186  {-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
187  {-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
188  {-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
189  {-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
190  {-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
191  {-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
192  {-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
193  { 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
194  {-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
195  {-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
196  {-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
197  { 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
198  { 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
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},//U
200  { 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
201  {-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
202  { 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
203  {-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
204  {-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
205  {-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} //*
207  }};
208 
210  static constexpr matrix_type blosum62
211  {{
213  //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 *
214  { 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
215  {-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
216  { 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
217  {-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
218  {-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
219  {-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
220  { 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
221  {-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
222  {-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
223  {-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
224  {-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
225  {-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
226  {-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
227  {-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
228  { 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
229  {-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
230  {-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
231  {-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
232  { 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
233  { 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
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},//U
235  { 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
236  {-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
237  { 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
238  {-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
239  {-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
240  {-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} //*
242  }};
243 
245  static constexpr matrix_type blosum80
246  {{
248  //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 *
249  { 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
250  {-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
251  {-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
252  {-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
253  {-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
254  {-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
255  { 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
256  {-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
257  {-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
258  {-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
259  {-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
260  {-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
261  {-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
262  {-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
263  {-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
264  {-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
265  {-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
266  {-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
267  { 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
268  { 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
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},//U
270  {-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
271  {-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
272  {-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
273  {-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
274  {-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
275  {-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} //*
277  }};
278 
279  //TODO(h-2): add more matrixes
280 };
281 
287 aminoacid_scoring_scheme() -> aminoacid_scoring_scheme<int8_t>;
289 
293 template <arithmetic score_arg_type>
294 aminoacid_scoring_scheme(match_score<score_arg_type>,
295  mismatch_score<score_arg_type>) -> aminoacid_scoring_scheme<int8_t>;
296 
298 template <arithmetic score_arg_type>
299 aminoacid_scoring_scheme(std::array<std::array<score_arg_type, 27>, 27>) -> aminoacid_scoring_scheme<score_arg_type>;
300 
304 aminoacid_scoring_scheme(aminoacid_similarity_matrix) -> aminoacid_scoring_scheme<int8_t>;
306 
307 } // namespace seqan3
shortcuts.hpp
Provides various shortcuts for common std::ranges functions.
seqan3::aminoacid_scoring_scheme::aminoacid_scoring_scheme
constexpr aminoacid_scoring_scheme(matrix_type const &matrix) noexcept
Constructor for a custom scheme (delegates to set_custom_matrix()).
Definition: aminoacid_scoring_scheme.hpp:105
seqan3::aminoacid_scoring_scheme::aminoacid_scoring_scheme
constexpr aminoacid_scoring_scheme(match_score< score_arg_t > const ms, mismatch_score< score_arg_t > const mms)
Constructor for the simple scheme (delegates to set_simple_scheme()).
Definition: aminoacid_scoring_scheme.hpp:101
seqan3::aminoacid_similarity_matrix::BLOSUM80
The BLOSUM80 matrix for closely related proteins.
seqan3::scoring_scheme_base
A CRTP base class for scoring schemes.
Definition: scoring_scheme_base.hpp:100
seqan3::aminoacid_similarity_matrix::BLOSUM30
The BLOSUM30 matrix for very distantly related proteins.
seqan3::aminoacid_scoring_scheme::aminoacid_scoring_scheme
constexpr aminoacid_scoring_scheme(aminoacid_similarity_matrix const matrix_id)
Construct for seqan3::aminoacid_similarity_matrix.
Definition: aminoacid_scoring_scheme.hpp:111
algorithm
Adaptations of algorithms from the Ranges TS.
seqan3::mismatch_score
A strong type of underlying type score_type that represents the score two different characters.
Definition: scoring_scheme_base.hpp:67
aa27.hpp
Provides seqan3::aa27, container aliases and string literals.
seqan3::scoring_scheme_base< aminoacid_scoring_scheme< score_type >, aa27, score_type >::score_type
score_t score_type
Type of the score values.
Definition: scoring_scheme_base.hpp:107
std::array
seqan3
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:36
std::invalid_argument
seqan3::aminoacid_scoring_scheme::aminoacid_scoring_scheme
constexpr aminoacid_scoring_scheme() noexcept=default
The default constructor (delegates to set_hamming_distance()).
seqan3::aminoacid_similarity_matrix::BLOSUM45
The BLOSUM45 matrix for distantly related proteins.
seqan3::aminoacid_scoring_scheme
A data structure for managing and computing the score of two amino acids.
Definition: aminoacid_scoring_scheme.hpp:76
scoring_scheme_base.hpp
Provides seqan3::scoring_scheme_base.
seqan3::aminoacid_similarity_matrix
aminoacid_similarity_matrix
Identifiers for amino acid similarity matrixes.
Definition: aminoacid_scoring_scheme.hpp:37
seqan3::aminoacid_scoring_scheme::set_similarity_matrix
constexpr void set_similarity_matrix(aminoacid_similarity_matrix const matrix_id)
Set the similarity matrix scheme (e.g. BLOSUM62).
Definition: aminoacid_scoring_scheme.hpp:124
seqan3::scoring_scheme_base< aminoacid_scoring_scheme< score_type >, aa27, score_type >::matrix_type
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:121
seqan3::match_score
A strong type of underlying type score_type that represents the score of two matching characters.
Definition: scoring_scheme_base.hpp:42
seqan3::aa27
The twenty-seven letter amino acid alphabet.
Definition: aa27.hpp:43
seqan3::aminoacid_similarity_matrix::BLOSUM62
The BLOSUM62 matrix recommended for most use-cases.