Marine Biological Laboratory Workshop on Molecular Evolution  
Marine Biological Laboratory
HomePeopleScheduleSoftwareResources

Software
AWTY
BEAST
BEAUti
Clustal W
Clustal X
FASTA
FigTree
GARLI
GCG
LAMARC
MAFFT
Migrate-n
Modeltest
MrBayes
NCBI Resources
PAML
PAUP*
PHYLIP
ReadSeq
SeaView
T-Coffee
TreeView
Search


MrBayes

MrBayes (Ronquist and Huelsenbeck 2003) is a program for doing Bayesian phylogenetic analysis. The program uses a Markov Chain Monte Carlo (MCMC) method for exploring parameter space in a stepwise fashion. Each new step is either accepted or rejected based on the change in likelihood. The posterior probability for each parameter is based on the frequency with which the parameter values are observed. MrBayes uses Metropolis-coupled MCMC (MCMCMC) method of searching with several chains, some of which are "heated". Heating is the proportional, exponential increase in the posterior probability of a step and allows chains to escape local valleys (areas of tree-space where stepwise changes are likely to not find a tree with a higher posterior probability). At specified intervals, chain states are swapped based on the observed difference in likelihood. The most recent version of the program for the workshop includes new features, such as checkpointing, and strict and relaxed clock models for dating.

MrBayes is available for Windows, OSX, and Linux. All use a command-line interface and performs virtually the same on all platforms.

Version 3.2

Input data file format

NEXUS

Running MrBayes at the CDC Workshop

Instructions

MrBayes input files are in NEXUS format. At the MrBayes prompt type:

execute filename.nex

to enter a data file into the program. To set the desired nucleotide substitution model parameters type:

lset < parameter > = < option > < parameter > = < option >

but exchange the words in < > with parameters and options. For example:

lset nst=6 rates=invgamma

sets the model to a general time reversible substitution model with 6 rate categories. A proportion of the sites are invariable, while the rates for the remaining sites are drawn from a gamma distribution. More information on parameters and options are available in the Command Reference document, or by typing:

help

To set the MCMC parameters type:

mcmcp < parameter > = < value > < parameter > = < value >

and exchange the words in < > with parameters and values. For example:

mcmcp ngen=10000 nchains=4 printfreq=100 samplefreq=50

performs a MCMCMC analysis with four chains for 10000 generations. Information about the cold chain will be reported to the screen every 100 generations and saved to a file every 50 generations.

Start the analysis by typing:

mcmc

During the MCMC analysis, MrBayes prints the sampled parameter values to a text file (filename.nex.p), and the sampled trees to another text file (filename.nex.t). You have to remove or rename these files after each run, since MrBayes appends all outputs to files with these names. After the analysis is completed, typing the command:

sump

will summarize the information in the parameter file to the screen. The likelihood scores tend to change quickly at the beginning of an analysis (the burn-in phase) and then reach a stationary distribution, thus the first scores are typically discarded. The remaining trees can be used to create a consensus tree. The command:

sumt burnin = < number > contype=halfcompat

is used to produce summary statistics for the trees sampled during the analysis, minus the trees sampled during the burn-in phase. The partition information is output to one file (filename.parts), and a consensus tree is printed to another file (filename.con). MrBayes also produces a file that contains a list of all the trees that were found during the MCMC analysis, sorted by their probabilities (filename.trprobs).

If you are interested in the estimates for model parameters, you need to use the command sump again with the appropriate burnin:

sump burnin = < number >

Instead of typing all commands at the command line, you can write a MrBayes block in your datafile, see examples below.

Example Data Files

Example Command File

The co1.nex file contains a sample MrBayes block at the end of the file that defines site-specific rates for first, second, and third codon positions.

The mb_part_block file above provides an example of a MrBayes block for analysing multiple data partitions at the same time. In this file Fib5 is non-coding nDNA, tRNA, and ATPase, ND2 and ND3 are mtDNA. To use this block in MrBayes first execute your data file, then execute the block file. NOTE: you have to make sure that you have predefined your character sets and partitions according to your own data set.

For additional information on Bayesian phylogenetic inference and MrBayes, refer to these resources on MrBayes.

.......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... ..........

Maintained by Adam Bazinet
Direct questions and comments to Michael Cummings
Maintained by Adam Bazinet
Direct questions and comments to Michael Cummings