1 /*==========================================================================
2 SeqAn - The Library for Sequence Analysis
4 ============================================================================
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 3 of the License, or (at your option) any later version.
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
17 ============================================================================
18 $Id: basic_alphabet_simple_tabs.h,v 1.1 2008/08/25 16:20:02 langmead Exp $
19 ==========================================================================*/
21 #ifndef SEQAN_HEADER_BASIC_ALPHABET_SIMPLE_TABS_H
22 #define SEQAN_HEADER_BASIC_ALPHABET_SIMPLE_TABS_H
25 namespace SEQAN_NAMESPACE_MAIN
27 //////////////////////////////////////////////////////////////////////////////
29 //use same tables for Dna
31 template <typename T = void>
32 struct _Translate_Table_Dna5_2_Ascii
34 static char const VALUE[5];
37 char const _Translate_Table_Dna5_2_Ascii<T>::VALUE[5] = {'A', 'C', 'G', 'T', 'N'};
39 //____________________________________________________________________________
41 template <typename T = void>
42 struct _Translate_Table_Dna5_2_Iupac
44 static char const VALUE[5];
47 char const _Translate_Table_Dna5_2_Iupac<T>::VALUE[5] = {0x02, 0x04, 0x08, 0x01, 0x0f};
49 //____________________________________________________________________________
51 template <typename T = void>
52 struct _Translate_Table_Iupac_2_Ascii
54 static char const VALUE[16];
57 char const _Translate_Table_Iupac_2_Ascii<T>::VALUE[16] =
60 'T', //0001=1 //T=1: change between U and T is just inc/dec
64 'Y', //0101=5 TC (pyrimidine)
69 'R', //1010=A AG (purine)
77 //____________________________________________________________________________
79 template <typename T = void>
80 struct _Translate_Table_Iupac_2_Dna
82 static char const VALUE[16];
85 char const _Translate_Table_Iupac_2_Dna<T>::VALUE[16] =
105 //____________________________________________________________________________
108 template <typename T = void>
109 struct _Translate_Table_Iupac_2_Dna5
111 static char const VALUE[16];
113 template <typename T>
114 char const _Translate_Table_Iupac_2_Dna5<T>::VALUE[16] =
134 //____________________________________________________________________________
136 template <typename T = void>
137 struct _Translate_Table_Ascii_2_Dna
139 static char const VALUE[256];
141 template <typename T>
142 char const _Translate_Table_Ascii_2_Dna<T>::VALUE[256] =
144 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //0
145 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //1
146 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //2
147 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //3
149 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, //4
150 // , A, B, C, D, E, D, G, H, I, J, K, L, M, N, O,
152 0, 0, 0, 0, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //5
153 // P, Q, R, S, T, U, V, W, X, Y, Z, , , , ,
155 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, //6
156 // , a, b, c, d, e, f, g, h, i, j, k, l, m, n, o,
158 0, 0, 0, 0, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //7
159 // p, q, r, s, t, u, v, w, x, y, z, , , , ,
161 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //8
162 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //9
163 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //10
164 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //11
165 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //12
166 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //13
167 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //14
168 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 //15
171 //____________________________________________________________________________
174 template <typename T = void>
175 struct _Translate_Table_Ascii_2_Dna5
177 static char const VALUE[256];
179 template <typename T>
180 char const _Translate_Table_Ascii_2_Dna5<T>::VALUE[256] =
182 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //0
183 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //1
184 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //2
185 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //3
187 4, 0, 4, 1, 4, 4, 4, 2, 4, 4, 4, 4, 4, 4, 4, 4, //4
188 // , A, B, C, D, E, D, G, H, I, J, K, L, M, N, O,
190 4, 4, 4, 4, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //5
191 // P, Q, R, S, T, U, V, W, X, Y, Z, , , , ,
193 4, 0, 4, 1, 4, 4, 4, 2, 4, 4, 4, 4, 4, 4, 4, 4, //6
194 // , a, b, c, d, e, f, g, h, i, j, k, l, m, n, o,
196 4, 4, 4, 4, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //7
197 // p, q, r, s, t, u, v, w, x, y, z, , , , ,
199 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //8
200 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //9
201 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //10
202 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //11
203 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //12
204 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //13
205 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //14
206 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 //15
209 //____________________________________________________________________________
212 template <typename T = void>
213 struct _Translate_Table_Ascii_2_Iupac
215 static char const VALUE[256];
217 template <typename T>
218 char const _Translate_Table_Ascii_2_Iupac<T>::VALUE[256] =
220 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //0
221 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //1
222 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //2
223 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //3
225 15, 2, 13, 4, 11, 15, 15, 8, 7, 15, 15, 9, 15, 6, 15, 15, //4
226 // , A, B, C, D, E, F, G, H, I, J, K, L, M, N, O,
228 15, 15, 10, 12, 1, 0, 14, 3, 15, 5, 15, 15, 15, 15, 15, 15, //5
229 // P, Q, R, S, T, U, V, W, X, Y, Z, , , , ,
231 15, 2, 13, 4, 11, 15, 15, 8, 7, 15, 15, 9, 15, 6, 15, 15, //6
232 // , a, b, c, d, e, f, g, h, i, j, k, l, m, n, o,
234 15, 15, 10, 12, 1, 0, 14, 3, 15, 5, 15, 15, 15, 15, 15, 15, //7
235 // p, q, r, s, t, u, v, w, x, y, z, , , , ,
237 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //8
238 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //9
239 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //10
240 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //11
241 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //12
242 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //13
243 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //14
244 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15 //15
247 //____________________________________________________________________________
249 template <typename T = void>
250 struct _Translate_Table_Byte_2_Dna
252 static char const VALUE[256];
254 template <typename T>
255 char const _Translate_Table_Byte_2_Dna<T>::VALUE[256] =
257 0, 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //0
258 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //1
259 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //2
260 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //3
261 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //4
262 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //5
263 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //6
264 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //7
265 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //8
266 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //9
267 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //10
268 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //11
269 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //12
270 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //13
271 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //14
272 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 //15
275 //____________________________________________________________________________
278 template <typename T = void>
279 struct _Translate_Table_Byte_2_Dna5
281 static char const VALUE[256];
283 template <typename T>
284 char const _Translate_Table_Byte_2_Dna5<T>::VALUE[256] = {
285 0, 1, 2, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //0
286 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //1
287 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //2
288 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //3
289 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //4
290 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //5
291 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //6
292 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //7
293 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //8
294 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //9
295 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //10
296 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //11
297 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //12
298 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //13
299 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, //14
300 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 //15
303 //____________________________________________________________________________
306 template <typename T = void>
307 struct _Translate_Table_Byte_2_Iupac
309 static char const VALUE[256];
311 template <typename T>
312 char const _Translate_Table_Byte_2_Iupac<T>::VALUE[256] =
314 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, //0
315 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //1
316 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //2
317 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //3
318 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //4
319 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //5
320 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //6
321 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //7
322 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //8
323 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //9
324 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //10
325 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //11
326 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //12
327 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //13
328 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, //14
329 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15 //15
332 //____________________________________________________________________________
335 template <typename T = void>
336 struct _Translate_Table_AA_2_Ascii
338 static char const VALUE[24];
340 template <typename T>
341 char const _Translate_Table_AA_2_Ascii<T>::VALUE[24] =
343 'A', // 0 Ala Alanine
344 'R', // 1 Arg Arginine
345 'N', // 2 Asn Asparagine
346 'D', // 3 Asp Aspartic Acid
347 'C', // 4 Cys Cystine
348 'Q', // 5 Gln Glutamine
349 'E', // 6 Glu Glutamic Acid
350 'G', // 7 Gly Glycine
351 'H', // 8 His Histidine
352 'I', // 9 Ile Isoleucine
353 'L', //10 Leu Leucine
355 'M', //12 Met Methionine
356 'F', //13 Phe Phenylalanine
357 'P', //14 Pro Proline
359 'T', //16 Thr Threonine
360 'W', //17 Trp Tryptophan
361 'Y', //18 Tyr Tyrosine
363 'B', //20 Aspartic Acid, Asparagine
364 'Z', //21 Glutamic Acid, Glutamine
369 //____________________________________________________________________________
372 template <typename T = void>
373 struct _Translate_Table_Ascii_2_AA
375 static char const VALUE[256];
377 template <typename T>
378 char const _Translate_Table_Ascii_2_AA<T>::VALUE[256] =
380 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, //0
381 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, //1
382 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 22, 22, 22, 22, 22, //2
384 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, //3
385 22, 0, 20, 4, 3, 6, 13, 7, 8, 9, 22, 11, 10, 12, 2, 22, //4
386 // , A, B, C, D, E, F, G, H, I, J, K, L, M, N, O,
388 14, 5, 1, 15, 16, 22, 19, 17, 22, 18, 21, 22, 22, 22, 22, 22, //5
389 // P, Q, R, S, T, U, V, W, X, Y, Z, , , , , ,
391 22, 0, 20, 4, 3, 6, 13, 7, 8, 9, 22, 11, 10, 12, 2, 22, //6
392 // , a, b, c, d, e, f, g, h, i, j, k, l, m, n, o,
394 14, 5, 1, 15, 16, 22, 19, 17, 22, 18, 21, 22, 22, 22, 22, 22, //7
395 // p, q, r, s, t, u, v, w, x, y, z, , , , , ,
397 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, //8
398 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, //9
399 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, //10
400 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, //11
401 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, //12
402 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, //13
403 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, //14
404 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22 //15
407 //____________________________________________________________________________
410 template <typename T = void>
411 struct _Translate_Table_Byte_2_AA
413 static char const VALUE[256];
415 template <typename T>
416 char const _Translate_Table_Byte_2_AA<T>::VALUE[256] =
418 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, //0
419 16, 17, 18, 19, 20, 21, 22, 23, 22, 22, 22, 22, 22, 22, 22, 22, //1
420 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, //2
421 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, //3
422 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, //4
423 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, //5
424 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, //6
425 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, //7
426 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, //8
427 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, //9
428 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, //10
429 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, //11
430 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, //12
431 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, //13
432 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, //14
433 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22 //15
436 //////////////////////////////////////////////////////////////////////////////
438 }//namespace SEQAN_NAMESPACE_MAIN
439 #endif //#ifndef SEQAN_HEADER_...