SeqAn3 3.1.0
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
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
104 : base_t{matrix}
105 {}
106
110 {
111 set_similarity_matrix(matrix_id);
112 }
114
123 {
124 switch (matrix_id)
125 {
126 case aminoacid_similarity_matrix::blosum30: std::ranges::copy(blosum30, begin(matrix)); break;
127 case aminoacid_similarity_matrix::blosum45: std::ranges::copy(blosum45, begin(matrix)); break;
128 case aminoacid_similarity_matrix::blosum62: std::ranges::copy(blosum62, begin(matrix)); break;
129 case aminoacid_similarity_matrix::blosum80: std::ranges::copy(blosum80, begin(matrix)); break;
130 default:
131 throw std::invalid_argument{"ERROR in set_similarity_matrix(), matrix_id has no matrix."};
132 }
133 }
135
136private:
138 static constexpr matrix_type blosum30
139 {{
141 //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 *
142 { 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
143 { 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
144 {-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
145 { 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
146 { 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
147 {-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
148 { 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
149 {-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
150 { 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
151 {-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
152 { 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
153 {-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
154 { 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
155 { 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
156 { 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
157 {-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
158 { 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
159 {-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
160 { 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
161 { 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
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},//U
163 { 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
164 {-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
165 { 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
166 {-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
167 { 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
168 {-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} //*
170 }};
171
173 static constexpr matrix_type blosum45
174 {{
176 //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 *
177 { 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
178 {-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
179 {-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
180 {-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
181 {-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
182 {-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
183 { 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
184 {-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
185 {-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
186 {-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
187 {-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
188 {-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
189 {-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
190 {-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
191 { 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
192 {-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
193 {-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
194 {-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
195 { 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
196 { 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
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},//U
198 { 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
199 {-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
200 { 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
201 {-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
202 {-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
203 {-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} //*
205 }};
206
208 static constexpr matrix_type blosum62
209 {{
211 //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 *
212 { 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
213 {-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
214 { 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
215 {-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
216 {-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
217 {-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
218 { 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
219 {-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
220 {-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
221 {-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
222 {-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
223 {-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
224 {-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
225 {-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
226 { 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
227 {-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
228 {-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
229 {-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
230 { 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
231 { 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
232 { 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
233 { 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
234 {-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
235 { 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
236 {-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
237 {-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
238 {-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} //*
240 }};
241
243 static constexpr matrix_type blosum80
244 {{
246 //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 *
247 { 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
248 {-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
249 {-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
250 {-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
251 {-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
252 {-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
253 { 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
254 {-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
255 {-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
256 {-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
257 {-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
258 {-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
259 {-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
260 {-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
261 {-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
262 {-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
263 {-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
264 {-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
265 { 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
266 { 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
267 {-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
268 {-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
269 {-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
270 {-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
271 {-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
272 {-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
273 {-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} //*
275 }};
276
277 //TODO(h-2): add more matrixes
278};
279
287
291template <arithmetic score_arg_type>
294
296template <arithmetic score_arg_type>
298
304
305} // namespace seqan3
Provides seqan3::aa27, container aliases and string literals.
The <algorithm> header from C++20's standard library.
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:122
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:109
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
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: cigar_operation_table.hpp:2
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