-
Notifications
You must be signed in to change notification settings - Fork 5
/
command.c
15123 lines (14318 loc) · 822 KB
/
command.c
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
/*
* MrBayes 3
*
* (c) 2002-2013
*
* John P. Huelsenbeck
* Dept. Integrative Biology
* University of California, Berkeley
* Berkeley, CA 94720-3140
*
* Fredrik Ronquist
* Swedish Museum of Natural History
* Box 50007
* SE-10405 Stockholm, SWEDEN
*
* With important contributions by
*
* Paul van der Mark ([email protected])
* Maxim Teslenko ([email protected])
*
* and by many users (run 'acknowledgments' to see more info)
*
* This program is free software; you can redistribute it and/or
* modify it 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 (www.gnu.org).
*
*/
#include "bayes.h"
#include "command.h"
#include "mbbeagle.h"
#include "model.h"
#include "mcmc.h"
#include "sumpt.h"
#include "utils.h"
#if defined(__MWERKS__)
#include "SIOUX.h"
#endif
const char* const svnRevisionCommandC = "$Rev: 1072 $"; /* Revision keyword which is expended/updated by svn on each commit/update */
#define NUMCOMMANDS 62 /* The total number of commands in the program */
#define NUMPARAMS 276 /* The total number of parameters */
#define PARAM(i, s, f, l) p->string = s; \
p->fp = f; \
p->valueList = l; \
p++;
#define HIDE 0
#define SHOW 1
/* Debugging options */
#undef SHOW_TOKENS
#undef ECHO_PROCESSED_COMMANDS
/* Local function prototypes */
int AddNameSet(NameSet **nameSetList, int numNameSets, char **nameSet, int numNames);
int AddToSet (int i, int j, int k, int id);
int AllocCharacters (void);
int AllocMatrix (void);
int AllocTaxa (void);
char ChangeCase (char c);
int CharacterCode (char ch, int *charCode, int chType);
int CharacterNumber (int charCode, int chType);
int CheckInitialPartitions (void);
int Dex (TreeNode *p);
int DoAbout (void);
int DoAcknowledgments (void);
int DoBeginParm (char *parmName, char *tkn);
int DoBreaks (void);
int DoBreaksParm (char *parmName, char *tkn);
int DoCalibrate (void);
int DoCalibrateParm (char *parmName, char *tkn);
int DoCharset (void);
int DoCharsetParm (char *parmName, char *tkn);
int DoCharStat (void);
int DoCitations (void);
int DoConstraint (void);
int DoConstraintParm (char *parmName, char *tkn);
int DoCtype (void);
int DoCtypeParm (char *parmName, char *tkn);
int DoDelete (void);
int DoDeleteParm (char *parmName, char *tkn);
int DoDimensions (void);
int DoDimensionsParm (char *parmName, char *tkn);
int DoDisclaimer (void);
int DoEndBlock (void);
int DoExecuteParm (char *parmName, char *tkn);
int DoExclude (void);
int DoExcludeParm (char *parmName, char *tkn);
int DoFormat (void);
int DoFormatParm (char *parmName, char *tkn);
int DoHelp (void);
int DoHelpParm (char *parmName, char *tkn);
int DoInclude (void);
int DoIncludeParm (char *parmName, char *tkn);
int DoLog (void);
int DoLogParm (char *parmName, char *tkn);
int DoManual (void);
int DoManualParm (char *parmName, char *tkn);
int DoMatrix (void);
int DoMatrixParm (char *parmName, char *tkn);
int DoNexusParm (char *parmName, char *tkn);
int DoOutgroup (void);
int DoOutgroupParm (char *parmName, char *tkn);
int DoPairs (void);
int DoPairsParm (char *parmName, char *tkn);
int DoPartition (void);
int DoPartitionParm (char *parmName, char *tkn);
int DoRestore (void);
int DoRestoreParm (char *parmName, char *tkn);
int DoSet (void);
int DoSetParm (char *parmName, char *tkn);
int DoShowBeagle (void);
int DoShowMatrix (void);
int DoShowUserTrees (void);
int DoSpeciespartition (void);
int DoSpeciespartitionParm (char *parmName, char *tkn);
int DoTaxaset (void);
int DoTaxasetParm (char *parmName, char *tkn);
int DoTaxaStat (void);
int DoTaxlabels (void);
int DoTaxlabelsParm (char *parmName, char *tkn);
int DoTranslate (void);
int DoTranslateParm (char *parmName, char *tkn);
int DoTree (void);
int DoTreeParm (char *parmName, char *tkn);
int DoUserTree (void);
int DoUserTreeParm (char *parmName, char *tkn);
int DoVersion (void);
int FindValidParam (char *tk, int *numMatches);
int FreeCharacters (void);
int FreeMatrix (void);
int FreeTaxa (void);
int GetNumPartDivisions (int n);
int GetUserHelp (char *helpTkn);
int IsAmbig (int charCode, int dType);
int IsMissing (int charCode, int dType);
int MBResID (char nuc);
int NucID (char nuc);
void PrintSettings (char *command);
void PrintYesNo (int yn, char s[4]);
int ProtID (char aa);
int SetPartition (int part);
int SetSpeciespartition (int part);
int SetTaxaFromTranslateTable (void);
int StandID (char nuc);
void WhatVariableExp (BitsLong exp, char *st);
MrBFlt WhichCont (int x);
/* globals */
int autoClose; /* autoclose */
int autoOverwrite; /* Overwrite or append outputfiles when nowarnings=yes */
Calibration *calibrationPtr; /* ptr to calibration being set */
CharInformation *charInfo; /* holds critical information about characters */
BitsLong **charSet; /* holds information about defined charsets */
char **charSetNames; /* holds names of character sets */
Comptree comptreeParams; /* holds parameters for comparetree command */
char **constraintNames; /* holds names of constraints */
int dataType; /* type of data */
Calibration defaultCalibration; /* default calibration */
BitsLong **definedConstraint; /* bitfields representing taxa sets of defined constraints */
BitsLong **definedConstraintTwo; /* bitfields representing second taxa sets of defined constraints (used for PARTIAL constraints) */
BitsLong **definedConstraintPruned; /* bitfields representing taxa sets of defined constraints after delited taxa are removed */
BitsLong **definedConstraintTwoPruned; /* bitfields representing second taxa sets of defined constraints for PARTIAL constraints after delited*/
/* taxa are removed and for NEGATIVE constraint it contains complements of definedConstraintPruned */
int echoMB; /* flag used by Manual to prevent echoing */
BitsLong expecting; /* variable denoting expected token type */
int foundNewLine; /* whether a new line has been found */
int inComment; /* flag for whether input stream is commented */
int inComparetreeCommand; /* flag set whenever you enter comparetree cmd */
int inferAncStates; /* should ancestral states be inferred (y/n) */
int inferSiteOmegas; /* should site omegas be inferred (y/n) */
int inferSiteRates; /* should site rates be inferred (y/n) */
int inMrbayesBlock; /* flag for whether we are in a mrbayes block */
int inSumtCommand; /* flag set whenever you enter sumt cmd */
int inTreesBlock; /* flag for whether we are in a trees block */
int inValidCommand; /* a useful flag set whenever you enter a cmd */
int isInAmbig, isInPoly; /* flags whether we are within () or {} */
int isTaxsetDef; /* is a taxon set defined */
int isTranslateDef; /* is a translation block defined */
int isTranslateDiff; /* is translate different from current taxaset? */
char logFileName[100]; /* name of the log file */
int logToFile; /* should screen output be logged to a file */
FILE *logFileFp; /* file pointer to log file */
int longIntegerSize; /* size of an unsigned integer */
char manFileName[100]; /* name of the file for the command help info */
int *matrix; /* matrix containing original data */
int matrixHasPoly; /* flag for whether matrix has polymorphisms */
int memAllocs[NUM_ALLOCS]; /* allocated memory flags */
int mode; /* mode of program (interactive/noninteractive) */
Calibration *nodeCalibration; /* holds information about node calibrations */
int noWarn; /* no warnings on overwriting files */
int numChar; /* number of characters in character matrix */
int numCharSets; /* number of character sets */
int numComments; /* counts how deeply nested a comment is */
int numDefinedConstraints; /* number of constraints defined */
int numDefinedPartitions; /* number of partitions defined */
int numDefinedSpeciespartitions; /* number of speciespartitions defined */
int numNamedTaxa; /* number of named taxa during parsing of cmd */
int numOpenExeFiles; /* number of execute files open */
int numSpecies; /* number of species in current speciespartition */
int numTaxa; /* number of taxa in character matrix */
int numTaxaSets; /* number of taxa sets */
int numTranslates; /* number of taxa in active translate block */
int outGroupNum; /* number of outgroup taxon */
ParmInfo paramTable[NUMPARAMS]; /* information on parameters */
char **partitionNames; /* hold names of partitions (first is "default") */
int **partitionId; /* holds information about defined partitions */
int partitionNum; /* index of current partition */
Plot plotParams; /* holds parameters for plot command */
int precision; /* precision of samples and summary stats */
int quitOnError; /* quit on error? */
int replaceLogFile; /* should logfile be replace/appended to */
int scientific; /* use scientific format for samples ? */
char spacer[10]; /* holds blanks for printing indentations */
NameSet *speciesNameSets; /* hold species name sets, one for each speciespartition */
int **speciespartitionId; /* holds info about defined speciespartitions */
char **speciespartitionNames; /* hold names of speciespartitions (first is "default") */
int speciespartitionNum; /* index of current speciespartition */
Sump sumpParams; /* holds parameters for sump command */
Sumt sumtParams; /* holds parameters for sumt command */
Sumss sumssParams; /* holds parameters for sumss command */
TaxaInformation *taxaInfo; /* holds critical information about taxa */
char **taxaNames; /* holds name of taxa */
BitsLong **taxaSet; /* holds information about defined taxasets */
char **taxaSetNames; /* holds names of taxa sets */
int *tempActiveConstraints;/* temporarily holds active constraints size allcated */
enum ConstraintType *definedConstraintsType; /* Store type of constraint */
int *tempSet; /* temporarily holds defined set */
int *tempSetNeg; /* holds bitset of negative set of taxa for partial constraint*/
int theAmbigChar; /* int containing ambiguous character */
Calibration *tipCalibration; /* holds information about node calibrations */
char **transFrom; /* translation block information */
char **transTo; /* translation block information */
int userBrlensDef; /* are the branch lengths on user tree defined */
#if defined (BEAGLE_ENABLED)
int tryToUseBEAGLE; /* try to use the BEAGLE library */
int beagleScalingScheme; /* BEAGLE dynamic scaling */
int beagleScalingFrequency;/* BEAGLE dynamic scaling frequency */
long beagleFlags; /* BEAGLE required resource flags */
int beagleResourceNumber; /* BEAGLE resource number */
int *beagleResource; /* BEAGLE resource choice list */
int beagleResourceCount; /* BEAGLE resource choice list length */
int beagleInstanceCount; /* total number of BEAGLE instances */
#endif
#if defined (THREADS_ENABLED)
int tryToUseThreads; /* try to use pthreads with BEAGLE library */
#endif
/* local (to this file) */
char *tokenP, token[CMD_STRING_LENGTH], *cmdStr=NULL;
Calibration defaultCalibration = {
"Unconstrained", /* name */
unconstrained, /* prior */
{ -1.0, -1.0, -1.0 }, /* priorParams */
NULL, /* LnPriorProb */
NULL, /* LnPriorRatio */
-1.0, /* min */
-1.0 /* max */
};
CmdType commands[] =
{
/* Information on commands initialization:
1 = Command number (cmdNumber)
2 = Command name (string)
3 = Special command (YES/NO) (specialCmd)
4 = Pointer to finishing function (fp)
5 = Number of valid parameters (numParms)
6 = List of valid parameters (parmList)
7 = Expecting (2^TokenType) (expect) (PARAMETER = 4; SEMICOLON = 32; ALPHA = 16384;
ALPHA | QUESTIONMARK | DASH | NUMBER | ASTERISK | EXCLAMATIONMARK | PERCENT | WEIRD | SEMICOLON = 11715360;
ALPHA | QUESTIONMARK | DASH | NUMBER | ASTERISK | EXCLAMATIONMARK | PERCENT | WEIRD | VERTICALBAR | SEMICOLON | LEFTPAR | RIGHTPAR | LEFTCURL | RIGHTCURL = 649252640;
PARAMETER | SEMICOLON = 36; NUMBER | ALPHA = 49152; ALPHA | SEMICOLON = 16416; EQUALSIGN = 8; NUMBER = 32768)
8 = Description of the command (cmdDescription)
9 = Where should the command be used (cmdUse) (IN_CMD = used from command line or mrbayes block; IN_FILE = used in data block or in tree block)
10 = Should the command be shown when "help" is typed (hiding).
#1 #2 #3 #4 #5 #6 #7 #8 #9 #10
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
{ 0, "#", NO, NULL, 1, {0}, 4, "", IN_FILE, HIDE },
{ 1, "About", NO, DoAbout, 0, {-1}, 32, "Describes the program", IN_CMD, SHOW },
{ 2, "Acknowledgments", NO, DoAcknowledgments, 0, {-1}, 32, "Shows program acknowledgments", IN_CMD, SHOW },
{ 3, "Begin", NO, NULL, 6, {1,2,3,201,226,227}, 4, "Denotes beginning of block in file", IN_FILE, SHOW },
{ 4, "Calibrate", NO, DoCalibrate, 1, {119}, 4, "Assigns dates to terminals or interior nodes", IN_CMD, SHOW },
{ 5, "Charset", NO, DoCharset, 1, {15}, 4, "Assigns a group of sites to a set", IN_CMD, SHOW },
{ 6, "Charstat", NO, DoCharStat, 0, {-1}, 32, "Shows status of characters", IN_CMD, SHOW },
{ 7, "Citations", NO, DoCitations, 0, {-1}, 32, "Citation of program, models, and methods", IN_CMD, SHOW },
{ 8, "Comparetree", NO, DoCompareTree, 7, {127,128,129,130,221,222,223}, 36, "Compares the trees from two tree files", IN_CMD, SHOW },
{ 9, "Constraint", NO, DoConstraint, 1, {66}, 4, "Defines a constraint on tree topology", IN_CMD, SHOW },
{ 10, "Ctype", NO, DoCtype, 1, {65}, 4, "Assigns ordering for the characters", IN_CMD, SHOW },
{ 11, "Databreaks", YES, DoBreaks, 1, {93}, 32768, "Defines data breaks for autodiscrete gamma model", IN_CMD, SHOW },
{ 12, "Delete", YES, DoDelete, 1, {47}, 49152, "Deletes taxa from the analysis", IN_CMD, SHOW },
{ 13, "Dimensions", NO, DoDimensions, 2, {4,5}, 4, "Defines size of character matrix", IN_FILE, SHOW },
{ 14, "Disclaimer", NO, DoDisclaimer, 0, {-1}, 32, "Describes program disclaimer", IN_CMD, SHOW },
{ 15, "End", NO, DoEndBlock, 0, {-1}, 32, "Denotes end of a block in file", IN_FILE, SHOW },
{ 16, "Endblock", NO, DoEndBlock, 0, {-1}, 32, "Alternative way of denoting end of a block", IN_FILE, SHOW },
{ 17, "Exclude", YES, DoExclude, 1, {45}, 49152, "Excludes sites from the analysis", IN_CMD, SHOW },
{ 18, "Execute", YES, DoExecute, 1, {12}, 16384, "Executes a file", IN_CMD, SHOW },
{ 19, "Format", NO, DoFormat, 7, {6,7,8,9,10,219,220}, 4, "Defines character format in data block", IN_FILE, SHOW },
{ 20, "Help", YES, DoHelp, 1, {50}, 16416, "Provides detailed description of commands", IN_CMD, SHOW },
{ 21, "Include", YES, DoInclude, 1, {46}, 49152, "Includes sites", IN_CMD, SHOW },
{ 22, "Link", NO, DoLink, 30, {55,56,57,58,59,60,61,62,63,72,73,74,75,76,105,118,193,194,195,196,197,242,243,252,253,255,256,
270,273,274}, 4, "Links parameters across character partitions", IN_CMD, SHOW },
{ 23, "Log", NO, DoLog, 5, {85,86,87,88,89}, 4, "Logs screen output to a file", IN_CMD, SHOW },
{ 24, "Lset", NO, DoLset, 16, {28,29,30,31,32,33,34,40,51,52,53,90,91,131,188,189}, 4, "Sets the parameters of the likelihood model", IN_CMD, SHOW },
{ 25, "Manual", NO, DoManual, 1, {126}, 36, "Prints a command reference to a text file", IN_CMD, SHOW },
{ 26, "Matrix", YES, DoMatrix, 1, {11},649252640, "Defines matrix of characters in data block", IN_FILE, SHOW },
{ 27, "Mcmc", NO, DoMcmc, 46, {17,18,19,20,21,22,23,24,25,26,27,84,98,112,113,114,115,116,132,142,143,144,148,149,150,151,152,
153,154,155,156,157,158,159,160,166,169,190,191,198,199,200,202,213,214,215}, 36, "Starts Markov chain Monte Carlo analysis", IN_CMD, SHOW },
{ 28, "Mcmcp", NO, DoMcmcp, 46, {17,18,19,20,21,22,23,24,25,26,27,84,98,112,113,114,115,116,132,142,143,144,148,149,150,151,152,
153,154,155,156,157,158,159,160,166,169,190,191,198,199,200,202,213,214,215}, 4, "Sets parameters of a chain (without starting analysis)", IN_CMD, SHOW },
{ 29, "Outgroup", YES, DoOutgroup, 1, {78}, 49152, "Changes outgroup taxon", IN_CMD, SHOW },
{ 30, "Pairs", YES, DoPairs, 1, {92}, 32768, "Defines nucleotide pairs (doublets) for stem models", IN_CMD, SHOW },
{ 31, "Partition", NO, DoPartition, 1, {16}, 4, "Assigns a character partition", IN_CMD, SHOW },
{ 32, "Plot", NO, DoPlot, 6, {106,107,108,109,224,225}, 36, "Plots parameters from MCMC analysis", IN_CMD, SHOW },
{ 33, "Prset", NO, DoPrset, 43, {35,36,37,38,39,41,42,43,44,54,64,67,68,69,70,71,77,100,101,102,103,104,110,111,117,120,121,133,
168,172,173,174,183,184,185,218,241,246,247,251,254,269,271,272}, 4, "Sets the priors for the parameters", IN_CMD, SHOW },
{ 34, "Propset", NO, DoPropset, 1, {186}, 4, "Sets proposal probabilities and tuning parameters", IN_CMD, SHOW },
{ 35, "Quit", NO, DoQuit, 0, {-1}, 32, "Quits the program", IN_CMD, SHOW },
{ 36, "Report", NO, DoReport, 9, {122,123,124,125,134,135,136,192,217}, 4, "Controls how model parameters are reported", IN_CMD, SHOW },
{ 37, "Restore", YES, DoRestore, 1, {48}, 49152, "Restores taxa", IN_CMD, SHOW },
{ 38, "Set", NO, DoSet, 22, {13,14,94,145,170,171,179,181,182,216,229,233,234,235,236,237,238,239,240,245,268,275}, 4, "Sets run conditions and defines active data partition", IN_CMD, SHOW },
{ 39, "Showbeagle", NO, DoShowBeagle, 0, {-1}, 32, "Show available BEAGLE resources", IN_CMD, SHOW },
{ 40, "Showmatrix", NO, DoShowMatrix, 0, {-1}, 32, "Shows current character matrix", IN_CMD, SHOW },
{ 41, "Showmcmctrees", NO, DoShowMcmcTrees, 0, {-1}, 32, "Shows trees used in mcmc analysis", IN_CMD, SHOW },
{ 42, "Showmodel", NO, DoShowModel, 0, {-1}, 32, "Shows model settings", IN_CMD, SHOW },
{ 43, "Showmoves", NO, DoShowMoves, 1, {180}, 36, "Shows moves for current model", IN_CMD, SHOW },
{ 44, "Showparams", NO, DoShowParams, 0, {-1}, 32, "Shows parameters in current model", IN_CMD, SHOW },
{ 45, "Showusertrees", NO, DoShowUserTrees, 0, {-1}, 32, "Shows user-defined trees", IN_CMD, SHOW },
{ 46,"Speciespartition", NO,DoSpeciespartition, 1, {244}, 4, "Defines a partition of tips into species", IN_CMD, SHOW },
{ 47, "Ss", NO, DoSs, 50, {17,18,19,20,21,22,23,24,25,26,27,84,98,112,113,114,115,116,132,142,143,144,148,149,150,151,152,
153,154,155,156,157,158,159,160,166,169,190,191,198,199,200,202,213,214,215,248,249,250,257}, 36, "Starts stepping-stone sampling", IN_CMD, SHOW },
{ 48, "Ssp", NO, DoSsp, 50, {17,18,19,20,21,22,23,24,25,26,27,84,98,112,113,114,115,116,132,142,143,144,148,149,150,151,152,
153,154,155,156,157,158,159,160,166,169,190,191,198,199,200,202,213,214,215,248,249,250,257}, 36,"Sets parameters of stepping-stone analysis (without starting)",IN_CMD, SHOW },
{ 49, "Startvals", NO, DoStartvals, 1, {187}, 4, "Sets starting values of parameters", IN_CMD, SHOW },
{ 50, "Sump", NO, DoSump, 13, {96,97,137,138,139,140,141,161,162,178,211,212,231}, 36, "Summarizes parameters from MCMC analysis", IN_CMD, SHOW },
{ 51, "Sumss", NO, DoSumSs, 10, {258,259,260,261,262,263,264,265,266,267}, 36, "Summarizes parameters from stepping-stone analysis", IN_CMD, SHOW },
{ 52, "Sumt", NO, DoSumt, 21, {80,81,82,95,146,147,163,164,165,167,175,177,204,205,206,207,208,209,210,230,232}, 36, "Summarizes trees from MCMC analysis", IN_CMD, SHOW },
{ 53, "Taxastat", NO, DoTaxaStat, 0, {-1}, 32, "Shows status of taxa", IN_CMD, SHOW },
{ 54, "Taxset", NO, DoTaxaset, 1, {49}, 4, "Assigns a group of taxa to a set", IN_CMD, SHOW },
{ 55, "Taxlabels", YES, DoTaxlabels, 1, {228}, 49152, "Defines taxon labels", IN_FILE, SHOW },
{ 56, "Translate", YES, DoTranslate, 1, {83}, 49152, "Defines alternative names for taxa", IN_FILE, SHOW },
{ 57, "Tree", NO, DoTree, 1, {79}, 4, "Defines a tree", IN_FILE, SHOW },
{ 58, "Unlink", NO, DoUnlink, 30, {55,56,57,58,59,60,61,62,63,72,73,74,75,76,105,118,193,194,195,196,197,242,243,252,253,255,256,
270,273,274}, 4, "Unlinks parameters across character partitions", IN_CMD, SHOW },
{ 59, "Usertree", YES, DoUserTree, 1, {203}, 8, "Defines a single user tree", IN_CMD, HIDE },
{ 60, "Version", NO, DoVersion, 0, {-1}, 32, "Shows program version", IN_CMD, SHOW },
{ 61, "Compareref", NO, DoCompRefTree, 7, {127,128,129,130,221,222,223}, 36, "Compares the tree to the reference trees", IN_CMD, HIDE },
/* NOTE: If you add a command here, make certain to change NUMCOMMANDS (above, in this file) appropriately! */
{ 999, NULL, NO, NULL, 0, {-1}, 32, "", IN_CMD, HIDE }
};
int inDataBlock, inForeignBlock, isInterleaved, isFirstMatrixRead, isFirstInterleavedBlock,
taxonCount, fromI, toJ, everyK, foundDash, foundSlash, foundFirst, isMixed, whichPartition,
isNegative, numDivisions, charOrdering, foundExp, foundColon, isFirstNode, nextAvailableNode,
pairId, firstPair, inTaxaBlock, inCharactersBlock, foundEqual;
char gapId, missingId, matchId, tempSetName[100], **tempNames;
CmdType *commandPtr; /* Points to the commands array entry which corresponds to currently processed command */
ParmInfoPtr paramPtr; /* Points to paramTable table array entry which corresponds to currently processed parameter of current command */
TreeNode *pPtr, *qPtr;
enum ConstraintType consrtainType; /* Used only in processing of constraine command to indicate what is the type of constrain */
int AddToGivenSet (int i, int j, int k, int id, int *Set)
{
int m, n;
if (id <= 0)
{
MrBayesPrint ("%s The id for a temporary set should be greater than 0\n", spacer);
return (ERROR);
}
if (i < 0 && j < 0)
return (ERROR);
else if (i < 0 && j >= 0)
return (ERROR);
else if (i >= 0 && j < 0)
{
if (k >= 0)
return (ERROR);
else
{
if (Set[i] != 0)
{
MrBayesPrint ("%s Character %d defined more than once\n", spacer, i+1);
return (ERROR);
}
Set[i] = id;
}
}
else if (i >= 0 && j >= 0)
{
if (k < 0)
{
for (m=i; m<=j; m++)
{
if (Set[m] != 0)
{
MrBayesPrint ("%s Character %d defined more than once\n", spacer, m+1);
return (ERROR);
}
Set[m] = id;
}
}
else
{
n = k;
for (m=i; m<=j; m++)
{
if (n % k == 0)
{
if (Set[m] != 0)
{
MrBayesPrint ("%s Character %d defined more than once\n", spacer, m+1);
return (ERROR);
}
Set[m] = id;
}
n++;
}
}
}
return (NO_ERROR);
}
int AddToSet (int i, int j, int k, int id)
{
return AddToGivenSet (i, j, k,id, tempSet);
}
/* AddNameSet: Push a name set onto the end of a list of name sets, with reallocation
of list to hold the extra element. The calling function needs to keep track of
the counter holding the length of the list. */
int AddNameSet (NameSet **nameSetList, int numNameSets, char **nameSet, int numNames)
{
int i;
(*nameSetList) = (NameSet*) SafeRealloc ((void*)(*nameSetList), ((size_t)numNameSets+1)*sizeof(NameSet));
(*nameSetList)[numNameSets].names = NULL;
(*nameSetList)[numNameSets].numNames = numNames;
for (i=0; i<numNames; i++)
AddString(&((*nameSetList)[numNameSets].names), i, nameSet[i]);
return NO_ERROR;
}
/* AddString: Push a string onto the end of a list, with reallocation of list
to hold the extra element. The calling function needs to keep track of
the counter holding the length of the list. */
int AddString (char ***list, int len, char *token)
{
(*list) = (char **) SafeRealloc ((void *)(*list), ((size_t)len+1)*sizeof(char*));
if (!(*list))
return ERROR;
(*list)[len] = (char *) SafeCalloc ((strlen(token)+1), sizeof(char));
if (!(*list)[len])
return ERROR;
strcpy ((*list)[len], token);
return NO_ERROR;
}
int AllocCharacters (void)
{
int i, tempSetSize;
if (memAllocs[ALLOC_MATRIX] == YES)
goto errorExit;
matrix = (int *) SafeMalloc((size_t)numTaxa * (size_t)numChar * sizeof(int));
if (!matrix)
{
MrBayesPrint ("%s Problem allocating matrix (%d)\n", spacer, numTaxa * numChar * sizeof(int));
goto errorExit;
}
for (i=0; i<numTaxa * numChar; i++)
matrix[i] = 0;
memAllocs[ALLOC_MATRIX] = YES;
if (memAllocs[ALLOC_CHARINFO] == YES)
goto errorExit;
charInfo = (CharInformation *) SafeMalloc ((size_t)numChar * sizeof(CharInformation));
if (!charInfo)
{
MrBayesPrint ("%s Problem allocating charInfo (%d)\n", spacer, numChar * sizeof(CharInformation));
goto errorExit;
}
for (i=0; i<numChar; i++)
{
charInfo[i].isExcluded = NO;
charInfo[i].numStates = 0;
charInfo[i].charType = 0;
charInfo[i].isMissAmbig = NO;
charInfo[i].ctype = UNORD;
charInfo[i].charId = 0;
charInfo[i].pairsId = 0;
charInfo[i].bigBreakAfter = NO;
}
memAllocs[ALLOC_CHARINFO] = YES;
if (memAllocs[ALLOC_CHARSETS] == YES)
goto errorExit;
charSetNames = NULL;
charSet = NULL;
numCharSets = 0;
memAllocs[ALLOC_CHARSETS] = YES; /* safe to do free */
if (memAllocs[ALLOC_PARTITIONS] == YES)
goto errorExit;
partitionNames = NULL;
partitionId = (int**) SafeMalloc ((size_t)numChar * sizeof(int*));
for (i=0; i<numChar; i++)
partitionId[i] = (int *) SafeMalloc (sizeof(int));
numDefinedPartitions = 0; /* number of defined partitions */
memAllocs[ALLOC_PARTITIONS] = YES; /* safe to do free */
if (memAllocs[ALLOC_PARTITIONVARS] == YES)
goto errorExit;
numVars = NULL;
tempLinkUnlinkVec = NULL;
activeParts = NULL;
tempLinkUnlinkVec = NULL;
tempNum = NULL;
linkTable[0] = NULL;
tempLinkUnlink[0] = NULL;
for (i=0; i<NUM_LINKED; i++)
{
linkTable[i] = NULL;
tempLinkUnlink[i] = NULL;
activeParams[i] = NULL;
}
memAllocs[ALLOC_PARTITIONVARS] = YES;
if (memAllocs[ALLOC_TMPSET] == NO)
goto errorExit;
if (numChar > numTaxa)
tempSetSize = numChar;
else
tempSetSize = numTaxa;
tempSet = (int *) SafeRealloc ((void *)tempSet, (size_t)tempSetSize * sizeof(int));
tempSetNeg = (int *) SafeRealloc ((void *)tempSetNeg, (size_t)tempSetSize * sizeof(int));
if (!tempSet || !tempSetNeg)
{
MrBayesPrint ("%s Problem reallocating tempSet (%d)\n", spacer, tempSetSize * sizeof(int));
goto errorExit;
}
MrBayesPrint ("%s Allocated matrix\n", spacer);
return (NO_ERROR);
errorExit:
MrBayesPrint ("%s Problem allocating matrix\n", spacer);
FreeMatrix();
return (ERROR);
}
int AllocMatrix (void)
{
if (memAllocs[ALLOC_TAXA] == NO && AllocTaxa() == ERROR)
return ERROR;
else
return (AllocCharacters());
}
int AllocTaxa (void)
{
int i;
if (defTaxa==NO)
{
MrBayesPrint ("%s Number of taxa not defined\n", spacer);
return (ERROR);
}
if (numTaxa == 0)
{
MrBayesPrint ("%s Number of taxa is 0\n", spacer);
return (ERROR);
}
/* allocate space for taxa */
if (memAllocs[ALLOC_TAXA] == YES)
goto errorExit;
taxaNames = NULL; /* This variable is allocated in AddString */
taxaInfo = (TaxaInformation *) SafeMalloc ((size_t)numTaxa * sizeof(TaxaInformation));
if (!taxaInfo)
{
goto errorExit;
}
tipCalibration = (Calibration *) SafeMalloc ((size_t)numTaxa * sizeof(Calibration));
if (!tipCalibration)
{
free (taxaInfo);
taxaInfo = NULL;
goto errorExit;
}
for (i=0; i<numTaxa; i++)
{
taxaInfo[i].isDeleted = NO;
taxaInfo[i].charCount = 0;
}
memAllocs[ALLOC_TAXA] = YES;
/* taxa sets */
if (memAllocs[ALLOC_TAXASETS] == YES)
goto errorExit;
taxaSetNames = NULL;
taxaSet = NULL;
numTaxaSets = 0;
memAllocs[ALLOC_TAXASETS] = YES; /* safe to free */
/* species partitions; allocate space and set default species partition */
if (memAllocs[ALLOC_SPECIESPARTITIONS] == YES)
goto errorExit;
speciespartitionNames = NULL;
speciesNameSets = NULL;
speciespartitionId = (int**) SafeMalloc ((size_t)numTaxa * sizeof(int*));
for (i=0; i<numTaxa; i++)
{
speciespartitionId[i] = (int *) SafeMalloc (sizeof(int));
speciespartitionId[i][0] = i + 1; /* 1-based taxon index, do not ask me why */
}
numDefinedSpeciespartitions = 0; /* number of defined species partitions */
memAllocs[ALLOC_SPECIESPARTITIONS] = YES; /* safe to do free */
/* constraints */
if (memAllocs[ALLOC_CONSTRAINTS] == YES)
goto errorExit;
constraintNames = NULL;
definedConstraintsType = NULL;
definedConstraint = NULL;
definedConstraintTwo = NULL;
definedConstraintPruned = NULL;
definedConstraintTwoPruned = NULL;
numDefinedConstraints = 0;
tempActiveConstraints = NULL;
memAllocs[ALLOC_CONSTRAINTS] = YES; /* safe to free */
/* translate table */
transFrom = NULL;
transTo = NULL;
numTranslates = 0;
/* tempSet */
if (memAllocs[ALLOC_TMPSET] == YES)
goto errorExit;
tempSet = (int *) SafeMalloc ((size_t)numTaxa * sizeof(int));
tempSetNeg = (int *) SafeMalloc ((size_t)numTaxa * sizeof(int));
if (!tempSet || !tempSetNeg)
goto errorExit;
memAllocs[ALLOC_TMPSET] = YES;
/* make sure previous user trees are freed */
if (numUserTrees > 0)
{
MrBayesPrint ("%s Previous user trees not freed\n", spacer);
goto errorExit;
}
MrBayesPrint ("%s Allocated taxon set\n", spacer);
return NO_ERROR;
errorExit:
MrBayesPrint ("%s Problem allocating taxon set\n", spacer);
FreeTaxa();
return ERROR;
}
char ChangeCase (char c)
{
int x;
x = tolower(c);
return (x);
}
int CharacterCode (char ch, int *charCode, int chType)
{
if (chType == DNA || chType == RNA)
{
if ((*charCode = NucID (ch)) == -1)
{
MrBayesPrint ("%s Unrecognized DNA/RNA character '%c'\n", spacer, ch);
return (ERROR);
}
}
else if (chType == PROTEIN)
{
if ((*charCode = ProtID (ch)) == -1)
{
MrBayesPrint ("%s Unrecognized Protein character '%c'\n", spacer, ch);
return (ERROR);
}
}
else if (chType == RESTRICTION)
{
if ((*charCode = MBResID (ch)) == -1)
{
MrBayesPrint ("%s Unrecognized Restriction character '%c'\n", spacer, ch);
return (ERROR);
}
}
else if (chType == STANDARD)
{
if ((*charCode = StandID (ch)) == -1)
{
MrBayesPrint ("%s Unrecognized Standard character '%c'\n", spacer, ch);
return (ERROR);
}
}
else if (chType == CONTINUOUS)
{
MrBayesPrint ("%s CharacterCode function cannot check continuous characters\n", spacer);
}
else
{
MrBayesPrint ("%s Unrecognized character type (%d)\n", spacer, chType);
return (ERROR);
}
return (NO_ERROR);
}
int CharacterNumber (int charCode, int chType)
{
int i, x = charCode;
if (chType == CONTINUOUS)
return 0;
for (i=0; x!=0; i++)
x >>= 1;
return (i);
}
int CheckInitialPartitions (void)
{
int i;
for (i=0; i<numChar; i++)
{
if (partitionId[i][0] <= 0 || partitionId[i][0] > numDivisions)
{
MrBayesPrint ("%s The partition for site %d is incorrect\n", spacer, i+1);
return (ERROR);
}
}
return (NO_ERROR);
}
int CheckStringValidity (char *s)
{
int i, numUnknownChars, tempNumComments, tempInComment;
char temp[100];
i = 0;
numUnknownChars = 0;
tempNumComments = numComments;
tempInComment = inComment;
while (s[i] != '\0')
{
if (tempInComment == NO)
{
if (!IsIn(s[i],"=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789.;:,#()[]?-*/'\\'!%\"&~+^$@|{}`>< "))
{
if (IsWhite(s[i]) == 1 || IsWhite(s[i]) == 2)
{
}
else
{
if (commandPtr == NULL)
return (ERROR);
MrBayesPrint ("%s Unknown character \"%c\" (ASCII code %d)\n", spacer, s[i], s[i]);
if (!strcmp(commandPtr->string,"Matrix"))
{
if (foundNewLine == NO)
{
MrBayesPrint ("%s The error is in character %d for taxon %s\n", spacer, taxaInfo[taxonCount-1].charCount+i+1, "???"); /* bug? */
}
else
{
if (taxonCount == 0)
MrBayesPrint ("%s The error is in the first taxon name\n", spacer);
else
{
strcpy(temp, taxaNames[taxonCount]);
if (isInterleaved == NO)
MrBayesPrint ("%s The error is in the name of the taxon following taxon %s\n", spacer, temp);
else
{
MrBayesPrint ("%s The error is in the name of the taxon following taxon %s\n", spacer, temp);
MrBayesPrint ("%s in one of the interleaved data blocks\n", spacer);
}
}
}
}
else if (!strcmp(commandPtr->string,"Execute"))
{
MrBayesPrint ("%s Assuming irrelevant characters at beginning of file; processing continues\n", spacer);
return (NO_ERROR);
}
return (ERROR);
}
}
if (s[i]=='[')
{
tempInComment = YES;
tempNumComments++;
}
}
else if (tempInComment == YES)
{
if (s[i]==']')
{
tempNumComments--;
if (tempNumComments == 0)
tempInComment = NO;
}
}
i++;
}
if (numUnknownChars > 0)
return (ERROR);
else
return (NO_ERROR);
}
/* CheckString: This function simply checks a vector of strings for a match against token.
Upon return, matchIndex contains the index of the matched string. An
ERROR is returned if there are no matches. */
int CheckString (char **list, int len, char *token, int *matchIndex)
{
int i;
*matchIndex = -1;
for (i=0; i<len; i++)
{
if (StrCmpCaseInsensitive(token,list[i]) == 0)
{
*matchIndex = i;
return (NO_ERROR);
}
}
return (ERROR);
}
int Dex (TreeNode *p)
{
return (p == NULL) ? -1 : p->index;
}
int DoAbout (void)
{
MrBayesPrint (" --------------------------------------------------------------------------- \n");
MrBayesPrint (" About the program \n");
MrBayesPrint (" \n");
MrBayesPrint (" MrBayes is a program for the Bayesian estimation of phylogeny. Bayesian \n");
MrBayesPrint (" inference of phylogeny is based upon the posterior probability distribution \n");
MrBayesPrint (" of trees. Trees are labelled T1, T2, ..., Tn, where n is the number of \n");
MrBayesPrint (" possible trees. The posterior probability of the i-th tree is calculated \n");
MrBayesPrint (" using Bayes\'s formula as \n");
MrBayesPrint (" \n");
MrBayesPrint (" Pr[Ti | X] = Pr[X | Ti] X Pr[Ti] / Pr[X] \n");
MrBayesPrint (" \n");
MrBayesPrint (" where X is a character matrix. Here, \"Pr[Ti | X]\" is the posterior \n");
MrBayesPrint (" probability of the i-th tree, \"Pr[X | Ti]\" is the likelihood of the \n");
MrBayesPrint (" i-th tree, and \"Pr[Ti]\" is the prior probability of the i-th tree. The \n");
MrBayesPrint (" denominator of Bayes\'s formula (\"Pr[X]\") is a normalizing constant that \n");
MrBayesPrint (" involves a summation over all possible trees. The likelihood, as described \n");
MrBayesPrint (" above, cannot be calculated with knowledge of only the tree\'s topology. You \n");
MrBayesPrint (" also need to have information on the lenths of the branches and on the \n");
MrBayesPrint (" mechanism of character change. Hence, the likelihood (\"Pr[X | Ti]\") \n");
MrBayesPrint (" involves a multidimensional integral over all possible combinations of \n");
MrBayesPrint (" branch lengths and substitution model parameters. \n");
MrBayesPrint (" \n");
MrBayesPrint (" In practice, it is impossible to calculate the posterior probability dist- \n");
MrBayesPrint (" ribution of trees analytically. Instead, the posterior probability \n");
MrBayesPrint (" of trees must be approximated. MrBayes uses a method called Markov chain \n");
MrBayesPrint (" Monte Carlo (MCMC) to approximate the posterior probability of trees. \n");
MrBayesPrint (" The object of MCMC is to construct a Markov chain that has as its state \n");
MrBayesPrint (" space the parameters of the phylogenetic model and a stationary distribution \n");
MrBayesPrint (" that is the posterior probability distribution of trees. MCMC takes valid, \n");
MrBayesPrint (" albeit dependent, samples from the posterior probability distribution of \n");
MrBayesPrint (" trees. The fraction of the time any tree appears in this sample is a \n");
MrBayesPrint (" valid approximation of the posterior probability of the tree. MrBayes keeps \n");
MrBayesPrint (" track of all the parameters of the phylogenetic model. The trees (with branch \n");
MrBayesPrint (" lengths) that were sampled by the MCMC procedure are saved in one file \n");
MrBayesPrint (" (a file with a \".t\" extension) whereas the parameters of the model of \n");
MrBayesPrint (" character change are saved in another file (a file with a \".p\" ext- \n");
MrBayesPrint (" ension). You can summarize the results in the \".t\" and \".p\" files \n");
MrBayesPrint (" using the \"sumt\" and \"sump\" commands, respectively. \n");
MrBayesPrint (" \n");
MrBayesPrint (" MrBayes was originally written by John Huelsenbeck in August of 2000 and was \n");
MrBayesPrint (" intended to be distributed to a small number of people. In March of 2001, \n");
MrBayesPrint (" Fredrik Ronquist started making contributions to the program. The contribu- \n");
MrBayesPrint (" tions were of such a significant nature that he was made a coauthor of the \n");
MrBayesPrint (" program. Version 3 of MrBayes was a fully joint effort, started in the summer \n");
MrBayesPrint (" of 2002 when JPH visited Sweden on a grant from the Wenner-Gren Foundations. \n");
MrBayesPrint (" Several others have contributed to the MrBayes code since then, most notably \n");
MrBayesPrint (" Paul van der Mark and Maxim Teslenko, both postdocs/programmers in Fredrik's \n");
MrBayesPrint (" lab. A large number of users and students, too many to list here, have also \n");
MrBayesPrint (" contributed importantly to the project (type 'Acknowledgments' for a list of \n");
MrBayesPrint (" some of them). \n");
MrBayesPrint (" \n");
MrBayesPrint (" Since 2003, MrBayes has been distributed from SourceForge. Bugs can be repor- \n");
MrBayesPrint (" ted to the MrBayes site on SourceForge or by contacting Maxim Teslenko \n");
MrBayesPrint (" ([email protected]) directly. \n");
MrBayesPrint (" --------------------------------------------------------------------------- \n");
return (NO_ERROR);
}
int DoAcknowledgments (void)
{
MrBayesPrint (" --------------------------------------------------------------------------- \n");
MrBayesPrint (" Acknowledgments \n");
MrBayesPrint (" \n");
MrBayesPrint (" JPH and FR would like to thank Gautam Altekar, Andrea Betancourt, Jon \n");
MrBayesPrint (" Bollback, Barry Hall, Jimmy McGuire, Rasmus Nielsen, David Swofford, \n");
MrBayesPrint (" Johan Nylander, Mikael Thollesson, and Derrick Zwickl for help during the \n");
MrBayesPrint (" initial development of this program. Gautam Altekar, especially, was instru- \n");
MrBayesPrint (" mental in getting the parallel version of the program working. Important bug- \n");
MrBayesPrint (" fixes and additional functionality was contributed by Clemens Lakner, Sebas- \n");
MrBayesPrint (" tian Hoehna, Paul Lewis, Mark Holder, Julian Catchen and Bret Larget. Marc \n");
MrBayesPrint (" Suchard, Daniel Ayres and Aaron Darling got mrbayes working with beagle and \n");
MrBayesPrint (" contributed a lot of related functionality and bug fixes. Aaron Darling was \n");
MrBayesPrint (" instrumental in getting the Windows installer set up. Liu Liang and Dennis \n");
MrBayesPrint (" Pearl helped integrate MrBayes with BEST. \n");
MrBayesPrint (" \n");
MrBayesPrint (" Bug fixes and user support was provided by Paul van der Mark (2005-2007) and \n");
MrBayesPrint (" from 2010 by Maxim Teslenko ([email protected]). \n");
MrBayesPrint (" \n");
MrBayesPrint (" Our wives -- Edna Huelsenbeck and Eva Ronquist -- showed extraordinary \n");
MrBayesPrint (" patience with us while we spent many late nights programming. \n");
MrBayesPrint (" \n");
MrBayesPrint (" JPH was supported by NSF grants DEB-007540 and MCB-0075404 and a Wenner- \n");
MrBayesPrint (" Gren scholarship while writing this program. FR was supported by grants \n");
MrBayesPrint (" from the Swedish Natural Science Research Council and the Swedish Research \n");
MrBayesPrint (" Council. \n");
MrBayesPrint (" --------------------------------------------------------------------------- \n");
return (NO_ERROR);
}
int DoBeginParm (char *parmName, char *tkn)
{
if (expecting == Expecting(PARAMETER))
{
/* set Data (inDataBlock) *************************************************************/
if (!strcmp(parmName, "Data"))
{
if (FreeModel () == ERROR)
return (ERROR);
if (FreeMatrix () == ERROR)
return (ERROR);
MrBayesPrint (" Reading data block\n");
inDataBlock = YES;
expecting = Expecting(SEMICOLON);
strcpy (spacer, " ");
}
/* set Characters (inCharactersBlock) *************************************************************/