Skip to content

Bayesian phylogenetics with BEAST

Bayesian Evolutionary Analysis by Sampling Trees (BEAST) is a software package that performs phylogenetic tree analysis with user specified molecular clock models using the widely popular Bayesian Markov chain Monte Carlo (MCMC) methods. BEAST has its origins in modeling pathogen evolution in near real time but is also popular for other phylogenetic applications. BEAST is a well documented and flexible tool for modeling phylogenetics. Using BEAST at CARC offers more power for rigorous computations.

Generating BEAST input files: BEAUti

BEAST uses .xml files which contain sequences and model parameters. Because BEAST is capable of incorporating a diverse range of meta data and specific time modeling parameters, the graphical user interface BEAUTi allows users to upload nexus files and create .xml files with ease. Make sure that the version of beast in the module you load matches the version of BEAUTi used to generate the .xml files.

Running BEAST on Easley

Once a .xml file is generated, beast can be easily run on CARC. An example Slurm script is as follows:

#!/bin/bash

#SBATCH --job-name BEASTjob
#SBATCH --partition general
#SBATCH --nodes 1
#SBATCH --ntasks-per-node 8
#SBATCH --time 24:00:00
#SBATCH --output BEASTjob.out
#SBATCH --error BEASTjob.err

cd $SLURM_SUBMIT_DIR

module load llvm/17.0.6-ahyd
module load beast2/2.7.4-mh57

# Compute nodes don't have Java installed, and the beast2 module doesn't pull it in
# for you, so you need to bring your own. Get one from conda:
module load miniconda3/latest
source activate java_env

beast my_data.xml

Set up java_env once beforehand with conda create -n java_env -c conda-forge openjdk=17.

Submit it with sbatch beast_job.sh.

The output should be a job log (joined with any potential error file), and a .tree file for your downstream analysis. For more assistance with BEAST at CARC please email help@carc.unm.edu.

Migrated from UNM-CARC QuickBytes (last source update 2019-10-15). Spotted a problem? Open an issue or pull request.

Machine-readable versions of this page: Markdown twin · raw source on GitHub · llms.txt · llms-full.txt (whole site). See For AI agents.