source: tags/initial/TREEGEN/base.c

Last change on this file was 2, checked in by oldcode, 23 years ago

Initial revision

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.2 KB
Line 
1#include "base.h"
2
3#ifndef __CTYPE_H
4    #include <ctype.h>
5#endif
6
7char helixBaseChar[BASECHARS] = { 'A', 'C', 'G', 'T', '=' },
8     loopBaseChar[BASECHARS]  = { 'a', 'c', 'g', 't', '-' };
9
10int basesArePairing[BASECHARS][BASECHARS] =
11{
12
13/*    A  C  G  T  - */
14
15    { 0, 0, 0, 1, 0 }, /* A */
16    { 0, 0, 1, 0, 0 }, /* C */
17    { 0, 1, 0, 0, 0 }, /* G */
18    { 1, 0, 0, 0, 0 }, /* T */
19    { 0, 0, 0, 0, 0 }, /* - */
20};
21
22int baseCharType[MAXBASECHAR+1],
23    charIsDelete[MAXBASECHAR+1],
24    charIsHelical[MAXBASECHAR+1];
25
26/* -------------------------------------------------------------------------- */
27/*      void initBaseLookups(void) */
28/* ------------------------------------------------------ 25.05.95 02.07 ---- */
29void initBaseLookups(void)
30{
31    int b;
32
33    for (b = 0; b<MAXBASECHAR; b++)
34    {
35        baseCharType[b]  = -1;
36        charIsDelete[b]  = 0;
37        charIsHelical[b] = 0;
38    }
39
40    for (b = 0; b<BASECHARS; b++)
41    {
42        int c1 = helixBaseChar[b],
43            c2 = loopBaseChar[b];
44
45        assert(c1<=MAXBASECHAR);
46        assert(c2<=MAXBASECHAR);
47
48        baseCharType[c1]  = b;
49        baseCharType[c2]  = b;
50        charIsHelical[c1] = 1;
51    }
52}
Note: See TracBrowser for help on using the repository browser.