简介

BEAST 2是用于分子序列的贝叶斯系统发生分析的跨平台程序。它使用严格或宽松的分子时钟模型来估计有根的,经过时间测量的系统发育。它可以用作重建系统发育的方法,但它也是测试进化假设的框架,而无需以单个树形拓扑为条件。BEAST 2使用马尔可夫链蒙特卡罗(MCMC)在树空间上求平均,因此每棵树的权重均与其后验概率成正比。BEAST 2包括用于设置标准分析的图形用户界面和用于分析结果的一套程序。

官网:http://www.beast2.org/

下载beast和相关包

官网下载地址:

https://github.com/CompEvol/CBAN

https://github.com/CompEvol/CBAN/blob/master/packages2.6.xml

下载所有需要的包(依据个人情况下载):

上传到服务器

将所有包上传到服务器

安装beast

二进制包 BEAST_with_JRE2.v2.6.0.Linux.tgz 直接解压缩即可使用:

# 解压缩
tar zxvf BEAST_with_JRE2.v2.6.0.Linux.tgz
# 设置路径
beast_root=/path/to/beast # 请修改为实际的解压后的绝对路径!!!!
export PATH=$beast_root/bin:$PATH
export LD_LIBRARY_PATH=$beast_lib/lib:$LD_LIBRARY_PATH
export JAVA_HOME=$beast_root/jre1.8.0_212
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

安装其他包

创建包安装的根目录:

if [ ! -d ~/.beast/2.6 ];then
    mkdir -p ~/.beast/2.6
fi

然后将各个需要的包解压缩到这个目录即可安装成功:

unzip BEAST.package.v2.6.1.zip -d ~/.beast/2.6/BEAST  # 2.6.0 -> 2.6.1

unzip StarBEAST2.zip -d ~/.beast/2.6/StarBEAST2
unzip SA.v2.0.2.zip -d ~/.beast/2.6/SA
unzip BEASTlabs.addon.v1.9.0.zip -d ~/.beast/2.6/BEASTlabs
unzip MM.addon.v1.1.1.zip -d ~/.beast/2.6/MM

mkdir BDSKY
unzip BDSKY.addon.v1.4.5.zip -d BDSKY   # 官网下载的这个包目录层级不对,所以自己改一下
mv BDSKY ~/.beast/2.6

测试

直接运行 beast 命令,看是否可以成功启动。成功启动如下:

[zhenggang@ln2%tianhe beast]$ beast

                        BEAST v2.6.1, 2002-2019
             Bayesian Evolutionary Analysis Sampling Trees
                       Designed and developed by
 Remco Bouckaert, Alexei J. Drummond, Andrew Rambaut & Marc A. Suchard

                   Centre for Computational Evolution
                         University of Auckland
                       r.bouckaert@auckland.ac.nz
                        alexei@cs.auckland.ac.nz

                   Institute of Evolutionary Biology
                        University of Edinburgh
                           a.rambaut@ed.ac.uk

                    David Geffen School of Medicine
                 University of California, Los Angeles
                           msuchard@ucla.edu

                      Downloads, Help & Resources:
                           http://beast2.org/

  Source code distributed under the GNU Lesser General Public License:
                   http://github.com/CompEvol/beast2

                           BEAST developers:
   Alex Alekseyenko, Trevor Bedford, Erik Bloomquist, Joseph Heled,
 Sebastian Hoehna, Denise Kuehnert, Philippe Lemey, Wai Lok Sibon Li,
Gerton Lunter, Sidney Markowitz, Vladimir Minin, Michael Defoin Platel,
          Oliver Pybus, Tim Vaughan, Chieh-Hsi Wu, Walter Xie

                               Thanks to:
          Roald Forsberg, Beth Shapiro and Korbinian Strimmer

我们编写一个简单的 1.xml 输入文件,运行 beast 1.xml,观察是否能够正常运行,例如(部分输出):


                        BEAST v2.6.1, 2002-2019
             Bayesian Evolutionary Analysis Sampling Trees
                       Designed and developed by
 Remco Bouckaert, Alexei J. Drummond, Andrew Rambaut & Marc A. Suchard

...

                               Thanks to:
          Roald Forsberg, Beth Shapiro and Korbinian Strimmer

Random number seed: 1572754201802

File: 1_s_f.xml seed: 1572754201802 threads: 1
Loading package BEAST v2.6.1
Loading package starbeast2 v0.15.5
Loading package SA v2.0.2
Loading package BEASTLabs v1.9.0
Loading package MM v1.1.1
Loading package BDSKY v1.4.5
Loading package BEAST v2.6.1
t82_0: 5000 4

...

Start likelihood: -10843.63302484645
Writing file 1_s_f.log
Writing file 1_s_f.trees
         Sample      posterior     likelihood          prior
              0    -10843.6330    -10768.6374       -74.9955 --
           1000     -9928.8676     -9865.9374       -62.9302 --
           2000     -9929.6049     -9862.7149       -66.8900 --

官方算例可以前往 https://www.beast2.org/tutorials/ 学习。

以后用

可以将如下代码写在 ~/.bashrc 文件中,下回登陆即可自动加载 beast 了。

beast_root=/path/to/beast # 请修改为beast的安装路径!!!!
export PATH=$beast_root/bin:$PATH
export LD_LIBRARY_PATH=$beast_lib/lib:$LD_LIBRARY_PATH
export JAVA_HOME=$beast_root/jre1.8.0_212
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar