1 | |
---|
2 | /* version 3.6. (c) Copyright 1993-2000 by the University of Washington. |
---|
3 | Written by Joseph Felsenstein, Akiko Fuseki, Sean Lamont, and Andrew Keeffe. |
---|
4 | Permission is granted to copy and use this program provided no fee is |
---|
5 | charged for it and provided that this copyright notice is not removed. */ |
---|
6 | |
---|
7 | /* |
---|
8 | seq.h: included in dnacomp, dnadist, dnainvar, dnaml, dnamlk, dnamove, |
---|
9 | dnapars, dnapenny, protdist, protpars, & restml |
---|
10 | */ |
---|
11 | |
---|
12 | #define maxcutter 8 /* maximum number of bases in a site in restml */ |
---|
13 | |
---|
14 | /* move */ |
---|
15 | /* All the below moved here in the Great TreeRead Migration of '96 */ |
---|
16 | |
---|
17 | #define ebcdic EBCDIC |
---|
18 | #define MAXNCH 20 |
---|
19 | |
---|
20 | /* All of this came over from cons.h -plc*/ |
---|
21 | #define OVER 7 |
---|
22 | #define ADJACENT_PAIRS 1 |
---|
23 | #define CORR_IN_1_AND_2 2 |
---|
24 | #define ALL_IN_1_AND_2 3 |
---|
25 | #define NO_PAIRING 4 |
---|
26 | #define ALL_IN_FIRST 5 |
---|
27 | #define TREE1 8 |
---|
28 | #define TREE2 9 |
---|
29 | |
---|
30 | #define FULL_MATRIX 11 |
---|
31 | #define VERBOSE 22 |
---|
32 | #define SPARSE 33 |
---|
33 | |
---|
34 | /* Used in proml, promlk, dnaml, dnamlk for undefined bestyet*/ |
---|
35 | #define UNDEFINED 1.0 |
---|
36 | |
---|
37 | |
---|
38 | /* Number of columns per block in a matrix output */ |
---|
39 | #define COLUMNS_PER_BLOCK 10 |
---|
40 | |
---|
41 | |
---|
42 | /*end move*/ |
---|
43 | |
---|
44 | |
---|
45 | typedef struct gbases { |
---|
46 | baseptr base; |
---|
47 | struct gbases *next; |
---|
48 | } gbases; |
---|
49 | |
---|
50 | typedef struct nuview_data { |
---|
51 | /* A big 'ol collection of pointers used in nuview */ |
---|
52 | double *yy, *wwzz, *vvzz, *vzsumr, *vzsumy, *sum, *sumr, *sumy; |
---|
53 | sitelike *xx; |
---|
54 | } nuview_data; |
---|
55 | |
---|
56 | struct LOC_hyptrav { |
---|
57 | boolean bottom; |
---|
58 | node *r; |
---|
59 | long *hypset; |
---|
60 | boolean maybe, nonzero; |
---|
61 | long tempset, anc; |
---|
62 | } ; |
---|
63 | |
---|
64 | |
---|
65 | extern long nonodes, endsite, outgrno, nextree, which; |
---|
66 | |
---|
67 | extern boolean interleaved, printdata, outgropt, treeprint, dotdiff, transvp; |
---|
68 | |
---|
69 | extern steptr weight, category, alias, location, ally; |
---|
70 | |
---|
71 | #ifndef OLDC |
---|
72 | /* function prototypes */ |
---|
73 | void free_all_x_in_array (long, pointarray); |
---|
74 | void free_all_x2_in_array (long, pointarray); |
---|
75 | void alloctemp(node **, long *, long); |
---|
76 | void freetemp(node **); |
---|
77 | void freetree2 (pointarray, long); |
---|
78 | void inputdata(long); |
---|
79 | void alloctree(pointarray *, long, boolean); |
---|
80 | void allocx(long, long, pointarray, boolean); |
---|
81 | |
---|
82 | void prot_allocx(long, long, pointarray, boolean); |
---|
83 | void allocx2(long, long, long, pointarray, boolean); |
---|
84 | void setuptree(pointarray, long, boolean); |
---|
85 | void setuptree2(tree); |
---|
86 | void alloctip(node *, long *); |
---|
87 | void alloctrans(transptr *, long, long); |
---|
88 | void getbasefreqs(double, double, double, double, double *, double *, |
---|
89 | double *, double *, double *, double *, double *, |
---|
90 | double *xi, double *, double *, boolean, boolean); |
---|
91 | void empiricalfreqs(double *,double *,double *,double *,steptr,pointarray); |
---|
92 | void sitesort(long, steptr); |
---|
93 | void sitecombine(long); |
---|
94 | |
---|
95 | void sitescrunch(long); |
---|
96 | void sitesort2(long, steptr); |
---|
97 | void sitecombine2(long, steptr); |
---|
98 | void sitescrunch2(long, long, long, steptr); |
---|
99 | void makevalues(pointarray, long *, boolean); |
---|
100 | void makevalues2(long, pointarray, long, long, sequence, steptr); |
---|
101 | void fillin(node *, node *, node *); |
---|
102 | long getlargest(long *); |
---|
103 | void multifillin(node *, node *, long); |
---|
104 | void sumnsteps(node *, node *, node *, long, long); |
---|
105 | |
---|
106 | void sumnsteps2(node *, node *, node *, long, long, long *); |
---|
107 | void multisumnsteps(node *, node *, long, long, long *); |
---|
108 | void multisumnsteps2(node *); |
---|
109 | boolean alltips(node *, node *); |
---|
110 | void gdispose(node *, node **, pointarray); |
---|
111 | void preorder(node *, node *, node *, node *, node *, node *, long); |
---|
112 | void updatenumdesc(node *, node *, long); |
---|
113 | void add(node *,node *,node *,node **,boolean,pointarray,node **,long *); |
---|
114 | void findbelow(node **below, node *item, node *fork); |
---|
115 | |
---|
116 | void re_move(node *item, node **fork, node **root, boolean recompute, |
---|
117 | pointarray, node **, long *); |
---|
118 | void postorder(node *p); |
---|
119 | void getnufork(node **, node **, pointarray, long *); |
---|
120 | void reroot(node *, node *); |
---|
121 | void reroot2(node *, node *); |
---|
122 | void reroot3(node *, node *, node *, node *, node **); |
---|
123 | void savetraverse(node *); |
---|
124 | void newindex(long, node *); |
---|
125 | void flipindexes(long, pointarray); |
---|
126 | boolean parentinmulti(node *); |
---|
127 | |
---|
128 | long sibsvisited(node *, long *); |
---|
129 | long smallest(node *, long *); |
---|
130 | void bintomulti(node **, node **, node **, long *); |
---|
131 | void backtobinary(node **, node *, node **); |
---|
132 | boolean outgrin(node *, node *); |
---|
133 | void flipnodes(node *, node *); |
---|
134 | void moveleft(node *, node *, node **); |
---|
135 | void savetree(node *, long *, pointarray, node **, long *); |
---|
136 | void addnsave(node *, node *, node *, node **, node **,boolean, |
---|
137 | pointarray, long *, long *); |
---|
138 | void addbestever(long *, long *, long, boolean, long *, bestelm *); |
---|
139 | |
---|
140 | void addtiedtree(long, long *, long, boolean,long *, bestelm *); |
---|
141 | void clearcollapse(pointarray); |
---|
142 | void clearbottom(pointarray); |
---|
143 | void collabranch(node *, node *, node *); |
---|
144 | boolean allcommonbases(node *, node *, boolean *); |
---|
145 | void findbottom(node *, node **); |
---|
146 | boolean moresteps(node *, node *); |
---|
147 | boolean passdown(node *, node *, node *, node *, node *, node *, |
---|
148 | node *, node *, node *, boolean); |
---|
149 | boolean trycollapdesc(node *, node *, node *, node *, node *, |
---|
150 | node *, node *, node *, node *, boolean , long *); |
---|
151 | void setbottom(node *); |
---|
152 | |
---|
153 | boolean zeroinsubtree(node *, node *, node *, node *, node *, |
---|
154 | node *, node *, node *, boolean, node *, long *); |
---|
155 | boolean collapsible(node *, node *, node *, node *, node *, |
---|
156 | node *, node *, node *, boolean, node *, long *, pointarray); |
---|
157 | void replaceback(node **, node *, node *, node **, long *); |
---|
158 | void putback(node *, node *, node *, node **); |
---|
159 | void savelocrearr(node *, node *, node *, node *, node *, node *, |
---|
160 | node *, node *, node *, node **, long, long *, boolean, |
---|
161 | boolean , boolean *, long *, bestelm *, pointarray , |
---|
162 | node **, long *); |
---|
163 | void clearvisited(pointarray); |
---|
164 | void hyprint(long, long, struct LOC_hyptrav *,pointarray, Char *); |
---|
165 | void gnubase(gbases **, gbases **, long); |
---|
166 | void chuckbase(gbases *, gbases **); |
---|
167 | void hyptrav(node *, long *, long, long, boolean,pointarray, |
---|
168 | gbases **, Char *); |
---|
169 | |
---|
170 | void hypstates(long , node *, pointarray, gbases **, Char *); |
---|
171 | void initbranchlen(node *p); |
---|
172 | void initmin(node *, long, boolean); |
---|
173 | void initbase(node *, long); |
---|
174 | void inittreetrav(node *, long); |
---|
175 | void compmin(node *, node *); |
---|
176 | void minpostorder(node *, pointarray); |
---|
177 | void branchlength(node *,node *,double *,pointarray); |
---|
178 | void printbranchlengths(node *); |
---|
179 | void branchlentrav(node *,node *,long,long,double *,pointarray); |
---|
180 | |
---|
181 | void treelength(node *, long, pointarray); |
---|
182 | void coordinates(node *, long *, double, long *); |
---|
183 | void drawline(long, double, node *); |
---|
184 | void printree(node *, double); |
---|
185 | void writesteps(long, boolean, steptr, node *); |
---|
186 | void treeout(node *, long, long *, node *); |
---|
187 | void treeout3(node *, long, long *, node *); |
---|
188 | void drawline2(long, double, tree); |
---|
189 | void drawline3(long, double, node *); |
---|
190 | void copynode(node *, node *, long); |
---|
191 | |
---|
192 | void prot_copynode(node *, node *, long); |
---|
193 | void copy_(tree *, tree *, long, long); |
---|
194 | void prot_copy_(tree *, tree *, long, long); |
---|
195 | void standev(long, long, long, double, double *, long **, longer); |
---|
196 | void standev2(long, long, long, long, double, double *, double **, |
---|
197 | steptr, longer); |
---|
198 | void freetip(node *); |
---|
199 | void freenontip(node *); |
---|
200 | void freenodes(long, pointarray); |
---|
201 | void freenode(node **); |
---|
202 | void freetree(long, pointarray); |
---|
203 | |
---|
204 | void freex(long, pointarray); |
---|
205 | void freex2(long, pointarray); |
---|
206 | void freegarbage(gbases **); |
---|
207 | void freegrbg(node **); |
---|
208 | /*function prototypes*/ |
---|
209 | #endif |
---|
210 | |
---|