MrBayes - bwHPC Wiki MrBayes - bwHPC Wiki

MrBayes

From bwHPC Wiki
Jump to: navigation, search
Description Content
module load bio/mrbayes
License Free Software
Citing n./a.
Links MrBayes Homepage | MrBayes Documentation
Graphical Interface No
Plugins Beagle Library


1 Description

MrBayes is a program for Bayesian inference and model choice across a wide range of phylogenetic and evolutionary models. MrBayes uses Markov chain Monte Carlo (MCMC) methods to estimate the posterior distribution of model parameters.
Program features include:

  • A common command-line interface across Macintosh, Windows, and UNIX operating systems;0jk
  • Extensive help available from the command line;
  • Analysis of nucleotide, amino acid, restriction site, and morphological data;
  • Mixing of data types, such as molecular and morphological characters, in a single analysis;
  • Easy linking and unlinking of parameters across data partitions;
  • An abundance of evolutionary models, including 4x4, doublet, and codon models for nucleotide data and many of the standard rate matrices for amino acid data;
  • Estimation of positively selected sites in a fully hierarchical Bayesian framework;
  • Full integration of the BEST algorithms for the multi-species coalescent.
  • Support for complex combinations of positive, negative, and backbone constraints on topologies;
  • Model jumping across the GTR model space and across fixed rate matrices for amino acid data;
  • Monitoring of convergence during the analysis, and access to a wide range of convergence diagnostics tools after the analysis has finished;
  • Rich summaries of posterior samples of branch and node parameters printed to majority rule consensus trees in FigTree format;
  • Implementation of the stepping-stone method for accurate estimation of model likelihoods for Bayesian model choice using Bayes factors;
  • The ability to spread jobs over a cluster of computers using MPI (for Macintosh (OS X) and UNIX environments only);
  • Support for the BEAGLE library, resulting in dramatic speedups for codon and amino acid models on compatible hardware (NVIDIA graphics cards);
  • Checkpointing across all models, allowing the user to seemlessly extend a previous analysis or recover from a system crash;


For more information on features please visit the MrBayes Command Reference (PDF).

2 Versions and Availability

A list of versions currently available on all bwHPC-C5-Clusters can be obtained from the

Cluster Information System CIS

On the command line interface of any bwHPC cluster you'll get a list of available versions by using the command 'module avail bio/mrbayes'.

$ module avail bio/mrbayes
---------------------- /opt/bwhpc/common/modulefiles -----------------------
bio/mrbayes/3.2.6


3 License

This program is a free software package.

4 Loading the module

4.1 default

You can load the default version of MrBayes with the command 'module load bio/mrbayes'.

$ module load bio/mrbayes
$ module list
Currently Loaded Modulefiles:
  1) bio/mrbayes/3.2.6

The module will try to load modules it needs to function. If loading the module fails, check if you have already loaded one of those modules, but not in the version needed for MrBayes.

4.2 Special Version

If you wish to load a spacial/older or newer version, you can do so using '$ module load bio/mrbayes/'version' to load the version you desires.
Example:

$ module avail bio/mrbayes
------------------------ /opt/bwhpc/common/modulefiles -------------------------
bio/mrbayes/3.2.6
$ module load bio/mrbayes/3.2.6
$ module list
Currently Loaded Modulefiles:
  1) compiler/gnu/5.2           3) bio/mrbayes/3.2.6
  2) mpi/openmpi/1.10-gnu-5.2


5 Program Binaries

You can find the binary-files in the bin folder of the MrBayes system. After loading the module ('module load bio/mrbayes') this path is also set to the local $PATH- and $MRBAXES_HOME environments.

5.1 Serial Version

This serial software is a command-line one and consist of only one single binary called mb.

5.2 Parallel Version

This parallel (MPI) command-line is called mb_mpi.

5.3 Index of MrBayes Home Folder

Version 3.2.6

$ ls -lRF $MRBAYES_HOME
# $MRBAYES_HOME
/opt/bwhpc/common/bio/mrbayes/3.2.6:
[dir] bin/
[dir] bwhpc-build-log.d/
[dir] bwhpc-examples/
[dir] documentation/
[dir] examples/
[dir] modulefiles/
# $MRBAYES_BIN_DIR
/opt/bwhpc/common/bio/mrbayes/3.2.6/bin:
[...] mb* # THIS IS THE SERIAL VERSION
[...] mb_mpi*  # THIS IS THE MPI-/PARALLEL version
# Build-Logs (how we built the system)
/opt/bwhpc/common/bio/mrbayes/3.2.6/bwhpc-build-log.d:
beagle_configure.out          beagle_make_check.out           beagle_make_install.out
beagle_make.out               mrbayes_parallel_configure.out  mrbayes_parallel_make.out
mrbayes_serial_configure.out  mrbayes_serial_make.out
# $MRBAYES_EXA_DIR  # bwhpc-example moab submit script and test-data
/opt/bwhpc/common/bio/mrbayes/3.2.6/bwhpc-examples:
[...] bwhpc-mrbayes-example.moab # Moab submit script for use with 'msub'
[...] hymfossil.nex # example data file for above script
# $MRBAYES_DOC_DIR # vendor supplied documentation
/opt/bwhpc/common/bio/mrbayes/3.2.6/documentation:
[...] commref_mb3.2.txt
[...] Manual_MrBayes_v3.2.pdf
[...] release_note.txt
# Vendor supplied example files
/opt/bwhpc/common/bio/mrbayes/3.2.6/examples:
[...] avian_ovomucoids.nex
[...] codon.nex
[...] cynmix.nex
[...] finch.nex
[...] hymfossil.nex
[...] primates.nex
[...] replicase.nex
[...] sceloporus.nex
# our module-file
/opt/bwhpc/common/bio/mrbayes/3.2.6/modulefiles:
[...] bio-mrbayes-3.2.6

'*' indicates the file is executable.

6 bwHPC Examples for MPI Jobs with MrBayes

In the folder $MRBAYES_EXA_DIR you'll find an example how to use this software.

$ ls -l $MRBAYES_EXA_DIR
[...] bwhpc-mrbayes-example.moab # Moab example script for use with 'msub *.moab'
[...] hymfossil.nex # example data file


6.1 MPI Parameters

Once the MPI environment is ready, a parallel MrBayes job is typically started with a line such as

$ mpirun -np 4 mb_mpi batch.nex > log.txt

This line calls the MPI version of MrBayes (just called 'mb_mpi' here) and asks it to run the file batch.nex using four processors (-np 4), saving the screen output to the file log.txt .

6.2 How to use the MrBayes test-script

  • Create your own work-space
# WS-Name        Days alive (max. 60)
ws_allocate mrbayes_repo 30
  • Change dir to your workspace
cd $(ws_find mrbayes_repo)
  • Copy the moab-example file you'll find in this folder and make your modifications
cp $MRBAYES_EXA_DIR/bwhpc-mrbayes-example.moab .
  • Submit your job
msub bwhpc-mrbayes-example.moab
  • Wait for awhile...

... until you see some more files created. The *.tgz-file contains your data.

tar xvzf *.tgz to extract the file-contents


6.2.1 Exerpt from bwhpc-mrbayes-example.moab

These parameters are allying for use of the MPI compiled version on the cluster.

#!/bin/bash
#
#MSUB -N mrbayes_job
#MSUB -j oe
#MSUB -o $(JOBNAME).$(JOBID)
#MSUB -m ae
# -M 'your e-mail-address@DN'
#MSUB -l nodes=2:ppn=2
#MSUB -l mem=10000mb
#MSUB -l walltime=00:10:00
[...]
echo " "
echo "### Loading MRBAYES module:"
echo " "
module load bio/mrbayes/3.2.6
[ -z "$MRBAYES_HOME" ] && { echo 'ERROR: Failed to load module bio/mrbayes/3.2.6.'; exit 1; }
echo "MRBAYES_HOME = ${MRBAYES_HOME}"
module list

echo " "
echo "### Copying input test files for job (if required):"
echo " "
cp -v $MRBAYES_EXA_DIR/*.nex .

echo " "
echo "### Runing MRBAYES example in MPI mode..."
echo " "
echo "SLURM_JOB_NUM_NODES  = ${SLURM_JOB_NUM_NODES}"
# This is an example 'mb_mpi' command running in MPI-mode.
mpirun -np ${SLURM_JOB_NUM_NODES} mb_mpi hymfossil.nex > mymfossil_out.txt 2>&1
[...]


The output of the above script is a compressed tarball.
Your expected(?) summary will be included in the file 'mymfossil_out.txt' (example).
At the beginning and end of the output file you should see something like this:

                            MrBayes v3.2.6 x64
                      (Bayesian Analysis of Phylogeny)

                             (Parallel version)
                         (2 processors available)

              Distributed under the GNU General Public License
               Type "help" or "help <command>" for information
                     on the commands that are available.

                   Type "about" for authorship and general
                       information about the program.

   Executing file "hymfossil.nex"
   UNIX line termination
   Longest line length = 1117

[...]

      Setting print frequency to 10000
      Setting diagnosing frequency to 50000
      Setting chain output file names to "hymfossil.nex.run<i>.<p/t>"
      Successfully set chain parameters
   Exiting mrbayes block
   Reached end of file

   Tasks completed, exiting program because mode is noninteractive
   To return control to the command line after completion of file processing,
   set mode to interactive with 'mb -i <filename>' (i is for interactive)
   or use 'set mode=interactive'



7 MrBayes-Specific Environments

To see a list of all environments set by the module use
'env | grep MRBAYES'. Or use the command 'module display bio/mrbayes'.

$ module display bio/mrbayes
-------------------------------------------------------------------
/opt/bwhpc/common/modulefiles/bio/mrbayes/3.2.6:
module-whatis	 MrBayes 3.2.6 is a program for Bayesian inference and model
     choice across a wide range of phylogenetic and evolutionary models. 
setenv		 MRBAYES_VERSION 3.2.6 
setenv		 MRBAYES_HOME /opt/bwhpc/common/bio/mrbayes/3.2.6 
setenv		 MRBAYES_EXA_DIR /opt/bwhpc/common/bio/mrbayes/3.2.6/bwhpc-examples 
setenv		 MRBAYES_BIN_DIR /opt/bwhpc/common/bio/mrbayes/3.2.6/bin 
setenv		 MRBAYES_DOC_DIR /opt/bwhpc/common/bio/mrbayes/3.2.6/documentation 
setenv		 MRBAYES_BPR_URL http://www.bwhpc-c5.de/wiki/index.php/MrBayes 
prepend-path	 PATH /opt/bwhpc/common/bio/mrbayes/3.2.6/bin 
prepend-path	 LD_LIBRARY_PATH /opt/bwhpc/common/bio/mrbayes/3.2.6/beagle/lib 
module		 load compiler/intel/15.0 
module		 load mpi/impi/5.0.3-intel-15.0 
conflict	 bio/mrbayes 


8 Version-Specific Information

For a more detailed information to a specific version of this module, see the information available via the module system with the command 'module help bio/mrbayes/version'.
For a small abstract what MrBayes is about use the command 'module whatis bio/mrbayes
Example:

$ module whatis bio/mrbayes
bio/mrbayes          : MrBayes 3.2.6 is a program for Bayesian inference and model
          choice across a wide range of phylogenetic and evolutionary models.
$ module help bio/mrbayes
----------- Module Specific Help for 'bio/mrbayes/3.2.6' ----------
DESCRIPTION

  MrBayes is a program for Bayesian inference and model choice
  across a wide range of phylogenetic and evolutionary models.
[...]
DOCUMENTATION

*  MRBAYES AT A GLANCE   
   http://mrbayes.sourceforge.net/index.php

*  MRBAYES User Guide and Documents
   Online: http://mrbayes.sourceforge.net/manual.php
   Local: /opt/bwhpc/common/bio/mrbayes/3.2.6/documentation

*  MRBAYES Downloads
   http://mrbayes.sourceforge.net/download.php
  
*  bwHPC examples and a moab example script can be found here:
   /opt/bwhpc/common/bio/mrbayes/3.2.6/bwhpc-examples
[...]
BINARY FILES

   Serial version: mb
   Parallel version (MPI): mp_mpi
[...]