This vignette is a tutorial how to use
babette and its most important
The main function of
bbt_run_from_model. Here is part of its help:
Do a full run: create a 'BEAST2' configuration file (like BEAUti 2), run 'BEAST2', parse results (like Tracer) Usage bbt_run_from_model( fasta_filename, inference_model, beast2_options )
Simplifying this to all arguments that do not have a default:
bbt_run_from_model( fasta_filename )
fasta_filename is the argument to specify which FASTA file to work on.
babette is bundled with some FASTA files, so obtaining a path to a FASTA file is easy:
fasta_filename available, we have the minimal requirements to call
bbt_run_from_model like this:
out <- bbt_run_from_model(fasta_filename)
Note that this code is not ran, as it would take too long. The reason this would take too long, is that the MCMC run that will be executed is set to one million states by default. To specify the MCMC options and shorten this run, the
mcmc argument is used.
The inference run’s MCMC is part of the inference model. To get an inference model with a short MCMC, create a test inference model like this:
mcmc is the
inference_model argument to specify the MCMC run options:
With these MCMC options, we can now call
bbt_run_from_model in way that it will finish fast:
The return value,
out contains the results of the MCMC run. For this tutorial, visualizing
out is ignored, as the ‘Demo’ vignette discusses this. Instead, we will work through the other
site_model is the
inference_model parameter for a site model. As this tutorial works on a DNA alignment, such a site model can also be called a nucleotide substitution model.
Picking a site model is easy: just type:
This will trigger auto-complete to show all site models.
The simplest site model is the Jukes-Cantor DNA substitution model. To use this model in
Using this site model:
clock_models is the
inference_model parameter for a clock model.
Picking a clock model is easy: just type:
This will trigger auto-complete to show all clock models.
The simplest site model is the strict clock model. To use this model in
Using this clock model:
tree_prior is the
inference_model parameter to select a tree prior.
Picking a tree prior is easy: just type:
This will trigger auto-complete to show all tree priors.
The simplest tree prior is the Yule (pure-birth) tree prior. To use this model in
Using this tree prior:
mrca_priors is the
inference_model parameter to use a Most Recent Common Ancestor (hence, MRCA) prior. With such a prior, it can be specified which taxa have a shared common ancestor and when it existed.
Here is how to specify that the first two taxa in a FASTA file are sister species:
To specify when the MRCA of all taxa was present, we’ll first create a prior distribution of the crown age, after which we can use that distribution.
To assume the crown age to follow a normal distribution, with a mean of 15.0 (time units), with a standard deviation of 1.0, use
To use that distribution in our MRCA prior:
Using such an MRCA prior: