| 1 | |
|---|
| 2 | #define PREPARE_MRBAYES_INFILE(INFILE) \ |
|---|
| 3 | ( \ |
|---|
| 4 | arb_sed -i '/LABELPOS/d' INFILE `#MrBayes does not understand the LABELPOS command, therefore it is removed.` && \ |
|---|
| 5 | arb_sed -i '/EQUATE/d' INFILE `#MrBayes does not support EQUATE macros, remove them.` && \ |
|---|
| 6 | arb_sed -i '/OPTIONS/,/;/d' INFILE `#MrBayes does not support the OPTIONS block, remove it. (delete everything between OPTIONS and ';')` \ |
|---|
| 7 | ) |
|---|
| 8 | |
|---|
| 9 | #define NEXUS2NEWICK(FROM,APPENDTO) ($ARBHOME/bin/arb_nexus2newick.awk FROM >> APPENDTO || STOP_ON_FAILURE(arb_nexus2newick)) |
|---|
| 10 | |
|---|
| 11 | item:MrBayes |
|---|
| 12 | itemmeta:B |
|---|
| 13 | seqtype:* |
|---|
| 14 | itemmethod:(GOTO_LOCAL_DIR; \ |
|---|
| 15 | GEN_NEXUS(mrbayes_in) && \ |
|---|
| 16 | PREPARE_MRBAYES_INFILE(mrbayes_in) && \ |
|---|
| 17 | ( \ |
|---|
| 18 | `# append the mrbayes command block to the nexus file`; \ |
|---|
| 19 | COMMAND="begin mrbayes; \ |
|---|
| 20 | set autoclose=yes nowarn=yes; \ |
|---|
| 21 | lset nst=$NST rates=$RATES ngammacat=$NGAMMACAT; \ |
|---|
| 22 | mcmc ngen=$NGEN nchains=$NCHAINS temp=$TEMP samplefreq=$SAMPLEFREQ burninfrac=$BURNINFRAC; \ |
|---|
| 23 | sump; \ |
|---|
| 24 | sumt Outputname=mrbayes_out Conformat=simple; \ |
|---|
| 25 | end;" \ |
|---|
| 26 | && echo $COMMAND >> mrbayes_in; \ |
|---|
| 27 | ) && \ |
|---|
| 28 | RUN_IN_WINDOW(( ($ARBHOME/bin/mb mrbayes_in || STOP_ON_FAILURE(MrBayes)) && \ |
|---|
| 29 | NEXUS2NEWICK(mrbayes_out.con.tre,mr_bayes_out.newick) && \ |
|---|
| 30 | $DISPLAY_FUNC));)& |
|---|
| 31 | |
|---|
| 32 | itemhelp:MrBayes.help |
|---|
| 33 | |
|---|
| 34 | arg:DISPLAY_FUNC |
|---|
| 35 | argtype:choice_menu |
|---|
| 36 | arglabel:What to do with the tree? |
|---|
| 37 | argchoice:Load into ARB ('tree_mrBayes_//'):$ARBHOME/bin/arb_read_tree tree_mrbayes_$$ mr_bayes_out.newick "PRG=MrBayes FILTER=$FILTER RATE=$RATES" |
|---|
| 38 | argchoice:Treetool:treetool mr_bayes_out.newick |
|---|
| 39 | |
|---|
| 40 | arg:NST |
|---|
| 41 | argtype:choice_menu |
|---|
| 42 | arglabel:Number of substitution types |
|---|
| 43 | argchoice:6:6 |
|---|
| 44 | argchoice:mixed:mixed |
|---|
| 45 | argchoice:1:1 |
|---|
| 46 | argchoice:2:2 |
|---|
| 47 | |
|---|
| 48 | arg:RATES |
|---|
| 49 | argtype:choice_menu |
|---|
| 50 | arglabel:Model for among-site rate variation |
|---|
| 51 | argchoice:A proportion of the sites are invariable:propinv |
|---|
| 52 | argchoice:No rate variation across sites:equal |
|---|
| 53 | argchoice:Gamma-distributed rates across sites:gamma |
|---|
| 54 | argchoice:Autocorrelated rates across sites:adgamma |
|---|
| 55 | argchoice:Mixed invariable/gamma:invgamma |
|---|
| 56 | |
|---|
| 57 | |
|---|
| 58 | arg:NGAMMACAT |
|---|
| 59 | argtype:text |
|---|
| 60 | arglabel:Number of rate categories for the gamma distribution\n(Range [0 .. n]) |
|---|
| 61 | argtext:4 |
|---|
| 62 | |
|---|
| 63 | arg:NGEN |
|---|
| 64 | argtype:text |
|---|
| 65 | arglabel:Number of cycles for the MCMC algorithm |
|---|
| 66 | argtext:100000 |
|---|
| 67 | |
|---|
| 68 | arg:NCHAINS |
|---|
| 69 | argtype:text |
|---|
| 70 | arglabel:Number of chains |
|---|
| 71 | argtext:4 |
|---|
| 72 | |
|---|
| 73 | arg:TEMP |
|---|
| 74 | argtype:text |
|---|
| 75 | arglabel:Temperature parameter for heating the chains |
|---|
| 76 | argtext:0.5 |
|---|
| 77 | |
|---|
| 78 | arg:SAMPLEFREQ |
|---|
| 79 | argtype:text |
|---|
| 80 | arglabel:Markov chain sample frequency |
|---|
| 81 | argtext:500 |
|---|
| 82 | |
|---|
| 83 | arg:BURNINFRAC |
|---|
| 84 | argtype:text |
|---|
| 85 | arglabel:Fraction of samples that will be discarded\nwhen convergence diagnostics are calculated [0..1] |
|---|
| 86 | argtext:0.25 |
|---|
| 87 | |
|---|
| 88 | |
|---|
| 89 | in:TmpInputFile |
|---|
| 90 | informat:genbank |
|---|
| 91 | insave: |
|---|
| 92 | |
|---|
| 93 | //------------------------------------------------------------------------------------------ |
|---|
| 94 | |
|---|
| 95 | |
|---|
| 96 | item:MrBayes (custom) |
|---|
| 97 | itemmeta:c |
|---|
| 98 | seqtype:* |
|---|
| 99 | itemmethod:(GOTO_LOCAL_DIR; \ |
|---|
| 100 | GEN_NEXUS(mrbayes_in) && \ |
|---|
| 101 | PREPARE_MRBAYES_INFILE(mrbayes_in) && \ |
|---|
| 102 | ( \ |
|---|
| 103 | `# append the mrbayes command block to the nexus file`; \ |
|---|
| 104 | cat $COMMAND_FILE >> mrbayes_in; \ |
|---|
| 105 | ) && \ |
|---|
| 106 | RUN_IN_WINDOW(( ($ARBHOME/bin/mb mrbayes_in || STOP_ON_FAILURE(MrBayes)) && \ |
|---|
| 107 | NEXUS2NEWICK(mrbayes_out.con.tre,mr_bayes_out.newick) && \ |
|---|
| 108 | $DISPLAY_FUNC)))& |
|---|
| 109 | |
|---|
| 110 | itemhelp:MrBayesCustom.help |
|---|
| 111 | |
|---|
| 112 | arg:DISPLAY_FUNC |
|---|
| 113 | argtype:choice_menu |
|---|
| 114 | arglabel:What to do with the tree? |
|---|
| 115 | argchoice:Load into ARB ('tree_mrBayes_//'):$ARBHOME/bin/arb_read_tree tree_mrbayes_$$ mr_bayes_out.newick "PRG=MrBayes(custom) FILTER=$FILTER RATE=$RATES" |
|---|
| 116 | argchoice:Treetool:treetool mr_bayes_out.newick |
|---|
| 117 | |
|---|
| 118 | arg:COMMAND_FILE |
|---|
| 119 | argtype:filename |
|---|
| 120 | arglabel:MrBayes command file |
|---|
| 121 | |
|---|
| 122 | in:TmpInputFile |
|---|
| 123 | informat:genbank |
|---|
| 124 | insave: |
|---|
| 125 | |
|---|