-
Notifications
You must be signed in to change notification settings - Fork 192
/
axml.h
1709 lines (1280 loc) · 49.8 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
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* 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
* Alexandros.Stamatakis@epfl.ch
*
* 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>
#include <stdio.h>
#include <inttypes.h>
#include <sys/types.h>
#ifdef __AVX
#define BYTE_ALIGNMENT 32
#else
#define BYTE_ALIGNMENT 16
#endif
#ifdef _USE_PTHREADS
#include <pthread.h>
#endif
#define NUM_RELL_BOOTSTRAPS 1000
#define NUM_ASC_CORRECTIONS 6
#define MAX_TIP_EV 0.999999999 /* max tip vector value, sum of EVs needs to be smaller than 1.0, otherwise the numerics break down */
#define smoothings 32 /* maximum smoothing passes through tree */
#define iterations 10 /* maximum iterations of iterations per insert */
#define newzpercycle 1 /* iterations of makenewz per tree traversal */
#define nmlngth 256 /* number of characters in species name */
#define deltaz 0.00001 /* test of net branch length change in update */
#define defaultz 0.9 /* value of z assigned as starting point */
#define unlikely -1.0E300 /* low likelihood for initialization */
#define SUMMARIZE_LENGTH -3
#define SUMMARIZE_LH -2
#define NO_BRANCHES -1
#define MASK_LENGTH 32
#define VECTOR_LENGTH (NUM_BRANCHES / MASK_LENGTH)
#define GET_BITVECTOR_LENGTH(x) ((x % MASK_LENGTH) ? (x / MASK_LENGTH + 1) : (x / MASK_LENGTH))
#define zmin 1.0E-15 /* max branch prop. to -log(zmin) (= 34) */
#define zmax (1.0 - 1.0E-6) /* min branch prop. to 1.0-zmax (= 1.0E-6) */
#define twotothe256 \
115792089237316195423570985008687907853269984665640564039457584007913129639936.0
/* 2**256 (exactly) */
#define minlikelihood (1.0/twotothe256)
#define minusminlikelihood -minlikelihood
#define badRear -1
#define NUM_BRANCHES 128
#define TRUE 1
#define FALSE 0
#define LIKELIHOOD_EPSILON 0.0000001
#define THREAD_TO_DEBUG 1
#define AA_SCALE 10.0
#define AA_SCALE_PLUS_EPSILON 10.001
/* ALPHA_MIN is critical -> numerical instability, eg for 4 discrete rate cats */
/* and alpha = 0.01 the lowest rate r_0 is */
/* 0.00000000000000000000000000000000000000000000000000000000000034878079110511010487 */
/* which leads to numerical problems Table for alpha settings below: */
/* */
/* 0.010000 0.00000000000000000000000000000000000000000000000000000000000034878079110511010487 */
/* 0.010000 yielded nasty numerical bugs in at least one case ! */
/* 0.020000 0.00000000000000000000000000000044136090435925743185910935350715027016962154188875 */
/* 0.030000 0.00000000000000000000476844846859006690412039180149775802624789852441798419292220 */
/* 0.040000 0.00000000000000049522423236954066431210260930029681736928018820007024736185030633 */
/* 0.050000 0.00000000000050625351310359203371872643495343928538368616365517027588794007897377 */
/* 0.060000 0.00000000005134625283884191118711474021861409372524676086868566926568746566772461 */
/* 0.070000 0.00000000139080650074206434685544624965062437960128249869740102440118789672851562 */
/* 0.080000 0.00000001650681201563587066858709818343436959153791576682124286890029907226562500 */
/* 0.090000 0.00000011301977332931251259273962858978301859735893231118097901344299316406250000 */
/* 0.100000 0.00000052651925834844387815526344648331402709118265192955732345581054687500000000 */
#define ALPHA_MIN 0.02
#define ALPHA_MAX 1000.0
#define RATE_MIN 0.0001
#define RATE_MAX 1000000.0
#define INVAR_MIN 0.0001
#define INVAR_MAX 0.9999
#define TT_MIN 0.0000001
#define TT_MAX 1000000.0
#define FREQ_MIN 0.001
#define LG4X_RATE_MIN 0.0000001
#define LG4X_RATE_MAX 1000.0
/*
previous values between 0.001 and 0.000001
TO AVOID NUMERICAL PROBLEMS WHEN FREQ == 0 IN PARTITIONED MODELS, ESPECIALLY WITH AA
previous value of FREQ_MIN was: 0.000001, but this seemed to cause problems with some
of the 7-state secondary structure models with some rather exotic small toy test datasets,
on the other hand 0.001 caused problems with some of the 16-state secondary structure models
For some reason the frequency settings seem to be repeatedly causing numerical problems
*/
#define ITMAX 100
#define SHFT(a,b,c,d) (a)=(b);(b)=(c);(c)=(d);
#define SIGN(a,b) ((b) > 0.0 ? fabs(a) : -fabs(a))
#define ABS(x) (((x)<0) ? (-(x)) : (x))
#define MIN(x,y) (((x)<(y)) ? (x) : (y))
#define MAX(x,y) (((x)>(y)) ? (x) : (y))
#define NINT(x) ((int) ((x)>0 ? ((x)+0.5) : ((x)-0.5)))
#define LOG(x) log(x)
#define EXP(x) exp(x)
#define PointGamma(prob,alpha,beta) PointChi2(prob,2.0*(alpha))/(2.0*(beta))
#define programName "RAxML"
#define programVersion "8.2.12"
#define programVersionInt 8212
#define programDate "May 2018"
#define TREE_EVALUATION 0
#define BIG_RAPID_MODE 1
#define CALC_BIPARTITIONS 2
#define SPLIT_MULTI_GENE 3
#define CHECK_ALIGNMENT 4
#define PER_SITE_LL 5
#define PARSIMONY_ADDITION 6
#define CLASSIFY_ML 7
#define DISTANCE_MODE 8
#define GENERATE_BS 9
#define COMPUTE_ELW 10
#define BOOTSTOP_ONLY 11
#define COMPUTE_LHS 12
#define COMPUTE_BIPARTITION_CORRELATION 13
#define COMPUTE_RF_DISTANCE 14
#define MORPH_CALIBRATOR 15
#define CONSENSUS_ONLY 16
#define FAST_SEARCH 17
#define EPA_SITE_SPECIFIC_BIAS 18
#define SH_LIKE_SUPPORTS 19
#define CLASSIFY_MP 20
#define ANCESTRAL_STATES 21
#define QUARTET_CALCULATION 22
#define THOROUGH_OPTIMIZATION 23
#define OPTIMIZE_BR_LEN_SCALER 24
#define ANCESTRAL_SEQUENCE_TEST 25
#define PLAUSIBILITY_CHECKER 26
#define CALC_BIPARTITIONS_IC 27
#define ROOT_TREE 28
#define STEAL_BRANCH_LENGTHS 29
#define SUBTREE_EPA 30
#define AUTO_ML 0
#define AUTO_BIC 1
#define AUTO_AIC 2
#define AUTO_AICC 3
#define M_GTRCAT 1
#define M_GTRGAMMA 2
#define M_BINCAT 3
#define M_BINGAMMA 4
#define M_PROTCAT 5
#define M_PROTGAMMA 6
#define M_32CAT 7
#define M_32GAMMA 8
#define M_64CAT 9
#define M_64GAMMA 10
#define DAYHOFF 0
#define DCMUT 1
#define JTT 2
#define MTREV 3
#define WAG 4
#define RTREV 5
#define CPREV 6
#define VT 7
#define BLOSUM62 8
#define MTMAM 9
#define LG 10
#define MTART 11
#define MTZOA 12
#define PMB 13
#define HIVB 14
#define HIVW 15
#define JTTDCMUT 16
#define FLU 17
#define STMTREV 18
#define DUMMY 19
#define DUMMY2 20
#define AUTO 21
#define LG4 22
#define LG4X 23
#define PROT_FILE 24
#define GTR_UNLINKED 25
#define GTR 26 /* GTR always needs to be the last one */
#define NUM_PROT_MODELS 27
/* bipartition stuff */
#define BIPARTITIONS_ALL 0
#define GET_BIPARTITIONS_BEST 1
#define DRAW_BIPARTITIONS_BEST 2
#define BIPARTITIONS_BOOTSTOP 3
#define BIPARTITIONS_RF 4
#define GATHER_BIPARTITIONS_IC 5
#define FIND_BIPARTITIONS_IC 6
#define BIPARTITIONS_PARTIAL_TC 7
/* bootstopping stuff */
//#define BOOTSTOP_PERMUTATIONS 100
#define START_BSTOP_TEST 10
//#define FC_THRESHOLD 99
#define FC_SPACING 50
#define FC_LOWER 0.99
#define FC_INIT 20
#define FREQUENCY_STOP 0
#define MR_STOP 1
#define MRE_STOP 2
#define MRE_IGN_STOP 3
#define MR_CONSENSUS 0
#define MRE_CONSENSUS 1
#define STRICT_CONSENSUS 2
#define USER_DEFINED 3
/* bootstopping stuff end */
#define TIP_TIP 0
#define TIP_INNER 1
#define INNER_INNER 2
#define MIN_MODEL -1
#define BINARY_DATA 0
#define DNA_DATA 1
#define AA_DATA 2
#define SECONDARY_DATA 3
#define SECONDARY_DATA_6 4
#define SECONDARY_DATA_7 5
#define GENERIC_32 6
#define GENERIC_64 7
#define MAX_MODEL 8
#define SEC_6_A 0
#define SEC_6_B 1
#define SEC_6_C 2
#define SEC_6_D 3
#define SEC_6_E 4
#define SEC_7_A 5
#define SEC_7_B 6
#define SEC_7_C 7
#define SEC_7_D 8
#define SEC_7_E 9
#define SEC_7_F 10
#define SEC_16 11
#define SEC_16_A 12
#define SEC_16_B 13
#define SEC_16_C 14
#define SEC_16_D 15
#define SEC_16_E 16
#define SEC_16_F 17
#define SEC_16_I 18
#define SEC_16_J 19
#define SEC_16_K 20
#define ORDERED_MULTI_STATE 0
#define MK_MULTI_STATE 1
#define GTR_MULTI_STATE 2
#define CAT 0
#define GAMMA 1
#define GAMMA_I 2
typedef int boolean;
typedef struct {
double lh;
int tree;
double weight;
} elw;
struct ent
{
unsigned int *bitVector;
unsigned int *treeVector;
unsigned int amountTips;
int *supportVector;
unsigned int bipNumber;
unsigned int bipNumber2;
unsigned int supportFromTreeset[2];
//added by Kassian for TC/IC correction on partial gene trees
unsigned int *taxonMask;
unsigned int bLink;
double adjustedSupport;
double tempSupport;
int tempSupportFrom;
unsigned int coveredNumber;
boolean covered;
//Kassian modif end
struct ent *next;
};
typedef struct ent entry;
typedef unsigned int hashNumberType;
typedef unsigned int parsimonyNumber;
/*typedef uint_fast32_t parsimonyNumber;*/
#define PCF 32
/*
typedef uint64_t parsimonyNumber;
#define PCF 16
typedef unsigned char parsimonyNumber;
#define PCF 2
*/
typedef struct
{
hashNumberType tableSize;
entry **table;
hashNumberType entryCount;
}
hashtable;
struct stringEnt
{
int nodeNumber;
char *word;
struct stringEnt *next;
};
typedef struct stringEnt stringEntry;
typedef struct
{
hashNumberType tableSize;
stringEntry **table;
}
stringHashtable;
typedef struct ratec
{
double accumulatedSiteLikelihood;
double rate;
}
rateCategorize;
typedef struct
{
int tipCase;
#ifdef _HET
boolean parentIsTip;
#endif
#ifdef _BASTIEN
double secondDerivativeQ[NUM_BRANCHES];
double secondDerivativeR[NUM_BRANCHES];
double secondDerivativeP[NUM_BRANCHES];
#endif
int pNumber;
int qNumber;
int rNumber;
double qz[NUM_BRANCHES];
double rz[NUM_BRANCHES];
} traversalInfo;
typedef struct
{
traversalInfo *ti;
int count;
} traversalData;
struct noderec;
typedef struct epBrData
{
int *countThem;
int *executeThem;
unsigned int *parsimonyScore;
double *branches;
double *distalBranches;
double *likelihoods;
double originalBranchLength;
char branchLabel[64];
int leftNodeNumber;
int rightNodeNumber;
int *leftScaling;
int *rightScaling;
double branchLengths[NUM_BRANCHES];
double *left;
double *right;
int branchNumber;
int jointLabel;
} epaBranchData;
typedef struct
{
epaBranchData *epa;
unsigned int *vector;
int support;
int *supports;
double ic;
double icAll;
struct noderec *oP;
struct noderec *oQ;
} branchInfo;
typedef struct
{
boolean valid;
int partitions;
int *partitionList;
}
linkageData;
typedef struct
{
int entries;
linkageData* ld;
}
linkageList;
typedef struct noderec
{
branchInfo *bInf;
double z[NUM_BRANCHES];
#ifdef _BASTIEN
double secondDerivative[NUM_BRANCHES];
boolean secondDerivativeValid[NUM_BRANCHES];
#endif
struct noderec *next;
struct noderec *back;
hashNumberType hash;
int support;
int number;
char x;
}
node, *nodeptr;
typedef struct
{
double lh;
double pendantBranch;
double distalBranch;
int number;
}
info;
typedef struct bInf {
double likelihood;
nodeptr node;
} bestInfo;
typedef struct iL {
bestInfo *list;
int n;
int valid;
} infoList;
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 states;
int maxTipStates;
size_t lower;
size_t upper;
size_t width;
int dataType;
int protModels;
int autoProtModels;
boolean usePredefinedProtFreqs;
int mxtips;
boolean optimizeBaseFrequencies;
int numberOfCategories;
int **expVector;
double **xVector;
size_t *xSpaceVector;
size_t *expSpaceVector;
unsigned char **yVector;
//asc bias
boolean ascBias;
int ascOffset;
int *ascExpVector;
double *ascSumBuffer;
double *ascVector;
double ascScaler[64];
//asc bias end
char *partitionName;
char proteinSubstitutionFileName[2048];
char ascFileName[2048];
double externalAAMatrix[420];
double *sumBuffer;
double *gammaRates;
double *EIGN;
double *EV;
double *EI;
double *left;
double *right;
double *invariableFrequencies;
double invariableWeight;
#ifdef _HET
/* heterotachy */
double *EIGN_TIP;
double *EV_TIP;
double *EI_TIP;
double *tipVector_TIP;
double *substRates_TIP;
#endif
/* LG4 */
double *EIGN_LG4[4];
double *rawEIGN_LG4[4];
double *EV_LG4[4];
double *EI_LG4[4];
double *frequencies_LG4[4];
double *tipVector_LG4[4];
double *substRates_LG4[4];
/* LG4X */
double weights[4];
double weightExponents[4];
double weightsBuffer[4];
double weightExponentsBuffer[4];
/* LG4 */
double *frequencies;
double *freqExponents;
double *tipVector;
double *substRates;
double *perSiteLL;
double *perSiteRates;
double *unscaled_perSiteRates;
unsigned int *globalScaler;
int *wgt;
int *invariant;
int *rateCategory;
int *symmetryVector;
int *frequencyGrouping;
boolean nonGTR;
double alpha;
double propInvariant;
int gapVectorLength;
unsigned int *gapVector;
double *gapColumn;
size_t initialGapVectorSize;
size_t parsimonyLength;
parsimonyNumber *parsVect;
double brLenScaler;
//andre opt
unsigned int *presenceMap;
} pInfo;
typedef struct
{
int left;
int right;
double likelihood;
} lhEntry;
typedef struct
{
int count;
int size;
lhEntry *entries;
} lhList;
typedef struct idlist
{
int value;
struct idlist *next;
} IdList;
typedef struct List_{
void *value;
struct List_ *next;
} List;
/***************************************************************/
typedef struct
{
double z[NUM_BRANCHES];
nodeptr p, q;
int cp, cq;
}
connectRELL, *connptrRELL;
typedef struct
{
connectRELL *connect;
int start;
double likelihood;
}
topolRELL;
typedef struct
{
int max;
topolRELL **t;
}
topolRELL_LIST;
/* simple tree structure */
typedef struct
{
nodeptr p, q;
//int cp, cq;
}
connectTree, *connptrTree;
typedef struct
{
connectTree *connect;
int start;
double likelihood;
}
topolTree;
typedef struct
{
int max;
topolTree **t;
}
treeList;
/***********************************************************/
#define NOT_DEFINED 0
#define LEWIS_CORRECTION 1
#define FELSENSTEIN_CORRECTION 2
#define STAMATAKIS_CORRECTION 3
#define GOLDMAN_CORRECTION_1 4
#define GOLDMAN_CORRECTION_2 5
#define GOLDMAN_CORRECTION_3 6
/**************************************************************/
typedef struct {
boolean optimizeAllTrees;
boolean saveMemory;
int *resample;
treeList *rellTrees;
int numberOfBranches;
int numberOfTipsForInsertion;
int *readPartition;
boolean perPartitionEPA;
int *inserts;
int branchCounter;
int *ti;
int numberOfTrees;
stringHashtable *nameHash;
pInfo *partitionData;
pInfo *initialPartitionData;
pInfo *extendedPartitionData;
int *dataVector;
int *initialDataVector;
int *extendedDataVector;
int *patternPosition;
int *columnPosition;
char *secondaryStructureInput;
boolean *executeModel;
double *perPartitionLH;
double *storedPerPartitionLH;
traversalData td[1];
unsigned int *parsimonyScore;
int maxCategories;
double *sumBuffer;
double *perSiteLL;
double coreLZ[NUM_BRANCHES];
int modelNumber;
int multiBranch;
int numBranches;
int maxNodes;
int bootStopCriterion;
int consensusType;
int consensusUserThreshold;
double wcThreshold;
double *storedBrLens;
boolean useBrLenScaler;
boolean useFastScaling;
branchInfo *bInf;
int multiStateModel;
size_t innerNodes;
boolean curvatOK[NUM_BRANCHES];
/* the stuff below is shared among DNA and AA, span does
not change depending on datatype */
double *invariants;
/* model stuff end */
unsigned char **yVector;
int secondaryStructureModel;
int discreteRateCategories;
int originalCrunchedLength;
int fullSites;
int *originalModel;
int *originalDataVector;
int *originalWeights;
int *secondaryStructurePairs;
double *partitionContributions;
int ascertainmentCorrectionType;
int autoProteinSelectionType;
unsigned int numberOfEPAEntries;
double accumulatedEPACutoff;
boolean useAccumulatedEPACutoff;
double probThresholdEPA;
#ifdef _BASTIEN
double secondDerivative[NUM_BRANCHES];
boolean doBastienStuff;
#endif
double lhCutoff;
double lhAVG;
uint64_t lhDEC;
uint64_t itCount;
int numberOfInvariableColumns;
int weightOfInvariableColumns;
int rateHetModel;
double startLH;
double endLH;
double likelihood;
double *likelihoods;
int *invariant;
node **nodep;
node *start;
int mxtips;
int mxtipsVector[NUM_BRANCHES];
int *model;
int *constraintVector;
int numberOfSecondaryColumns;
boolean searchConvergenceCriterion;
int branchLabelCounter;
int ntips;
int binaryFile_ntips;
int nextnode;
int NumberOfModels;
int parsimonyLength;
int checkPointCounter;
int treeID;
int numberOfOutgroups;
int *outgroupNums;
char **outgroups;
boolean useEpaHeuristics;
double fastEPAthreshold;
boolean bigCutoff;
boolean partitionSmoothed[NUM_BRANCHES];
boolean partitionConverged[NUM_BRANCHES];
boolean rooted;
boolean grouped;
boolean constrained;
boolean doCutoff;
boolean catOnly;
rawdata *rdta;
cruncheddata *cdta;
char **nameList;
char *tree_string;
size_t treeStringLength;
unsigned int bestParsimony;
double bestOfNode;
nodeptr removeNode;
nodeptr insertNode;
double zqr[NUM_BRANCHES];
double currentZQR[NUM_BRANCHES];
double currentLZR[NUM_BRANCHES];
double currentLZQ[NUM_BRANCHES];
double currentLZS[NUM_BRANCHES];
double currentLZI[NUM_BRANCHES];
double lzs[NUM_BRANCHES];
double lzq[NUM_BRANCHES];
double lzr[NUM_BRANCHES];
double lzi[NUM_BRANCHES];
int mr_thresh;
boolean wasRooted;
nodeptr leftRootNode;
nodeptr rightRootNode;
int rootLabel;
boolean useGammaMedian;
boolean noRateHet;
boolean corrected_IC_Score;
boolean useK80;
boolean useHKY85;
boolean useJC69;
#ifdef _USE_PTHREADS