SeqAn3 3.2.0
The Modern C++ library for sequence analysis.
aminoacid_scoring_scheme.hpp
Go to the documentation of this file.
1// -----------------------------------------------------------------------------------------------------
2// Copyright (c) 2006-2022, Knut Reinert & Freie Universität Berlin
3// Copyright (c) 2016-2022, 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 <algorithm>
17
20
21namespace seqan3
22{
23
36{
37 //ATTENTION: when you change this, also update set_similarity_matrix() below
58};
59
73template <arithmetic score_type = int8_t>
74class aminoacid_scoring_scheme : public scoring_scheme_base<aminoacid_scoring_scheme<score_type>, aa27, score_type>
75{
76private:
79
81 using base_t::matrix;
82
84 friend base_t;
85
86public:
89 using typename base_t::matrix_type;
91
96 constexpr aminoacid_scoring_scheme() noexcept = default;
98 template <arithmetic score_arg_t>
99 constexpr aminoacid_scoring_scheme(match_score<score_arg_t> const ms, mismatch_score<score_arg_t> const mms) :
100 base_t{ms, mms}
101 {}
103 constexpr aminoacid_scoring_scheme(matrix_type const & matrix) noexcept : base_t{matrix}
104 {}
105
109 {
110 set_similarity_matrix(matrix_id);
111 }
113
122 {
123 switch (matrix_id)
124 {
126 std::ranges::copy(blosum30, begin(matrix));
127 break;
129 std::ranges::copy(blosum45, begin(matrix));
130 break;
132 std::ranges::copy(blosum62, begin(matrix));
133 break;
135 std::ranges::copy(blosum80, begin(matrix));
136 break;
137 default:
138 throw std::invalid_argument{"ERROR in set_similarity_matrix(), matrix_id has no matrix."};
139 }
140 }
142
143private:
145 static constexpr matrix_type blosum30{{
147 //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 *
148 {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
149 {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
150 {-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
151 {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
152 {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
153 {-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
154 {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
155 {-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
156 {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
157 {-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
158 {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
159 {-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
160 {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
161 {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
162 {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
163 {-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
164 {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
165 {-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
166 {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
167 {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
168 {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
169 {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
170 {-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
171 {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
172 {-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
173 {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
174 {-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} //*
176 }};
177
179 static constexpr matrix_type blosum45{{
181 //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 *
182 {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
183 {-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
184 {-1, -2, 12, -3, -3, -2, -3, -3, -3, -3, -3, -2, -2, -2,
185 -2, -4, -3, -3, -1, -1, -2, -1, -5, -2, -3, -3, -5}, //C
186 {-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
187 {-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
188 {-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
189 {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
190 {-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
191 {-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
192 {-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
193 {-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
194 {-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
195 {-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
196 {-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
197 {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
198 {-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
199 {-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
200 {-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
201 {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
202 {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
203 {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
204 {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
205 {-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
206 {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
207 {-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
208 {-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
209 {-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} //*
211 }};
212
214 static constexpr matrix_type blosum62{{
216 //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 *
217 {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
218 {-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
219 {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
220 {-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
221 {-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
222 {-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
223 {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
224 {-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
225 {-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
226 {-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
227 {-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
228 {-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
229 {-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
230 {-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
231 {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
232 {-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
233 {-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
234 {-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
235 {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
236 {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
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}, //U
238 {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
239 {-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
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}, //X
241 {-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
242 {-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
243 {-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} //*
245 }};
246
248 static constexpr matrix_type blosum80{{
250 //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 *
251 {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
252 {-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
253 {-1, -6, 13, -7, -7, -4, -6, -7, -2, -3, -6, -3, -3, -5,
254 -4, -6, -5, -6, -2, -2, -4, -2, -5, -4, -5, -7, -8}, //C
255 {-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
256 {-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
257 {-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
258 {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
259 {-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
260 {-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
261 {-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
262 {-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
263 {-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
264 {-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
265 {-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
266 {-1, -3, -4, -3, -2, -3, -3, -2, -2, -2, -2, -2, -2, -2,
267 -2, -3, -2, -2, -1, -1, -2, -2, -5, -2, -3, -1, -8}, //O
268 {-1, -4, -6, -3, -2, -6, -5, -4, -5, -5, -2, -5, -4, -4,
269 -3, 12, -3, -3, -2, -3, -3, -4, -7, -3, -6, -2, -8}, //P
270 {-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
271 {-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
272 {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
273 {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
274 {-1, -3, -4, -3, -2, -3, -3, -2, -2, -2, -2, -2, -2, -2,
275 -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,
279 -2, -3, -2, -2, -1, -1, -2, -2, -5, -2, -3, -1, -8}, //X
280 {-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
281 {-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
282 {-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} //*
284 }};
285
286 //TODO(h-2): add more matrixes
287};
288
295aminoacid_scoring_scheme()->aminoacid_scoring_scheme<int8_t>;
296
300template <arithmetic score_arg_type>
303
305template <arithmetic score_arg_type>
307
311aminoacid_scoring_scheme(aminoacid_similarity_matrix)->aminoacid_scoring_scheme<int8_t>;
313
314} // namespace seqan3
Provides seqan3::aa27, container aliases and string literals.
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:75
constexpr void set_similarity_matrix(aminoacid_similarity_matrix const matrix_id)
Set the similarity matrix scheme (e.g. blosum62).
Definition: aminoacid_scoring_scheme.hpp:121
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:103
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:108
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
T copy(T... args)
aminoacid_similarity_matrix
Identifiers for amino acid similarity matrixes.
Definition: aminoacid_scoring_scheme.hpp:36
@ blosum80
The blosum80 matrix for closely related proteins.
@ blosum30
The blosum30 matrix for very distantly related proteins.
@ blosum45
The blosum45 matrix for distantly related proteins.
@ blosum62
The blosum62 matrix recommended for most use-cases.
A type that satisfies std::is_arithmetic_v<t>.
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:29
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