For all examples, do load beautier
:
library(beautier)
All examples read the alignment from a FASTA file (usually my_fasta.fas
)
and create a BEAST2 input file called my_beast.xml
.
Using all default settings, only specify a DNA alignment.
create_beast2_input_file(
"test_output_0.fas",
"my_beast.xml"
)
All other parameters are set to their defaults, as in BEAUti.
create_beast2_input_file(
"my_alignment.fas",
"my_beast.xml",
site_model = create_jc69_site_model()
)
create_beast2_input_file(
"my_alignment.fas",
"my_beast.xml",
clock_model = create_rln_clock_model()
)
create_beast2_input_file(
"my_alignment.fas",
"my_beast.xml",
tree_prior = create_bd_tree_prior()
)
create_beast2_input_file(
"my_alignment.fas",
"my_beast.xml",
tree_prior = create_yule_tree_prior(
birth_rate_distr = create_normal_distr()
)
)
Thanks to Yacine Ben Chehida for this use case
create_beast2_input_file(
"my_alignment.fas",
"my_beast.xml",
site_model = create_hky_site_model(
gamma_site_model = create_gamma_site_model(prop_invariant = 0.5)
)
)
Thanks to Yacine Ben Chehida for this use case
create_beast2_input_file(
"my_alignment.fas",
"my_beast.xml",
clock_model = create_strict_clock_model(
clock_rate_param = 0.5
)
)
Thanks to Paul van Els and Yacine Ben Chehida for this use case.
Since v1.13
it is supported to specify
an MRCA ('Most Recent Common Ancestor') prior.
create_beast2_input_file(
"my_alignment.fas",
"my_beast.xml",
mrca_prior = create_mrca_prior()
)
create_beast2_input_file(
"my_alignment.fas",
"my_beast.xml",
mrca_prior = create_mrca_prior(
mrca_distr = create_normal_distr(
mean = 10.0,
sigma = 0.01
)
)
)
Since v1.13
it is supported to specify
an MRCA ('Most Recent Common Ancestor') prior.
With an MRCA prior, it is possible to specify a close-to-fixed crown age:
crown_age <- 15
create_beast2_input_file(
"my_alignment.fas",
"my_beast.xml",
mrca_prior = create_mrca_prior(
is_monophyletic = TRUE,
mrca_distr = create_normal_distr(
mean = crown_age,
sigma = 0.001
)
)
)
# Deprecated support for now
if (1 == 2) {
create_beast2_input_file(
c("anthus_aco.fas", "anthus_nd2.fas"),
"my_beast.xml"
)
}
Thanks to Paul van Els for this use case and supplying these FASTA files.
# Deprecated support for now
beautier::create_beast2_input_file(
c("anthus_aco.fas", "anthus_nd2.fas"),
"my_beast.xml",
site_models = list(
create_hky_site_model(),
create_tn93_site_model()
)
)
Since v1.12
this it is supported to have two alignments with different site models, clock models and tree priors.
Thanks to Paul van Els for this use case.
# Deprecated support for now
if (1 == 2) {
beautier::create_beast2_input_file(
c("anthus_aco.fas", "anthus_nd2.fas"),
"my_beast.xml",
clock_models = list(
create_strict_clock_model(id = "anthus_aco"),
create_strict_clock_model(id = "anthus_aco")
)
)
}
In a future version, it will be supported to have two alignments with shared site models, clock models and tree priors.
Thanks to Yacine Ben Chehida for this use case.