**MrBayes **is a program for the Bayesian estimation of phylogeny. Bayesian inference of phylogeny is based upon a quantity called the posterior probability distribution of trees, which is the probability of a tree conditioned on the observations. The conditioning is accomplished using Bayes's theorem. The posterior probability distribution of trees is impossible to calculate analytically; instead, MrBayes uses a simulation technique called Markov chain Monte Carlo (or MCMC) to approximate the posterior probabilities of trees.

## Availability and Restrictions

### Versions

The following versions of MrBayes are available:

* Current default version

You can use `module spider mrbayes`

to view available modules for a given machine. Feel free to contact OSC Help if you need other versions for your work.

### Access

MrBayes is available without restriction to all OSC users.

## Usage

### Set-up

To load the MrBayes software on the Oakley system, use the following command:

module load mrbayes

### Using MrBayes

Once mrbayes module is loaded, the commands are available for your use. The command for serial version is

mb

Parallel Mrbayes can only be used via batch system. The command is

mb-parallel

### Batch Usage

Below is a sample batch script for running serial mrbayes job. It asks for 1 processor and 30 minutes of walltime.

#PBS -l walltime=30:00
#PBS -l nodes=1:ppn=1
#PBS -N mb
#PBS -j oe
set -x
date
cd $PBS_O_WORKDIR
cp ./primates.nex $TMPDIR
cp ./primates.nxs $TMPDIR
cd $TMPDIR
module load mrbayes/3.2.1
/usr/bin/time mb ./primates.nxs > mb.log
cp * $PBS_O_WORKDIR
date

Below is a sample batch script for running a parallel job on Oakley. It asks for 2 nodes, 24 processors and 30 minutes of walltime.

#PBS -l walltime=30:00
#PBS -l nodes=2:ppn=12
#PBS -N mb-parallel
#PBS -j oe
set -x
date
cd $PBS_O_WORKDIR
pbsdcp ./primates.nex $TMPDIR
pbsdcp ./primates.nxs $TMPDIR
cd $TMPDIR
module load mrbayes
/usr/bin/time mpiexec mb-parallel ./primates.nxs > mb-paralllel.log
pbsdcp -g '*' $PBS_O_WORKDIR
date

## Further Reading

## See Also