Run MrBayes from scratch PDF Print

This quide address the need of running MrBayes computation in MetaCentrum from scratch (without previous knowledge how and where to connect, linux commands, etc.). There is only one prerequisite, the account in MetaCentrum (how to apply is shown at our main page). Short guides but with deeper expected knowledge are in MetaCentrum pages.

See official manual pages of MrBayes program.

Follow the steps to run your MrBayes job (replace all USERLOGIN with your login (user account) in MetaCentrum):

  • you need a script to run your MrBayes job
    Open your favorite text editor (e.g. Notepad) and copy there following text:
#!/bin/sh
#PBS -N MrBayes
#PBS -q normal
#PBS -l nodes=1:ppn=2:nfs4
#PBS -j oe
# previous lines defines: job name, queue where job run,
#  resources that we request (4 processor on one machine) and
#  that mail will be send at the end of job

# add modules
. /packages/run/modules-2.0/init/sh
module add modules ics.muni.cz mpich-p4 mrbayes
# get name of machine where job is run
cat $PBS_NODEFILE
# make directory in shared home and enter it
mkdir /home/USERLOGIN/MB
cd /home/USERLOGIN/MB
# copy input data from /storage to shared home
cp /storage/home/USERLOGIN/MB/mrbayesINPUT.nex /home/USERLOGIN/MB
# RUN MrBayes in parallel on your input data
mpiexec mb-mpi /home/USERLOGIN/MB/mrbayesINPUT.nex
# copy results from shared home to /storage
cp /home/USERLOGIN/MB/myresults* /storage/home/USERLOGIN/MB
Replace USERLOGIN with your login in MetaCentrum and replace mrbayesINPUT.nex with the name of your input data in nexus format. Save the script as mrbayesJOB.qsub
  • the beginning and ending of your input data file (e.g. mrbayesINPUT.nex) should look like:
#NEXUS
[saved by seaview on Mon Aug 08 15:08:07 2011]
BEGIN DATA;
DIMENSIONS NTAX=113 NCHAR=1184;
FORMAT DATATYPE=DNA
GAP=-
;
MATRIX
[1] CLH52B
ggggaattttccgcaatgggcgaaagcc ...
...gtgtggctggnatcacctcctt
;
begin mrbayes;
[ Set the parameters of the likelihood model, keeping prset at default conditions ]
lset
nst=6
nucmodel=4by4
code=universal
rates=gamma
ngammacat=4;
[ Set the outgroup for the analysis ]
outgroup 112;
[ Set Markov chain Monte Carlo parameters ]
mcmcp
ngen=100000
nruns=2
swapfreq=5
printfreq=100
samplefreq=100
nchains=4
savebrlens=yes
ordertaxa=no
filename=myresults;
[ Go! ]
mcmc;
end;

See that name of output files will have prefix myresults (it corresponds to the names in script). There are example data.

  • you need a program to copy files from/to MetaCentrum:
    Download and install WinSCP program.
  • to copy input files:
    1. Run WinSCP program and connect to MetaCentrum (host name hermes.prf.jcu.cz, use your login and password to MetaCentrum and protocol SCP), click on Login
    Login in WinSCP
    2. Change directory to  /storage/home/USERLOGIN (go down to / and than up in direcotory tree)
    3. Create sub directory MB (use F7 key) in USERLOGIN directory and enter in it
    4. Copy script mrbayesJOB.qsub and your input data (e.g. mrbayesINPUT.nex) in /storage/home/USERLOGIN/MB directory (use F5 key)
    WinSCP copy files
  • now you need a program to connect to MetaCentrum:
    Download and install PuTTY program.
  • run PuTTY and connect to MetaCentrum (host name hermes.prf.jcu.cz and use your login and password to MetaCentrum), click on Open
    Putty login
  • change the directory by writing following command in PuTTY window (do not forget to change USERLOGIN by your login)
    cd  /storage/home/USERLOGIN/MB
  • now submit (run) your MrBayes job in MetaCentrum by writing command in PuTTY window
    qsub mrbayesJOB.qsub
  • you can watch your job: The simplest way is to use your web browser (Mozilla, IE, Chrome, ..) and open the page, where you replace the text USERLOGIN in address by your login to MetaCentrum. It may take some time than job is starting the computation. You can click on job in the page to know what happening.
  • after finishing of your MrBayes job, you will get email
  • for copying results (result files starting by myresults that was specified in .nex file) use again WinSCP program to copy results from MetaCentrum to you computer
    WinSCP copy results
  • if there are no results, look at files in /storage/home/USERLOGIN/MB directory: after finishing of job there should appear file(s) (MrBayes.oX or MrBayes.eX where X is some great number), there should be written what is the problem, why results do not appear e.g. you make typo in script

The most common changes in previous guide are:

  • Increase the number of processors to get results faster:
    change number 2 in the head of script into 4 or 8
  • Increase the time for job computation (e.g. your job is not finished after 24 hours and you get info in MrBayes.oX file):
    change normal in head of script to long or jcu (jcu is privileged queue and you should ask in Contacts for possibility to submit there)

For better work with WinSCP and PuTTY there is following guide.

Last Updated on Thursday, 20 September 2012 07:12