ARB
base.c
Go to the documentation of this file.
1 #include "base.h"
2 #include <ctype.h>
3 
4 char helixBaseChar[BASECHARS] = { 'A', 'C', 'G', 'T', '=' },
5  loopBaseChar[BASECHARS] = { 'a', 'c', 'g', 't', '-' };
6 
8 // A C G T -
9  { 0, 0, 0, 1, 0 }, // A
10  { 0, 0, 1, 0, 0 }, // C
11  { 0, 1, 0, 0, 0 }, // G
12  { 1, 0, 0, 0, 0 }, // T
13  { 0, 0, 0, 0, 0 }, // -
14 };
15 
19 
21  int b;
22 
23  for (b = 0; b<MAXBASECHAR; b++) {
24  baseCharType[b] = -1;
25  charIsDelete[b] = 0;
26  charIsHelical[b] = 0;
27  }
28 
29  for (b = 0; b<BASECHARS; b++) {
30  int c1 = helixBaseChar[b];
31  int c2 = loopBaseChar[b];
32 
33  assert(c1<=MAXBASECHAR);
34  assert(c2<=MAXBASECHAR);
35 
36  baseCharType[c1] = b;
37  baseCharType[c2] = b;
38  charIsHelical[c1] = 1;
39  }
40 }
char loopBaseChar[BASECHARS]
Definition: base.c:5
int charIsHelical[MAXBASECHAR+1]
Definition: base.c:16
int basesArePairing[BASECHARS][BASECHARS]
Definition: base.c:7
int charIsDelete[MAXBASECHAR+1]
Definition: base.c:16
char helixBaseChar[BASECHARS]
Definition: base.c:4
#define MAXBASECHAR
Definition: base.h:21
#define BASECHARS
Definition: base.h:18
void initBaseLookups()
Definition: base.c:20
#define assert(bed)
int baseCharType[MAXBASECHAR+1]
Definition: base.c:16