1 | #ifndef alpha_h |
---|
2 | #define alpha_h |
---|
3 | |
---|
4 | bool StrHasAmino(const char *Str); |
---|
5 | bool StrHasGap(const char *Str); |
---|
6 | void ClearInvalidLetterWarning(); |
---|
7 | void InvalidLetterWarning(char c, char w); |
---|
8 | void ReportInvalidLetters(); |
---|
9 | |
---|
10 | extern unsigned g_CharToLetter[]; |
---|
11 | extern unsigned g_CharToLetterEx[]; |
---|
12 | |
---|
13 | extern char g_LetterToChar[]; |
---|
14 | extern char g_LetterExToChar[]; |
---|
15 | |
---|
16 | extern char g_UnalignChar[]; |
---|
17 | extern char g_AlignChar[]; |
---|
18 | |
---|
19 | extern bool g_IsWildcardChar[]; |
---|
20 | extern bool g_IsResidueChar[]; |
---|
21 | |
---|
22 | #define CharToLetter(c) (g_CharToLetter[(unsigned char) (c)]) |
---|
23 | #define CharToLetterEx(c) (g_CharToLetterEx[(unsigned char) (c)]) |
---|
24 | |
---|
25 | #define LetterToChar(u) (g_LetterToChar[u]) |
---|
26 | #define LetterExToChar(u) (g_LetterExToChar[u]) |
---|
27 | |
---|
28 | #define IsResidueChar(c) (g_IsResidueChar[(unsigned char) (c)]) |
---|
29 | #define IsGapChar(c) ('-' == (c) || '.' == (c)) |
---|
30 | #define IsWildcardChar(c) (g_IsWildcardChar[(unsigned char) (c)]) |
---|
31 | |
---|
32 | #define AlignChar(c) (g_AlignChar[(unsigned char) (c)]) |
---|
33 | #define UnalignChar(c) (g_UnalignChar[(unsigned char) (c)]) |
---|
34 | |
---|
35 | // AX=Amino alphabet with eXtensions (B, Z and X) |
---|
36 | enum AX |
---|
37 | { |
---|
38 | AX_A, |
---|
39 | AX_C, |
---|
40 | AX_D, |
---|
41 | AX_E, |
---|
42 | AX_F, |
---|
43 | AX_G, |
---|
44 | AX_H, |
---|
45 | AX_I, |
---|
46 | AX_K, |
---|
47 | AX_L, |
---|
48 | AX_M, |
---|
49 | AX_N, |
---|
50 | AX_P, |
---|
51 | AX_Q, |
---|
52 | AX_R, |
---|
53 | AX_S, |
---|
54 | AX_T, |
---|
55 | AX_V, |
---|
56 | AX_W, |
---|
57 | AX_Y, |
---|
58 | |
---|
59 | AX_X, // Any |
---|
60 | |
---|
61 | AX_B, // D or N |
---|
62 | AX_Z, // E or Q |
---|
63 | |
---|
64 | AX_GAP, |
---|
65 | }; |
---|
66 | const unsigned AX_COUNT = AX_GAP + 1; |
---|
67 | |
---|
68 | // NX=Nucleotide alphabet with extensions |
---|
69 | enum NX |
---|
70 | { |
---|
71 | NX_A, |
---|
72 | NX_C, |
---|
73 | NX_G, |
---|
74 | NX_T, |
---|
75 | NX_U = NX_T, |
---|
76 | |
---|
77 | NX_M, // AC |
---|
78 | NX_R, // AG |
---|
79 | NX_W, // AT |
---|
80 | NX_S, // CG |
---|
81 | NX_Y, // CT |
---|
82 | NX_K, // GT |
---|
83 | NX_V, // ACG |
---|
84 | NX_H, // ACT |
---|
85 | NX_D, // AGT |
---|
86 | NX_B, // CGT |
---|
87 | NX_X, // GATC |
---|
88 | NX_N, // GATC |
---|
89 | NX_GAP |
---|
90 | }; |
---|
91 | const unsigned NX_COUNT = NX_GAP + 1; |
---|
92 | |
---|
93 | const unsigned MAX_ALPHA = 20; |
---|
94 | const unsigned MAX_ALPHA_EX = AX_COUNT; |
---|
95 | const unsigned MAX_CHAR = 256; |
---|
96 | |
---|
97 | extern ALPHA g_Alpha; |
---|
98 | extern unsigned g_AlphaSize; |
---|
99 | |
---|
100 | void SetAlpha(ALPHA Alpha); |
---|
101 | char GetWildcardChar(); |
---|
102 | bool IsNucleo(char c); |
---|
103 | bool IsDNA(char c); |
---|
104 | bool IsRNA(char c); |
---|
105 | |
---|
106 | #endif // alpha_h |
---|