贝叶斯法构建进化树:MrBayes

1. 简介

使用贝叶斯法构建进化树的软件有很多。在这里简要介绍MrBayes的安装和使用。以下介绍是对几种贝叶斯法构建进化树软件的简介:

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.

BAMBE A nice program by Bret Larget and Donald Simon for the Bayesian inference of phylogeny.

Mac5 A program by Paul-Michael Agapow that deals with gaps as a fifth state.

Beast BEAST, written by Alexei Drummond and Andrew Rambaut, is a cross-platform program for Bayesian MCMC analysis of molecular sequences. It is particularly good for molecular clock analyses.

PHASE Paul Higgs is the author of Phase, designed specifically for use with RNA sequences that have a conserved secondary structure, e.g. rRNA and tRNA.

2. MrBayes的安装

通过MrByes官网:http://mrbayes.sourceforge.net/来下载MrBayes软件并安装。软件包中有其PDF格式的Manual。在windows系统下的MrBayes不能支持多线程运行,在Linux下则能很好地进行并行运算。

MrBayes的安装过程需要注意:其src文件夹的源码文件中有个名为CompileInstructions.txt的文件,介绍了如何进行软件的安装。

$ sudo yum install openmpi* mpi*
$ wget http://sourceforge.net/projects/mrbayes/files/latest/download?source=files
$ tar zxf mrbayes-3.*.*.tar.gz
$ cd mrbayes_3.*.*/src
$ autoconf
$ ./configure --with-beagle=no --enable-mpi=yes
$ make -j 8
$ sudo cp mb /usr/local/bin  (optional)

以下是使用MrBayes的指令,单线程或多线程运行MrBayes.

$ ./mb
$ cat > ~/.mpd.conf
MPD_SECRETWORD=mr45-j9z
$ chmod 600 ~/.mpd.conf
$ mpd &
$ mpirun -np 8 ./mb
                            MrBayes v3.2.1 x64

                      (Bayesian Analysis of Phylogeny)

                             (Parallel version)
                         (24 processors available)

              Distributed under the GNU General Public License

               Type "help" or "help " for information
                     on the commands that are available.

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

MrBayes >

附加使用心得

1. 使用多线程版本得到的树状图和单线程版本的树状图完全不一样,差别太大。多线程版本的树状图完全是所有的分支都集合到一个点上,而单线程的就正常了。这可能是由于不会使用多线程运行MrBayes的原因 或 软件在多线程下的运算方法不好(可能性很小)

2. 在使用MrBayes 3.2.1版本中,发现默认下得出的tree文件中在treeview软件中显现不出后验概率,而3.1.2版本有。

3. 但是在64位的Linux系统中使用3.1.2版本总是会Crash (core dumped)。幸好在此网页中找到了解决方法:Bioinformatics applications at University of Canterbury HPC

需要对Mrbayes安装包中多个文件进行修改,方法就是打个补丁:mb_64bit_safe.patch,再以64位的参数来make。步骤如下:

$ wget http://sourceforge.net/projects/mrbayes/files/mrbayes/3.1.2/mrbayes-3.1.2.tar.gz
$ tar zxf mrbayes-3.1.2.tar.gz
$ cd mrbayes-3.1.2
$ wget https://technical.bestgrid.org/images/7/73/Mb_64bit-safe.patch.txt
$ patch -R -p 1 < Mb_64bit-safe.patch.txt
$ OBJECT_MODE=64 make _64BIT=yes

至此,则运行MrBayes正常了。

3. MrBayes的简单教程

3.1 使用MrBayes来做一个典型的 Bayesian phylogenetic analysis,包括4个步骤:

a. Read the Nexus data file
b. Set the evolutionary model
c. Run the analysis
d. Summarize the samples

3.2 MrBayes分步演示

1. 导入nex文件.本案例使用多线程运行的演示,使用24个CPU运行程序。

$ mpd &
$ mpirun -np 24 mb
MrBayes > execute example.nex

2. 设置进化模型参数.本例中设定数据为DNA数据.

MrBayes > lset nst=6 rates=invgamma

3.1 主程序运行。
以下命令中nchains的值要 >= 设置使用CPU数。在单线程运行的时候可以不需要设置,而在多线程运行的时候不设置则会报错;ngen则是运行的长度,默认1,000,000次;samplefreq则是取样频率,每隔多少次运行次数取一次样;printfreq是打印频率,即每运行多少次将打印一行结果到屏幕上,默认为500;diagnfreq则代表每运行多少次分析一次结果,得出 Average standard deviation of split frequencies,默认是5,000.

运行时,会在输出到屏幕的最后一列看到预测的程序剩余运行时间。

MrBayes > mcmc nchains=24 ngen=2000000 samplefreq=1000 printfreq=500 diagnfreq=5000

3.2 如果在设定的代数运行完毕后,给出的 Average standard deviation of split frequencies的值小于0.01,则根据提示输入‘no'来停止运行,反之则输入'yes'继续运行直到满足其值小于0.01为止。

If you are intersted mainly in the well-supported parts of the tree, a standard deviation below 0.05 may be adequate.

4.1 使用sump来对参数值进行归纳。设置的burnin值为 (ngen / samplefreq) * 0.25 。程序给出一个概括的表,要确保PSRF一列中的值接近 1.0,否则需要运行该多的代数。

MrBayes > sump burnin=500

4.2 使用sumt来构树。burnin值和前一个相同

MrBayes > sumt burnin=500

4. 详细的MrBayes使用教程

4.1 将数据导入到MrBayes

MrBayes导入的数据为Nexus文件,该文件可以有4中数据类型:aligned nucleotide or amino acid sequences, morphological ("standard") data, restriction site (binary) data。Nexus文件中可以混合有这4种数据。

Nexus数据文件通常由其它程序产生,比如 Mesquite。文件以 nex 为后缀。

使用 execute fielenameexe filename将文件中的数据导入到MrBayes中。

4.2 指定模型

匿名进行回复 取消回复

您的电子邮箱地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据