|
Last change
on this file was
16766,
checked in by westram, 8 years ago
|
|
|
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Author Date Id Revision
|
|
File size:
919 bytes
|
| Line | |
|---|
| 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 | |
|---|
| 7 | int basesArePairing[BASECHARS][BASECHARS] = { |
|---|
| 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 | |
|---|
| 16 | int baseCharType[MAXBASECHAR+1], |
|---|
| 17 | charIsDelete[MAXBASECHAR+1], |
|---|
| 18 | charIsHelical[MAXBASECHAR+1]; |
|---|
| 19 | |
|---|
| 20 | void initBaseLookups() { |
|---|
| 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 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.