| 1 | #define PRINT_WID 550 |
|---|
| 2 | #define PRINT_HT 750 |
|---|
| 3 | #define BASE_TO_BASE_DIST 1.0 |
|---|
| 4 | #define CW 1 |
|---|
| 5 | #define CCW -1 |
|---|
| 6 | #define CWID 5 |
|---|
| 7 | #define CHT 6 |
|---|
| 8 | #ifndef TRUE |
|---|
| 9 | #define TRUE 1 |
|---|
| 10 | #define FALSE 0 |
|---|
| 11 | #endif |
|---|
| 12 | #define NULL 0 |
|---|
| 13 | #define PI_val 3.1415926535 |
|---|
| 14 | #define PI_o2 PI_val / 2 |
|---|
| 15 | #define TWO_PI 2*PI_val |
|---|
| 16 | |
|---|
| 17 | /* Text attributed */ |
|---|
| 18 | |
|---|
| 19 | #define HILITE 1 |
|---|
| 20 | #define BOLD 2 |
|---|
| 21 | #define ITALIC 4 |
|---|
| 22 | #define LOLITE 8 |
|---|
| 23 | |
|---|
| 24 | /* Constraint types */ |
|---|
| 25 | |
|---|
| 26 | #define ANGULAR 1 |
|---|
| 27 | #define POSITIONAL 2 |
|---|
| 28 | #define DISTANCE 3 |
|---|
| 29 | |
|---|
| 30 | /* colors */ |
|---|
| 31 | #define BLACK 0 |
|---|
| 32 | #define MAGENTA 1 |
|---|
| 33 | #define YELLOW 2 |
|---|
| 34 | #define BLUE 3 |
|---|
| 35 | #define CYAN 4 |
|---|
| 36 | #define GREEN 5 |
|---|
| 37 | #define RED 6 |
|---|
| 38 | #define WHITE 7 |
|---|
| 39 | |
|---|
| 40 | #define Max(a,b) (a)>(b)?(a):(b) |
|---|
| 41 | #define Min(a,b) (a)<(b)?(a):(b) |
|---|
| 42 | #define distance(a,b,c,d) sqrt( ((a)-(c))*((a)-(c))+((b)-(d))*((b)-(d)) ) |
|---|
| 43 | #define sqr(a) ((a)*(a)) |
|---|
| 44 | |
|---|
| 45 | typedef struct distanceconstraint |
|---|
| 46 | { |
|---|
| 47 | double dist; /*distance*/ |
|---|
| 48 | int pair; /*pairing partner*/ |
|---|
| 49 | } Dcon; |
|---|
| 50 | |
|---|
| 51 | typedef struct positionalconstraint |
|---|
| 52 | { |
|---|
| 53 | double dx,dy; /*delta x and y*/ |
|---|
| 54 | int pair; /*pairing partner*/ |
|---|
| 55 | } Pcon; |
|---|
| 56 | |
|---|
| 57 | typedef struct labelstruct |
|---|
| 58 | { |
|---|
| 59 | double dist,dx,dy,x,y; |
|---|
| 60 | char text[80]; |
|---|
| 61 | int distflag; |
|---|
| 62 | } Label; |
|---|
| 63 | |
|---|
| 64 | |
|---|
| 65 | typedef struct basestruct |
|---|
| 66 | { |
|---|
| 67 | double x,y; /*position*/ |
|---|
| 68 | int rel_loc; /*location in alignment*/ |
|---|
| 69 | int known; /*is position known?*/ |
|---|
| 70 | int pair; /*pase pair*/ |
|---|
| 71 | char nuc; /*this base (a,g,c,t,u etc)*/ |
|---|
| 72 | int dir; /*direction of traversal*/ |
|---|
| 73 | int attr; /*text attributes*/ |
|---|
| 74 | int size; /*font size*/ |
|---|
| 75 | Dcon dforw,dback; /*distance constraint*/ |
|---|
| 76 | Pcon *pos; /*positional constraints*/ |
|---|
| 77 | int posnum; /*number of positional constraints*/ |
|---|
| 78 | int depth; /*depth of helix nesting*/ |
|---|
| 79 | Label *label; /*label for nucc*/ |
|---|
| 80 | } Base; |
|---|
| 81 | |
|---|
| 82 | typedef struct sequencestruct |
|---|
| 83 | { |
|---|
| 84 | int len; /*sequence len*/ |
|---|
| 85 | char *name; /*sequence name*/ |
|---|
| 86 | char *sequence; /*base list*/ |
|---|
| 87 | }Sequence; |
|---|
| 88 | |
|---|
| 89 | typedef struct datasetstruct |
|---|
| 90 | { |
|---|
| 91 | int siz; /*number of taxa (plus helix)*/ |
|---|
| 92 | int len; /*length of ALIGNMENT in bases*/ |
|---|
| 93 | Sequence helix; /*helix information*/ |
|---|
| 94 | Sequence taxa[4096]; /*individual taxa*/ |
|---|
| 95 | } DataSet; |
|---|
| 96 | |
|---|
| 97 | typedef struct loopstackstruct |
|---|
| 98 | { |
|---|
| 99 | double dist; /*distance to LAST base*/ |
|---|
| 100 | int nucnum; /*nucleotide index*/ |
|---|
| 101 | } LoopStak; |
|---|
| 102 | |
|---|