Create a BEAST2 XML input text

create_beast2_input(
  input_filename,
  tipdates_filename = NA,
  site_model = beautier::create_jc69_site_model(),
  clock_model = beautier::create_strict_clock_model(),
  tree_prior = beautier::create_yule_tree_prior(),
  mrca_prior = NA,
  mcmc = beautier::create_mcmc(),
  beauti_options = beautier::create_beauti_options()
)

Arguments

input_filename

A FASTA filename. Use get_fasta_filename to obtain a testing FASTA filename.

tipdates_filename

name of the file containing the tip dates. This file is assumed to have two columns, separated by a tab. The first column contains the taxa names, the second column contains the date.

site_model

a site model, as returned by create_site_model

clock_model

a clock model, as returned by create_clock_model

tree_prior

a tree priors, as returned by create_tree_prior

mrca_prior

a Most Recent Common Ancestor prior, as returned by create_mrca_prior

mcmc

one MCMC. Use create_mcmc to create an MCMC. Use create_ns_mcmc to create an MCMC for a Nested Sampling run. Use check_mcmc to check if an MCMC is valid. Use rename_mcmc_filenames to rename the filenames in an MCMC.

beauti_options

one BEAUti options object, as returned by create_beauti_options

Value

a character vector of XML strings

See also

Use create_beast2_input_from_model to create the BEAST2 XML input text from an inference model Use create_beast2_input_file to also save it to file.

create_beast2_input_file shows more examples

Author

Richèl J.C. Bilderbeek

Examples

  text <- create_beast2_input(
    input_filename = get_fasta_filename()
  )
  testit::assert(substr(text[1], 1, 5) == "<?xml")
  text[1]
#> [1] "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?><beast beautitemplate='Standard' beautistatus='' namespace=\"beast.core:beast.evolution.alignment:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood\" required=\"\" version=\"2.4\">"
  testit::assert(tail(text, n = 1) == "</beast>")