File: alpha.h

package info (click to toggle)
mothur 1.48.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 13,684 kB
  • sloc: cpp: 161,854; makefile: 122; sh: 31
file content (50 lines) | stat: -rwxr-xr-x 1,473 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef alpha_h
#define alpha_h

#include <limits.h>
#include <string>

using namespace std;

const unsigned INVALID_LETTER = 0;
const unsigned char INVALID_CHAR = '?';

extern unsigned g_CharToLetterAmino[];
extern unsigned g_CharToLetterAminoStop[];
extern unsigned char g_LetterToCharAmino[];
extern unsigned g_CharToLetterNucleo[];
extern unsigned char g_LetterToCharNucleo[];
extern unsigned g_CodonWordToAminoLetter[];
extern char g_CodonWordToAminoChar[];
extern unsigned char g_CharToCompChar[];
extern unsigned g_CharToCompLetter[];
extern bool g_IsAminoChar[];
extern bool g_IsNucleoChar[];
extern bool g_IsACGTU[];
extern float g_AminoFreqs[];

extern unsigned g_CharToLetterRed[];
extern unsigned char g_LetterToCharRed[];
extern unsigned g_RedAlphaSize;

void LogRedAlphaRed();
void ReadRedAlphaFromFile(const string &FileName);
unsigned char GetAminoCharFrom3NucChars(unsigned char c1, unsigned char c2,
  unsigned char c3);

static inline bool AminoLetterIsStartCodon(unsigned char Letter)
	{
	return Letter == 10;
	}

static inline bool AminoLetterIsStopCodon(unsigned char Letter)
	{
	return Letter == 20;
	}

const char *WordToStr(unsigned Word, unsigned WordLength, bool Nucleo);
const char *WordToStrNucleo(unsigned Word, unsigned WordLength);
const char *WordToStrAmino(unsigned Word, unsigned WordLength);
const char *WordToStrAmino2(unsigned Word, unsigned WordLength, char *Str);

#endif // alpha_h