]> git.donarmstrong.com Git - mothur.git/blob - alpha.h
e491c9c602ffe0186f0d3b2aec6d514d87832b05
[mothur.git] / alpha.h
1 //uchime by Robert C. Edgar http://drive5.com/uchime This code is donated to the public domain.\r
2 \r
3 #ifndef alpha_h\r
4 #define alpha_h\r
5 \r
6 #include <limits.h>\r
7 #include <string>\r
8 \r
9 using namespace std;\r
10 \r
11 const unsigned INVALID_LETTER = 0;\r
12 const unsigned char INVALID_CHAR = '?';\r
13 \r
14 extern unsigned g_CharToLetterAmino[];\r
15 extern unsigned g_CharToLetterAminoStop[];\r
16 extern unsigned char g_LetterToCharAmino[];\r
17 extern unsigned g_CharToLetterNucleo[];\r
18 extern unsigned char g_LetterToCharNucleo[];\r
19 extern unsigned g_CodonWordToAminoLetter[];\r
20 extern char g_CodonWordToAminoChar[];\r
21 extern unsigned char g_CharToCompChar[];\r
22 extern unsigned g_CharToCompLetter[];\r
23 extern bool g_IsAminoChar[];\r
24 extern bool g_IsNucleoChar[];\r
25 extern bool g_IsACGTU[];\r
26 extern float g_AminoFreqs[];\r
27 \r
28 extern unsigned g_CharToLetterRed[];\r
29 extern unsigned char g_LetterToCharRed[];\r
30 extern unsigned g_RedAlphaSize;\r
31 \r
32 void LogRedAlphaRed();\r
33 void ReadRedAlphaFromFile(const string &FileName);\r
34 unsigned char GetAminoCharFrom3NucChars(unsigned char c1, unsigned char c2,\r
35   unsigned char c3);\r
36 \r
37 static inline bool AminoLetterIsStartCodon(unsigned char Letter)\r
38         {\r
39         return Letter == 10;\r
40         }\r
41 \r
42 static inline bool AminoLetterIsStopCodon(unsigned char Letter)\r
43         {\r
44         return Letter == 20;\r
45         }\r
46 \r
47 const char *WordToStr(unsigned Word, unsigned WordLength, bool Nucleo);\r
48 const char *WordToStrNucleo(unsigned Word, unsigned WordLength);\r
49 const char *WordToStrAmino(unsigned Word, unsigned WordLength);\r
50 const char *WordToStrAmino2(unsigned Word, unsigned WordLength, char *Str);\r
51 \r
52 #endif // alpha_h\r