-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaxml.h
269 lines (149 loc) · 4.43 KB
/
axml.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
/* RAxML-VI-HPC (version 2.2) a program for sequential and parallel estimation of phylogenetic trees
* Copyright August 2006 by Alexandros Stamatakis
*
* Partially derived from
* fastDNAml, a program for estimation of phylogenetic trees from sequences by Gary J. Olsen
*
* and
*
* Programs of the PHYLIP package by Joe Felsenstein.
*
* This program is free software; you may redistribute it and/or modify its
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
*
* For any other enquiries send an Email to Alexandros Stamatakis
*
* When publishing work that is based on the results from RAxML-VI-HPC please cite:
*
* Alexandros Stamatakis:"RAxML-VI-HPC: maximum likelihood-based phylogenetic analyses
* with thousands of taxa and mixed models".
* Bioinformatics 2006; doi: 10.1093/bioinformatics/btl446
*/
#include <assert.h>
#include <stdint.h>
#define nmlngth 256 /* number of characters in species name */
#define NUM_BRANCHES 10
#define TRUE 1
#define FALSE 0
#define MIN(x,y) (((x)<(y)) ? (x) : (y))
#define programName "Parsimonator"
#define programVersion "1.0.3"
#define programDate "June 2013"
#define M_GTRCAT 1
#define TIP_TIP 0
#define TIP_INNER 1
#define INNER_INNER 2
#define DNA_DATA 1
typedef int boolean;
typedef unsigned int parsimonyNumber;
#define PCF 32
typedef struct ratec
{
double accumulatedSiteLikelihood;
double rate;
}
rateCategorize;
struct noderec;
typedef struct noderec
{
struct noderec *next;
struct noderec *back;
int number;
char x;
}
node, *nodeptr;
typedef struct
{
int numsp;
int sites;
unsigned char **y;
unsigned char *y0;
unsigned char *yBUF;
int *wgt;
} rawdata;
typedef struct {
int *alias; /* site representing a pattern */
int *aliaswgt; /* weight by pattern */
int *rateCategory;
int endsite; /* # of sequence patterns */
double *patrat; /* rates per pattern */
double *patratStored;
} cruncheddata;
typedef struct
{
int left;
int right;
double likelihood;
} lhEntry;
typedef struct
{
int count;
int size;
lhEntry *entries;
} lhList;
typedef struct List_{
void *value;
struct List_ *next;
} List;
struct stringEnt
{
int nodeNumber;
char *word;
struct stringEnt *next;
};
typedef struct stringEnt stringEntry;
typedef unsigned int hashNumberType;
typedef struct
{
hashNumberType tableSize;
stringEntry **table;
}
stringHashtable;
typedef struct {
parsimonyNumber **parsimonyState_A;
parsimonyNumber **parsimonyState_C;
parsimonyNumber **parsimonyState_G;
parsimonyNumber **parsimonyState_T;
unsigned int *parsimonyScore;
int *ti;
unsigned int compressedWidth;
unsigned char **yVector;
stringHashtable *nameHash;
node **nodep;
node *start;
int mxtips;
int ntips;
int nextnode;
rawdata *rdta;
cruncheddata *cdta;
char **nameList;
char *tree_string;
int *nodesInTree;
int treeStringLength;
unsigned int bestParsimony;
nodeptr removeNode;
nodeptr insertNode;
} tree;
/***************************************************************/
/**************************************************************/
typedef struct {
long parsimonySeed;
boolean restart;
int numberOfTrees;
} analdef;
/****************************** FUNCTIONS ****************************************************/
extern void makeParsimonyTreeFastDNA(tree *tr, analdef *adef);
extern void printBothOpen(const char* format, ... );
extern double gettime(void);
extern unsigned int precomputed16_bitcount (unsigned int n);
extern FILE *myfopen(const char *path, const char *mode);
extern void treeReadLen (FILE *fp, tree *tr);