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.
Using all default settings, only specify a DNA alignment.
[No screenshot, as this cannot be done in BEAUti yet]
create_beast2_input_file_1_12(
"my_fasta.fas",
"my_beast.xml",
fixed_crown_age = TRUE,
initial_phylogenies = fasta_to_phylo(
fasta_filename = "my_fasta.fas",
crown_age = 15)
)
create_beast2_input_file(
"my_fasta.fas",
"my_beast.xml",
posterior_crown_age = 15
)
fasta_to_phylo
creates a random phylogeny from
a FASTA file of a certain crown age.
create_beast2_input_file(
"my_alignment.fas",
"my_beast.xml",
site_models = create_jc69_site_model()
)
create_beast2_input_file(
"my_alignment.fas",
"my_beast.xml",
clock_models = create_rln_clock_model()
)
create_beast2_input_file(
"my_alignment.fas",
"my_beast.xml",
tree_priors = create_bd_tree_prior()
)
create_beast2_input_file(
"my_alignment.fas",
"my_beast.xml",
tree_priors = 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_models = 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_models = create_strict_clock_model(
clock_rate_param = create_clock_rate_param(value = 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_priors = create_mrca_prior(
alignment_id = get_alignment_id("my_alignment.fas"),
taxa_names = get_taxa_names("my_alignment.fas")
)
)
create_beast2_input_file(
"my_alignment.fas",
"my_beast.xml",
mrca_priors = create_mrca_prior(
alignment_id = get_alignment_id("my_alignment.fas"),
taxa_names = get_taxa_names("my_alignment.fas"),
mrca_distr = create_normal_distr(
mean = create_mean_param(value = 10.0),
sigma = create_sigma_param(value = 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_priors = create_mrca_prior(
alignment_id = get_alignment_id("my_alignment.fas"),
taxa_names = get_taxa_names("my_alignment.fas"),
is_monophyletic = TRUE,
mrca_distr = create_normal_distr(
mean = create_mean_param(value = crown_age),
sigma = create_sigma_param(value = 0.001)
)
)
)
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.
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.
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")
)
)
From v1.14
, 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.