Title: | 'BEAUti' from R |
---|---|
Description: | 'BEAST2' (<https://www.beast2.org>) is a widely used Bayesian phylogenetic tool, that uses DNA/RNA/protein data and many model priors to create a posterior of jointly estimated phylogenies and parameters. 'BEAUti 2' (which is part of 'BEAST2') is a GUI tool that allows users to specify the many possible setups and generates the XML file 'BEAST2' needs to run. This package provides a way to create 'BEAST2' input files without active user input, but using R function calls instead. |
Authors: | Richèl J.C. Bilderbeek [aut, cre] , Joëlle Barido-Sottani [rev] (Joëlle reviewed the package for rOpenSci, see https://github.com/ropensci/onboarding/issues/209), David Winter [rev] (David reviewed the package for rOpenSci, see https://github.com/ropensci/onboarding/issues/209), Paul Van Els [ctb] , Raphael Scherrer [ctb] , Yacine B. Chehida [ctb] , Katharine S. Walter [ctb] , Gary Napier [ctb] , Jason Griffiths [ctb] , Thijs Janzen [ctb] , Pedro Taucce [ctb] , Olivier Roy [ctb], Jana Riederer [ctb] |
Maintainer: | Richèl J.C. Bilderbeek <[email protected]> |
License: | GPL-3 |
Version: | 2.6.13 |
Built: | 2024-12-05 04:42:27 UTC |
Source: | https://github.com/ropensci/beautier |
Converts an alpha parameter to XML
alpha_parameter_to_xml(alpha_parameter, beauti_options)
alpha_parameter_to_xml(alpha_parameter, beauti_options)
alpha_parameter |
an alpha parameter, as created by create_alpha_param |
beauti_options |
one BEAUti options object,
as returned by |
the parameter as XML text
Richèl J.C. Bilderbeek
remove_beautier_folder() check_empty_beautier_folder() # The alpha parameter must be initialized, i.e. have an ID alpha_parameter_to_xml( alpha_parameter = create_alpha_param(id = "1"), beauti_options = create_beauti_options() ) check_empty_beautier_folder()
remove_beautier_folder() check_empty_beautier_folder() # The alpha parameter must be initialized, i.e. have an ID alpha_parameter_to_xml( alpha_parameter = create_alpha_param(id = "1"), beauti_options = create_beauti_options() ) check_empty_beautier_folder()
Determine if x consists out of clock_models objects
are_clock_models(x)
are_clock_models(x)
x |
the object to check if it consists out of clock_models objects |
TRUE if x, or all elements of x, are clock_model objects
Richèl J.C. Bilderbeek
check_empty_beautier_folder() rln_clock_model <- create_rln_clock_model() strict_clock_model <- create_strict_clock_model() both_clock_models <- list(rln_clock_model, strict_clock_model) # TRUE are_clock_models(rln_clock_model) are_clock_models(strict_clock_model) are_clock_models(both_clock_models) # FALSE are_clock_models(NA) are_clock_models(NULL) are_clock_models("nonsense") are_clock_models(create_jc69_site_model()) check_empty_beautier_folder()
check_empty_beautier_folder() rln_clock_model <- create_rln_clock_model() strict_clock_model <- create_strict_clock_model() both_clock_models <- list(rln_clock_model, strict_clock_model) # TRUE are_clock_models(rln_clock_model) are_clock_models(strict_clock_model) are_clock_models(both_clock_models) # FALSE are_clock_models(NA) are_clock_models(NULL) are_clock_models("nonsense") are_clock_models(create_jc69_site_model()) check_empty_beautier_folder()
Will stop if the arguments are not MCMCs.
are_equal_mcmcs(mcmc_1, mcmc_2)
are_equal_mcmcs(mcmc_1, mcmc_2)
mcmc_1 |
an MCMC, as created by |
mcmc_2 |
an MCMC, as created by |
TRUE if the two MCMCs are equal
Richèl J.C. Bilderbeek
Use create_mcmc
to create an MCMC
if (is_on_ci()) { check_empty_beautier_folder() mcmc_1 <- create_mcmc(chain_length = 1000) mcmc_2 <- create_mcmc(chain_length = 314) # TRUE are_equal_mcmcs(mcmc_1, mcmc_1) # FALSE are_equal_mcmcs(mcmc_1, mcmc_2) check_empty_beautier_folder() }
if (is_on_ci()) { check_empty_beautier_folder() mcmc_1 <- create_mcmc(chain_length = 1000) mcmc_2 <- create_mcmc(chain_length = 314) # TRUE are_equal_mcmcs(mcmc_1, mcmc_1) # FALSE are_equal_mcmcs(mcmc_1, mcmc_2) check_empty_beautier_folder() }
Will stop if the arguments are not screenlogs.
are_equal_screenlogs(screenlog_1, screenlog_2)
are_equal_screenlogs(screenlog_1, screenlog_2)
screenlog_1 |
an screenlog, as created by create_screenlog |
screenlog_2 |
an screenlog, as created by create_screenlog |
TRUE if the two screenlogs are equal
Richèl J.C. Bilderbeek
Use create_screenlog to create an screenlog
check_empty_beautier_folder() screenlog_1 <- create_screenlog(log_every = 1000) screenlog_2 <- create_screenlog(log_every = 314) # TRUE are_equal_screenlogs(screenlog_1, screenlog_1) # FALSE are_equal_screenlogs(screenlog_1, screenlog_2) check_empty_beautier_folder()
check_empty_beautier_folder() screenlog_1 <- create_screenlog(log_every = 1000) screenlog_2 <- create_screenlog(log_every = 314) # TRUE are_equal_screenlogs(screenlog_1, screenlog_1) # FALSE are_equal_screenlogs(screenlog_1, screenlog_2) check_empty_beautier_folder()
Will stop if the arguments are not tracelogs.
are_equal_tracelogs(tracelog_1, tracelog_2)
are_equal_tracelogs(tracelog_1, tracelog_2)
tracelog_1 |
an tracelog, as created by create_tracelog |
tracelog_2 |
an tracelog, as created by create_tracelog |
TRUE if the two tracelogs are equal
Richèl J.C. Bilderbeek
Use create_tracelog to create an tracelog
check_empty_beautier_folder() tracelog_1 <- create_tracelog(log_every = 1000) tracelog_2 <- create_tracelog(log_every = 314) # TRUE are_equal_tracelogs(tracelog_1, tracelog_1) # FALSE are_equal_tracelogs(tracelog_1, tracelog_2) check_empty_beautier_folder()
check_empty_beautier_folder() tracelog_1 <- create_tracelog(log_every = 1000) tracelog_2 <- create_tracelog(log_every = 314) # TRUE are_equal_tracelogs(tracelog_1, tracelog_1) # FALSE are_equal_tracelogs(tracelog_1, tracelog_2) check_empty_beautier_folder()
Will stop if the arguments are not treelogs.
are_equal_treelogs(treelog_1, treelog_2)
are_equal_treelogs(treelog_1, treelog_2)
treelog_1 |
an treelog, as created by create_treelog |
treelog_2 |
an treelog, as created by create_treelog |
TRUE if the two treelogs are equal
Richèl J.C. Bilderbeek
Use create_treelog to create an treelog
check_empty_beautier_folder() treelog_1 <- create_treelog(log_every = 1000) treelog_2 <- create_treelog(log_every = 314) # TRUE are_equal_treelogs(treelog_1, treelog_1) # FALSE are_equal_treelogs(treelog_1, treelog_2) check_empty_beautier_folder()
check_empty_beautier_folder() treelog_1 <- create_treelog(log_every = 1000) treelog_2 <- create_treelog(log_every = 314) # TRUE are_equal_treelogs(treelog_1, treelog_1) # FALSE are_equal_treelogs(treelog_1, treelog_2) check_empty_beautier_folder()
Determine if XML files result in equal trees
are_equal_xml_files(filename_1, filename_2, section)
are_equal_xml_files(filename_1, filename_2, section)
filename_1 |
name of a first XML file |
filename_2 |
name of a second XML file |
section |
name of an XML section.
Assumes that there is one line that starts with |
TRUE if the two sections of the XML files are equal, FALSE otherwise
Richèl J.C. Bilderbeek
to check for equivalence, use are_equivalent_xml_files
check_empty_beautier_folder() are_equal_xml_files( filename_1 = get_beautier_path("2_4.xml"), filename_2 = get_beautier_path("2_6_0.xml"), section = "taxonset" ) check_empty_beautier_folder()
check_empty_beautier_folder() are_equal_xml_files( filename_1 = get_beautier_path("2_4.xml"), filename_2 = get_beautier_path("2_6_0.xml"), section = "taxonset" ) check_empty_beautier_folder()
Determine if XML lines result in equal trees
are_equal_xml_lines(lines_1, lines_2, section)
are_equal_xml_lines(lines_1, lines_2, section)
lines_1 |
lines of a first XML file |
lines_2 |
lines of a second XML file |
section |
name of an XML section.
Assumes that there is one line that starts with |
TRUE if the two sections of the XML files are equal, FALSE otherwise
Richèl J.C. Bilderbeek
check_empty_beautier_folder() are_equal_xml_lines( lines_1 = readLines(get_beautier_path("2_4.xml")), lines_2 = readLines(get_beautier_path("2_6_0.xml")), section = "taxonset" ) check_empty_beautier_folder()
check_empty_beautier_folder() are_equal_xml_lines( lines_1 = readLines(get_beautier_path("2_4.xml")), lines_2 = readLines(get_beautier_path("2_6_0.xml")), section = "taxonset" ) check_empty_beautier_folder()
Internal function used for debugging to determine if XML files result in equivalent trees
are_equivalent_xml_files(filename_1, filename_2, section = NA)
are_equivalent_xml_files(filename_1, filename_2, section = NA)
filename_1 |
name of a first XML file |
filename_2 |
name of a second XML file |
section |
the name of the XML section, use NA to check the whole file |
TRUE if the two XML files result in equivalent trees, FALSE otherwise
Richèl J.C. Bilderbeek
to check for equality, use are_equal_xml_files
check_empty_beautier_folder() are_equivalent_xml_files( filename_1 = get_beautier_path("2_4.xml"), filename_2 = get_beautier_path("2_6_0.xml") ) check_empty_beautier_folder()
check_empty_beautier_folder() are_equivalent_xml_files( filename_1 = get_beautier_path("2_4.xml"), filename_2 = get_beautier_path("2_6_0.xml") ) check_empty_beautier_folder()
Determine if XML lines result in equivalent trees
are_equivalent_xml_lines(lines_1, lines_2, section = NA, verbose = FALSE)
are_equivalent_xml_lines(lines_1, lines_2, section = NA, verbose = FALSE)
lines_1 |
lines of a first XML file |
lines_2 |
lines of a second XML file |
section |
the name of the XML section |
verbose |
if TRUE, additional information is displayed, that is potentially useful in debugging |
TRUE if the two XML lines result in equivalent trees, FALSE otherwise
Richèl J.C. Bilderbeek
Determine if XML lines result in equivalent trees
are_equivalent_xml_lines_all(lines_1, lines_2, verbose = FALSE)
are_equivalent_xml_lines_all(lines_1, lines_2, verbose = FALSE)
lines_1 |
lines of a first XML file |
lines_2 |
lines of a second XML file |
verbose |
if TRUE, additional information is displayed, that is potentially useful in debugging |
TRUE if the two XML lines result in equivalent trees, FALSE otherwise
Richèl J.C. Bilderbeek
Determine if XML operator lines result in equivalent trees
are_equivalent_xml_lines_loggers(lines_1, lines_2, verbose = FALSE)
are_equivalent_xml_lines_loggers(lines_1, lines_2, verbose = FALSE)
lines_1 |
lines of a first XML file |
lines_2 |
lines of a second XML file |
verbose |
if TRUE, additional information is displayed, that is potentially useful in debugging |
TRUE if the two XML lines result in equivalent trees, FALSE otherwise
Richèl J.C. Bilderbeek
Determine if XML operator lines result in equivalent trees
are_equivalent_xml_lines_operators(lines_1, lines_2, verbose = FALSE)
are_equivalent_xml_lines_operators(lines_1, lines_2, verbose = FALSE)
lines_1 |
lines of a first XML file |
lines_2 |
lines of a second XML file |
verbose |
if TRUE, additional information is displayed, that is potentially useful in debugging |
TRUE if the two XML lines result in equivalent trees, FALSE otherwise
Richèl J.C. Bilderbeek
Determine if XML lines result in equivalent trees
are_equivalent_xml_lines_section(lines_1, lines_2, section, verbose = FALSE)
are_equivalent_xml_lines_section(lines_1, lines_2, section, verbose = FALSE)
lines_1 |
lines of a first XML file |
lines_2 |
lines of a second XML file |
section |
the name of the XML section |
verbose |
if TRUE, additional information is displayed, that is potentially useful in debugging |
TRUE if the two XML lines result in equivalent trees, FALSE otherwise
Richèl J.C. Bilderbeek
Checks if all filenames have a FASTA filename extension
are_fasta_filenames(filenames)
are_fasta_filenames(filenames)
filenames |
filenames |
TRUE if all filenames have a FASTA filename extension
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # TRUE are_fasta_filenames("1.fas") are_fasta_filenames("1.fasta") are_fasta_filenames("1.FAS") are_fasta_filenames("1.FASTA") are_fasta_filenames(c("1.fas", "2.fas")) # FALSE are_fasta_filenames("") are_fasta_filenames(NA) are_fasta_filenames(NULL) are_fasta_filenames(Inf) are_fasta_filenames("1.fasX") are_fasta_filenames(c("1.fas", "2.exe")) are_fasta_filenames(c("1.bat", "2.exe")) check_empty_beautier_folder()
check_empty_beautier_folder() # TRUE are_fasta_filenames("1.fas") are_fasta_filenames("1.fasta") are_fasta_filenames("1.FAS") are_fasta_filenames("1.FASTA") are_fasta_filenames(c("1.fas", "2.fas")) # FALSE are_fasta_filenames("") are_fasta_filenames(NA) are_fasta_filenames(NULL) are_fasta_filenames(Inf) are_fasta_filenames("1.fasX") are_fasta_filenames(c("1.fas", "2.exe")) are_fasta_filenames(c("1.bat", "2.exe")) check_empty_beautier_folder()
Determine if x consists out of IDs
are_ids(x)
are_ids(x)
x |
the object to check if it consists out of IDs |
TRUE if x, or all elements of x, are IDs
Richèl J.C. Bilderbeek
to check one ID, use is_id
check_empty_beautier_folder() # TRUE are_ids("anthus_aco") are_ids(c("anthus_aco", "anthus_nd2")) are_ids(list("anthus_aco", "anthus_nd2")) are_ids(c(1, 2)) are_ids(1) # FALSE are_ids(NULL) are_ids(NA) are_ids(c()) are_ids(ape::rcoal(3)) are_ids(c(ape::rcoal(3), ape::rcoal(4))) check_empty_beautier_folder()
check_empty_beautier_folder() # TRUE are_ids("anthus_aco") are_ids(c("anthus_aco", "anthus_nd2")) are_ids(list("anthus_aco", "anthus_nd2")) are_ids(c(1, 2)) are_ids(1) # FALSE are_ids(NULL) are_ids(NA) are_ids(c()) are_ids(ape::rcoal(3)) are_ids(c(ape::rcoal(3), ape::rcoal(4))) check_empty_beautier_folder()
Determine if x consists out of initialized clock_models objects
are_init_clock_models(x)
are_init_clock_models(x)
x |
the object to check if it consists out of initialized clock_models objects |
TRUE if x, or all elements of x, are initialized clock_model objects
Richèl J.C. Bilderbeek
Determine if x consists out of initialized MRCA priors
are_init_mrca_priors(x)
are_init_mrca_priors(x)
x |
the object to check if it consists out of initialized MRCA priors |
TRUE if x, or all elements of x, are initialized MRCA priors
Richèl J.C. Bilderbeek
Determine if x consists out of initialized site_models objects
are_init_site_models(x)
are_init_site_models(x)
x |
the object to check if it consists out of initialized site_models objects |
TRUE if x, or all elements of x, are initialized site_model objects
Richèl J.C. Bilderbeek
Determine if x consists out of initialized tree_priors objects
are_init_tree_priors(x)
are_init_tree_priors(x)
x |
the object to check if it consists out of initialized tree_priors objects |
TRUE if x, or all elements of x, are initialized tree_prior objects
Richèl J.C. Bilderbeek
Determine if the MRCA priors' alignment IDs are present in the FASTA files
are_mrca_align_ids_in_fasta(mrca_prior, fasta_filename)
are_mrca_align_ids_in_fasta(mrca_prior, fasta_filename)
mrca_prior |
a Most Recent Common Ancestor prior,
as returned by |
fasta_filename |
a FASTA filename.
Use |
TRUE if all the MRCA priors' alignment IDs are present in the FASTA files. Returns FALSE otherwise
Richèl J.C. Bilderbeek
Determine if x consists out of MRCA priors
are_mrca_priors(mrca_priors)
are_mrca_priors(mrca_priors)
mrca_priors |
a list of one or more Most Recent Common Ancestor priors,
as returned by |
TRUE if x, or all elements of x, are MRCA priors. Returns FALSE otherwise
Richèl J.C. Bilderbeek
Determine if the MRCA priors' taxa names are present in the FASTA files
are_mrca_taxon_names_in_fasta(mrca_prior, fasta_filename)
are_mrca_taxon_names_in_fasta(mrca_prior, fasta_filename)
mrca_prior |
a Most Recent Common Ancestor prior,
as returned by |
fasta_filename |
a FASTA filename.
Use |
TRUE if the MRCA priors' taxa names are present in the FASTA files. FALSE otherwise.
Richèl J.C. Bilderbeek
Are the clock models Relaxed Log-Normal clock models?
are_rln_clock_models(clock_models)
are_rln_clock_models(clock_models)
clock_models |
a list of one or more clock models,
as returned by |
vector of booleans with the same length
as the number of clock models in clock_models
.
Each nth element is TRUE if the nth element
in clock_models
is a relaxed log-normal
clock model, FALSE otherwise
Richèl J.C. Bilderbeek
Determine if x consists out of site_models objects
are_site_models(x)
are_site_models(x)
x |
the object to check if it consists out of site_models objects |
TRUE if x, or all elements of x, are site_model objects
Richèl J.C. Bilderbeek
Use create_site_model to create a site model
check_empty_beautier_folder() jc69_site_model <- create_jc69_site_model() gtr_site_model <- create_gtr_site_model() both_site_models <- list(jc69_site_model, gtr_site_model) # TRUE are_site_models(jc69_site_model) # TRUE are_site_models(gtr_site_model) # TRUE are_site_models(both_site_models) check_empty_beautier_folder()
check_empty_beautier_folder() jc69_site_model <- create_jc69_site_model() gtr_site_model <- create_gtr_site_model() both_site_models <- list(jc69_site_model, gtr_site_model) # TRUE are_site_models(jc69_site_model) # TRUE are_site_models(gtr_site_model) # TRUE are_site_models(both_site_models) check_empty_beautier_folder()
Determine if x consists out of tree_priors objects
are_tree_priors(x)
are_tree_priors(x)
x |
the object to check if it consists out of tree_priors objects |
TRUE if x, or all elements of x, are tree_prior objects
Richèl J.C. Bilderbeek
Use create_yule_tree_prior to create a Yule tree prior
check_empty_beautier_folder() yule_tree_prior <- create_yule_tree_prior() bd_tree_prior <- create_bd_tree_prior() both_tree_priors <- list(yule_tree_prior, bd_tree_prior) # TRUE are_tree_priors(yule_tree_prior) # TRUE are_tree_priors(bd_tree_prior) # TRUE are_tree_priors(both_tree_priors) check_empty_beautier_folder()
check_empty_beautier_folder() yule_tree_prior <- create_yule_tree_prior() bd_tree_prior <- create_bd_tree_prior() both_tree_priors <- list(yule_tree_prior, bd_tree_prior) # TRUE are_tree_priors(yule_tree_prior) # TRUE are_tree_priors(bd_tree_prior) # TRUE are_tree_priors(both_tree_priors) check_empty_beautier_folder()
Converts a 'bPopSizes' parameter to XML
b_pop_sizes_param_to_xml( b_pop_sizes_param, beauti_options = create_beauti_options() )
b_pop_sizes_param_to_xml( b_pop_sizes_param, beauti_options = create_beauti_options() )
b_pop_sizes_param |
a Bayesian population size parameter, as created by create_b_pop_sizes_param |
beauti_options |
one BEAUti options object,
as returned by |
the parameter as XML text
Richèl J.C. Bilderbeek
Converts a Bayesian population sizes parameter to XML
b_pop_sizes_parameter_to_xml( b_pop_sizes_parameter, beauti_options = create_beauti_options() )
b_pop_sizes_parameter_to_xml( b_pop_sizes_parameter, beauti_options = create_beauti_options() )
b_pop_sizes_parameter |
a Bayesian population size parameter, as created by create_b_pop_sizes_param |
beauti_options |
one BEAUti options object,
as returned by |
the parameter as XML text
Richèl J.C. Bilderbeek
b_pop_sizes_parameter_to_xml( b_pop_sizes_parameter = create_b_pop_sizes_param(id = 42), beauti_options = create_beauti_options() ) b_pop_sizes_parameter_to_xml( b_pop_sizes_parameter = create_b_pop_sizes_param(id = 42, upper = Inf), beauti_options = create_beauti_options() )
b_pop_sizes_parameter_to_xml( b_pop_sizes_parameter = create_b_pop_sizes_param(id = 42), beauti_options = create_beauti_options() ) b_pop_sizes_parameter_to_xml( b_pop_sizes_parameter = create_b_pop_sizes_param(id = 42, upper = Inf), beauti_options = create_beauti_options() )
Creates the tree prior section in the prior section of the prior section of the distribution section of a BEAST2 XML parameter file for a Birth-Death tree prior
bd_tree_prior_to_xml_prior_distr(bd_tree_prior, beauti_options)
bd_tree_prior_to_xml_prior_distr(bd_tree_prior, beauti_options)
bd_tree_prior |
a Birth-Death tree prior, as created
by |
beauti_options |
one BEAUti options object,
as returned by |
lines of XML text
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # <distribution id="posterior" spec="util.CompoundDistribution"> # <distribution id="prior" spec="util.CompoundDistribution"> # HERE, where the ID of the distribution is 'prior' # </distribution> # <distribution id="likelihood" ...> # </distribution> # </distribution> check_empty_beautier_folder()
check_empty_beautier_folder() # <distribution id="posterior" spec="util.CompoundDistribution"> # <distribution id="prior" spec="util.CompoundDistribution"> # HERE, where the ID of the distribution is 'prior' # </distribution> # <distribution id="likelihood" ...> # </distribution> # </distribution> check_empty_beautier_folder()
Converts a beta parameter to XML
beta_parameter_to_xml(beta_parameter, beauti_options = create_beauti_options())
beta_parameter_to_xml(beta_parameter, beauti_options = create_beauti_options())
beta_parameter |
a beta parameter, as created by create_beta_param |
beauti_options |
one BEAUti options object,
as returned by |
the parameter as XML text
Richèl J.C. Bilderbeek
Creates the tree prior section in the prior section of the prior section of the distribution section of a BEAST2 XML parameter file for a Birth-Death tree prior
cbs_tree_prior_to_xml_prior_distr(cbs_tree_prior, beauti_options)
cbs_tree_prior_to_xml_prior_distr(cbs_tree_prior, beauti_options)
cbs_tree_prior |
a Coalescent Bayesian Skyline tree prior,
as returned by |
beauti_options |
one BEAUti options object,
as returned by |
lines of XML text
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # <distribution id="posterior" spec="util.CompoundDistribution"> # <distribution id="prior" spec="util.CompoundDistribution"> # HERE, where the ID of the distribution is 'prior' # </distribution> # <distribution id="likelihood" ...> # </distribution> # </distribution> check_empty_beautier_folder()
check_empty_beautier_folder() # <distribution id="posterior" spec="util.CompoundDistribution"> # <distribution id="prior" spec="util.CompoundDistribution"> # HERE, where the ID of the distribution is 'prior' # </distribution> # <distribution id="likelihood" ...> # </distribution> # </distribution> check_empty_beautier_folder()
Creates the tree prior section in the prior section of the prior section of the distribution section of a BEAST2 XML parameter file for a Coalescent Constant Population tree prior
ccp_tree_prior_to_xml_prior_distr(ccp_tree_prior, beauti_options)
ccp_tree_prior_to_xml_prior_distr(ccp_tree_prior, beauti_options)
ccp_tree_prior |
a Coalescent Constant Population tree prior,
as returned by |
beauti_options |
one BEAUti options object,
as returned by |
lines of XML text
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # <distribution id="posterior" spec="util.CompoundDistribution"> # <distribution id="prior" spec="util.CompoundDistribution"> # HERE, where the ID of the distribution is 'prior' # </distribution> # <distribution id="likelihood" ...> # </distribution> # </distribution> check_empty_beautier_folder()
check_empty_beautier_folder() # <distribution id="posterior" spec="util.CompoundDistribution"> # <distribution id="prior" spec="util.CompoundDistribution"> # HERE, where the ID of the distribution is 'prior' # </distribution> # <distribution id="likelihood" ...> # </distribution> # </distribution> check_empty_beautier_folder()
state
sectionConvert a CCP tree prior
to the XML as part of the state
section
ccp_tree_prior_to_xml_state(inference_model)
ccp_tree_prior_to_xml_state(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
XML as text
check_empty_beautier_folder() # Need an ID and inital value inference_model <- create_inference_model( tree_prior = create_ccp_tree_prior( id = "anthus_nd2_sub", pop_size_distr = create_normal_distr( id = 123, value = 3.14 ) ) ) ccp_tree_prior_to_xml_state(inference_model) check_empty_beautier_folder()
check_empty_beautier_folder() # Need an ID and inital value inference_model <- create_inference_model( tree_prior = create_ccp_tree_prior( id = "anthus_nd2_sub", pop_size_distr = create_normal_distr( id = 123, value = 3.14 ) ) ) ccp_tree_prior_to_xml_state(inference_model) check_empty_beautier_folder()
Creates the tree prior section in the prior section of the prior section of the distribution section of a BEAST2 XML parameter file for a Coalescent Exponential Population tree prior
cep_tree_prior_to_xml_prior_distr(cep_tree_prior, beauti_options)
cep_tree_prior_to_xml_prior_distr(cep_tree_prior, beauti_options)
cep_tree_prior |
a Coalescent Exponential Population tree prior,
as returned by |
beauti_options |
one BEAUti options object,
as returned by |
lines of XML text
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # <distribution id="posterior" spec="util.CompoundDistribution"> # <distribution id="prior" spec="util.CompoundDistribution"> # HERE, where the ID of the distribution is 'prior' # </distribution> # <distribution id="likelihood" ...> # </distribution> # </distribution> check_empty_beautier_folder()
check_empty_beautier_folder() # <distribution id="posterior" spec="util.CompoundDistribution"> # <distribution id="prior" spec="util.CompoundDistribution"> # HERE, where the ID of the distribution is 'prior' # </distribution> # <distribution id="likelihood" ...> # </distribution> # </distribution> check_empty_beautier_folder()
alignment_id
is valid.Will stop if not.
check_alignment_id(alignment_id)
check_alignment_id(alignment_id)
alignment_id |
ID of the alignment,
as returned by get_alignment_id.
Keep at |
nothing, will stop if needed
check_empty_beautier_folder() # anthus_aco_sub alignment_id <- get_alignment_id("/home/homer/anthus_aco_sub.fas") check_alignment_id(alignment_id) check_empty_beautier_folder()
check_empty_beautier_folder() # anthus_aco_sub alignment_id <- get_alignment_id("/home/homer/anthus_aco_sub.fas") check_alignment_id(alignment_id) check_empty_beautier_folder()
beauti_options
is a valid beauti_options
object.Calls stop
if the beauti_options
object is invalid
check_beauti_options(beauti_options)
check_beauti_options(beauti_options)
beauti_options |
one BEAUti options object,
as returned by |
nothing
Richèl J.C. Bilderbeek
Use create_beauti_options to create a valid BEAUti options setup
check_empty_beautier_folder() check_beauti_options(create_beauti_options()) check_empty_beautier_folder()
check_empty_beautier_folder() check_beauti_options(create_beauti_options()) check_empty_beautier_folder()
Calls stop
if the clock model is invalid
check_clock_model(clock_model)
check_clock_model(clock_model)
clock_model |
a clock model,
as returned by |
TRUE if clock_model
is a valid clock model
Richèl J.C. Bilderbeek
Use create_clock_model to create a valid clock model
check_empty_beautier_folder() check_clock_model(create_strict_clock_model()) check_clock_model(create_rln_clock_model()) check_empty_beautier_folder()
check_empty_beautier_folder() check_clock_model(create_strict_clock_model()) check_clock_model(create_rln_clock_model()) check_empty_beautier_folder()
Will stop if the object is not a list of one or more clock models.
check_clock_models(clock_models)
check_clock_models(clock_models)
clock_models |
the object to be checked if it is a list of one or more valid clock models |
nothing. Will stop if the object is not a list of one or more clock models.
Richèl J.C. Bilderbeek
Use create_clock_model to create a valid clock model
check_empty_beautier_folder() check_clock_models(create_strict_clock_model()) check_clock_models(list(create_strict_clock_model())) check_clock_models( list(create_strict_clock_model(), create_rln_clock_model()) ) check_empty_beautier_folder()
check_empty_beautier_folder() check_clock_models(create_strict_clock_model()) check_clock_models(list(create_strict_clock_model())) check_clock_models( list(create_strict_clock_model(), create_rln_clock_model()) ) check_empty_beautier_folder()
Internal function to verify that, if there are 'beautier' temporary files created, these are also cleaned up, as by CRAN policy.
check_empty_beautier_folder(beautier_folder = get_beautier_folder())
check_empty_beautier_folder(beautier_folder = get_beautier_folder())
beautier_folder |
the path to the beautier temporary files folder |
If the 'beautier' folder does not exist, this function does nothing. If there are folder and/or files in the 'beautier' folder, an error is given.
No return value, called for side effects.
Richèl J.C. Bilderbeek
use remove_beautier_folder to remove the default 'beautier' folder
remove_beautier_folder() check_empty_beautier_folder() remove_beautier_folder()
remove_beautier_folder() check_empty_beautier_folder() remove_beautier_folder()
Will stop if not
check_file_and_model_agree(input_filename, inference_model)
check_file_and_model_agree(input_filename, inference_model)
input_filename |
A FASTA filename.
Use |
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
nothing, will stop if needed
stop
if the file is absentFunction to check if a file exists.
Calls stop
if the file is absent
check_file_exists(filename, filename_description = NA)
check_file_exists(filename, filename_description = NA)
filename |
name of the file |
filename_description |
description of the filename |
nothing. Will stop
if the file is absent,
with a proper error message
Richèl J.C. Bilderbeek
check_empty_beautier_folder() check_file_exists(get_beautier_path("anthus_aco_sub.fas")) check_empty_beautier_folder()
check_empty_beautier_folder() check_file_exists(get_beautier_path("anthus_aco_sub.fas")) check_empty_beautier_folder()
Calls stop
if the filename is invalid
check_filename(filename, allow_empty_str = FALSE, allow_na = FALSE)
check_filename(filename, allow_empty_str = FALSE, allow_na = FALSE)
filename |
a filename, as can be checked by check_filename |
allow_empty_str |
allow a string to be empty |
allow_na |
allow NA |
The filename (invisibly)
Richèl J.C. Bilderbeek
check_empty_beautier_folder() check_filename("trace.log") check_filename("my.trees") check_empty_beautier_folder()
check_empty_beautier_folder() check_filename("trace.log") check_filename("my.trees") check_empty_beautier_folder()
Checks if the parameter is a valid gamma site model
check_gamma_site_model(gamma_site_model)
check_gamma_site_model(gamma_site_model)
gamma_site_model |
a site model's gamma site model,
as returned by |
nothing. Will call stop
if the argument is not a valid
gamma site model
Richèl J.C. Bilderbeek
check_empty_beautier_folder() check_gamma_site_model(create_gamma_site_model()) check_empty_beautier_folder()
check_empty_beautier_folder() check_gamma_site_model(create_gamma_site_model()) check_empty_beautier_folder()
Checks if the gamma site model has the right list elements' names
check_gamma_site_model_names(gamma_site_model)
check_gamma_site_model_names(gamma_site_model)
gamma_site_model |
a site model's gamma site model,
as returned by |
nothing. Will call stop
if the argument is not a valid
gamma site model
Richèl J.C. Bilderbeek
gtr_site_model
is a valid
GTR nucleotide substitution model.Use create_gtr_site_model to create a valid GTR nucleotide substitution model.
check_gtr_site_model(gtr_site_model)
check_gtr_site_model(gtr_site_model)
gtr_site_model |
a GTR site model,
as returned by |
TRUE is the gtr_site_model
is a valid
GTR nucleotide substitution model, FALSE otherwise
check_empty_beautier_folder() check_gtr_site_model(create_gtr_site_model()) check_empty_beautier_folder()
check_empty_beautier_folder() check_gtr_site_model(create_gtr_site_model()) check_empty_beautier_folder()
gtr_site_model
has the list elements
of a valid gtr_site_model
object.Calls stop
if an element is missing
check_gtr_site_model_names(gtr_site_model)
check_gtr_site_model_names(gtr_site_model)
gtr_site_model |
a GTR site model,
as returned by |
nothing
Richèl J.C. Bilderbeek
Use create_gtr_site_model
to create a valid gtr_site_model
Calls stop
if the supplied object is not a valid
Bayesian phylogenetic inference model.
check_inference_model(inference_model)
check_inference_model(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
nothing
Richèl J.C. Bilderbeek
Use create_inference_model to create a valid Bayesian phylogenetic inference model
check_empty_beautier_folder() check_inference_model(create_inference_model()) check_empty_beautier_folder()
check_empty_beautier_folder() check_inference_model(create_inference_model()) check_empty_beautier_folder()
inference_model
is a valid BEAUti inference model.Calls stop
if not.
check_inference_models(inference_models)
check_inference_models(inference_models)
inference_models |
a list of one or more inference models, as can be created by create_inference_model |
nothing
Richèl J.C. Bilderbeek
Use create_inference_model to create a valid BEAST2 options object
check_empty_beautier_folder() check_inference_models(list(create_inference_model())) check_empty_beautier_folder()
check_empty_beautier_folder() check_inference_models(list(create_inference_model())) check_empty_beautier_folder()
is_monophyletic
has a valid value.Will stop if not.
check_is_monophyletic(is_monophyletic)
check_is_monophyletic(is_monophyletic)
is_monophyletic |
boolean to indicate monophyly is assumed in
a Most Recent Common Ancestor prior,
as returned by |
No return value, called for side effects
mode
is a valid logging mode.Check if the supplied mode
is a valid logging mode.
check_log_mode(mode)
check_log_mode(mode)
mode |
mode how to log.
Valid are |
No return value, called for side effects
sort
is a valid logging sorting option.Check if the supplied sort
is a valid logging sorting option.
check_log_sort(sort)
check_log_sort(sort)
sort |
how to sort the entries in a log.
Valid are |
No return value, called for side effects
Calls stop
if the MCMC is invalid
check_mcmc(mcmc)
check_mcmc(mcmc)
mcmc |
one MCMC.
Use |
nothing
Richèl J.C. Bilderbeek
Use create_mcmc
to create a valid MCMC
check_empty_beautier_folder() check_mcmc(create_mcmc()) check_empty_beautier_folder()
check_empty_beautier_folder() check_mcmc(create_mcmc()) check_empty_beautier_folder()
Calls stop
if an element is missing
check_mcmc_list_element_names(mcmc)
check_mcmc_list_element_names(mcmc)
mcmc |
one MCMC.
Use |
nothing
Richèl J.C. Bilderbeek
Use create_mcmc
to create a valid MCMC
Calls stop
if a value is invalid
check_mcmc_values(mcmc)
check_mcmc_values(mcmc)
mcmc |
one MCMC.
Use |
nothing
Richèl J.C. Bilderbeek
Use create_mcmc
to create a valid MCMC
Calls stop
if the MRCA prior is invalid.
check_mrca_prior(mrca_prior)
check_mrca_prior(mrca_prior)
mrca_prior |
a Most Recent Common Ancestor prior,
as returned by |
nothing
Richèl J.C. Bilderbeek
Use create_mrca_prior to create a valid MRCA prior
check_empty_beautier_folder() fasta_filename <- get_beautier_path("anthus_aco.fas") mrca_prior <- create_mrca_prior( alignment_id = get_alignment_id(fasta_filename = fasta_filename), taxa_names = get_taxa_names(filename = fasta_filename) ) mrca_prior <- create_mrca_prior( alignment_id = get_alignment_id(fasta_filename = fasta_filename), taxa_names = get_taxa_names(filename = fasta_filename) ) check_mrca_prior(mrca_prior) check_empty_beautier_folder()
check_empty_beautier_folder() fasta_filename <- get_beautier_path("anthus_aco.fas") mrca_prior <- create_mrca_prior( alignment_id = get_alignment_id(fasta_filename = fasta_filename), taxa_names = get_taxa_names(filename = fasta_filename) ) mrca_prior <- create_mrca_prior( alignment_id = get_alignment_id(fasta_filename = fasta_filename), taxa_names = get_taxa_names(filename = fasta_filename) ) check_mrca_prior(mrca_prior) check_empty_beautier_folder()
mrca_prior_name
is a valid MRCA prior name.A valid MRCA prior name is either NA or one character string. Will stop if not.
check_mrca_prior_name(mrca_prior_name)
check_mrca_prior_name(mrca_prior_name)
mrca_prior_name |
the unique name of the MRCA prior, for example a genus, family, order or even class name. Leave at NA to have it named automatically. |
No return value, called for side effects
Calls stop
if not.
check_mrca_prior_names(mrca_prior)
check_mrca_prior_names(mrca_prior)
mrca_prior |
a Most Recent Common Ancestor prior,
as returned by |
nothing
Richèl J.C. Bilderbeek
Use check_mrca_prior to check the entire MRCA prior
Will stop if not.
check_mrca_prior_taxa_names(taxa_names)
check_mrca_prior_taxa_names(taxa_names)
taxa_names |
names of the taxa,
as returned by |
No return value, called for side effects
Will stop if not, else will do nothing
check_ns_mcmc(mcmc)
check_ns_mcmc(mcmc)
mcmc |
one MCMC.
Use |
No return value, called for side effects
Richèl J.C. Bilderbeek
use create_ns_mcmc
to create an MCMC that uses Nested Sampling
to estimate a marginal likelihood
Calls stop
if the parameter is invalid
check_param(param)
check_param(param)
param |
a parameter, as can be created by |
nothing
Richèl J.C. Bilderbeek
Use create_param to create a valid parameter
check_empty_beautier_folder() check_param(create_alpha_param()) check_param(create_beta_param()) check_empty_beautier_folder()
check_empty_beautier_folder() check_param(create_alpha_param()) check_param(create_beta_param()) check_empty_beautier_folder()
param
has the list elements
of a valid param
object.Calls stop
if an element is missing
check_param_names(param)
check_param_names(param)
param |
a parameter, as can be created by |
nothing
Richèl J.C. Bilderbeek
Use create_param to create a valid param
param
has the list elements
of the right type for a valid param
object.Calls stop
if an element has the incorrect type
check_param_types(param)
check_param_types(param)
param |
a parameter, as can be created by |
nothing
Richèl J.C. Bilderbeek
Use create_param to create a valid param
Calls stop
if the phylogeny is invalid
check_phylogeny(phylogeny)
check_phylogeny(phylogeny)
phylogeny |
a phylogeny of type |
nothing
Richèl J.C. Bilderbeek
Use ape::read.tree
to create a phylogeny
check_empty_beautier_folder() # Must do nothing on phylogenies phylogeny <- ape::read.tree(text = "(A:1, B:1):1;") check_phylogeny(phylogeny) check_empty_beautier_folder()
check_empty_beautier_folder() # Must do nothing on phylogenies phylogeny <- ape::read.tree(text = "(A:1, B:1):1;") check_phylogeny(phylogeny) check_empty_beautier_folder()
Will stop if not
check_rename_fun(rename_fun)
check_rename_fun(rename_fun)
rename_fun |
a function to rename a filename, as can be checked by check_rename_fun. This function should have one argument, which will be a filename or NA. The function should return one filename (when passed one filename) or one NA (when passed one NA). Example rename functions are:
|
No return value, called for side effects
Richèl J.C. Bilderbeek
Calls stop
if the clock model is invalid
check_rln_clock_model(clock_model)
check_rln_clock_model(clock_model)
clock_model |
a clock model,
as returned by |
TRUE if clock_model
is a valid clock model
Richèl J.C. Bilderbeek
Use create_clock_model to create a valid clock model
check_empty_beautier_folder() check_rln_clock_model(create_rln_clock_model()) check_empty_beautier_folder()
check_empty_beautier_folder() check_rln_clock_model(create_rln_clock_model()) check_empty_beautier_folder()
screenlog
is valid.Will call stop if not.
check_screenlog(screenlog)
check_screenlog(screenlog)
screenlog |
a |
No return value, called for side effects
Richèl J.C. Bilderbeek
check_empty_beautier_folder() check_screenlog(create_test_screenlog()) check_empty_beautier_folder()
check_empty_beautier_folder() check_screenlog(create_test_screenlog()) check_empty_beautier_folder()
screenlog
has the list elements
of a valid screenlog
object.Calls stop
if an element is missing
check_screenlog_names(screenlog)
check_screenlog_names(screenlog)
screenlog |
a |
nothing
Richèl J.C. Bilderbeek
Use create_screenlog to create a valid screenlog
Calls stop
if a value is invalid
check_screenlog_values(screenlog)
check_screenlog_values(screenlog)
screenlog |
a |
nothing
Richèl J.C. Bilderbeek
Use create_screenlog to create a valid screenlog
Calls stop
if the site models are invalid
check_site_model(site_model)
check_site_model(site_model)
site_model |
a site model,
as returned by |
nothing
Richèl J.C. Bilderbeek
Use create_site_model to create a valid site model
check_empty_beautier_folder() check_site_model(create_jc69_site_model()) check_site_model(create_hky_site_model()) check_site_model(create_tn93_site_model()) check_site_model(create_gtr_site_model()) # Can use list of one site model check_site_model(list(create_jc69_site_model())) check_empty_beautier_folder()
check_empty_beautier_folder() check_site_model(create_jc69_site_model()) check_site_model(create_hky_site_model()) check_site_model(create_tn93_site_model()) check_site_model(create_gtr_site_model()) # Can use list of one site model check_site_model(list(create_jc69_site_model())) check_empty_beautier_folder()
site_model
has the list elements
of a valid site_model
object.Calls stop
if an element is missing
check_site_model_names(site_model)
check_site_model_names(site_model)
site_model |
a site model,
as returned by |
nothing
Richèl J.C. Bilderbeek
Use create_site_model to create a valid site_model
site_model
has the list elements
of the right type for a valid site_model
object.Calls stop
if an element has the incorrect type
check_site_model_types(site_model)
check_site_model_types(site_model)
site_model |
a site model,
as returned by |
nothing
Richèl J.C. Bilderbeek
Use create_site_model to create a valid site_model
Will stop if the object is not a list of one or more site models.
check_site_models(site_models)
check_site_models(site_models)
site_models |
the object to be checked if it is a list of one or more valid site models |
nothing. Will stop if the object is not a list of one or more site models.
Richèl J.C. Bilderbeek
Use create_site_model to create a valid site model
check_empty_beautier_folder() check_site_models(create_jc69_site_model()) check_site_models(list(create_jc69_site_model())) check_site_models( list(create_jc69_site_model(), create_gtr_site_model()) ) check_empty_beautier_folder()
check_empty_beautier_folder() check_site_models(create_jc69_site_model()) check_site_models(list(create_jc69_site_model())) check_site_models( list(create_jc69_site_model(), create_gtr_site_model()) ) check_empty_beautier_folder()
store_every
holds a valid valueWill stop if not
check_store_every(store_every)
check_store_every(store_every)
store_every |
number of states the MCMC will process
before the posterior's state will be saved to file.
Use -1 or |
No return value, called for side effects
Calls stop
if the clock model is invalid
check_strict_clock_model(clock_model)
check_strict_clock_model(clock_model)
clock_model |
a clock model,
as returned by |
TRUE if clock_model
is a valid clock model
Richèl J.C. Bilderbeek
Use create_clock_model to create a valid clock model
check_empty_beautier_folder() check_strict_clock_model(create_strict_clock_model()) check_empty_beautier_folder()
check_empty_beautier_folder() check_strict_clock_model(create_strict_clock_model()) check_empty_beautier_folder()
tn93_site_model
is a valid
TN93 nucleotide substitution model.Use create_tn93_site_model to create a valid TN93 nucleotide substitution model.
check_tn93_site_model(tn93_site_model)
check_tn93_site_model(tn93_site_model)
tn93_site_model |
a TN93 site model,
as returned by |
No return value, called for side effects
check_empty_beautier_folder() check_tn93_site_model(create_tn93_site_model()) check_empty_beautier_folder()
check_empty_beautier_folder() check_tn93_site_model(create_tn93_site_model()) check_empty_beautier_folder()
tn93_site_model
has the list elements
of a valid tn93_site_model
object.Calls stop
if an element is missing
check_tn93_site_model_names(tn93_site_model)
check_tn93_site_model_names(tn93_site_model)
tn93_site_model |
a TN93 site model,
as returned by |
nothing
Richèl J.C. Bilderbeek
Use create_tn93_site_model
to create a valid tn93_site_model
tracelog
is valid.Will call stop if not.
check_tracelog(tracelog)
check_tracelog(tracelog)
tracelog |
a |
No return value, called for side effects
tracelog
has the list elements
of a valid tracelog
object.Calls stop
if an element is missing
check_tracelog_names(tracelog)
check_tracelog_names(tracelog)
tracelog |
a |
nothing
Richèl J.C. Bilderbeek
Use create_tracelog to create a valid tracelog
Calls stop
if a value is invalid
check_tracelog_values(tracelog)
check_tracelog_values(tracelog)
tracelog |
a |
nothing
Richèl J.C. Bilderbeek
Use create_tracelog to create a valid tracelog
Calls stop
if the tree priors are invalid
check_tree_prior(tree_prior)
check_tree_prior(tree_prior)
tree_prior |
a tree priors,
as returned by |
nothing
Richèl J.C. Bilderbeek
Use create_tree_prior to create a valid tree prior
check_empty_beautier_folder() check_tree_prior(create_yule_tree_prior()) check_tree_prior(create_bd_tree_prior()) check_tree_prior(create_cbs_tree_prior()) check_tree_prior(create_ccp_tree_prior()) check_tree_prior(create_cep_tree_prior()) # Can use list of one tree prior check_tree_prior(list(create_yule_tree_prior())) check_empty_beautier_folder()
check_empty_beautier_folder() check_tree_prior(create_yule_tree_prior()) check_tree_prior(create_bd_tree_prior()) check_tree_prior(create_cbs_tree_prior()) check_tree_prior(create_ccp_tree_prior()) check_tree_prior(create_cep_tree_prior()) # Can use list of one tree prior check_tree_prior(list(create_yule_tree_prior())) check_empty_beautier_folder()
Will stop if the object is not a list of one or more tree priors.
check_tree_priors(tree_priors)
check_tree_priors(tree_priors)
tree_priors |
the object to be checked if it is a list of one or more valid tree priors |
nothing. Will stop if the object is not a list of one or more tree priors.
Richèl J.C. Bilderbeek
Use create_tree_prior to create a valid tree prior
check_empty_beautier_folder() check_tree_priors(create_yule_tree_prior()) check_tree_priors(list(create_yule_tree_prior())) check_tree_priors(list(create_yule_tree_prior(), create_bd_tree_prior())) check_empty_beautier_folder()
check_empty_beautier_folder() check_tree_priors(create_yule_tree_prior()) check_tree_priors(list(create_yule_tree_prior())) check_tree_priors(list(create_yule_tree_prior(), create_bd_tree_prior())) check_empty_beautier_folder()
treelog
is valid.Will call stop if not.
check_treelog(treelog)
check_treelog(treelog)
treelog |
a |
No return value, called for side effects
Richèl J.C. Bilderbeek
check_empty_beautier_folder() check_treelog(create_test_treelog()) check_empty_beautier_folder()
check_empty_beautier_folder() check_treelog(create_test_treelog()) check_empty_beautier_folder()
treelog
has the list elements
of a valid treelog
object.Calls stop
if an element is missing
check_treelog_names(treelog)
check_treelog_names(treelog)
treelog |
a |
nothing
Richèl J.C. Bilderbeek
Use create_treelog to create a valid treelog
Calls stop
if a value is invalid
check_treelog_values(treelog)
check_treelog_values(treelog)
treelog |
a |
nothing
Richèl J.C. Bilderbeek
Use create_treelog to create a valid treelog
Converts a clock model to the operators
section of the
XML as text
clock_model_to_xml_operators(inference_model)
clock_model_to_xml_operators(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
a character vector of XML strings
Richèl J.C. Bilderbeek
Internal function to converts a clock model
to the prior
section of the XML as text
clock_model_to_xml_prior_distr(inference_model)
clock_model_to_xml_prior_distr(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
a character vector of XML strings
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # <distribution id="posterior" spec="util.CompoundDistribution"> # <distribution id="prior" spec="util.CompoundDistribution"> # HERE, where the ID of the distribution is 'prior' # </distribution> # <distribution id="likelihood" ...> # </distribution> # </distribution> clock_model_to_xml_prior_distr( inference_model = create_inference_model() ) check_empty_beautier_folder()
check_empty_beautier_folder() # <distribution id="posterior" spec="util.CompoundDistribution"> # <distribution id="prior" spec="util.CompoundDistribution"> # HERE, where the ID of the distribution is 'prior' # </distribution> # <distribution id="likelihood" ...> # </distribution> # </distribution> clock_model_to_xml_prior_distr( inference_model = create_inference_model() ) check_empty_beautier_folder()
Converts a clock model to the state
section of the
XML as text
clock_model_to_xml_state(inference_model)
clock_model_to_xml_state(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
lines of XML text, without indentation nor state
tags
Richèl J.C. Bilderbeek
Creates the clock model's XML for the tracelog section
clock_model_to_xml_tracelog(inference_model)
clock_model_to_xml_tracelog(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
a character vector of XML strings
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # <logger id="tracelog" ...> #' # Here # </logger> check_empty_beautier_folder()
check_empty_beautier_folder() # <logger id="tracelog" ...> #' # Here # </logger> check_empty_beautier_folder()
TreeLogger
Convert a clock model to the XML of the TreeLogger
clock_model_to_xml_treelogger(clock_model)
clock_model_to_xml_treelogger(clock_model)
clock_model |
a clock model,
as returned by |
a character vector of XML strings
This is an internal function, so it should be marked with
@export
. This is not done, as this will disallow all
functions to find the documentation parameters
Richèl J.C. Bilderbeek
Converts a clockRate
parameter to XML
clock_rate_param_to_xml( clock_rate_param, beauti_options = create_beauti_options() )
clock_rate_param_to_xml( clock_rate_param, beauti_options = create_beauti_options() )
clock_rate_param |
a |
beauti_options |
one BEAUti options object,
as returned by |
the parameter as XML text
Richèl J.C. Bilderbeek
Internal debug function to compare the actually created lines to expected lines using any diff tool
compare_lines( lines, expected, section = NA, created_lines_filename = get_beautier_tempfilename(pattern = "created", fileext = ".xml"), expected_lines_filename = get_beautier_tempfilename(pattern = "expected", fileext = ".xml") )
compare_lines( lines, expected, section = NA, created_lines_filename = get_beautier_tempfilename(pattern = "created", fileext = ".xml"), expected_lines_filename = get_beautier_tempfilename(pattern = "expected", fileext = ".xml") )
lines |
the created lines |
expected |
the expected/goal/target lines |
section |
the XML section. Leave at NA to compare all lines |
created_lines_filename |
name of the file where the (section of the) created lines are stored |
expected_lines_filename |
name of the file where the (section of the) expected lines are stored |
nothing. Instead, two files are created, with the
names created_lines_filename
and expected_lines_filename
that contain the
section under investigation, so that a diff tool
can compare these
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # Creates temporary files in beautier folder compare_lines( lines = readLines(get_beautier_path("bd_2_4.xml")), expected = readLines(get_beautier_path("bd_2_4.xml")) ) remove_beautier_folder() check_empty_beautier_folder()
check_empty_beautier_folder() # Creates temporary files in beautier folder compare_lines( lines = readLines(get_beautier_path("bd_2_4.xml")), expected = readLines(get_beautier_path("bd_2_4.xml")) ) remove_beautier_folder() check_empty_beautier_folder()
Count the number of spaces before the first character
count_trailing_spaces(line)
count_trailing_spaces(line)
line |
line of text |
the number of spaces before the first character
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # 0 count_trailing_spaces("x") # 1 count_trailing_spaces(" y") # 2 count_trailing_spaces(" <") # 0 count_trailing_spaces("") # 1 count_trailing_spaces(" ") # 2 count_trailing_spaces(" ") check_empty_beautier_folder()
check_empty_beautier_folder() # 0 count_trailing_spaces("x") # 1 count_trailing_spaces(" y") # 2 count_trailing_spaces(" <") # 0 count_trailing_spaces("") # 1 count_trailing_spaces(" ") # 2 count_trailing_spaces(" ") check_empty_beautier_folder()
Create a parameter called alpha
create_alpha_param(id = NA, value = 0)
create_alpha_param(id = NA, value = 0)
id |
the parameter's ID |
value |
value of the parameter |
a parameter called alpha
this parameter is used in a beta distribution
(as returned by create_beta_distr
)
and gamma distribution
(as returned by create_gamma_distr
)
and inverse-gamma distribution
(as returned by create_inv_gamma_distr
).
It cannot be estimated (as a hyper parameter) yet.
Richèl J.C. Bilderbeek
the function create_param
contains a list
of all parameters that can be created
if (is_on_ci()) { # Create the parameter alpha_param <- create_alpha_param() # Use the parameter in a distribution beta_distr <- create_beta_distr( alpha = alpha_param ) # Use the distribution to create a BEAST2 input file beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = create_yule_tree_prior( birth_rate_distr = beta_distr ) ) file.remove(beast2_input_file) remove_beautier_folder() }
if (is_on_ci()) { # Create the parameter alpha_param <- create_alpha_param() # Use the parameter in a distribution beta_distr <- create_beta_distr( alpha = alpha_param ) # Use the distribution to create a BEAST2 input file beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = create_yule_tree_prior( birth_rate_distr = beta_distr ) ) file.remove(beast2_input_file) remove_beautier_folder() }
Create a parameter called 'b_pop_sizes'.
create_b_pop_sizes_param(id = NA, value = 1, upper = "380000.0")
create_b_pop_sizes_param(id = NA, value = 1, upper = "380000.0")
id |
the parameter's ID |
value |
value of the parameter |
upper |
upper value of the parameter |
a parameter called b_pop_sizes
this parameter is used in a CBS model, as created by create_cbs_tree_prior
Richèl J.C. Bilderbeek
the function create_param
contains a list
of all parameters that can be created
# Create the parameter b_pop_sizes_param <- create_b_pop_sizes_param()
# Create the parameter b_pop_sizes_param <- create_b_pop_sizes_param()
Create a Birth-Death tree prior
create_bd_tree_prior( id = NA, birth_rate_distr = create_uniform_distr(), death_rate_distr = create_uniform_distr() )
create_bd_tree_prior( id = NA, birth_rate_distr = create_uniform_distr(), death_rate_distr = create_uniform_distr() )
id |
the ID of the alignment |
birth_rate_distr |
the birth rate distribution,
as created by a |
death_rate_distr |
the death rate distribution,
as created by a |
a Birth-Death tree_prior
Richèl J.C. Bilderbeek
An alignment ID can be extracted from
its FASTA filename using get_alignment_id
if (is_on_ci()) { bd_tree_prior <- create_bd_tree_prior() beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = bd_tree_prior ) file.remove(beast2_input_file) remove_beautier_folder() }
if (is_on_ci()) { bd_tree_prior <- create_bd_tree_prior() beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = bd_tree_prior ) file.remove(beast2_input_file) remove_beautier_folder() }
<beast ...>
XMLThe <beast ...>
XML is the XML at the start of a BEAST2
XML input file, directly after the general XML declaration (as
created by create_xml_declaration).
create_beast2_beast_xml(beauti_options)
create_beast2_beast_xml(beauti_options)
beauti_options |
one BEAUti options object,
as returned by |
the XML
Richèl J.C. Bilderbeek
remove_beautier_folder() create_beast2_beast_xml( beauti_options = create_beauti_options_v2_6() ) check_empty_beautier_folder()
remove_beautier_folder() create_beast2_beast_xml( beauti_options = create_beauti_options_v2_6() ) check_empty_beautier_folder()
Create a BEAST2 XML input text
create_beast2_input( input_filename, tipdates_filename = NA, site_model = create_jc69_site_model(), clock_model = create_strict_clock_model(), tree_prior = create_yule_tree_prior(), mrca_prior = NA, mcmc = create_mcmc(), beauti_options = create_beauti_options() )
create_beast2_input( input_filename, tipdates_filename = NA, site_model = create_jc69_site_model(), clock_model = create_strict_clock_model(), tree_prior = create_yule_tree_prior(), mrca_prior = NA, mcmc = create_mcmc(), beauti_options = create_beauti_options() )
input_filename |
A FASTA filename.
Use |
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 |
clock_model |
a clock model,
as returned by |
tree_prior |
a tree priors,
as returned by |
mrca_prior |
a Most Recent Common Ancestor prior,
as returned by |
mcmc |
one MCMC.
Use |
beauti_options |
one BEAUti options object,
as returned by |
a character vector of XML strings
Richèl J.C. Bilderbeek
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
if (is_on_ci()) { create_beast2_input( input_filename = get_fasta_filename() ) }
if (is_on_ci()) { create_beast2_input( input_filename = get_fasta_filename() ) }
beast
tag of a BEAST2 parameter file.Creates the XML text for the beast
tag of a BEAST2 parameter file,
which is directly after the XML
declaration (created by create_xml_declaration.
create_beast2_input_beast( input_filename, inference_model = create_inference_model() )
create_beast2_input_beast( input_filename, inference_model = create_inference_model() )
input_filename |
A FASTA filename.
Use |
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
The beast
tag has these elements:
<beast[...]> <data [...] </data> [map names] <run[...]> [...] </run> </beast>
lines of XML text
Richèl J.C. Bilderbeek
Use create_beast2_input_from_model to create the complete XML text.
Use create_beast2_input_data to create the XML text for
the data
tag only.
Use create_beast2_input_map to create the XML text for
the [map names]
part.
Use create_beast2_input_run to create the XML text for
the run
tag only.
data
section of a BEAST2 XML parameter fileCreates the data
section of a BEAST2 XML parameter file
create_beast2_input_data( input_filename, beauti_options = create_beauti_options() )
create_beast2_input_data( input_filename, beauti_options = create_beauti_options() )
input_filename |
A FASTA filename.
Use |
beauti_options |
one BEAUti options object,
as returned by |
lines of XML text
Richèl J.C. Bilderbeek
check_empty_beautier_folder() create_beast2_input_data( input_filename = get_fasta_filename(), beauti_options = create_beauti_options_v2_4() ) check_empty_beautier_folder()
check_empty_beautier_folder() create_beast2_input_data( input_filename = get_fasta_filename(), beauti_options = create_beauti_options_v2_4() ) check_empty_beautier_folder()
Creates the data section of a BEAST2 XML parameter file
create_beast2_input_data_sequences( input_fasta_filename, beauti_options = create_beauti_options() )
create_beast2_input_data_sequences( input_fasta_filename, beauti_options = create_beauti_options() )
input_fasta_filename |
one FASTA filename |
beauti_options |
one BEAUti options object,
as returned by |
lines of XML text
Richèl J.C. Bilderbeek
Creates the distribution section of a BEAST2 XML parameter file.
create_beast2_input_distr(inference_model)
create_beast2_input_distr(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
lines of XML text
this function is not intended for regular use, thus its long name length is accepted
Richèl J.C. Bilderbeek
check_empty_beautier_folder() inference_model <- init_inference_model( input_filename = get_fasta_filename(), inference_model = create_inference_model( beauti_options = create_beauti_options_v2_4() ) ) create_beast2_input_distr( inference_model = inference_model ) # <distribution id="posterior" spec="util.CompoundDistribution"> # <distribution id="prior" spec="util.CompoundDistribution"> # HERE, where the ID of the distribution is 'prior' # </distribution> # <distribution id="likelihood" ...> # </distribution> # </distribution> check_empty_beautier_folder()
check_empty_beautier_folder() inference_model <- init_inference_model( input_filename = get_fasta_filename(), inference_model = create_inference_model( beauti_options = create_beauti_options_v2_4() ) ) create_beast2_input_distr( inference_model = inference_model ) # <distribution id="posterior" spec="util.CompoundDistribution"> # <distribution id="prior" spec="util.CompoundDistribution"> # HERE, where the ID of the distribution is 'prior' # </distribution> # <distribution id="likelihood" ...> # </distribution> # </distribution> check_empty_beautier_folder()
distribution
tag
with the likelihood
ID,
of a BEAST2 parameter file.Creates the XML text for the distribution
tag
with the likelihood
ID,
of a BEAST2 parameter file,
in an unindented form
create_beast2_input_distr_lh(inference_model)
create_beast2_input_distr_lh(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
The distribution
tag (with ID equals likelihood
)
has these elements:
<distribution id="likelihood"[...]> <distribution id="treeLikelihood"[...]> [...] </distribution> </distribution>
The distribution
section with ID treeLikelihood
is created by create_tree_likelihood_distr_xml.
Zooming out:
<beast[...]> <run[...]> <distribution id="posterior"[...]> <distribution id="likelihood"[...]> [this section] </distribution> </distribution> </run> </beast>
lines of XML text
this function is not intended for regular use, thus its long name length is accepted
Richèl J.C. Bilderbeek
this function is called by create_beast2_input_distr
,
together with create_beast2_input_distr_prior
Creates the prior section in the distribution section of a BEAST2 XML parameter file
create_beast2_input_distr_prior(inference_model)
create_beast2_input_distr_prior(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
lines of XML text
this function is not intended for regular use, thus its long name length is accepted
Richèl J.C. Bilderbeek
this function is called by create_beast2_input_distr
,
together with create_beast2_input_distr_lh
check_empty_beautier_folder() # <distribution id="posterior" spec="util.CompoundDistribution"> # <distribution id="prior" spec="util.CompoundDistribution"> # HERE, where the ID of the distribution is 'prior' # </distribution> # <distribution id="likelihood" ...> # </distribution> # </distribution> check_empty_beautier_folder()
check_empty_beautier_folder() # <distribution id="posterior" spec="util.CompoundDistribution"> # <distribution id="prior" spec="util.CompoundDistribution"> # HERE, where the ID of the distribution is 'prior' # </distribution> # <distribution id="likelihood" ...> # </distribution> # </distribution> check_empty_beautier_folder()
Create a BEAST2 input file
create_beast2_input_file( input_filename, output_filename, site_model = create_jc69_site_model(), clock_model = create_strict_clock_model(), tree_prior = create_yule_tree_prior(), mrca_prior = NA, mcmc = create_mcmc(), beauti_options = create_beauti_options(), tipdates_filename = NA )
create_beast2_input_file( input_filename, output_filename, site_model = create_jc69_site_model(), clock_model = create_strict_clock_model(), tree_prior = create_yule_tree_prior(), mrca_prior = NA, mcmc = create_mcmc(), beauti_options = create_beauti_options(), tipdates_filename = NA )
input_filename |
A FASTA filename.
Use |
output_filename |
Name of the XML parameter file created by this function. BEAST2 uses this file as input. |
site_model |
a site model,
as returned by |
clock_model |
a clock model,
as returned by |
tree_prior |
a tree priors,
as returned by |
mrca_prior |
a Most Recent Common Ancestor prior,
as returned by |
mcmc |
one MCMC.
Use |
beauti_options |
one BEAUti options object,
as returned by |
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. |
nothing
Richèl J.C. Bilderbeek
Use create_beast2_input_file_from_model to do the same with an
inference model.
See create_site_model
for examples with
different site models. See create_clock_model
for examples
with clock models. See create_tree_prior
for examples with
different tree priors. See create_mcmc
for examples with
a different MCMC setup.
if (is_on_ci()) { check_empty_beautier_folder() # Get an example FASTA file input_filename <- get_fasta_filename() # The file created by beautier, a BEAST2 input file output_filename <- get_beautier_tempfilename() create_beast2_input_file( input_filename, output_filename ) file.remove(output_filename) remove_beautier_folder() check_empty_beautier_folder() }
if (is_on_ci()) { check_empty_beautier_folder() # Get an example FASTA file input_filename <- get_fasta_filename() # The file created by beautier, a BEAST2 input file output_filename <- get_beautier_tempfilename() create_beast2_input_file( input_filename, output_filename ) file.remove(output_filename) remove_beautier_folder() check_empty_beautier_folder() }
Create a BEAST2 input file from an inference model
create_beast2_input_file_from_model( input_filename, output_filename, inference_model = create_inference_model() )
create_beast2_input_file_from_model( input_filename, output_filename, inference_model = create_inference_model() )
input_filename |
A FASTA filename.
Use |
output_filename |
Name of the XML parameter file created by this function. BEAST2 uses this file as input. |
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
nothing
Richèl J.C. Bilderbeek
use create_beast2_input_from_model to get the BEAST2 input file as text
See create_site_model
for examples with
different site models.
See create_clock_model
for examples
with clock models.
See create_tree_prior
for examples with
different tree priors.
See create_mcmc
for examples with
a different MCMC setup.
Use create_beast2_input_file to do the same with the elements
of an inference model.
if (is_on_ci()) { check_empty_beautier_folder() output_filename <- get_beautier_tempfilename() create_beast2_input_file_from_model( input_filename = get_fasta_filename(), output_filename = output_filename, inference_model = create_inference_model() ) file.remove(output_filename) remove_beautier_folder() check_empty_beautier_folder() }
if (is_on_ci()) { check_empty_beautier_folder() output_filename <- get_beautier_tempfilename() create_beast2_input_file_from_model( input_filename = get_fasta_filename(), output_filename = output_filename, inference_model = create_inference_model() ) file.remove(output_filename) remove_beautier_folder() check_empty_beautier_folder() }
The main two XML tags are these:
<?xml[...]?><beast[...]> [...] </beast>
create_beast2_input_from_model(input_filename, inference_model)
create_beast2_input_from_model(input_filename, inference_model)
input_filename |
A FASTA filename.
Use |
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
a character vector of XML strings
Richèl J.C. Bilderbeek
Use create_beast2_input_file_from_model to also save it to file.
Use create_xml_declaration
to create the XML text of the XML declaration.
Use create_beast2_input_beast to create
to create the XML text of the beast
tag.
if (is_on_ci()) { check_empty_beautier_folder() text <- create_beast2_input_from_model( input_filename = get_fasta_filename(), inference_model = create_inference_model() ) check_empty_beautier_folder() }
if (is_on_ci()) { check_empty_beautier_folder() text <- create_beast2_input_from_model( input_filename = get_fasta_filename(), inference_model = create_inference_model() ) check_empty_beautier_folder() }
init
section of a BEAST2 XML parameter fileCreates the init
section of a BEAST2 XML parameter file
create_beast2_input_init(inference_model)
create_beast2_input_init(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
lines of XML text
Richèl J.C. Bilderbeek
check_empty_beautier_folder() inference_model <- init_inference_model( input_filename = get_fasta_filename(), inference_model = create_test_inference_model() ) xml <- create_beast2_input_init( inference_model = inference_model ) check_empty_beautier_folder()
check_empty_beautier_folder() inference_model <- init_inference_model( input_filename = get_fasta_filename(), inference_model = create_test_inference_model() ) xml <- create_beast2_input_init( inference_model = inference_model ) check_empty_beautier_folder()
Creates the map section of a BEAST2 XML parameter file
create_beast2_input_map(beauti_options)
create_beast2_input_map(beauti_options)
beauti_options |
one BEAUti options object,
as returned by |
lines of XML text
Richèl J.C. Bilderbeek
Creates the operators section of a BEAST2 XML parameter file
create_beast2_input_operators(inference_model)
create_beast2_input_operators(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
lines of XML text
Richèl J.C. Bilderbeek
run
' section of a BEAST2 XML parameter fileCreates the 'run
' section of a BEAST2 XML parameter file,
without being indented.
create_beast2_input_run( input_filename, inference_model = create_inference_model() )
create_beast2_input_run( input_filename, inference_model = create_inference_model() )
input_filename |
A FASTA filename.
Use |
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
The run
tag has these elements:
<run[...]> <state[...]> [...] </state> <init[...]> [...] </init> <distribution[...]> [...] </distribution> [operator ids] [loggers] </run>
lines of XML text
Richèl J.C. Bilderbeek
Use create_beast2_input_state
to create the XML text of the state
tag.
Use create_beast2_input_init
to create the XML text of the init
tag.
Use create_beast2_input_distr
to create the XML text of the distribution
tag.
Use create_beast2_input_operators
to create the XML text of the [operator ids]
section.
Use create_loggers_xml
to create the XML text of the [loggers]
part.
state
' section of a BEAST2 XML parameter fileCreates the 'state
' section of a BEAST2 XML parameter file,
without being indented.
create_beast2_input_state(inference_model)
create_beast2_input_state(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
The state
tag has these elements:
<state[...]> <tree[...]> [...] </tree> [parameters] </run>
lines of XML text
Richèl J.C. Bilderbeek
Use create_beast2_input_state
to create the XML text of the tree
tag.
to create the XML text of the [parameters]
section.
'BEAUti' options are settings that differ between 'BEAUti' version. The use of these options is mostly for testing older versions Whatever option chosen here, the created XML file will be valid.
create_beauti_options( capitalize_first_char_id = FALSE, nucleotides_uppercase = FALSE, beast2_version = "2.4", required = "", sequence_indent = 20, status = "", namespace = get_default_beast_namespace_v2_4() )
create_beauti_options( capitalize_first_char_id = FALSE, nucleotides_uppercase = FALSE, beast2_version = "2.4", required = "", sequence_indent = 20, status = "", namespace = get_default_beast_namespace_v2_4() )
capitalize_first_char_id |
must the ID of alignment start with a capital? TRUE if yes, FALSE if it can be left lower case (if it is lowercase) |
nucleotides_uppercase |
must the nucleotides of the DNA sequence be in uppercase? |
beast2_version |
the BEAST2 version |
required |
things that may be required,
for example |
sequence_indent |
the number of spaces the XML |
status |
the BEAUti status |
namespace |
the 'namespace' XML element in the 'beast' XML tag. |
Available BEAUti options are:
* create_beauti_options_v2_4
* create_beauti_options_v2_6
'beautier' uses v2.4 by default, as this is when the first tests were written.
a BEAUti options structure
Richèl J.C. Bilderbeek
if (is_on_ci()) { check_empty_beautier_folder() beauti_options <- create_beauti_options_v2_4() xml <- create_beast2_input( get_fasta_filename(), beauti_options = beauti_options ) check_empty_beautier_folder() }
if (is_on_ci()) { check_empty_beautier_folder() beauti_options <- create_beauti_options_v2_4() xml <- create_beast2_input( get_fasta_filename(), beauti_options = beauti_options ) check_empty_beautier_folder() }
Function to create the BEAUti options for version 2.4, by calling create_beauti_options.
create_beauti_options_v2_4()
create_beauti_options_v2_4()
a BEAUti options structure
Richèl J.C. Bilderbeek
if (is_on_ci()) { check_empty_beautier_folder() beauti_options <- create_beauti_options_v2_4() xml <- create_beast2_input( get_fasta_filename(), beauti_options = beauti_options ) check_empty_beautier_folder() }
if (is_on_ci()) { check_empty_beautier_folder() beauti_options <- create_beauti_options_v2_4() xml <- create_beast2_input( get_fasta_filename(), beauti_options = beauti_options ) check_empty_beautier_folder() }
Function to create the BEAUti options for version 2.6, by calling create_beauti_options.
create_beauti_options_v2_6( beast2_version = "2.6", sequence_indent = 8, nucleotides_uppercase = FALSE, status = "", namespace = get_default_beast_namespace_v2_6(), required = "" )
create_beauti_options_v2_6( beast2_version = "2.6", sequence_indent = 8, nucleotides_uppercase = FALSE, status = "", namespace = get_default_beast_namespace_v2_6(), required = "" )
beast2_version |
the BEAST2 version |
sequence_indent |
the number of spaces the XML |
nucleotides_uppercase |
must the nucleotides of the DNA sequence be in uppercase? |
status |
the BEAUti status |
namespace |
the 'namespace' XML element in the 'beast' XML tag. |
required |
things that may be required,
for example |
a BEAUti options structure
Richèl J.C. Bilderbeek
see create_beauti_options_v2_4 for using the older v2.4
if (is_on_ci()) { check_empty_beautier_folder() beauti_options <- create_beauti_options_v2_6() xml <- create_beast2_input( get_fasta_filename(), beauti_options = beauti_options ) check_empty_beautier_folder() }
if (is_on_ci()) { check_empty_beautier_folder() beauti_options <- create_beauti_options_v2_6() xml <- create_beast2_input( get_fasta_filename(), beauti_options = beauti_options ) check_empty_beautier_folder() }
Create the default 'beautier' temporary folder
create_beautier_tempfolder()
create_beautier_tempfolder()
nothing
Richèl J.C. Bilderbeek
create_beautier_tempfolder() remove_beautier_folder() check_empty_beautier_folder()
create_beautier_tempfolder() remove_beautier_folder() check_empty_beautier_folder()
Create a beta distribution
create_beta_distr( id = NA, alpha = 0, beta = 1, value = NA, lower = NA, upper = NA )
create_beta_distr( id = NA, alpha = 0, beta = 1, value = NA, lower = NA, upper = NA )
id |
the distribution's ID |
alpha |
the alpha shape parameter,
a numeric value.
The value
of alpha must be at least 0.0.
For advanced usage, use the structure
as returned by |
beta |
the beta shape parameter,
a numeric value.
The value
of beta must be at least 1.0.
For advanced usage, use the structure
as returned by |
value |
the initial value for the MCMC |
lower |
the lower bound, the lowest possible value |
upper |
an upper limit of the uniform distribution.
If the upper limits needs to be infinity, set |
a beta distribution
Richèl J.C. Bilderbeek
the function create_distr
shows an overview
of all supported distributions
if (is_on_ci()) { beta_distr <- create_beta_distr() beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = create_yule_tree_prior( birth_rate_distr = beta_distr ) ) file.remove(beast2_input_file) remove_beautier_folder() }
if (is_on_ci()) { beta_distr <- create_beta_distr() beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = create_yule_tree_prior( birth_rate_distr = beta_distr ) ) file.remove(beast2_input_file) remove_beautier_folder() }
Create a parameter called beta
create_beta_param(id = NA, value = 1)
create_beta_param(id = NA, value = 1)
id |
the parameter's ID |
value |
value of the parameter |
a parameter called beta
this parameter is used in a beta distribution
(as returned by create_beta_distr
)
and gamma distribution
(as returned by create_gamma_distr
)
and inverse-gamma distribution
(as returned by create_inv_gamma_distr
).
It cannot be estimated (as a hyper parameter) yet.
Richèl J.C. Bilderbeek
the function create_param
contains a list
of all parameters that can be created
if (is_on_ci()) { # Create the parameter beta_param <- create_beta_param() # Use the parameter in a distribution gamma_distr <- create_gamma_distr( beta = beta_param ) # Use the distribution to create a BEAST2 input file beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = create_yule_tree_prior( birth_rate_distr = gamma_distr ) ) file.remove(beast2_input_file) remove_beautier_folder() }
if (is_on_ci()) { # Create the parameter beta_param <- create_beta_param() # Use the parameter in a distribution gamma_distr <- create_gamma_distr( beta = beta_param ) # Use the distribution to create a BEAST2 input file beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = create_yule_tree_prior( birth_rate_distr = gamma_distr ) ) file.remove(beast2_input_file) remove_beautier_folder() }
branchRateModel
section
of the XML as text.Creates the branchRateModel
section
of the XML as text.
create_branch_rate_model_xml(inference_model)
create_branch_rate_model_xml(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
The distribution
tag (with ID equals treeLikelihood
)
has these elements:
<branchRateModel[...]> [...] </branchRateModel>
When there is a strict clock, create_strict_clock_branch_rate_model_xml is called. When there is an RLN clock, create_rln_clock_branch_rate_model_xml is called.
Zooming out:
<beast[...]> <run[...]> <distribution id="posterior"[...]> <distribution id="likelihood"[...]> <distribution id="treeLikelihood"[...]> [...] [this section] </distribution> </distribution> </distribution> </run> </beast>
a character vector of XML strings
Richèl J.C. Bilderbeek
Create a Coalescent Bayesian Skyline tree prior
create_cbs_tree_prior( id = NA, group_sizes_dimension = 5, b_pop_sizes_param = create_b_pop_sizes_param(), pop_sizes_scaler_scale_factor = "" )
create_cbs_tree_prior( id = NA, group_sizes_dimension = 5, b_pop_sizes_param = create_b_pop_sizes_param(), pop_sizes_scaler_scale_factor = "" )
id |
an alignment's IDs.
An ID can be extracted from its FASTA filename
with |
group_sizes_dimension |
the group sizes' dimension,
as used by the CBS tree prior (see |
b_pop_sizes_param |
a Bayesian population size parameter, as created by create_b_pop_sizes_param |
pop_sizes_scaler_scale_factor |
the scale factor used by the population sizes scaler operator |
a Coalescent Bayesian Skyline tree_prior
Richèl J.C. Bilderbeek
An alignment ID can be extracted from
its FASTA filename using get_alignment_id
if (is_on_ci()) { cbs_tree_prior <- create_cbs_tree_prior() beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_beautier_path("test_output_6.fas"), beast2_input_file, tree_prior = cbs_tree_prior ) file.remove(beast2_input_file) remove_beautier_folder() }
if (is_on_ci()) { cbs_tree_prior <- create_cbs_tree_prior() beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_beautier_path("test_output_6.fas"), beast2_input_file, tree_prior = cbs_tree_prior ) file.remove(beast2_input_file) remove_beautier_folder() }
Create a Coalescent Constant Population tree prior
create_ccp_tree_prior( id = NA, pop_size_distr = create_one_div_x_distr(value = 0.3) )
create_ccp_tree_prior( id = NA, pop_size_distr = create_one_div_x_distr(value = 0.3) )
id |
the ID of the alignment |
pop_size_distr |
the population distribution,
as created by a |
a Coalescent Constant Population tree_prior
Richèl J.C. Bilderbeek
An alignment ID can be extracted from
its FASTA filename using get_alignment_id
if (is_on_ci()) { ccp_tree_prior <- create_ccp_tree_prior() beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = ccp_tree_prior ) file.remove(beast2_input_file) remove_beautier_folder() }
if (is_on_ci()) { ccp_tree_prior <- create_ccp_tree_prior() beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = ccp_tree_prior ) file.remove(beast2_input_file) remove_beautier_folder() }
Create a Coalescent Exponential Population tree prior
create_cep_tree_prior( id = NA, pop_size_distr = create_one_div_x_distr(), growth_rate_distr = create_laplace_distr() )
create_cep_tree_prior( id = NA, pop_size_distr = create_one_div_x_distr(), growth_rate_distr = create_laplace_distr() )
id |
the ID of the alignment |
pop_size_distr |
the population distribution,
as created by a |
growth_rate_distr |
the growth rate distribution,
as created by a |
a Coalescent Exponential Population tree_prior
Richèl J.C. Bilderbeek
An alignment ID can be extracted from
its FASTA filename using get_alignment_id
if (is_on_ci()) { cep_tree_prior <- create_cep_tree_prior() beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = cep_tree_prior ) file.remove(beast2_input_file) remove_beautier_folder() }
if (is_on_ci()) { cep_tree_prior <- create_cep_tree_prior() beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = cep_tree_prior ) file.remove(beast2_input_file) remove_beautier_folder() }
General function to create a clock model
create_clock_model(name, id, ...)
create_clock_model(name, id, ...)
name |
the clock model name. Valid
names can be found in |
id |
a clock model's ID |
... |
specific clock model parameters |
a valid clock model
Prefer using the named function
create_rln_clock_model
and create_strict_clock_model
Richèl J.C. Bilderbeek
An alignment ID can be extracted from
its FASTA filename using get_alignment_id
.
For more examples about creating a relaxed log-normal clock
model, see create_rln_clock_model
.
For more examples about creating a strict clock
model, see create_strict_clock_model
.
if (is_on_ci()) { # Can use any of these models strict_clock_model <- create_strict_clock_model() rln_clock_model <- create_rln_clock_model() beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( get_fasta_filename(), beast2_input_file, clock_model = strict_clock_model ) file.remove(beast2_input_file) remove_beautier_folder() }
if (is_on_ci()) { # Can use any of these models strict_clock_model <- create_strict_clock_model() rln_clock_model <- create_rln_clock_model() beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( get_fasta_filename(), beast2_input_file, clock_model = strict_clock_model ) file.remove(beast2_input_file) remove_beautier_folder() }
Create a clock model from name
create_clock_model_from_name(clock_model_name)
create_clock_model_from_name(clock_model_name)
clock_model_name |
name of a clock model,
must be a name as returned by |
a clock model, as can be created by create_clock_model
Richèl J.C. Bilderbeek
Use create_clock_model
to create a clock model
check_empty_beautier_folder() create_clock_model_from_name(get_clock_model_names()[1]) check_empty_beautier_folder()
check_empty_beautier_folder() create_clock_model_from_name(get_clock_model_names()[1]) check_empty_beautier_folder()
create_rln_clock_model
,
and create_strict_clock_model
Creates all supported clock models,
which is a list of the types returned by
create_rln_clock_model
,
and create_strict_clock_model
create_clock_models()
create_clock_models()
a list of site_models
Richèl J.C. Bilderbeek
Use create_clock_model to create a clock model
check_empty_beautier_folder() clock_models <- create_clock_models() is_rln_clock_model(clock_models[[1]]) is_strict_clock_model(clock_models[[2]]) check_empty_beautier_folder()
check_empty_beautier_folder() clock_models <- create_clock_models() is_rln_clock_model(clock_models[[1]]) is_strict_clock_model(clock_models[[2]]) check_empty_beautier_folder()
Create clock models from their names
create_clock_models_from_names(clock_model_names)
create_clock_models_from_names(clock_model_names)
clock_model_names |
one or more names of a clock model,
must be name among those returned by |
a list of one or more clock models
Richèl J.C. Bilderbeek
Use create_clock_models to get all clock models
check_empty_beautier_folder() create_clock_models_from_names(get_clock_model_names()) check_empty_beautier_folder()
check_empty_beautier_folder() create_clock_models_from_names(get_clock_model_names()) check_empty_beautier_folder()
clock_rate
,
as needed by create_strict_clock_model
Create a parameter called clock_rate
,
as needed by create_strict_clock_model
create_clock_rate_param(value = "1.0", estimate = FALSE, id = NA)
create_clock_rate_param(value = "1.0", estimate = FALSE, id = NA)
value |
value of the parameter |
estimate |
TRUE if this parameter is to be estimated by BEAST2, FALSE otherwise |
id |
the parameter's ID |
a parameter called rate
It cannot be estimated (as a hyper parameter) yet.
Richèl J.C. Bilderbeek
the function create_param
contains a list
of all parameters that can be created
if (is_on_ci()) { clock_rate_param <- create_clock_rate_param( id = "anthus_aco", value = 1.0 ) # Use the parameter in a clock model strict_clock_model <- create_strict_clock_model( clock_rate_param = clock_rate_param ) # Use the distribution to create a BEAST2 input file beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, clock_model = strict_clock_model ) file.remove(beast2_input_file) remove_beautier_folder() }
if (is_on_ci()) { clock_rate_param <- create_clock_rate_param( id = "anthus_aco", value = 1.0 ) # Use the parameter in a clock model strict_clock_model <- create_strict_clock_model( clock_rate_param = clock_rate_param ) # Use the distribution to create a BEAST2 input file beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, clock_model = strict_clock_model ) file.remove(beast2_input_file) remove_beautier_folder() }
Creates the clockRate
parameter with the name stateNode
,
such as:
<parameter id="ucldStdev.c:[id]" [...] name="stateNode">0.1</parameter>
create_clock_rate_state_node_parameter_xml(inference_model)
create_clock_rate_state_node_parameter_xml(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
the following XML:
<parameter id="ucldStdev.c:[id]" lower="0.0" name="stateNode">
0.1
</parameter>
Richèl J.C. Bilderbeek
check_empty_beautier_folder() create_ucld_stdev_state_node_param_xml( create_inference_model( clock_model = create_rln_clock_model(id = 314) ) ) check_empty_beautier_folder()
check_empty_beautier_folder() create_ucld_stdev_state_node_param_xml( create_inference_model( clock_model = create_rln_clock_model(id = 314) ) ) check_empty_beautier_folder()
<data ..>
XMLCreate the <data ..>
XML
create_data_xml(id, beast2_version)
create_data_xml(id, beast2_version)
id |
an alignment's IDs.
An ID can be extracted from its FASTA filename
with |
beast2_version |
BEAST2 version, for example, |
lines of XML text
Richèl J.C. Bilderbeek
General function to create a distribution.
create_distr(name, id, value = NA, lower = NA, upper = NA, ...)
create_distr(name, id, value = NA, lower = NA, upper = NA, ...)
name |
the distribution name. Valid
names can be found in |
id |
the distribution's ID |
value |
the initial value for the MCMC |
lower |
the lower bound, the lowest possible value |
upper |
an upper limit of the uniform distribution.
If the upper limits needs to be infinity, set |
... |
specific distribution parameters |
a distribution
Prefer using the
named functions
create_beta_distr
,
create_exp_distr
,
create_gamma_distr
,
create_inv_gamma_distr
,
create_laplace_distr
,
create_log_normal_distr
,
create_normal_distr
,
create_one_div_x_distr
,
create_poisson_distr
and create_uniform_distr
See
create_beta_distr
,
create_exp_distr
,
create_gamma_distr
,
create_inv_gamma_distr
,
create_laplace_distr
,
create_log_normal_distr
,
create_normal_distr
,
create_one_div_x_distr
,
create_poisson_distr
and create_uniform_distr
for examples how to use those distributions
Richèl J.C. Bilderbeek
if (is_on_ci()) { # Use any distribution distr <- create_beta_distr() beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = create_yule_tree_prior( birth_rate_distr = distr ) ) file.remove(beast2_input_file) remove_beautier_folder() }
if (is_on_ci()) { # Use any distribution distr <- create_beta_distr() beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = create_yule_tree_prior( birth_rate_distr = distr ) ) file.remove(beast2_input_file) remove_beautier_folder() }
Create an exponential distribution
create_exp_distr(id = NA, mean = 1, value = NA, lower = NA, upper = NA)
create_exp_distr(id = NA, mean = 1, value = NA, lower = NA, upper = NA)
id |
the distribution's ID |
mean |
the mean parameter,
a numeric value.
For advanced usage, use the structure
as returned by |
value |
the initial value for the MCMC |
lower |
the lower bound, the lowest possible value |
upper |
an upper limit of the uniform distribution.
If the upper limits needs to be infinity, set |
an exponential distribution
Richèl J.C. Bilderbeek
the function create_distr
shows an overview
of all supported distributions
if (is_on_ci()) { exp_distr <- create_exp_distr() beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = create_yule_tree_prior( birth_rate_distr = exp_distr ) ) file.remove(beast2_input_file) remove_beautier_folder() }
if (is_on_ci()) { exp_distr <- create_exp_distr() beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = create_yule_tree_prior( birth_rate_distr = exp_distr ) ) file.remove(beast2_input_file) remove_beautier_folder() }
Create a parameter called freq
create_freq_param( id = NA, lower = "0.0", upper = "1.0", value = "0.25", estimate = TRUE, dimension = 4 )
create_freq_param( id = NA, lower = "0.0", upper = "1.0", value = "0.25", estimate = TRUE, dimension = 4 )
id |
the parameter's ID |
lower |
lowest possible value of the parameter. If the parameter
is estimated, |
upper |
upper value of the parameter |
value |
value of the parameter |
estimate |
TRUE if this parameter is to be estimated by BEAST2, FALSE otherwise |
dimension |
the number of dimensions, for example, as used in create_freq_param |
a parameter called freq
Richèl J.C. Bilderbeek
Create a gamma distribution
create_gamma_distr( id = NA, alpha = 0.5396, beta = 0.3819, value = NA, lower = NA, upper = NA )
create_gamma_distr( id = NA, alpha = 0.5396, beta = 0.3819, value = NA, lower = NA, upper = NA )
id |
the distribution's ID |
alpha |
the alpha shape parameter,
a numeric value.
For advanced usage, use the structure
as returned by |
beta |
the beta shape parameter,
a numeric value.
For advanced usage, use the structure
as returned by |
value |
the initial value for the MCMC |
lower |
the lower bound, the lowest possible value |
upper |
an upper limit of the uniform distribution.
If the upper limits needs to be infinity, set |
a gamma distribution
Richèl J.C. Bilderbeek
the function create_distr
shows an overview
of all supported distributions
if (is_on_ci()) { gamma_distr <- create_gamma_distr( alpha = 0.05, beta = 10.0 ) gtr_site_model <- create_gtr_site_model( rate_ac_prior_distr = gamma_distr ) beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, site_model = gtr_site_model ) file.remove(beast2_input_file) remove_beautier_folder() }
if (is_on_ci()) { gamma_distr <- create_gamma_distr( alpha = 0.05, beta = 10.0 ) gtr_site_model <- create_gtr_site_model( rate_ac_prior_distr = gamma_distr ) beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, site_model = gtr_site_model ) file.remove(beast2_input_file) remove_beautier_folder() }
Create a gamma site model, part of a site model
create_gamma_site_model( gamma_cat_count = "0", gamma_shape = "1.0", prop_invariant = "0.0", gamma_shape_prior_distr = NA, freq_equilibrium = "estimated", freq_prior_uniform_distr_id = 1000 )
create_gamma_site_model( gamma_cat_count = "0", gamma_shape = "1.0", prop_invariant = "0.0", gamma_shape_prior_distr = NA, freq_equilibrium = "estimated", freq_prior_uniform_distr_id = 1000 )
gamma_cat_count |
the number of gamma categories, must be an integer with value zero or more |
gamma_shape |
gamma curve shape parameter |
prop_invariant |
the proportion invariant, must be a value from 0.0 to 1.0 |
gamma_shape_prior_distr |
the distribution of the gamma shape prior.
|
freq_equilibrium |
the frequency in which the rates are at equilibrium
are either |
freq_prior_uniform_distr_id |
the ID of the ‘FrequenciesPrior'’s uniform distribution |
a gamma site model
Richèl J.C. Bilderbeek
Use create_gamma_site_model
to create a gamma site model
if (is_on_ci()) { gamma_site_model <- create_gamma_site_model(prop_invariant = 0.5) site_model <- create_hky_site_model(gamma_site_model = gamma_site_model) beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( get_fasta_filename(), beast2_input_file, site_model = site_model ) file.remove(beast2_input_file) remove_beautier_folder() }
if (is_on_ci()) { gamma_site_model <- create_gamma_site_model(prop_invariant = 0.5) site_model <- create_hky_site_model(gamma_site_model = gamma_site_model) beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( get_fasta_filename(), beast2_input_file, site_model = site_model ) file.remove(beast2_input_file) remove_beautier_folder() }
Create a GTR site model
create_gtr_site_model( id = NA, gamma_site_model = create_gamma_site_model(), rate_ac_prior_distr = create_gamma_distr(alpha = 0.05, beta = create_beta_param(value = "10.0")), rate_ag_prior_distr = create_gamma_distr(alpha = 0.05, beta = create_beta_param(value = "20.0")), rate_at_prior_distr = create_gamma_distr(alpha = 0.05, beta = create_beta_param(value = "10.0")), rate_cg_prior_distr = create_gamma_distr(alpha = 0.05, beta = create_beta_param(value = "10.0")), rate_gt_prior_distr = create_gamma_distr(alpha = 0.05, beta = create_beta_param(value = "10.0")), rate_ac_param = create_rate_ac_param(), rate_ag_param = create_rate_ag_param(), rate_at_param = create_rate_at_param(), rate_cg_param = create_rate_cg_param(), rate_ct_param = create_rate_ct_param(), rate_gt_param = create_rate_gt_param(), freq_equilibrium = "estimated", freq_param = create_freq_param() )
create_gtr_site_model( id = NA, gamma_site_model = create_gamma_site_model(), rate_ac_prior_distr = create_gamma_distr(alpha = 0.05, beta = create_beta_param(value = "10.0")), rate_ag_prior_distr = create_gamma_distr(alpha = 0.05, beta = create_beta_param(value = "20.0")), rate_at_prior_distr = create_gamma_distr(alpha = 0.05, beta = create_beta_param(value = "10.0")), rate_cg_prior_distr = create_gamma_distr(alpha = 0.05, beta = create_beta_param(value = "10.0")), rate_gt_prior_distr = create_gamma_distr(alpha = 0.05, beta = create_beta_param(value = "10.0")), rate_ac_param = create_rate_ac_param(), rate_ag_param = create_rate_ag_param(), rate_at_param = create_rate_at_param(), rate_cg_param = create_rate_cg_param(), rate_ct_param = create_rate_ct_param(), rate_gt_param = create_rate_gt_param(), freq_equilibrium = "estimated", freq_param = create_freq_param() )
id |
the IDs of the alignment (can be extracted from
the FASTA filename using |
gamma_site_model |
a gamma site model, as created by create_gamma_site_model |
rate_ac_prior_distr |
the AC rate prior distribution,
as returned by |
rate_ag_prior_distr |
the AG rate prior distribution,
as returned by |
rate_at_prior_distr |
the AT rate prior distribution,
as returned by |
rate_cg_prior_distr |
the CG rate prior distribution,
as returned by |
rate_gt_prior_distr |
the GT rate prior distribution,
as returned by |
rate_ac_param |
the 'rate AC' parameter,
a numeric value.
For advanced usage, use the structure
as returned by |
rate_ag_param |
the 'rate AG' parameter,
a numeric value.
For advanced usage, use the structure
as returned by |
rate_at_param |
the 'rate AT' parameter,
a numeric value.
For advanced usage, use the structure
as returned by |
rate_cg_param |
the 'rate CG' parameter,
a numeric value.
For advanced usage, use the structure
as returned by |
rate_ct_param |
the 'rate CT' parameter,
a numeric value.
For advanced usage, use the structure
as returned by |
rate_gt_param |
the 'rate GT' parameter,
a numeric value.
For advanced usage, use the structure
as returned by |
freq_equilibrium |
the frequency in which the rates are at equilibrium
are either |
freq_param |
a 'freq' parameter, as created by create_freq_param |
a GTR site_model
Richèl J.C. Bilderbeek
if (is_on_ci()) { gtr_site_model <- create_gtr_site_model( rate_ac_param = 1.2, rate_ag_param = 2.3, rate_at_param = 3.4, rate_cg_param = 4.5, rate_ct_param = 5.6, rate_gt_param = 6.7 ) beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, site_model = gtr_site_model ) file.remove(beast2_input_file) remove_beautier_folder() }
if (is_on_ci()) { gtr_site_model <- create_gtr_site_model( rate_ac_param = 1.2, rate_ag_param = 2.3, rate_at_param = 3.4, rate_cg_param = 4.5, rate_ct_param = 5.6, rate_gt_param = 6.7 ) beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, site_model = gtr_site_model ) file.remove(beast2_input_file) remove_beautier_folder() }
substModel
sectionConverts a GTR site model to XML,
used in the substModel
section
create_gtr_subst_model_xml(site_model)
create_gtr_subst_model_xml(site_model)
site_model |
a site model,
as returned by |
the site model as XML text
Richèl J.C. Bilderbeek
Create an HKY site model
create_hky_site_model( id = NA, kappa = "obsolete", kappa_param = create_kappa_param(value = "2.0"), gamma_site_model = create_gamma_site_model(), kappa_prior_distr = create_log_normal_distr(m = create_m_param(value = "1.0"), s = 1.25), freq_equilibrium = "estimated", freq_param = create_freq_param() )
create_hky_site_model( id = NA, kappa = "obsolete", kappa_param = create_kappa_param(value = "2.0"), gamma_site_model = create_gamma_site_model(), kappa_prior_distr = create_log_normal_distr(m = create_m_param(value = "1.0"), s = 1.25), freq_equilibrium = "estimated", freq_param = create_freq_param() )
id |
the IDs of the alignment (can be extracted from
the FASTA filename using |
kappa |
obsoleted parameter. It is the value in the 'kappa_param' argument |
kappa_param |
a 'kappa' parameter, as created by create_kappa_param |
gamma_site_model |
a gamma site model, as created by create_gamma_site_model |
kappa_prior_distr |
the distribution of the kappa prior,
which is a log-normal distribution
(as created by |
freq_equilibrium |
the frequency in which the rates are at equilibrium
are either |
freq_param |
a 'freq' parameter, as created by create_freq_param |
an HKY site_model
Richèl J.C. Bilderbeek
if (is_on_ci()) { hky_site_model <- create_hky_site_model() output_filename <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), output_filename = output_filename, site_model = hky_site_model ) file.remove(output_filename) remove_beautier_folder() }
if (is_on_ci()) { hky_site_model <- create_hky_site_model() output_filename <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), output_filename = output_filename, site_model = hky_site_model ) file.remove(output_filename) remove_beautier_folder() }
substModel
sectionConverts a site model to XML,
used in the substModel
section
create_hky_subst_model_xml(site_model)
create_hky_subst_model_xml(site_model)
site_model |
a site model,
as returned by |
the site model as XML text
Richèl J.C. Bilderbeek
Create a Bayesian phylogenetic inference model, as can be done by BEAUti.
create_inference_model( site_model = create_jc69_site_model(), clock_model = create_strict_clock_model(), tree_prior = create_yule_tree_prior(), mrca_prior = NA, mcmc = create_mcmc(), beauti_options = create_beauti_options(), tipdates_filename = NA )
create_inference_model( site_model = create_jc69_site_model(), clock_model = create_strict_clock_model(), tree_prior = create_yule_tree_prior(), mrca_prior = NA, mcmc = create_mcmc(), beauti_options = create_beauti_options(), tipdates_filename = NA )
site_model |
a site model,
as returned by |
clock_model |
a clock model,
as returned by |
tree_prior |
a tree priors,
as returned by |
mrca_prior |
a Most Recent Common Ancestor prior,
as returned by |
mcmc |
one MCMC.
Use |
beauti_options |
one BEAUti options object,
as returned by |
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. |
an inference model
Richèl J.C. Bilderbeek
Use create_test_inference_model to create an inference model with a short MCMC, to be used in testing. Use create_ns_inference_model to create an inference model to estimate the marginal likelihood (aka evidence) using a nested sampling approach.
if (is_on_ci()) { check_empty_beautier_folder() # Create an MCMC chain with 50 states inference_model <- create_inference_model( mcmc = create_mcmc(chain_length = 50000, store_every = 1000) ) output_filename <- get_beautier_tempfilename() create_beast2_input_file_from_model( input_filename = get_fasta_filename(), output_filename = output_filename, inference_model = inference_model ) file.remove(output_filename) remove_beautier_folder() check_empty_beautier_folder() }
if (is_on_ci()) { check_empty_beautier_folder() # Create an MCMC chain with 50 states inference_model <- create_inference_model( mcmc = create_mcmc(chain_length = 50000, store_every = 1000) ) output_filename <- get_beautier_tempfilename() create_beast2_input_file_from_model( input_filename = get_fasta_filename(), output_filename = output_filename, inference_model = inference_model ) file.remove(output_filename) remove_beautier_folder() check_empty_beautier_folder() }
Create an inverse-gamma distribution
create_inv_gamma_distr( id = NA, alpha = 0, beta = 1, value = NA, lower = NA, upper = NA )
create_inv_gamma_distr( id = NA, alpha = 0, beta = 1, value = NA, lower = NA, upper = NA )
id |
the distribution's ID |
alpha |
the alpha shape parameter,
a numeric value.
For advanced usage, use the structure
as returned by |
beta |
the beta shape parameter,
a numeric value.
For advanced usage, use the structure
as returned by |
value |
the initial value for the MCMC |
lower |
the lower bound, the lowest possible value |
upper |
an upper limit of the uniform distribution.
If the upper limits needs to be infinity, set |
an inverse-gamma distribution
Richèl J.C. Bilderbeek
the function create_distr
shows an overview
of all supported distributions
if (is_on_ci()) { inv_gamma_distr <- create_inv_gamma_distr() beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = create_yule_tree_prior( birth_rate_distr = inv_gamma_distr ) ) file.remove(beast2_input_file) remove_beautier_folder() }
if (is_on_ci()) { inv_gamma_distr <- create_inv_gamma_distr() beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = create_yule_tree_prior( birth_rate_distr = inv_gamma_distr ) ) file.remove(beast2_input_file) remove_beautier_folder() }
Create a JC69 site model
create_jc69_site_model(id = NA, gamma_site_model = create_gamma_site_model())
create_jc69_site_model(id = NA, gamma_site_model = create_gamma_site_model())
id |
the IDs of the alignment (can be extracted from
the FASTA filename using |
gamma_site_model |
a gamma site model, as created by create_gamma_site_model |
a JC69 site_model
Richèl J.C. Bilderbeek
if (is_on_ci()) { jc69_site_model <- create_jc69_site_model() output_filename <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), output_filename = output_filename, site_model = jc69_site_model ) file.remove(output_filename) remove_beautier_folder() }
if (is_on_ci()) { jc69_site_model <- create_jc69_site_model() output_filename <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), output_filename = output_filename, site_model = jc69_site_model ) file.remove(output_filename) remove_beautier_folder() }
substModel
sectionConverts a JC69 site model to XML,
used in the substModel
section
create_jc69_subst_model_xml(site_model)
create_jc69_subst_model_xml(site_model)
site_model |
a site model,
as returned by |
the site model as XML text
Richèl J.C. Bilderbeek
Create a parameter called kappa 1
create_kappa_1_param(id = NA, lower = "0.0", value = "2.0", estimate = TRUE)
create_kappa_1_param(id = NA, lower = "0.0", value = "2.0", estimate = TRUE)
id |
the parameter's ID |
lower |
lowest possible value of the parameter. If the parameter
is estimated, |
value |
value of the parameter |
estimate |
TRUE if this parameter is to be estimated by BEAST2, FALSE otherwise |
a parameter called kappa 1
Richèl J.C. Bilderbeek
Create a parameter called kappa 2
create_kappa_2_param(id = NA, lower = "0.0", value = "2.0", estimate = TRUE)
create_kappa_2_param(id = NA, lower = "0.0", value = "2.0", estimate = TRUE)
id |
the parameter's ID |
lower |
lowest possible value of the parameter. If the parameter
is estimated, |
value |
value of the parameter |
estimate |
TRUE if this parameter is to be estimated by BEAST2, FALSE otherwise |
a parameter called kappa 2
Richèl J.C. Bilderbeek
Create a parameter called kappa
create_kappa_param(id = NA, lower = "0.0", value = "2.0", estimate = TRUE)
create_kappa_param(id = NA, lower = "0.0", value = "2.0", estimate = TRUE)
id |
the parameter's ID |
lower |
lowest possible value of the parameter. If the parameter
is estimated, |
value |
value of the parameter |
estimate |
TRUE if this parameter is to be estimated by BEAST2, FALSE otherwise |
a parameter called kappa
Richèl J.C. Bilderbeek
Create a parameter called lambda
create_lambda_param(id = NA, value = 0)
create_lambda_param(id = NA, value = 0)
id |
the parameter's ID |
value |
value of the parameter |
a parameter called lambda
this parameter is used in a Poisson distribution
(as returned by create_poisson_distr
)
Richèl J.C. Bilderbeek
the function create_param
contains a list
of all parameters that can be created
if (is_on_ci()) { # Create the parameter lambda_param <- create_lambda_param() # Use the parameter in a distribution poisson_distr <- create_poisson_distr( lambda = lambda_param ) # Use the distribution to create a BEAST2 input file beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = create_yule_tree_prior( birth_rate_distr = poisson_distr ) ) file.remove(beast2_input_file) remove_beautier_folder() }
if (is_on_ci()) { # Create the parameter lambda_param <- create_lambda_param() # Use the parameter in a distribution poisson_distr <- create_poisson_distr( lambda = lambda_param ) # Use the distribution to create a BEAST2 input file beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = create_yule_tree_prior( birth_rate_distr = poisson_distr ) ) file.remove(beast2_input_file) remove_beautier_folder() }
Create a Laplace distribution
create_laplace_distr( id = NA, mu = 0, scale = 1, value = NA, lower = NA, upper = NA )
create_laplace_distr( id = NA, mu = 0, scale = 1, value = NA, lower = NA, upper = NA )
id |
the distribution's ID |
mu |
the mu parameter,
a numeric value.
For advanced usage, use the structure
as returned by |
scale |
the scale parameter,
a numeric value.
For advanced usage, use the structure
as returned by |
value |
the initial value for the MCMC |
lower |
the lower bound, the lowest possible value |
upper |
an upper limit of the uniform distribution.
If the upper limits needs to be infinity, set |
a Laplace distribution
Richèl J.C. Bilderbeek
the function create_distr
shows an overview
of all supported distributions
if (is_on_ci()) { laplace_distr <- create_laplace_distr() beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = create_yule_tree_prior( birth_rate_distr = laplace_distr ) ) file.remove(beast2_input_file) remove_beautier_folder() }
if (is_on_ci()) { laplace_distr <- create_laplace_distr() beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = create_yule_tree_prior( birth_rate_distr = laplace_distr ) ) file.remove(beast2_input_file) remove_beautier_folder() }
Create a log-normal distribution
create_log_normal_distr( id = NA, m = 0, s = 0, value = NA, lower = NA, upper = NA )
create_log_normal_distr( id = NA, m = 0, s = 0, value = NA, lower = NA, upper = NA )
id |
the distribution's ID |
m |
the m parameter,
a numeric value.
For advanced usage, use the structure
as returned by |
s |
the s parameter,
a numeric value.
For advanced usage, use the structure
as returned by |
value |
the initial value for the MCMC |
lower |
the lower bound, the lowest possible value |
upper |
an upper limit of the uniform distribution.
If the upper limits needs to be infinity, set |
a log-normal distribution
Richèl J.C. Bilderbeek
the function create_distr
shows an overview
of all supported distributions
if (is_on_ci()) { log_normal_distr <- create_log_normal_distr() beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = create_yule_tree_prior( birth_rate_distr = log_normal_distr ) ) file.remove(beast2_input_file) remove_beautier_folder() }
if (is_on_ci()) { log_normal_distr <- create_log_normal_distr() beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = create_yule_tree_prior( birth_rate_distr = log_normal_distr ) ) file.remove(beast2_input_file) remove_beautier_folder() }
The logger section has these elements:
<logger id="tracelog" [...]> [...] </logger> <logger id="screenlog" [...]> [...] </logger> <logger id="treelog.t:[alignment ID]" [...]> [...] </logger>
create_loggers_xml(input_filename, inference_model)
create_loggers_xml(input_filename, inference_model)
input_filename |
A FASTA filename.
Use |
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
lines of XML text
Richèl J.C. Bilderbeek
Use create_tracelog_xml to create the XML text
of the logger with the tracelog
ID.
Use create_screenlog_xml to create the XML text
of the logger with the screenlog
ID.
Use create_treelog_xml to create the XML text
of the loggers with the treelog
ID.
Create a parameter called m
create_m_param(id = NA, estimate = FALSE, lower = NA, upper = NA, value = 0)
create_m_param(id = NA, estimate = FALSE, lower = NA, upper = NA, value = 0)
id |
the parameter's ID |
estimate |
TRUE if this parameter is to be estimated by BEAST2, FALSE otherwise |
lower |
lowest possible value of the parameter. If the parameter
is estimated, |
upper |
upper value of the parameter |
value |
value of the parameter |
a parameter called m
this parameter is used in a log-normal distribution
(as returned by create_log_normal_distr
)
It cannot be estimated (as a hyper parameter) yet.
Richèl J.C. Bilderbeek
the function create_param
contains a list
of all parameters that can be created
if (is_on_ci()) { # Create the parameter m_param <- create_m_param() # Use the parameter in a distribution log_normal_distr <- create_log_normal_distr( m = m_param ) # Use the distribution to create a BEAST2 input file beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = create_yule_tree_prior( birth_rate_distr = log_normal_distr ) ) file.remove(beast2_input_file) remove_beautier_folder() }
if (is_on_ci()) { # Create the parameter m_param <- create_m_param() # Use the parameter in a distribution log_normal_distr <- create_log_normal_distr( m = m_param ) # Use the distribution to create a BEAST2 input file beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = create_yule_tree_prior( birth_rate_distr = log_normal_distr ) ) file.remove(beast2_input_file) remove_beautier_folder() }
Create an MCMC configuration, as in the BEAUti MCMC tab.
create_mcmc( chain_length = 1e+07, store_every = -1, pre_burnin = 0, n_init_attempts = 10, sample_from_prior = FALSE, tracelog = create_tracelog(), screenlog = create_screenlog(), treelog = create_treelog() )
create_mcmc( chain_length = 1e+07, store_every = -1, pre_burnin = 0, n_init_attempts = 10, sample_from_prior = FALSE, tracelog = create_tracelog(), screenlog = create_screenlog(), treelog = create_treelog() )
chain_length |
length of the MCMC chain |
store_every |
number of states the MCMC will process
before the posterior's state will be saved to file.
Use -1 or |
pre_burnin |
number of burn in samples taken before entering the main loop |
n_init_attempts |
number of initialization attempts before failing |
sample_from_prior |
set to TRUE to sample from the prior |
tracelog |
a |
screenlog |
a |
treelog |
a |
There are four things that can be saved:
* store_every
: saves the state of the MCMC to file,
as a .state.xml
file
* tracelog
: stores the trace of the state of the MCMC
to file. See create_tracelog
how to specify the filename
* screenlog
: stores the screen output
to file. See create_screenlog
how to specify the filename
* treelog
: stores the estimated phylogenies
to file. See create_treelog
how to specify the filename
an MCMC configuration
Richèl J.C. Bilderbeek
Use create_test_mcmc
to create a short regular MCMC,
that can be used for testing runs.
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.
if (is_on_ci()) { # Create an MCMC chain with 50 states mcmc <- create_mcmc(chain_length = 50000, store_every = 1000) beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( get_fasta_filename(), beast2_input_file, mcmc = mcmc ) file.remove(beast2_input_file) remove_beautier_folder() }
if (is_on_ci()) { # Create an MCMC chain with 50 states mcmc <- create_mcmc(chain_length = 50000, store_every = 1000) beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( get_fasta_filename(), beast2_input_file, mcmc = mcmc ) file.remove(beast2_input_file) remove_beautier_folder() }
Create a parameter called mean
create_mean_param(id = NA, value = 0)
create_mean_param(id = NA, value = 0)
id |
the parameter's ID |
value |
value of the parameter |
a parameter called mean
this parameter is used in an exponential distribution
(as returned by create_exp_distr
)
and normal distribution
(as returned by create_normal_distr
).
It cannot be estimated (as a hyper parameter) yet.
Richèl J.C. Bilderbeek
the function create_param
contains a list
of all parameters that can be created
if (is_on_ci()) { # Create the parameter mean_param <- create_mean_param(value = 1.0) # Use the parameter in a distribution exp_distr <- create_exp_distr( mean = mean_param ) # Use the distribution to create a BEAST2 input file beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = create_yule_tree_prior( birth_rate_distr = exp_distr ) ) file.remove(beast2_input_file) remove_beautier_folder() }
if (is_on_ci()) { # Create the parameter mean_param <- create_mean_param(value = 1.0) # Use the parameter in a distribution exp_distr <- create_exp_distr( mean = mean_param ) # Use the distribution to create a BEAST2 input file beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = create_yule_tree_prior( birth_rate_distr = exp_distr ) ) file.remove(beast2_input_file) remove_beautier_folder() }
Create a Most Recent Common Ancestor prior
create_mrca_prior( alignment_id = NA, taxa_names = NA, is_monophyletic = FALSE, mrca_distr = NA, name = NA, clock_prior_distr_id = NA )
create_mrca_prior( alignment_id = NA, taxa_names = NA, is_monophyletic = FALSE, mrca_distr = NA, name = NA, clock_prior_distr_id = NA )
alignment_id |
ID of the alignment,
as returned by get_alignment_id.
Keep at |
taxa_names |
names of the taxa,
as returned by |
is_monophyletic |
boolean to indicate monophyly is assumed in
a Most Recent Common Ancestor prior,
as returned by |
mrca_distr |
the distribution used by the MRCA prior.
Can be NA (the default) or any distribution
returned by |
name |
the unique name of the MRCA prior, for example a genus, family, order or even class name. Leave at NA to have it named automatically. |
clock_prior_distr_id |
ID of an MRCA clock model's distribution.
Keep at |
an MRCA prior
Richèl J.C. Bilderbeek
check_empty_beautier_folder() fasta_filename <- get_beautier_path("anthus_aco.fas") # The first two taxa are sister species mrca_prior <- create_mrca_prior( taxa_names = get_taxa_names(filename = fasta_filename)[1:2] ) # The taxa are monophyletic mrca_prior <- create_mrca_prior( taxa_names = get_taxa_names(filename = fasta_filename), is_monophyletic = TRUE ) # Set the crown age to 10 mrca_prior <- create_mrca_prior( taxa_names = get_taxa_names(fasta_filename), mrca_distr = create_normal_distr(mean = 10, sigma = 0.1) ) check_empty_beautier_folder()
check_empty_beautier_folder() fasta_filename <- get_beautier_path("anthus_aco.fas") # The first two taxa are sister species mrca_prior <- create_mrca_prior( taxa_names = get_taxa_names(filename = fasta_filename)[1:2] ) # The taxa are monophyletic mrca_prior <- create_mrca_prior( taxa_names = get_taxa_names(filename = fasta_filename), is_monophyletic = TRUE ) # Set the crown age to 10 mrca_prior <- create_mrca_prior( taxa_names = get_taxa_names(fasta_filename), mrca_distr = create_normal_distr(mean = 10, sigma = 0.1) ) check_empty_beautier_folder()
Create a parameter called mu
create_mu_param(id = NA, value = 0)
create_mu_param(id = NA, value = 0)
id |
the parameter's ID |
value |
value of the parameter |
a parameter called mu
this parameter is used in a Laplace distribution
(as returned by create_laplace_distr
).
It cannot be estimated (as a hyper parameter) yet.
Richèl J.C. Bilderbeek
the function create_param
contains a list
of all parameters that can be created
if (is_on_ci()) { # Create the parameter mu_param <- create_mu_param() # Use the parameter in a distribution laplace_distr <- create_laplace_distr( mu = mu_param ) # Use the distribution to create a BEAST2 input file beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = create_yule_tree_prior( birth_rate_distr = laplace_distr ) ) file.remove(beast2_input_file) remove_beautier_folder() }
if (is_on_ci()) { # Create the parameter mu_param <- create_mu_param() # Use the parameter in a distribution laplace_distr <- create_laplace_distr( mu = mu_param ) # Use the distribution to create a BEAST2 input file beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = create_yule_tree_prior( birth_rate_distr = laplace_distr ) ) file.remove(beast2_input_file) remove_beautier_folder() }
Create an normal distribution
create_normal_distr( id = NA, mean = 0, sigma = 1, value = NA, lower = NA, upper = NA )
create_normal_distr( id = NA, mean = 0, sigma = 1, value = NA, lower = NA, upper = NA )
id |
the distribution's ID |
mean |
the mean parameter,
a numeric value.
For advanced usage, use the structure
as returned by |
sigma |
the sigma parameter,
a numeric value.
For advanced usage, use the structure
as returned by |
value |
the initial value for the MCMC |
lower |
the lower bound, the lowest possible value |
upper |
an upper limit of the uniform distribution.
If the upper limits needs to be infinity, set |
a normal distribution
Richèl J.C. Bilderbeek
the function create_distr
shows an overview
of all supported distributions
if (is_on_ci()) { normal_distr <- create_normal_distr() beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = create_yule_tree_prior( birth_rate_distr = normal_distr ) ) file.remove(beast2_input_file) remove_beautier_folder() }
if (is_on_ci()) { normal_distr <- create_normal_distr() beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = create_yule_tree_prior( birth_rate_distr = normal_distr ) ) file.remove(beast2_input_file) remove_beautier_folder() }
Create an inference model to measure the evidence of. To do so, the inference model is created as usual (see create_inference_model), except for using a Nested Sampling MCMC (see create_ns_mcmc)
create_ns_inference_model( site_model = create_jc69_site_model(), clock_model = create_strict_clock_model(), tree_prior = create_yule_tree_prior(), mcmc = create_ns_mcmc() )
create_ns_inference_model( site_model = create_jc69_site_model(), clock_model = create_strict_clock_model(), tree_prior = create_yule_tree_prior(), mcmc = create_ns_mcmc() )
site_model |
a site model,
as returned by |
clock_model |
a clock model,
as returned by |
tree_prior |
a tree priors,
as returned by |
mcmc |
one MCMC.
Use |
an inference model
Richèl J.C. Bilderbeek
Use create_inference_model to create a regular inference model. Use create_test_ns_inference_model to create an inference model to estimate the marginal likelihood with a short MCMC, to be used in testing.
check_empty_beautier_folder() inference_model <- create_ns_inference_model() check_empty_beautier_folder()
check_empty_beautier_folder() inference_model <- create_ns_inference_model() check_empty_beautier_folder()
This will result in a BEAST run that estimates the marginal
likelihood until convergence is achieved.
In this context, chain_length
is only an upper bound
to the length of that run.
create_ns_mcmc( chain_length = 1e+07, store_every = -1, pre_burnin = 0, n_init_attempts = 3, particle_count = 1, sub_chain_length = 5000, epsilon = "1e-12", tracelog = create_tracelog(), screenlog = create_screenlog(), treelog = create_treelog() )
create_ns_mcmc( chain_length = 1e+07, store_every = -1, pre_burnin = 0, n_init_attempts = 3, particle_count = 1, sub_chain_length = 5000, epsilon = "1e-12", tracelog = create_tracelog(), screenlog = create_screenlog(), treelog = create_treelog() )
chain_length |
upper bound to the length of the MCMC chain |
store_every |
number of states the MCMC will process
before the posterior's state will be saved to file.
Use -1 or |
pre_burnin |
number of burn in samples taken before entering the main loop |
n_init_attempts |
number of initialization attempts before failing |
particle_count |
number of particles |
sub_chain_length |
sub-chain length |
epsilon |
epsilon |
tracelog |
a |
screenlog |
a |
treelog |
a |
an MCMC object
Richèl J.C. Bilderbeek
* [1] Patricio Maturana Russel, Brendon J Brewer, Steffen Klaere, Remco R Bouckaert; Model Selection and Parameter Inference in Phylogenetics Using Nested Sampling, Systematic Biology, 2018, syy050, https://doi.org/10.1093/sysbio/syy050
Use create_mcmc
to create a regular MCMC.
Use create_test_ns_mcmc
to create an NS MCMC for testing,
with, among others, a short MCMC chain length.
Use check_ns_mcmc
to check that an NS MCMC object is valid.
if (is_on_ci()) { mcmc <- create_ns_mcmc( chain_length = 1e7, store_every = 1000, particle_count = 1, sub_chain_length = 1000, epsilon = 1e-12 ) beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( get_fasta_filename(), beast2_input_file, mcmc = mcmc ) file.remove(beast2_input_file) remove_beautier_folder() }
if (is_on_ci()) { mcmc <- create_ns_mcmc( chain_length = 1e7, store_every = 1000, particle_count = 1, sub_chain_length = 1000, epsilon = 1e-12 ) beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( get_fasta_filename(), beast2_input_file, mcmc = mcmc ) file.remove(beast2_input_file) remove_beautier_folder() }
Create a 1/x distribution
create_one_div_x_distr(id = NA, value = NA, lower = NA, upper = NA)
create_one_div_x_distr(id = NA, value = NA, lower = NA, upper = NA)
id |
the distribution's ID |
value |
the initial value for the MCMC |
lower |
the lower bound, the lowest possible value |
upper |
an upper limit of the uniform distribution.
If the upper limits needs to be infinity, set |
a 1/x distribution
Richèl J.C. Bilderbeek
the function create_distr
shows an overview
of all supported distributions
if (is_on_ci()) { one_div_x_distr <- create_one_div_x_distr() beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = create_yule_tree_prior( birth_rate_distr = one_div_x_distr ) ) file.remove(beast2_input_file) remove_beautier_folder() }
if (is_on_ci()) { one_div_x_distr <- create_one_div_x_distr() beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = create_yule_tree_prior( birth_rate_distr = one_div_x_distr ) ) file.remove(beast2_input_file) remove_beautier_folder() }
General function to create a parameter.
create_param(name, id, value, ...)
create_param(name, id, value, ...)
name |
the parameters' name. Valid
names can be found in |
id |
the parameter's ID |
value |
value of the parameter |
... |
specific parameter parameters |
a parameter
Prefer using the
named functions
create_alpha_param
,
create_beta_param
,
create_clock_rate_param
,
create_kappa_1_param
,
create_kappa_2_param
,
create_lambda_param
,
create_m_param
,
create_mean_param
,
create_mu_param
,
create_rate_ac_param
,
create_rate_ag_param
,
create_rate_at_param
,
create_rate_cg_param
,
create_rate_ct_param
,
create_rate_gt_param
,
create_s_param
,
create_scale_param
,
and create_sigma_param
Richèl J.C. Bilderbeek
if (is_on_ci()) { # Create an alpha parameter alpha_param <- create_alpha_param() # Use the parameter in a distribution beta_distr <- create_beta_distr( alpha = alpha_param ) # Use the distribution to create a BEAST2 input file beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = create_yule_tree_prior( birth_rate_distr = beta_distr ) ) file.remove(beast2_input_file) remove_beautier_folder() }
if (is_on_ci()) { # Create an alpha parameter alpha_param <- create_alpha_param() # Use the parameter in a distribution beta_distr <- create_beta_distr( alpha = alpha_param ) # Use the distribution to create a BEAST2 input file beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = create_yule_tree_prior( birth_rate_distr = beta_distr ) ) file.remove(beast2_input_file) remove_beautier_folder() }
Create a Poisson distribution
create_poisson_distr(id = NA, lambda = 0, value = NA, lower = NA, upper = NA)
create_poisson_distr(id = NA, lambda = 0, value = NA, lower = NA, upper = NA)
id |
the distribution's ID |
lambda |
the lambda parameter,
a numeric value.
For advanced usage, use the structure
as returned by |
value |
the initial value for the MCMC |
lower |
the lower bound, the lowest possible value |
upper |
an upper limit of the uniform distribution.
If the upper limits needs to be infinity, set |
a Poisson distribution
Richèl J.C. Bilderbeek
the function create_distr
shows an overview
of all supported distributions
if (is_on_ci()) { poisson_distr <- create_poisson_distr() beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = create_yule_tree_prior( birth_rate_distr = poisson_distr ) ) file.remove(beast2_input_file) remove_beautier_folder() }
if (is_on_ci()) { poisson_distr <- create_poisson_distr() beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = create_yule_tree_prior( birth_rate_distr = poisson_distr ) ) file.remove(beast2_input_file) remove_beautier_folder() }
Create a parameter called 'rate AC'
create_rate_ac_param(id = NA, estimate = TRUE, value = "1.0", lower = "0.0")
create_rate_ac_param(id = NA, estimate = TRUE, value = "1.0", lower = "0.0")
id |
the parameter's ID |
estimate |
TRUE if this parameter is to be estimated by BEAST2, FALSE otherwise |
value |
value of the parameter |
lower |
lowest possible value of the parameter. If the parameter
is estimated, |
a parameter called 'rate AC'
Richèl J.C. Bilderbeek
the function create_param
contains a list
of all parameters that can be created
if (is_on_ci()) { # Create parameter rate_ac_param <- create_rate_ac_param(value = 1, estimate = FALSE) # Use the parameter to create a BEAST2 input file beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, site_model = create_gtr_site_model( rate_ac_param = rate_ac_param ) ) file.remove(beast2_input_file) remove_beautier_folder() }
if (is_on_ci()) { # Create parameter rate_ac_param <- create_rate_ac_param(value = 1, estimate = FALSE) # Use the parameter to create a BEAST2 input file beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, site_model = create_gtr_site_model( rate_ac_param = rate_ac_param ) ) file.remove(beast2_input_file) remove_beautier_folder() }
Create a parameter called 'rate AG'
create_rate_ag_param(id = NA, estimate = TRUE, value = "1.0", lower = "0.0")
create_rate_ag_param(id = NA, estimate = TRUE, value = "1.0", lower = "0.0")
id |
the parameter's ID |
estimate |
TRUE if this parameter is to be estimated by BEAST2, FALSE otherwise |
value |
value of the parameter |
lower |
lowest possible value of the parameter. If the parameter
is estimated, |
a parameter called 'rate AG'
Richèl J.C. Bilderbeek
the function create_param
contains a list
of all parameters that can be created
if (is_on_ci()) { # Create parameter rate_ag_param <- create_rate_ag_param(value = 1, estimate = FALSE) # Use the parameter to create a BEAST2 input file beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, site_model = create_gtr_site_model( rate_ag_param = rate_ag_param ) ) file.remove(beast2_input_file) remove_beautier_folder() }
if (is_on_ci()) { # Create parameter rate_ag_param <- create_rate_ag_param(value = 1, estimate = FALSE) # Use the parameter to create a BEAST2 input file beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, site_model = create_gtr_site_model( rate_ag_param = rate_ag_param ) ) file.remove(beast2_input_file) remove_beautier_folder() }
Create a parameter called 'rate AT'
create_rate_at_param(id = NA, estimate = TRUE, value = "1.0", lower = "0.0")
create_rate_at_param(id = NA, estimate = TRUE, value = "1.0", lower = "0.0")
id |
the parameter's ID |
estimate |
TRUE if this parameter is to be estimated by BEAST2, FALSE otherwise |
value |
value of the parameter |
lower |
lowest possible value of the parameter. If the parameter
is estimated, |
a parameter called 'rate AT'
Richèl J.C. Bilderbeek
the function create_param
contains a list
of all parameters that can be created
if (is_on_ci()) { # Create parameter rate_at_param <- create_rate_at_param(value = 1, estimate = FALSE) # Use the parameter to create a BEAST2 input file beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, site_model = create_gtr_site_model( rate_at_param = rate_at_param ) ) file.remove(beast2_input_file) remove_beautier_folder() }
if (is_on_ci()) { # Create parameter rate_at_param <- create_rate_at_param(value = 1, estimate = FALSE) # Use the parameter to create a BEAST2 input file beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, site_model = create_gtr_site_model( rate_at_param = rate_at_param ) ) file.remove(beast2_input_file) remove_beautier_folder() }
Creates the rateCategories
state node,
such as:
"<stateNode id=\"rateCategories.c:[id]\"
spec=\"parameter.IntegerParameter\"
dimension=\"[dimension]\">
1
</stateNode>"
create_rate_categories_state_node_xml(inference_model)
create_rate_categories_state_node_xml(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
the following XML:
"<stateNode id=\"rateCategories.c:[id]\"
spec=\"parameter.IntegerParameter\" dimension=\"[dimension]\">
1
</stateNode>"
Richèl J.C. Bilderbeek
check_empty_beautier_folder() create_rate_categories_state_node_xml( create_inference_model( clock_model = create_rln_clock_model( id = 314, dimension = 1 ) ) ) check_empty_beautier_folder()
check_empty_beautier_folder() create_rate_categories_state_node_xml( create_inference_model( clock_model = create_rln_clock_model( id = 314, dimension = 1 ) ) ) check_empty_beautier_folder()
Create a parameter called 'rate CG'
create_rate_cg_param(id = NA, estimate = TRUE, value = "1.0", lower = "0.0")
create_rate_cg_param(id = NA, estimate = TRUE, value = "1.0", lower = "0.0")
id |
the parameter's ID |
estimate |
TRUE if this parameter is to be estimated by BEAST2, FALSE otherwise |
value |
value of the parameter |
lower |
lowest possible value of the parameter. If the parameter
is estimated, |
a parameter called 'rate CG'
Richèl J.C. Bilderbeek
the function create_param
contains a list
of all parameters that can be created
if (is_on_ci()) { # Create parameter rate_cg_param <- create_rate_cg_param(value = 1, estimate = FALSE) # Use the parameter to create a BEAST2 input file beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, site_model = create_gtr_site_model( rate_cg_param = rate_cg_param ) ) file.remove(beast2_input_file) remove_beautier_folder() }
if (is_on_ci()) { # Create parameter rate_cg_param <- create_rate_cg_param(value = 1, estimate = FALSE) # Use the parameter to create a BEAST2 input file beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, site_model = create_gtr_site_model( rate_cg_param = rate_cg_param ) ) file.remove(beast2_input_file) remove_beautier_folder() }
Create a parameter called 'rate CT'
create_rate_ct_param(id = NA, value = "1.0", lower = "0.0")
create_rate_ct_param(id = NA, value = "1.0", lower = "0.0")
id |
the parameter's ID |
value |
value of the parameter |
lower |
lowest possible value of the parameter. If the parameter
is estimated, |
a parameter called 'rate CT'
Richèl J.C. Bilderbeek
the function create_param
contains a list
of all parameters that can be created
if (is_on_ci()) { # Create parameter rate_ct_param <- create_rate_ct_param(value = 1) # Use the parameter to create a BEAST2 input file beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, site_model = create_gtr_site_model( rate_ct_param = rate_ct_param ) ) file.remove(beast2_input_file) remove_beautier_folder() }
if (is_on_ci()) { # Create parameter rate_ct_param <- create_rate_ct_param(value = 1) # Use the parameter to create a BEAST2 input file beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, site_model = create_gtr_site_model( rate_ct_param = rate_ct_param ) ) file.remove(beast2_input_file) remove_beautier_folder() }
Create a parameter called 'rate GT'
create_rate_gt_param(id = NA, estimate = TRUE, value = "1.0", lower = "0.0")
create_rate_gt_param(id = NA, estimate = TRUE, value = "1.0", lower = "0.0")
id |
the parameter's ID |
estimate |
TRUE if this parameter is to be estimated by BEAST2, FALSE otherwise |
value |
value of the parameter |
lower |
lowest possible value of the parameter. If the parameter
is estimated, |
a parameter called 'rate GT'
Richèl J.C. Bilderbeek
the function create_param
contains a list
of all parameters that can be created
if (is_on_ci()) { # Create parameter rate_gt_param <- create_rate_gt_param(value = 1, estimate = FALSE) # Use the parameter to create a BEAST2 input file beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, site_model = create_gtr_site_model( rate_gt_param = rate_gt_param ) ) file.remove(beast2_input_file) remove_beautier_folder() }
if (is_on_ci()) { # Create parameter rate_gt_param <- create_rate_gt_param(value = 1, estimate = FALSE) # Use the parameter to create a BEAST2 input file beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, site_model = create_gtr_site_model( rate_gt_param = rate_gt_param ) ) file.remove(beast2_input_file) remove_beautier_folder() }
Internal function to call create_branch_rate_model_xml for a relaxed log-normal clock.
create_rln_clock_branch_rate_model_xml(inference_model)
create_rln_clock_branch_rate_model_xml(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
a character vector of XML strings
Richèl J.C. Bilderbeek
Create a relaxed log-normal clock model
create_rln_clock_model( id = NA, mean_rate_prior_distr = create_uniform_distr(), ucldstdev_distr = create_gamma_distr(), mparam_id = NA, mean_clock_rate = "1.0", n_rate_categories = -1, normalize_mean_clock_rate = FALSE, dimension = NA, rate_scaler_factor = 0.75 )
create_rln_clock_model( id = NA, mean_rate_prior_distr = create_uniform_distr(), ucldstdev_distr = create_gamma_distr(), mparam_id = NA, mean_clock_rate = "1.0", n_rate_categories = -1, normalize_mean_clock_rate = FALSE, dimension = NA, rate_scaler_factor = 0.75 )
id |
an alignment's IDs.
An ID can be extracted from its FASTA filename
with |
mean_rate_prior_distr |
the mean clock rate prior distribution,
as created by a |
ucldstdev_distr |
the standard deviation of the uncorrelated
log-normal distribution,
as created by a |
mparam_id |
the ID of the M parameter in the |
mean_clock_rate |
the mean clock rate, 1.0 by default
(is called |
n_rate_categories |
the number of rate categories. -1 is default, 0 denotes as much rates as branches |
normalize_mean_clock_rate |
normalize the mean clock rate |
dimension |
the dimensionality of the relaxed clock model. Leave NA to let beautier calculate it. Else, the dimensionality of the clock equals twice the number of taxa minus two. |
rate_scaler_factor |
the strict clock model's operator scaler for the rate. Use an empty string to indicate the default. |
a relaxed log-normal clock_model
Richèl J.C. Bilderbeek
if (is_on_ci()) { rln_clock_model <- create_rln_clock_model() beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( get_fasta_filename(), beast2_input_file, clock_model = rln_clock_model ) file.remove(beast2_input_file) remove_beautier_folder() }
if (is_on_ci()) { rln_clock_model <- create_rln_clock_model() beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( get_fasta_filename(), beast2_input_file, clock_model = rln_clock_model ) file.remove(beast2_input_file) remove_beautier_folder() }
Create a parameter called s
create_s_param(id = NA, value = 0, lower = 0, upper = Inf)
create_s_param(id = NA, value = 0, lower = 0, upper = Inf)
id |
the parameter's ID |
value |
value of the parameter |
lower |
lowest possible value of the parameter. If the parameter
is estimated, |
upper |
upper value of the parameter |
a parameter called s
this parameter is used in a log-normal distribution
(as returned by create_log_normal_distr
)
Richèl J.C. Bilderbeek
the function create_param
contains a list
of all parameters that can be created
if (is_on_ci()) { # Create the parameter s_param <- create_s_param() # Use the parameter in a distribution log_normal_distr <- create_log_normal_distr( s = s_param ) # Use the distribution to create a BEAST2 input file beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = create_yule_tree_prior( birth_rate_distr = log_normal_distr ) ) file.remove(beast2_input_file) remove_beautier_folder() }
if (is_on_ci()) { # Create the parameter s_param <- create_s_param() # Use the parameter in a distribution log_normal_distr <- create_log_normal_distr( s = s_param ) # Use the distribution to create a BEAST2 input file beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = create_yule_tree_prior( birth_rate_distr = log_normal_distr ) ) file.remove(beast2_input_file) remove_beautier_folder() }
Create a parameter called scale
create_scale_param(id = NA, value = 0)
create_scale_param(id = NA, value = 0)
id |
the parameter's ID |
value |
value of the parameter |
a parameter called scale
this parameter is used in a Laplace distribution
(as returned by create_laplace_distr
)
Richèl J.C. Bilderbeek
the function create_param
contains a list
of all parameters that can be created
if (is_on_ci()) { # Create the parameter scale_param <- create_scale_param() # Use the parameter in a distribution laplace_distr <- create_laplace_distr( scale = scale_param ) # Use the distribution to create a BEAST2 input file beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = create_yule_tree_prior( birth_rate_distr = laplace_distr ) ) file.remove(beast2_input_file) remove_beautier_folder() }
if (is_on_ci()) { # Create the parameter scale_param <- create_scale_param() # Use the parameter in a distribution laplace_distr <- create_laplace_distr( scale = scale_param ) # Use the distribution to create a BEAST2 input file beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = create_yule_tree_prior( birth_rate_distr = laplace_distr ) ) file.remove(beast2_input_file) remove_beautier_folder() }
screenlog
objectCreate a screenlog
object
create_screenlog( filename = "", log_every = 1000, mode = "autodetect", sanitise_headers = FALSE, sort = "none" )
create_screenlog( filename = "", log_every = 1000, mode = "autodetect", sanitise_headers = FALSE, sort = "none" )
filename |
name of the file to store the posterior screens
phylogenies to. By default, this is |
log_every |
number of MCMC states between writing to file |
mode |
mode how to log. Valid values are the ones returned by get_log_modes |
sanitise_headers |
set to TRUE to sanitise the headers of the log file |
sort |
how to sort the log. Valid values are the ones returned by get_log_sorts |
a screenlog
object
Richèl J.C. Bilderbeek
check_empty_beautier_folder() create_screenlog() check_empty_beautier_folder()
check_empty_beautier_folder() create_screenlog() check_empty_beautier_folder()
screenlog
section of the logger
section
of a BEAST2 XML parameter fileCreates the screenlog
section of the logger
section
of a BEAST2 XML parameter file
create_screenlog_xml(inference_model = create_inference_model())
create_screenlog_xml(inference_model = create_inference_model())
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
the XML text
Richèl J.C. Bilderbeek
Create a parameter called sigma
create_sigma_param(id = NA, value = 1)
create_sigma_param(id = NA, value = 1)
id |
the parameter's ID |
value |
value of the parameter |
a parameter called sigma
this parameter is used in a normal distribution
(as returned by create_normal_distr
)
Richèl J.C. Bilderbeek
the function create_param
contains a list
of all parameters that can be created
if (is_on_ci()) { # Create the parameter sigma_param <- create_sigma_param() # Use the parameter in a distribution normal_distr <- create_normal_distr( sigma = sigma_param ) # Use the distribution to create a BEAST2 input file beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = create_yule_tree_prior( birth_rate_distr = normal_distr ) ) file.remove(beast2_input_file) remove_beautier_folder() }
if (is_on_ci()) { # Create the parameter sigma_param <- create_sigma_param() # Use the parameter in a distribution normal_distr <- create_normal_distr( sigma = sigma_param ) # Use the distribution to create a BEAST2 input file beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = create_yule_tree_prior( birth_rate_distr = normal_distr ) ) file.remove(beast2_input_file) remove_beautier_folder() }
General function to create a site model.
create_site_model(name, id, gamma_site_model = create_gamma_site_model(), ...)
create_site_model(name, id, gamma_site_model = create_gamma_site_model(), ...)
name |
the site model name. Valid
names can be found in |
id |
the IDs of the alignment (can be extracted from
the FASTA filename using |
gamma_site_model |
a gamma site model, as created by create_gamma_site_model |
... |
specific site model parameters |
a site_model
Prefer using the
named functions
create_gtr_site_model
,
create_hky_site_model
,,
create_jc69_site_model
,
and create_tn93_site_model
Richèl J.C. Bilderbeek
See create_gtr_site_model
for more examples
with a GTR site model. See create_hky_site_model
for more examples with an HKY site model. See
create_jc69_site_model
for more examples with a JC69
site model. See create_tn93_site_model
for more
examples with a TN93 site model
if (is_on_ci()) { check_empty_beautier_folder() input_filename <- get_fasta_filename() gtr_site_model <- create_gtr_site_model() hk_site_model <- create_hky_site_model() jc69_site_model <- create_jc69_site_model() tn93_site_model <- create_tn93_site_model() # Can use any site model output_filename <- get_beautier_tempfilename() create_beast2_input_file( input_filename = input_filename, output_filename = output_filename, site_model = jc69_site_model ) file.remove(output_filename) remove_beautier_folder() check_empty_beautier_folder() }
if (is_on_ci()) { check_empty_beautier_folder() input_filename <- get_fasta_filename() gtr_site_model <- create_gtr_site_model() hk_site_model <- create_hky_site_model() jc69_site_model <- create_jc69_site_model() tn93_site_model <- create_tn93_site_model() # Can use any site model output_filename <- get_beautier_tempfilename() create_beast2_input_file( input_filename = input_filename, output_filename = output_filename, site_model = jc69_site_model ) file.remove(output_filename) remove_beautier_folder() check_empty_beautier_folder() }
Create a site model from name
create_site_model_from_name(site_model_name)
create_site_model_from_name(site_model_name)
site_model_name |
name of a site model,
must be a name as returned by |
a site model
Richèl J.C. Bilderbeek
Use create_site_model to create a site model
check_empty_beautier_folder() site_model <- create_site_model_from_name(get_site_model_names()[1]) check_empty_beautier_folder()
check_empty_beautier_folder() site_model <- create_site_model_from_name(get_site_model_names()[1]) check_empty_beautier_folder()
parameter
s within the siteModel
section
of a BEAST2 parameter file.Internal function to creates the XML text for the
parameter
s within the siteModel
section,
which is part of the siteModel
section
of a BEAST2 parameter file.
create_site_model_parameters_xml(inference_model)
create_site_model_parameters_xml(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
The parameter
s sections has these elements:
[parameters]
[parameters]
can be a combination of these:
<parameter id="mutationRate.s[...]> <parameter id="gammaShape.s[...]> <parameter id="proportionInvariant.s[...]>
the site model as XML text
Richèl J.C. Bilderbeek
check_empty_beautier_folder()
check_empty_beautier_folder()
siteModel
tag
of a BEAST2 parameter file.Creates the XML text for the siteModel
tag of
a BEAST2 parameter file,
which is part of the distribution
node for the
treeLikelihood
ID.
create_site_model_xml(inference_model)
create_site_model_xml(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
The siteModel
tag has these elements:
<siteModel[...]> [parameters] <substModel[...]> [...] </substModel> </siteModel>
The parameter
section is created by
create_site_model_parameters_xml
The substModel
section is created by create_subst_model_xml
the site model as XML text
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # <distribution id="posterior"[...]"> # <distribution id="likelihood" [...]> # <siteModel...> # [parameters] # </siteModel> # </distribution> # </distribution> check_empty_beautier_folder()
check_empty_beautier_folder() # <distribution id="posterior"[...]"> # <distribution id="likelihood" [...]> # <siteModel...> # [parameters] # </siteModel> # </distribution> # </distribution> check_empty_beautier_folder()
create_gtr_site_model
,
create_hky_site_model
,
create_jc69_site_model
and create_tn93_site_model
Creates all supported site models
which is a list of the types returned by
create_gtr_site_model
,
create_hky_site_model
,
create_jc69_site_model
and create_tn93_site_model
create_site_models()
create_site_models()
a list of site_models
Richèl J.C. Bilderbeek
Use create_site_model to create a site model
check_empty_beautier_folder() # All created site models are a kind of site model site_models <- create_site_models() # TRUE is_gtr_site_model(site_models[[1]]) is_hky_site_model(site_models[[2]]) is_jc69_site_model(site_models[[3]]) is_tn93_site_model(site_models[[4]]) check_empty_beautier_folder()
check_empty_beautier_folder() # All created site models are a kind of site model site_models <- create_site_models() # TRUE is_gtr_site_model(site_models[[1]]) is_hky_site_model(site_models[[2]]) is_jc69_site_model(site_models[[3]]) is_tn93_site_model(site_models[[4]]) check_empty_beautier_folder()
Create site models from their names
create_site_models_from_names(site_model_names)
create_site_models_from_names(site_model_names)
site_model_names |
one or more names of a site model,
must be name among those returned by |
one or more site models
Richèl J.C. Bilderbeek
Use create_site_model to create a site model
check_empty_beautier_folder() create_site_models_from_names(get_site_model_names()) check_empty_beautier_folder()
check_empty_beautier_folder() create_site_models_from_names(get_site_model_names()) check_empty_beautier_folder()
Internal function to create the branchRateModel
section
of the XML as text, for a strict clock model
create_strict_clock_branch_rate_model_xml(inference_model)
create_strict_clock_branch_rate_model_xml(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
a character vector of XML strings
Richèl J.C. Bilderbeek
Create a strict clock model
create_strict_clock_model( id = NA, clock_rate_param = create_clock_rate_param(), clock_rate_distr = create_uniform_distr(), rate_scaler_factor = 0.75 )
create_strict_clock_model( id = NA, clock_rate_param = create_clock_rate_param(), clock_rate_distr = create_uniform_distr(), rate_scaler_factor = 0.75 )
id |
an alignment's IDs.
An ID can be extracted from its FASTA filename
with |
clock_rate_param |
the clock rate's parameter,
a numeric value.
For advanced usage, use the structure
as created by the |
clock_rate_distr |
the clock rate's distribution,
as created by a |
rate_scaler_factor |
the strict clock model's operator scaler for the rate. Use an empty string to indicate the default. |
a strict clock_model
I am unsure about the relationship between 'clock_rate_param' and 'clock_rate_distr'. Please contact me if you know the most natural architecture
Richèl J.C. Bilderbeek
if (is_on_ci()) { strict_clock_model <- create_strict_clock_model( clock_rate_param = 1.0, clock_rate_distr = create_uniform_distr() ) beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( get_fasta_filename(), beast2_input_file, clock_model = strict_clock_model ) file.remove(beast2_input_file) remove_beautier_folder() }
if (is_on_ci()) { strict_clock_model <- create_strict_clock_model( clock_rate_param = 1.0, clock_rate_distr = create_uniform_distr() ) beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( get_fasta_filename(), beast2_input_file, clock_model = strict_clock_model ) file.remove(beast2_input_file) remove_beautier_folder() }
Creates the StrictClockRateScaler
operator
such as:
...
create_strict_clock_rate_scaler_operator_xml(inference_model)
create_strict_clock_rate_scaler_operator_xml(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
the following XML:
...
Richèl J.C. Bilderbeek
check_empty_beautier_folder() create_strict_clock_rate_scaler_operator_xml( create_inference_model( clock_model = create_strict_clock_model(id = 314) ) ) check_empty_beautier_folder()
check_empty_beautier_folder() create_strict_clock_rate_scaler_operator_xml( create_inference_model( clock_model = create_strict_clock_model(id = 314) ) ) check_empty_beautier_folder()
substModel
sectionInternal function to create the substModel
section
create_subst_model_xml(inference_model)
create_subst_model_xml(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
the substModel
section as XML text
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # Inference model must be initialized inference_model <- create_inference_model( site_model = create_jc69_site_model(id = 123) ) create_subst_model_xml( inference_model = inference_model ) check_empty_beautier_folder()
check_empty_beautier_folder() # Inference model must be initialized inference_model <- create_inference_model( site_model = create_jc69_site_model(id = 123) ) create_subst_model_xml( inference_model = inference_model ) check_empty_beautier_folder()
Create a filename for a temporary 'screenlog' file
create_temp_screenlog_filename()
create_temp_screenlog_filename()
a filename for a temporary 'screenlog' file
Richèl J.C. Bilderbeek
use create_screenlog to create a screenlog.
check_empty_beautier_folder() create_temp_screenlog_filename() check_empty_beautier_folder()
check_empty_beautier_folder() create_temp_screenlog_filename() check_empty_beautier_folder()
Create a filename for a temporary 'tracelog' file
create_temp_tracelog_filename()
create_temp_tracelog_filename()
a filename for a temporary 'tracelog' file
Richèl J.C. Bilderbeek
use create_tracelog to create a tracelog.
check_empty_beautier_folder() create_temp_tracelog_filename() check_empty_beautier_folder()
check_empty_beautier_folder() create_temp_tracelog_filename() check_empty_beautier_folder()
Create a filename for a temporary 'treelog' file
create_temp_treelog_filename()
create_temp_treelog_filename()
a filename for a temporary 'treelog' file
Richèl J.C. Bilderbeek
use create_treelog to create a treelog.
check_empty_beautier_folder() create_temp_treelog_filename() check_empty_beautier_folder()
check_empty_beautier_folder() create_temp_treelog_filename() check_empty_beautier_folder()
Creates a simple inference model with a short MCMC chain, to be used in testing.
create_test_inference_model( site_model = create_jc69_site_model(), clock_model = create_strict_clock_model(), tree_prior = create_yule_tree_prior(), mrca_prior = NA, mcmc = create_test_mcmc(), beauti_options = create_beauti_options(), tipdates_filename = NA )
create_test_inference_model( site_model = create_jc69_site_model(), clock_model = create_strict_clock_model(), tree_prior = create_yule_tree_prior(), mrca_prior = NA, mcmc = create_test_mcmc(), beauti_options = create_beauti_options(), tipdates_filename = NA )
site_model |
a site model,
as returned by |
clock_model |
a clock model,
as returned by |
tree_prior |
a tree priors,
as returned by |
mrca_prior |
a Most Recent Common Ancestor prior,
as returned by |
mcmc |
one MCMC.
Use |
beauti_options |
one BEAUti options object,
as returned by |
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. |
an inference model
Richèl J.C. Bilderbeek
Use create_inference_model to create a regular inference model. Use create_test_ns_inference_model to create an inference model to estimate the marginal likelihood with a short MCMC, to be used in testing
if (is_on_ci()) { check_empty_beautier_folder() inference_model <- create_test_inference_model() beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file_from_model( get_fasta_filename(), beast2_input_file, inference_model = inference_model ) file.remove(beast2_input_file) remove_beautier_folder() check_empty_beautier_folder() }
if (is_on_ci()) { check_empty_beautier_folder() inference_model <- create_test_inference_model() beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file_from_model( get_fasta_filename(), beast2_input_file, inference_model = inference_model ) file.remove(beast2_input_file) remove_beautier_folder() check_empty_beautier_folder() }
Create an MCMC configuration for testing.
create_test_mcmc( chain_length = 3000, store_every = 1000, pre_burnin = 0, n_init_attempts = 10, sample_from_prior = FALSE, tracelog = create_test_tracelog(), screenlog = create_test_screenlog(), treelog = create_test_treelog() )
create_test_mcmc( chain_length = 3000, store_every = 1000, pre_burnin = 0, n_init_attempts = 10, sample_from_prior = FALSE, tracelog = create_test_tracelog(), screenlog = create_test_screenlog(), treelog = create_test_treelog() )
chain_length |
length of the MCMC chain |
store_every |
number of states the MCMC will process
before the posterior's state will be saved to file.
Use -1 or |
pre_burnin |
number of burn in samples taken before entering the main loop |
n_init_attempts |
number of initialization attempts before failing |
sample_from_prior |
set to TRUE to sample from the prior |
tracelog |
a |
screenlog |
a |
treelog |
a |
an MCMC configuration
Richèl J.C. Bilderbeek
Use create_mcmc
to create a default BEAST2 MCMC
if (is_on_ci()) { # Create an MCMC chain with 50 states mcmc <- create_test_mcmc() beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( get_fasta_filename(), beast2_input_file, mcmc = mcmc ) file.remove(beast2_input_file) remove_beautier_folder() }
if (is_on_ci()) { # Create an MCMC chain with 50 states mcmc <- create_test_mcmc() beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( get_fasta_filename(), beast2_input_file, mcmc = mcmc ) file.remove(beast2_input_file) remove_beautier_folder() }
Create an inference model to be tested by Nested Sampling
create_test_ns_inference_model( site_model = create_jc69_site_model(), clock_model = create_strict_clock_model(), tree_prior = create_yule_tree_prior(), mcmc = create_test_ns_mcmc() )
create_test_ns_inference_model( site_model = create_jc69_site_model(), clock_model = create_strict_clock_model(), tree_prior = create_yule_tree_prior(), mcmc = create_test_ns_mcmc() )
site_model |
a site model,
as returned by |
clock_model |
a clock model,
as returned by |
tree_prior |
a tree priors,
as returned by |
mcmc |
one MCMC.
Use |
an inference model
Richèl J.C. Bilderbeek
Use create_test_inference_model to create a regular inference model with a short MCMC, to be used in testing. Use create_ns_inference_model to create an inference model to estimate the marginal likelihood.
check_empty_beautier_folder() inference_model <- create_test_ns_inference_model() check_empty_beautier_folder()
check_empty_beautier_folder() inference_model <- create_test_ns_inference_model() check_empty_beautier_folder()
Create an NS MCMC object for testing
create_test_ns_mcmc( chain_length = 2000, store_every = 1000, pre_burnin = 0, n_init_attempts = 3, particle_count = 1, sub_chain_length = 500, epsilon = 1e-12, tracelog = create_test_tracelog(), screenlog = create_test_screenlog(), treelog = create_test_treelog() )
create_test_ns_mcmc( chain_length = 2000, store_every = 1000, pre_burnin = 0, n_init_attempts = 3, particle_count = 1, sub_chain_length = 500, epsilon = 1e-12, tracelog = create_test_tracelog(), screenlog = create_test_screenlog(), treelog = create_test_treelog() )
chain_length |
upper bound to the length of the MCMC chain |
store_every |
number of states the MCMC will process
before the posterior's state will be saved to file.
Use -1 or |
pre_burnin |
number of burn in samples taken before entering the main loop |
n_init_attempts |
number of initialization attempts before failing |
particle_count |
number of particles |
sub_chain_length |
sub-chain length |
epsilon |
epsilon |
tracelog |
a |
screenlog |
a |
treelog |
a |
an MCMC object
Richèl J.C. Bilderbeek
Use create_ns_mcmc
to create a default
nested sampling MCMC
if (is_on_ci()) { mcmc <- create_test_ns_mcmc() beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( get_fasta_filename(), beast2_input_file, mcmc = mcmc ) file.remove(beast2_input_file) remove_beautier_folder() }
if (is_on_ci()) { mcmc <- create_test_ns_mcmc() beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( get_fasta_filename(), beast2_input_file, mcmc = mcmc ) file.remove(beast2_input_file) remove_beautier_folder() }
screenlog
object, to be used in testingCreate a screenlog
object, to be used in testing
create_test_screenlog( filename = create_temp_screenlog_filename(), log_every = 1000, mode = "autodetect", sanitise_headers = FALSE, sort = "none" )
create_test_screenlog( filename = create_temp_screenlog_filename(), log_every = 1000, mode = "autodetect", sanitise_headers = FALSE, sort = "none" )
filename |
name of the file to store the posterior screens
phylogenies to. By default, this is |
log_every |
number of MCMC states between writing to file |
mode |
mode how to log. Valid values are the ones returned by get_log_modes |
sanitise_headers |
set to TRUE to sanitise the headers of the log file |
sort |
how to sort the log. Valid values are the ones returned by get_log_sorts |
a screenlog
object
Richèl J.C. Bilderbeek
create_test_screenlog()
create_test_screenlog()
tracelog
object, as used for testingCreate a tracelog
object, as used for testing
create_test_tracelog( filename = create_temp_tracelog_filename(), log_every = 1000, mode = "autodetect", sanitise_headers = TRUE, sort = "smart" )
create_test_tracelog( filename = create_temp_tracelog_filename(), log_every = 1000, mode = "autodetect", sanitise_headers = TRUE, sort = "smart" )
filename |
name of the file to store the posterior traces.
Use NA to use the filename |
log_every |
number of MCMC states between writing to file |
mode |
mode how to log. Valid values are the ones returned by get_log_modes |
sanitise_headers |
set to TRUE to sanitise the headers of the log file |
sort |
how to sort the log. Valid values are the ones returned by get_log_sorts |
a tracelog
object
Richèl J.C. Bilderbeek
create_test_tracelog()
create_test_tracelog()
treelog
object to be used in testingCreate a treelog
object to be used in testing
create_test_treelog( filename = create_temp_treelog_filename(), log_every = 1000, mode = "tree", sanitise_headers = FALSE, sort = "none" )
create_test_treelog( filename = create_temp_treelog_filename(), log_every = 1000, mode = "tree", sanitise_headers = FALSE, sort = "none" )
filename |
name of the file to store the posterior trees |
log_every |
number of MCMC states between writing to file |
mode |
mode how to log. Valid values are the ones returned by get_log_modes |
sanitise_headers |
set to TRUE to sanitise the headers of the log file |
sort |
how to sort the log. Valid values are the ones returned by get_log_sorts |
a treelog
object
Richèl J.C. Bilderbeek
create_test_treelog()
create_test_treelog()
Create a TN93 site model
create_tn93_site_model( id = NA, gamma_site_model = create_gamma_site_model(), kappa_1_param = create_kappa_1_param(), kappa_2_param = create_kappa_2_param(), kappa_1_prior_distr = create_log_normal_distr(m = 1, s = 1.25), kappa_2_prior_distr = create_log_normal_distr(m = 1, s = 1.25), freq_equilibrium = "estimated", freq_param = create_freq_param() )
create_tn93_site_model( id = NA, gamma_site_model = create_gamma_site_model(), kappa_1_param = create_kappa_1_param(), kappa_2_param = create_kappa_2_param(), kappa_1_prior_distr = create_log_normal_distr(m = 1, s = 1.25), kappa_2_prior_distr = create_log_normal_distr(m = 1, s = 1.25), freq_equilibrium = "estimated", freq_param = create_freq_param() )
id |
the IDs of the alignment (can be extracted from
the FASTA filename using |
gamma_site_model |
a gamma site model, as created by create_gamma_site_model |
kappa_1_param |
the 'kappa 1' parameter,
a numeric value.
For advanced usage, use the structure
as returned by |
kappa_2_param |
the 'kappa 2' parameter,
a numeric value.
For advanced usage, use the structure
as returned by |
kappa_1_prior_distr |
the distribution of the kappa 1 prior,
which is a log-normal distribution
(as created by |
kappa_2_prior_distr |
the distribution of the kappa 2 prior,
which is a log-normal distribution
(as created by |
freq_equilibrium |
the frequency in which the rates are at equilibrium
are either |
freq_param |
a 'freq' parameter, as created by create_freq_param |
a TN93 site_model
Richèl J.C. Bilderbeek
if (is_on_ci()) { tn93_site_model <- create_tn93_site_model( kappa_1_param = 2.0, kappa_2_param = 2.0 ) output_filename <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), output_filename = output_filename, site_model = tn93_site_model ) file.remove(output_filename) remove_beautier_folder() }
if (is_on_ci()) { tn93_site_model <- create_tn93_site_model( kappa_1_param = 2.0, kappa_2_param = 2.0 ) output_filename <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), output_filename = output_filename, site_model = tn93_site_model ) file.remove(output_filename) remove_beautier_folder() }
substModel
sectionConverts a TN93 site model to XML,
used in the substModel
section
create_tn93_subst_model_xml(site_model)
create_tn93_subst_model_xml(site_model)
site_model |
a site model,
as returned by |
the site model as XML text
Richèl J.C. Bilderbeek
tracelog
objectCreate a tracelog
object
create_tracelog( filename = NA, log_every = 1000, mode = "autodetect", sanitise_headers = TRUE, sort = "smart" )
create_tracelog( filename = NA, log_every = 1000, mode = "autodetect", sanitise_headers = TRUE, sort = "smart" )
filename |
name of the file to store the posterior traces.
Use NA to use the filename |
log_every |
number of MCMC states between writing to file |
mode |
mode how to log. Valid values are the ones returned by get_log_modes |
sanitise_headers |
set to TRUE to sanitise the headers of the log file |
sort |
how to sort the log. Valid values are the ones returned by get_log_sorts |
a tracelog
object
Richèl J.C. Bilderbeek
create_tracelog()
create_tracelog()
Creates the tracelog
section of the logger
section
of a BEAST2 XML parameter file
create_tracelog_xml(input_filename, inference_model)
create_tracelog_xml(input_filename, inference_model)
input_filename |
A FASTA filename.
Use |
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
lines of XML text
Richèl J.C. Bilderbeek
For example, a data frame with row A 1
and another row B 2
, the trait set string will be
A=1,B=2
create_trait_set_string(df)
create_trait_set_string(df)
df |
a data frame with two columns |
the trait set string
Richèl J.C. Bilderbeek
distribution
tag
with the treeLikelihood
ID,
of a BEAST2 parameter file.Creates the XML text for the distribution
tag
with the treeLikelihood
ID,
of a BEAST2 parameter file,
in an unindented form
create_tree_likelihood_distr_xml(inference_model)
create_tree_likelihood_distr_xml(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
The distribution
tag (with ID equals treeLikelihood
)
has these elements:
<distribution id="treeLikelihood"[...]> <siteModel[...]> [...] </siteModel> <branchRateModel[...]> [...] </branchRateModel> </distribution>
The siteModel
section
is created by create_site_model_xml.
The branchRateModel
section
is created by create_branch_rate_model_xml.
Zooming out:
<beast[...]> <run[...]> <distribution id="posterior"[...]> <distribution id="likelihood"[...]> [this section] </distribution> </distribution> </run> </beast>
lines of XML text
this function is not intended for regular use, thus its long name length is accepted
Richèl J.C. Bilderbeek
this function is called by create_beast2_input_distr
,
together with create_beast2_input_distr_prior
Internal function to create a tree prior
create_tree_prior(name, id, ...)
create_tree_prior(name, id, ...)
name |
the tree prior name. Can be any name
in |
id |
the ID of the alignment |
... |
specific tree prior parameters |
a tree_prior
Prefer the use the named functions
create_bd_tree_prior
,
create_cbs_tree_prior
,
create_ccp_tree_prior
create_cep_tree_prior
and create_yule_tree_prior
instead
Richèl J.C. Bilderbeek
See
create_bd_tree_prior
,
create_cbs_tree_prior
,
create_ccp_tree_prior
create_cep_tree_prior
and create_yule_tree_prior
for more examples using those functions
if (is_on_ci()) { check_empty_beautier_folder() beast2_input_file <- get_beautier_tempfilename() bd_tree_prior <- create_bd_tree_prior() cbs_tree_prior <- create_cbs_tree_prior() ccp_tree_prior <- create_ccp_tree_prior() cep_tree_prior <- create_cep_tree_prior() yule_tree_prior <- create_yule_tree_prior() # Use any of the above tree priors create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = bd_tree_prior ) file.remove(beast2_input_file) remove_beautier_folder() check_empty_beautier_folder() }
if (is_on_ci()) { check_empty_beautier_folder() beast2_input_file <- get_beautier_tempfilename() bd_tree_prior <- create_bd_tree_prior() cbs_tree_prior <- create_cbs_tree_prior() ccp_tree_prior <- create_ccp_tree_prior() cep_tree_prior <- create_cep_tree_prior() yule_tree_prior <- create_yule_tree_prior() # Use any of the above tree priors create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = bd_tree_prior ) file.remove(beast2_input_file) remove_beautier_folder() check_empty_beautier_folder() }
create_bd_tree_prior
,
create_cbs_tree_prior
,
create_ccp_tree_prior
,
create_cep_tree_prior
and create_yule_tree_prior
Creates all supported tree priors,
which is a list of the types returned by
create_bd_tree_prior
,
create_cbs_tree_prior
,
create_ccp_tree_prior
,
create_cep_tree_prior
and create_yule_tree_prior
create_tree_priors()
create_tree_priors()
a list of tree_priors
Richèl J.C. Bilderbeek
check_empty_beautier_folder() tree_priors <- create_tree_priors() # TRUE is_bd_tree_prior(tree_priors[[1]]) is_cbs_tree_prior(tree_priors[[2]]) is_ccp_tree_prior(tree_priors[[3]]) is_cep_tree_prior(tree_priors[[4]]) is_yule_tree_prior(tree_priors[[5]]) check_empty_beautier_folder()
check_empty_beautier_folder() tree_priors <- create_tree_priors() # TRUE is_bd_tree_prior(tree_priors[[1]]) is_cbs_tree_prior(tree_priors[[2]]) is_ccp_tree_prior(tree_priors[[3]]) is_cep_tree_prior(tree_priors[[4]]) is_yule_tree_prior(tree_priors[[5]]) check_empty_beautier_folder()
treelog
objectCreate a treelog
object
create_treelog( filename = "$(tree).trees", log_every = 1000, mode = "tree", sanitise_headers = FALSE, sort = "none" )
create_treelog( filename = "$(tree).trees", log_every = 1000, mode = "tree", sanitise_headers = FALSE, sort = "none" )
filename |
name of the file to store the posterior trees |
log_every |
number of MCMC states between writing to file |
mode |
mode how to log. Valid values are the ones returned by get_log_modes |
sanitise_headers |
set to TRUE to sanitise the headers of the log file |
sort |
how to sort the log. Valid values are the ones returned by get_log_sorts |
a 'treelog', as can be checked by check_treelog
Richèl J.C. Bilderbeek
check_empty_beautier_folder() create_treelog() check_empty_beautier_folder()
check_empty_beautier_folder() create_treelog() check_empty_beautier_folder()
Creates the XML text for the 'logger' tag with ID 'treelog'. This section has these elements: “' <logger id="treelog.t:test_output_0" spec="Logger" fileName="my_treelog.trees" logEvery="345000" mode="tree" sanitiseHeaders="true" sort="smart"> # nolint indeed long <log id="TreeWithMetaDataLogger.t:test_output_0" spec="beast.evolution.tree.TreeWithMetaDataLogger" tree="@Tree.t:test_output_0"/> # nolint indeed long </logger> “'
create_treelog_xml(inference_model)
create_treelog_xml(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
lines of XML text
Richèl J.C. Bilderbeek
Creates the ucldMean.c
parameter with the name stateNode
,
such as:
<parameter id=\"ucldMean.c:[id]\" spec=\"parameter.RealParameter\"
name=\"stateNode\">1.0</parameter>
create_ucld_mean_state_node_param_xml(inference_model)
create_ucld_mean_state_node_param_xml(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
the XML
<parameter id=\"ucldMean.c:[id]\" spec=\"parameter.RealParameter\"
name=\"stateNode\">1.0</parameter>
Richèl J.C. Bilderbeek
check_empty_beautier_folder() create_ucld_mean_state_node_param_xml( create_inference_model( clock_model = create_rln_clock_model(id = 314), beauti_options = create_beauti_options_v2_6() ) ) check_empty_beautier_folder()
check_empty_beautier_folder() create_ucld_mean_state_node_param_xml( create_inference_model( clock_model = create_rln_clock_model(id = 314), beauti_options = create_beauti_options_v2_6() ) ) check_empty_beautier_folder()
Creates the ucldStdev
parameter with the name stateNode
,
such as:
<parameter id="ucldStdev.c:[id]" [...] name="stateNode">0.1</parameter>
create_ucld_stdev_state_node_param_xml(inference_model)
create_ucld_stdev_state_node_param_xml(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
the following XML:
<parameter id="ucldStdev.c:[id]" lower="0.0" name="stateNode">
0.1
</parameter>
Richèl J.C. Bilderbeek
check_empty_beautier_folder() create_ucld_stdev_state_node_param_xml( create_inference_model( clock_model = create_rln_clock_model(id = 314) ) ) check_empty_beautier_folder()
check_empty_beautier_folder() create_ucld_stdev_state_node_param_xml( create_inference_model( clock_model = create_rln_clock_model(id = 314) ) ) check_empty_beautier_folder()
Create a uniform distribution
create_uniform_distr(id = NA, value = NA, lower = NA, upper = Inf)
create_uniform_distr(id = NA, value = NA, lower = NA, upper = Inf)
id |
the distribution's ID |
value |
the initial value for the MCMC |
lower |
the lower bound, the lowest possible value |
upper |
an upper limit of the uniform distribution.
If the upper limits needs to be infinity, set |
a uniform distribution
Richèl J.C. Bilderbeek
the function create_distr
shows an overview
of all supported distributions
if (is_on_ci()) { uniform_distr <- create_uniform_distr() beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = create_yule_tree_prior( birth_rate_distr = uniform_distr ) ) file.remove(beast2_input_file) remove_beautier_folder() }
if (is_on_ci()) { uniform_distr <- create_uniform_distr() beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = create_yule_tree_prior( birth_rate_distr = uniform_distr ) ) file.remove(beast2_input_file) remove_beautier_folder() }
Create the XML declaration of the BEAST2 XML input file
create_xml_declaration()
create_xml_declaration()
one line of XML text
Richèl J.C. Bilderbeek
check_empty_beautier_folder() create_xml_declaration() check_empty_beautier_folder()
check_empty_beautier_folder() create_xml_declaration() check_empty_beautier_folder()
Create a Yule tree prior
create_yule_tree_prior( id = NA, birth_rate_distr = create_uniform_distr() )
create_yule_tree_prior( id = NA, birth_rate_distr = create_uniform_distr() )
id |
the ID of the alignment |
birth_rate_distr |
the birth rate distribution,
as created by a |
a Yule tree_prior
Richèl J.C. Bilderbeek
An alignment ID can be extracted from
its FASTA filename using get_alignment_id
if (is_on_ci()) { yule_tree_prior <- create_yule_tree_prior() beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = yule_tree_prior ) file.remove(beast2_input_file) remove_beautier_folder() }
if (is_on_ci()) { yule_tree_prior <- create_yule_tree_prior() beast2_input_file <- get_beautier_tempfilename() create_beast2_input_file( input_filename = get_fasta_filename(), beast2_input_file, tree_prior = yule_tree_prior ) file.remove(beast2_input_file) remove_beautier_folder() }
create_param
.
This function does nothing. It is intended to inherit documentation from.Documentation of parameters (for example, create_param
.
This function does nothing. It is intended to inherit documentation from.
default_parameters_doc(dimension, estimate, id, lower, name, upper, value, ...)
default_parameters_doc(dimension, estimate, id, lower, name, upper, value, ...)
dimension |
the number of dimensions, for example, as used in create_freq_param |
estimate |
TRUE if this parameter is to be estimated by BEAST2, FALSE otherwise |
id |
the parameter's ID |
lower |
lowest possible value of the parameter. If the parameter
is estimated, |
name |
the parameters' name. Valid
names can be found in |
upper |
upper value of the parameter |
value |
value of the parameter |
... |
specific parameter parameters |
This is an internal function, so it should be marked with
@export
. This is not done, as this will disallow all
functions to find the documentation parameters
Richèl J.C. Bilderbeek
Documentation of general function arguments. This function does nothing. It is intended to inherit function argument documentation.
default_params_doc( alignment_id, allow_empty_str, allow_na, alpha_parameter, b_pop_sizes_param, b_pop_sizes_parameter, bd_tree_prior, beautier_folder, cbs_tree_prior, beast2_version, beauti_options, beta_parameter, ccp_tree_prior, cep_tree_prior, chain_length, clock_model, clock_model_name, clock_model_names, clock_models, clock_prior_distr_id, clock_rate_param, crown_age, crown_ages, distr_id, fasta_filename, fasta_filenames, filename, fixed_crown_age, fixed_crown_ages, freq_param, gamma_distr, gamma_site_model, group_sizes_dimension, gtr_site_model, has_non_strict_clock_model, has_tip_dating, hky_site_model, id, ids, inference_model, inference_models, initial_phylogenies, input_filename, input_filenames, is_monophyletic, jc69_site_model, kappa_param, log_every, m_param, mcmc, mode, mrca_prior, mrca_priors, mrca_prior_name, n_init_attempts, output_filename, param, param_id, phylogeny, pop_sizes_scaler_scale_factor, pre_burnin, rate_scaler_factor, rename_fun, rln_clock_model, sample_from_prior, sanitise_headers, screenlog, sequence_length, site_model, site_model_name, site_model_names, site_models, sort, store_every, strict_clock_model, taxa_names, tipdates_filename, tn93_site_model, tracelog, treelog, tree_prior, tree_prior_name, tree_prior_names, tree_priors, verbose, yule_tree_prior )
default_params_doc( alignment_id, allow_empty_str, allow_na, alpha_parameter, b_pop_sizes_param, b_pop_sizes_parameter, bd_tree_prior, beautier_folder, cbs_tree_prior, beast2_version, beauti_options, beta_parameter, ccp_tree_prior, cep_tree_prior, chain_length, clock_model, clock_model_name, clock_model_names, clock_models, clock_prior_distr_id, clock_rate_param, crown_age, crown_ages, distr_id, fasta_filename, fasta_filenames, filename, fixed_crown_age, fixed_crown_ages, freq_param, gamma_distr, gamma_site_model, group_sizes_dimension, gtr_site_model, has_non_strict_clock_model, has_tip_dating, hky_site_model, id, ids, inference_model, inference_models, initial_phylogenies, input_filename, input_filenames, is_monophyletic, jc69_site_model, kappa_param, log_every, m_param, mcmc, mode, mrca_prior, mrca_priors, mrca_prior_name, n_init_attempts, output_filename, param, param_id, phylogeny, pop_sizes_scaler_scale_factor, pre_burnin, rate_scaler_factor, rename_fun, rln_clock_model, sample_from_prior, sanitise_headers, screenlog, sequence_length, site_model, site_model_name, site_model_names, site_models, sort, store_every, strict_clock_model, taxa_names, tipdates_filename, tn93_site_model, tracelog, treelog, tree_prior, tree_prior_name, tree_prior_names, tree_priors, verbose, yule_tree_prior )
alignment_id |
ID of the alignment,
as returned by get_alignment_id.
Keep at |
allow_empty_str |
allow a string to be empty |
allow_na |
allow NA |
alpha_parameter |
an alpha parameter, as created by create_alpha_param |
b_pop_sizes_param |
a Bayesian population size parameter, as created by create_b_pop_sizes_param |
b_pop_sizes_parameter |
a Bayesian population size parameter, as created by create_b_pop_sizes_param |
bd_tree_prior |
a Birth-Death tree prior, as created
by |
beautier_folder |
the path to the beautier temporary files folder |
cbs_tree_prior |
a Coalescent Bayesian Skyline tree prior,
as returned by |
beast2_version |
BEAST2 version, for example, |
beauti_options |
one BEAUti options object,
as returned by |
beta_parameter |
a beta parameter, as created by create_beta_param |
ccp_tree_prior |
a Coalescent Constant Population tree prior,
as returned by |
cep_tree_prior |
a Coalescent Exponential Population tree prior,
as returned by |
chain_length |
length of the MCMC chain |
clock_model |
a clock model,
as returned by |
clock_model_name |
name of a clock model,
must be a name as returned by |
clock_model_names |
one or more names of a clock model,
must be name among those returned by |
clock_models |
a list of one or more clock models,
as returned by |
clock_prior_distr_id |
ID of an MRCA clock model's distribution.
Keep at |
clock_rate_param |
a |
crown_age |
the crown age of the phylogeny |
crown_ages |
the crown ages of the phylogenies. Set to NA if the crown age needs to be estimated |
distr_id |
a distributions' ID |
fasta_filename |
a FASTA filename.
Use |
fasta_filenames |
One or more FASTA filenames.
Use |
filename |
a filename, as can be checked by check_filename |
fixed_crown_age |
determines if the phylogeny's crown age is fixed. If FALSE, crown age is estimated by BEAST2. If TRUE, the crown age is fixed to the crown age of the initial phylogeny. |
fixed_crown_ages |
one or more booleans to determine if the phylogenies' crown ages are fixed. If FALSE, crown age is estimated by BEAST2. If TRUE, the crown age is fixed to the crown age of the initial phylogeny. |
freq_param |
a 'freq' parameter, as created by create_freq_param |
gamma_distr |
a gamma distribution,
as created by |
gamma_site_model |
a site model's gamma site model,
as returned by |
group_sizes_dimension |
the group sizes' dimension,
as used by the CBS tree prior (see |
gtr_site_model |
a GTR site model,
as returned by |
has_non_strict_clock_model |
boolean to indicate that the is already at least one non-strict (i.e. relaxed log-normal) clock model |
has_tip_dating |
TRUE if the user has supplied tip dates, FALSE otherwise |
hky_site_model |
an HKY site model,
as returned by |
id |
an alignment's IDs.
An ID can be extracted from its FASTA filename
with |
ids |
one or more alignments' IDs.
IDs can be extracted from their FASTA filenames
with |
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
inference_models |
a list of one or more inference models, as can be created by create_inference_model |
initial_phylogenies |
one or more MCMC chain's initial phylogenies.
Each one set to |
input_filename |
A FASTA filename.
Use |
input_filenames |
One or more FASTA filenames.
Use |
is_monophyletic |
boolean to indicate monophyly is assumed in
a Most Recent Common Ancestor prior,
as returned by |
jc69_site_model |
a JC69 site model,
as returned by |
kappa_param |
a kappa parameter, as created by create_kappa_param |
log_every |
number of MCMC states between writing to file |
m_param |
an m parameter, as created by create_m_param |
mcmc |
one MCMC.
Use |
mode |
mode how to log. Valid values are the ones returned by get_log_modes |
mrca_prior |
a Most Recent Common Ancestor prior,
as returned by |
mrca_priors |
a list of one or more Most Recent Common Ancestor priors,
as returned by |
mrca_prior_name |
the unique name of the MRCA prior, for example a genus, family, order or even class name. Leave at NA to have it named automatically. |
n_init_attempts |
number of initialization attempts before failing |
output_filename |
Name of the XML parameter file created by this function. BEAST2 uses this file as input. |
param |
a parameter, as can be created by |
param_id |
a parameter's ID |
phylogeny |
a phylogeny of type |
pop_sizes_scaler_scale_factor |
the scale factor used by the population sizes scaler operator |
pre_burnin |
number of burn in samples taken before entering the main loop |
rate_scaler_factor |
the strict clock model's operator scaler for the rate. Use an empty string to indicate the default. |
rename_fun |
a function to rename a filename, as can be checked by check_rename_fun. This function should have one argument, which will be a filename or NA. The function should return one filename (when passed one filename) or one NA (when passed one NA). Example rename functions are:
|
rln_clock_model |
a Relaxed Log-Normal clock model,
as returned by |
sample_from_prior |
set to TRUE to sample from the prior |
sanitise_headers |
set to TRUE to sanitise the headers of the log file |
screenlog |
a |
sequence_length |
a DNA sequence length, in base pairs |
site_model |
a site model,
as returned by |
site_model_name |
name of a site model,
must be a name as returned by |
site_model_names |
one or more names of a site model,
must be name among those returned by |
site_models |
one or more site models,
as returned by |
sort |
how to sort the log. Valid values are the ones returned by get_log_sorts |
store_every |
number of states the MCMC will process
before the posterior's state will be saved to file.
Use -1 or |
strict_clock_model |
a strict clock model,
as returned by |
taxa_names |
names of the taxa,
as returned by |
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. |
tn93_site_model |
a TN93 site model,
as returned by |
tracelog |
a |
treelog |
a |
tree_prior |
a tree priors,
as returned by |
tree_prior_name |
name of a tree prior,
must be a name as returned by |
tree_prior_names |
one or more names of a tree prior,
must be a name among those returned by |
tree_priors |
one or more tree priors,
as returned by |
verbose |
if TRUE, additional information is displayed, that is potentially useful in debugging |
yule_tree_prior |
a Yule tree_prior,
as created by |
This is an internal function, so it should be marked with
@export
. This is not done, as this will disallow all
functions to find the documentation parameters
Richèl J.C. Bilderbeek
Converts a distribution to XML
distr_to_xml(distr, beauti_options)
distr_to_xml(distr, beauti_options)
distr |
a distribution,
as created by |
beauti_options |
one BEAUti options object,
as returned by |
the distribution as XML text
Richèl J.C. Bilderbeek
check_empty_beautier_folder() distr_to_xml( create_uniform_distr(id = 1), beauti_options = create_beauti_options() ) check_empty_beautier_folder()
check_empty_beautier_folder() distr_to_xml( create_uniform_distr(id = 1), beauti_options = create_beauti_options() ) check_empty_beautier_folder()
Converts a beta distribution to XML
distr_to_xml_beta(distr, beauti_options)
distr_to_xml_beta(distr, beauti_options)
distr |
a beta distribution,
as created by |
beauti_options |
one BEAUti options object,
as returned by |
the distribution as XML text
Richèl J.C. Bilderbeek
Converts an exponential distribution to XML
distr_to_xml_exp(distr, beauti_options)
distr_to_xml_exp(distr, beauti_options)
distr |
an exponential distribution,
as created by |
beauti_options |
one BEAUti options object,
as returned by |
the distribution as XML text
Richèl J.C. Bilderbeek
Converts an inverse-gamma distribution to XML
distr_to_xml_inv_gamma(distr, beauti_options)
distr_to_xml_inv_gamma(distr, beauti_options)
distr |
an inverse-gamma distribution,
as created by |
beauti_options |
one BEAUti options object,
as returned by |
the distribution as XML text
Richèl J.C. Bilderbeek
Converts a Laplace distribution to XML
distr_to_xml_laplace(distr, beauti_options)
distr_to_xml_laplace(distr, beauti_options)
distr |
a Laplace distribution
as created by |
beauti_options |
one BEAUti options object,
as returned by |
the distribution as XML text
Richèl J.C. Bilderbeek
Converts a log-normal distribution to XML
distr_to_xml_log_normal(distr, beauti_options)
distr_to_xml_log_normal(distr, beauti_options)
distr |
a log-normal distribution,
as created by |
beauti_options |
one BEAUti options object,
as returned by |
the distribution as XML text
Richèl J.C. Bilderbeek
Converts a normal distribution to XML
distr_to_xml_normal(distr, beauti_options)
distr_to_xml_normal(distr, beauti_options)
distr |
a normal distribution,
as created by |
beauti_options |
one BEAUti options object,
as returned by |
the distribution as XML text
Richèl J.C. Bilderbeek
Converts a 1/x distribution to XML
distr_to_xml_one_div_x(distr, beauti_options)
distr_to_xml_one_div_x(distr, beauti_options)
distr |
a 1/x distribution,
as created by |
beauti_options |
one BEAUti options object,
as returned by |
the distribution as XML text
Richèl J.C. Bilderbeek
Converts a Poisson distribution to XML
distr_to_xml_poisson(distr, beauti_options)
distr_to_xml_poisson(distr, beauti_options)
distr |
a Poisson distribution,
as created by |
beauti_options |
one BEAUti options object,
as returned by |
the distribution as XML text
Richèl J.C. Bilderbeek
Converts a uniform distribution to XML
distr_to_xml_uniform(distr, beauti_options)
distr_to_xml_uniform(distr, beauti_options)
distr |
a uniform distribution,
as created by |
beauti_options |
one BEAUti options object,
as returned by |
the distribution as XML text
Richèl J.C. Bilderbeek
Extract everything between first loggers and last loggers line
extract_xml_loggers_from_lines(lines)
extract_xml_loggers_from_lines(lines)
lines |
lines of text |
lines of text from the first to and including the last operators line
Richèl J.C. Bilderbeek
Extract everything between first operators and last operators line
extract_xml_operators_from_lines(lines)
extract_xml_operators_from_lines(lines)
lines |
lines of text |
lines of text from the first to and including the last operators line
Richèl J.C. Bilderbeek
Get the lines of an XML section, including the section tags
extract_xml_section_from_lines(lines, section)
extract_xml_section_from_lines(lines, section)
lines |
lines of the XML text |
section |
the XML section name |
the section's lines of XML text, including the tags
Richèl J.C. Bilderbeek
Convert a FASTA file to a table of sequences
fasta_file_to_sequences(fasta_filename)
fasta_file_to_sequences(fasta_filename)
fasta_filename |
One existing FASTA filenames |
a table of sequences
Richèl J.C. Bilderbeek
check_empty_beautier_folder() fasta_file_to_sequences(fasta_filename = get_fasta_filename()) check_empty_beautier_folder()
check_empty_beautier_folder() fasta_file_to_sequences(fasta_filename = get_fasta_filename()) check_empty_beautier_folder()
Finds a clock model with a certain ID
find_clock_model(clock_models, id)
find_clock_model(clock_models, id)
clock_models |
a list of one or more clock models,
as returned by |
id |
the ID of the clock model |
the clock models with the desired ID, NULL if such a clock model is absent
Richèl J.C. Bilderbeek
Find the first line that satisfies a regex
find_first_regex_line(lines, regex)
find_first_regex_line(lines, regex)
lines |
lines of text |
regex |
the regex as text |
index of the line
Richèl J.C. Bilderbeek
Find the line number of the first section's opening tag
find_first_xml_opening_tag_line(lines, section)
find_first_xml_opening_tag_line(lines, section)
lines |
the lines of an XML text |
section |
the name of the XML section |
the line number's index (which is 1 for the first line) if the opening tag is found, else NA
Richèl J.C. Bilderbeek
Find the index of the last line that matches a regex
find_last_regex_line(lines, regex)
find_last_regex_line(lines, regex)
lines |
lines of text |
regex |
regex string |
index of the line
Richèl J.C. Bilderbeek
Find the highest line number of a section's closing tag
find_last_xml_closing_tag_line(lines, section)
find_last_xml_closing_tag_line(lines, section)
lines |
the lines of an XML text |
section |
the name of the XML section |
the line number's index (which is 1 for the first line) if the opening tag is found, else NA
Richèl J.C. Bilderbeek
freq_equilibrium
as XMLCreates the freq_equilibrium
as XML
freq_equilibrium_to_xml(freq_equilibrium, id)
freq_equilibrium_to_xml(freq_equilibrium, id)
freq_equilibrium |
a |
id |
a site model's name |
the freq_equilibrium
as XML
Richèl J.C. Bilderbeek
check_empty_beautier_folder() freq_equilibrium_to_xml(freq_equilibrium = "estimated", id = "my_id") check_empty_beautier_folder()
check_empty_beautier_folder() freq_equilibrium_to_xml(freq_equilibrium = "estimated", id = "my_id") check_empty_beautier_folder()
Converts a 'freq' parameter to XML
freq_param_to_xml(freq_param, beauti_options = create_beauti_options())
freq_param_to_xml(freq_param, beauti_options = create_beauti_options())
freq_param |
a 'freq' parameter, as created by create_freq_param |
beauti_options |
one BEAUti options object,
as returned by |
the parameter as XML text
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # The freq parameter must be initialized, i.e. have an ID freq_param_to_xml(freq_param = create_freq_param(id = "1")) check_empty_beautier_folder()
check_empty_beautier_folder() # The freq parameter must be initialized, i.e. have an ID freq_param_to_xml(freq_param = create_freq_param(id = "1")) check_empty_beautier_folder()
Converts a gamma distribution to XML
gamma_distr_to_xml(gamma_distr, beauti_options = create_beauti_options())
gamma_distr_to_xml(gamma_distr, beauti_options = create_beauti_options())
gamma_distr |
a gamma distribution,
as created by |
beauti_options |
one BEAUti options object,
as returned by |
the distribution as XML text
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # gamma distribution must be initialized gamma_distr_to_xml( gamma_distr = create_gamma_distr( id = "0", alpha = create_alpha_param(id = "2", value = "0.5396"), beta = create_beta_param(id = "3", value = "0.3819") ) ) check_empty_beautier_folder()
check_empty_beautier_folder() # gamma distribution must be initialized gamma_distr_to_xml( gamma_distr = create_gamma_distr( id = "0", alpha = create_alpha_param(id = "2", value = "0.5396"), beta = create_beta_param(id = "3", value = "0.3819") ) ) check_empty_beautier_folder()
Creates the gamma site models section in the distribution section of a BEAST2 XML parameter file
gamma_site_model_to_xml_prior_distr(inference_model)
gamma_site_model_to_xml_prior_distr(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
lines of XML text
Richèl J.C. Bilderbeek
state
sectionConverts a gamma site model to XML,
used in the state
section
gamma_site_model_to_xml_state(gamma_site_model, id)
gamma_site_model_to_xml_state(gamma_site_model, id)
gamma_site_model |
a gamma site model,
as created by |
id |
the site model's ID |
the gamma_site model as XML text
Richèl J.C. Bilderbeek
Internal function to creates the gamma site models section in the distribution section of a BEAST2 XML parameter file
gamma_site_models_to_xml_prior_distr( site_models, beauti_options = create_beauti_options() )
gamma_site_models_to_xml_prior_distr( site_models, beauti_options = create_beauti_options() )
site_models |
one or more site models,
as returned by |
beauti_options |
one BEAUti options object,
as returned by |
lines of XML text
Richèl J.C. Bilderbeek
This is done in the same way as BEAST2 will do so.
get_alignment_id(fasta_filename, capitalize_first_char_id = FALSE)
get_alignment_id(fasta_filename, capitalize_first_char_id = FALSE)
fasta_filename |
a FASTA filename.
Use |
capitalize_first_char_id |
if TRUE, the first character will be capitalized |
an alignment's ID
Richèl J.C. Bilderbeek
Use check_alignment_id to check if an alignment ID is valid.
check_empty_beautier_folder() # Path need not exist, use UNIX path as example # anthus_aco_sub alignment_id <- get_alignment_id("/home/homer/anthus_aco_sub.fas") check_alignment_id(alignment_id) check_empty_beautier_folder()
check_empty_beautier_folder() # Path need not exist, use UNIX path as example # anthus_aco_sub alignment_id <- get_alignment_id("/home/homer/anthus_aco_sub.fas") check_alignment_id(alignment_id) check_empty_beautier_folder()
This is done in the same way as BEAST2 does by default The file extension will be used to determine which type of file is worked on.
get_alignment_ids(filenames)
get_alignment_ids(filenames)
filenames |
names of the files to be checked |
the IDs extracted from the one or more files
Richèl J.C. Bilderbeek
Use get_alignment_ids_from_fasta_filenames to get the alignment IDs from files known to be FASTA files
check_empty_beautier_folder() get_alignment_ids( get_beautier_paths(c("anthus_aco.fas", "anthus_nd2.fas")) ) check_empty_beautier_folder()
check_empty_beautier_folder() get_alignment_ids( get_beautier_paths(c("anthus_aco.fas", "anthus_nd2.fas")) ) check_empty_beautier_folder()
This is done in the same way as BEAST2 does by default. The files are assumed to be FASTA. If this is not the case, there may be any kind of error message when calling this function.
get_alignment_ids_from_fasta_filenames(fasta_filenames)
get_alignment_ids_from_fasta_filenames(fasta_filenames)
fasta_filenames |
One or more FASTA filenames.
Use |
the IDs from one or more FASTA files
Richèl J.C. Bilderbeek
Use get_alignment_ids to get the alignment IDs from multiple kids of files. Use are_fasta_filenames to see if the filenames all have a common FASTA filename extension.
check_empty_beautier_folder() get_alignment_ids_from_fasta_filenames( get_beautier_paths(c("anthus_aco.fas", "anthus_nd2.fas")) ) check_empty_beautier_folder()
check_empty_beautier_folder() get_alignment_ids_from_fasta_filenames( get_beautier_paths(c("anthus_aco.fas", "anthus_nd2.fas")) ) check_empty_beautier_folder()
Get the path to the beautier temporary files folder
get_beautier_folder()
get_beautier_folder()
the path to the beautier temporary files folder
Richèl J.C. Bilderbeek
check_empty_beautier_folder() get_beautier_folder() check_empty_beautier_folder()
check_empty_beautier_folder() get_beautier_folder() check_empty_beautier_folder()
inst/extdata
folderGet the full path of a file in the inst/extdata
folder
get_beautier_path(filename)
get_beautier_path(filename)
filename |
the file's name, without the path |
the full path of the filename
Richèl J.C. Bilderbeek
for more files, use get_beautier_paths
check_empty_beautier_folder() get_beautier_path("test_output_0.fas") get_beautier_path("anthus_aco.fas") get_beautier_path("anthus_nd2.fas") check_empty_beautier_folder()
check_empty_beautier_folder() get_beautier_path("test_output_0.fas") get_beautier_path("anthus_aco.fas") get_beautier_path("anthus_nd2.fas") check_empty_beautier_folder()
inst/extdata
folderGet the full paths of files in the inst/extdata
folder
get_beautier_paths(filenames)
get_beautier_paths(filenames)
filenames |
the files' names, without the path |
the filenames' full paths
Richèl J.C. Bilderbeek
Use get_beautier_path to get the path of one file
for one file, use get_beautier_path
check_empty_beautier_folder() get_beautier_paths( c("test_output_0.fas", "anthus_aco.fas", "anthus_nd2.fas") ) check_empty_beautier_folder()
check_empty_beautier_folder() get_beautier_paths( c("test_output_0.fas", "anthus_aco.fas", "anthus_nd2.fas") ) check_empty_beautier_folder()
Get a temporary filename, similar to tempfile, except that it always writes to a temporary folder named beautier.
get_beautier_tempfilename(pattern = "file", fileext = "")
get_beautier_tempfilename(pattern = "file", fileext = "")
pattern |
a non-empty character vector giving the initial part of the name. |
fileext |
a non-empty character vector giving the file extension |
name for a temporary file
this function is added to make sure no temporary cache files are left undeleted
Will stop if the clock model is an invalid clock model
get_clock_model_name(clock_model)
get_clock_model_name(clock_model)
clock_model |
a clock model,
as returned by |
name of the clock model
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # StrictClock get_clock_model_name(create_strict_clock_model()) # RelaxedClock get_clock_model_name(create_rln_clock_model()) check_empty_beautier_folder()
check_empty_beautier_folder() # StrictClock get_clock_model_name(create_strict_clock_model()) # RelaxedClock get_clock_model_name(create_rln_clock_model()) check_empty_beautier_folder()
Get the clock model names
get_clock_model_names()
get_clock_model_names()
the clock model names
Richèl J.C. Bilderbeek
Use create_clock_models to create a list with all clock models
check_empty_beautier_folder() get_clock_model_names() check_empty_beautier_folder()
check_empty_beautier_folder() get_clock_model_names() check_empty_beautier_folder()
Collect the IDs of the list of clock models
get_clock_models_ids(clock_models)
get_clock_models_ids(clock_models)
clock_models |
a list of one or more clock models,
as returned by |
IDs of the clock models
Richèl J.C. Bilderbeek
The crown age of a phylogeny is the time between the present and the moment of at which the first diversification (resulting in two lineages) happened.
get_crown_age(phylogeny)
get_crown_age(phylogeny)
phylogeny |
The phylogeny to obtain the crown age of |
the crown age of the phylogeny
Richèl J.C. Bilderbeek
check_empty_beautier_folder() phylogeny <- ape::read.tree(text = "(a:15,b:15):1;") get_crown_age(phylogeny = phylogeny) check_empty_beautier_folder()
check_empty_beautier_folder() phylogeny <- ape::read.tree(text = "(a:15,b:15):1;") get_crown_age(phylogeny = phylogeny) check_empty_beautier_folder()
Get the default 'namespace' element value of the 'beast' XML tag.
get_default_beast_namespace()
get_default_beast_namespace()
the default 'namespace' element value of the 'beast' XML tag.
Richèl J.C. Bilderbeek
* For BEAST2 v2.4, use get_default_beast_namespace_v2_4 * For BEAST2 v2.6, use get_default_beast_namespace_v2_6
get_default_beast_namespace()
get_default_beast_namespace()
Get the default 'namespace' element value of the 'beast' XML tag for BEAST 2.4
get_default_beast_namespace_v2_4()
get_default_beast_namespace_v2_4()
the default 'namespace' element value of the 'beast' XML tag for BEAST 2.4
Richèl J.C. Bilderbeek
get_default_beast_namespace_v2_4()
get_default_beast_namespace_v2_4()
Get the default 'namespace' element value of the 'beast' XML tag for BEAST 2.6
get_default_beast_namespace_v2_6()
get_default_beast_namespace_v2_6()
the default 'namespace' element value of the 'beast' XML tag for BEAST 2.6
Richèl J.C. Bilderbeek
get_default_beast_namespace_v2_6()
get_default_beast_namespace_v2_6()
Get the number of parameters a distribution uses
get_distr_n_params(distr)
get_distr_n_params(distr)
distr |
a distribution,
as created by |
the number of parameters that distribution uses
Richèl J.C. Bilderbeek
check_empty_beautier_folder() get_distr_n_params(create_beta_distr()) get_distr_n_params(create_exp_distr()) get_distr_n_params(create_gamma_distr()) get_distr_n_params(create_inv_gamma_distr()) get_distr_n_params(create_laplace_distr()) get_distr_n_params(create_log_normal_distr()) get_distr_n_params(create_normal_distr()) get_distr_n_params(create_one_div_x_distr()) get_distr_n_params(create_poisson_distr()) get_distr_n_params(create_uniform_distr()) check_empty_beautier_folder()
check_empty_beautier_folder() get_distr_n_params(create_beta_distr()) get_distr_n_params(create_exp_distr()) get_distr_n_params(create_gamma_distr()) get_distr_n_params(create_inv_gamma_distr()) get_distr_n_params(create_laplace_distr()) get_distr_n_params(create_log_normal_distr()) get_distr_n_params(create_normal_distr()) get_distr_n_params(create_one_div_x_distr()) get_distr_n_params(create_poisson_distr()) get_distr_n_params(create_uniform_distr()) check_empty_beautier_folder()
Get the distribution names
get_distr_names()
get_distr_names()
the distribution names
Richèl J.C. Bilderbeek
check_empty_beautier_folder() get_distr_names() check_empty_beautier_folder()
check_empty_beautier_folder() get_distr_names() check_empty_beautier_folder()
Get the path of a FASTA file used in testing
get_fasta_filename()
get_fasta_filename()
the path of a FASTA file used in testing
Richèl J.C. Bilderbeek
if (is_on_ci()) { input_filename <- get_fasta_filename() output_filename <- get_beautier_tempfilename() create_beast2_input_file( input_filename = input_filename, output_filename = output_filename ) file.remove(output_filename) remove_beautier_folder() }
if (is_on_ci()) { input_filename <- get_fasta_filename() output_filename <- get_beautier_tempfilename() create_beast2_input_file( input_filename = input_filename, output_filename = output_filename ) file.remove(output_filename) remove_beautier_folder() }
The path need not to actually exist
get_file_base_sans_ext(filename)
get_file_base_sans_ext(filename)
filename |
A filename |
That filename without its full path and extension
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # Path need not exist, use UNIX path as example # test get_file_base_sans_ext("/home/homer/test.txt") check_empty_beautier_folder()
check_empty_beautier_folder() # Path need not exist, use UNIX path as example # test get_file_base_sans_ext("/home/homer/test.txt") check_empty_beautier_folder()
freq_equilibrium
argumentReturns valid values for the freq_equilibrium
argument
get_freq_equilibrium_names()
get_freq_equilibrium_names()
the valid values for the freq_equilibrium
argument
Richèl J.C. Bilderbeek
the freq_equilibrium
argument is used in
create_gtr_site_model
,
create_hky_site_model
,
and create_tn93_site_model
check_empty_beautier_folder() get_freq_equilibrium_names() check_empty_beautier_folder()
check_empty_beautier_folder() get_freq_equilibrium_names() check_empty_beautier_folder()
Get the number of distributions in a gamma site model
get_gamma_site_model_n_distrs(gamma_site_model)
get_gamma_site_model_n_distrs(gamma_site_model)
gamma_site_model |
a site model's gamma site model,
as returned by |
the number of distributions a gamma site model has
Richèl J.C. Bilderbeek
Use create_gamma_site_model to create a gamma site model
check_empty_beautier_folder() # zero distributions gamma_site_model <- create_gamma_site_model() get_gamma_site_model_n_distrs( gamma_site_model ) gamma_site_model <- create_gamma_site_model( gamma_cat_count = 2, gamma_shape_prior_distr = create_exp_distr() ) # one distribution get_gamma_site_model_n_distrs(gamma_site_model) check_empty_beautier_folder()
check_empty_beautier_folder() # zero distributions gamma_site_model <- create_gamma_site_model() get_gamma_site_model_n_distrs( gamma_site_model ) gamma_site_model <- create_gamma_site_model( gamma_cat_count = 2, gamma_shape_prior_distr = create_exp_distr() ) # one distribution get_gamma_site_model_n_distrs(gamma_site_model) check_empty_beautier_folder()
Get the number of distributions a site model has
get_gamma_site_model_n_params(gamma_site_model)
get_gamma_site_model_n_params(gamma_site_model)
gamma_site_model |
a site model's gamma site model,
as returned by |
the number of parameters a site model has
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # 0 parameters get_gamma_site_model_n_params( create_gamma_site_model(gamma_cat_count = 0) ) # 0 parameters get_gamma_site_model_n_params( create_gamma_site_model(gamma_cat_count = 1) ) # 1 parameter get_gamma_site_model_n_params( create_gamma_site_model( gamma_cat_count = 2, gamma_shape_prior_distr = create_exp_distr() ) ) check_empty_beautier_folder()
check_empty_beautier_folder() # 0 parameters get_gamma_site_model_n_params( create_gamma_site_model(gamma_cat_count = 0) ) # 0 parameters get_gamma_site_model_n_params( create_gamma_site_model(gamma_cat_count = 1) ) # 1 parameter get_gamma_site_model_n_params( create_gamma_site_model( gamma_cat_count = 2, gamma_shape_prior_distr = create_exp_distr() ) ) check_empty_beautier_folder()
Determines if there is at least one non-strict clock model in the list of one or more clock models
get_has_non_strict_clock_model(clock_models)
get_has_non_strict_clock_model(clock_models)
clock_models |
a list of one or more clock models,
as returned by |
TRUE if there is at least one non-strict clock model
Richèl J.C. Bilderbeek
If there is no name for a tipdates
file specified (as done by
setting inference_model$tipdates_filename
to NA,
there will be one filename less returned
get_inference_model_filenames(inference_model)
get_inference_model_filenames(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
the filenames stored in an inference model
check_empty_beautier_folder() inference_model <- create_inference_model() filenames <- get_inference_model_filenames(inference_model) check_empty_beautier_folder()
check_empty_beautier_folder() inference_model <- create_inference_model() filenames <- get_inference_model_filenames(inference_model) check_empty_beautier_folder()
Get the possible log modes
get_log_modes()
get_log_modes()
the possible log modes
Richèl J.C. Bilderbeek
get_log_modes()
get_log_modes()
Get the possible log sorts
get_log_sorts()
get_log_sorts()
the possible log sorts
Richèl J.C. Bilderbeek
get_log_sorts()
get_log_sorts()
If a filename is set to an empty string, to indicate a certain log file need not be created, this (non-)filename will not be returned.
get_mcmc_filenames(mcmc)
get_mcmc_filenames(mcmc)
mcmc |
one MCMC.
Use |
the filenames stored in an MCMC
Richèl J.C. Bilderbeek
check_empty_beautier_folder() mcmc <- create_mcmc() mcmc$tracelog$filename <- "/home/john/trace.log" mcmc$screenlog$filename <- "/home/john/screen.log" mcmc$treelog$filename <- "/home/john/tree.log" # 3 filenames filenames <- get_mcmc_filenames(mcmc) # If there is no need to write to the screenlog file ... mcmc$screenlog$filename <- "" # 2 filenames # ... one file less will be created filenames <- get_mcmc_filenames(mcmc) check_empty_beautier_folder()
check_empty_beautier_folder() mcmc <- create_mcmc() mcmc$tracelog$filename <- "/home/john/trace.log" mcmc$screenlog$filename <- "/home/john/screen.log" mcmc$treelog$filename <- "/home/john/tree.log" # 3 filenames filenames <- get_mcmc_filenames(mcmc) # If there is no need to write to the screenlog file ... mcmc$screenlog$filename <- "" # 2 filenames # ... one file less will be created filenames <- get_mcmc_filenames(mcmc) check_empty_beautier_folder()
Extract the number of taxa from a file
get_n_taxa(filename)
get_n_taxa(filename)
filename |
name of a FASTA file |
the number of taxa
Richèl J.C. Bilderbeek
check_empty_beautier_folder() fasta_filename <- get_beautier_path("test_output_5.fas") # 5 get_n_taxa(fasta_filename) check_empty_beautier_folder()
check_empty_beautier_folder() fasta_filename <- get_beautier_path("test_output_5.fas") # 5 get_n_taxa(fasta_filename) check_empty_beautier_folder()
Get the prefix of operator IDs
get_operator_id_pre(tree_prior)
get_operator_id_pre(tree_prior)
tree_prior |
a tree priors,
as returned by |
the prefix of operator IDs, similar to the name of a tree prior
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # BirthDeath get_operator_id_pre( tree_prior = create_bd_tree_prior() ) check_empty_beautier_folder()
check_empty_beautier_folder() # BirthDeath get_operator_id_pre( tree_prior = create_bd_tree_prior() ) check_empty_beautier_folder()
Get the parameter names
get_param_names()
get_param_names()
the parameter names
Richèl J.C. Bilderbeek
check_empty_beautier_folder() names <- get_param_names() check_empty_beautier_folder()
check_empty_beautier_folder() names <- get_param_names() check_empty_beautier_folder()
Or: get a function that returns the local version of a filename. Also, the function will return NA if the filename is NA
get_remove_dir_fun()
get_remove_dir_fun()
a function to remove the folder name from a path
Richèl J.C. Bilderbeek
see check_rename_fun for an overview of file renaming functions
The default filenames created by beautier are temporary files,
such as /home/john/.cache/tracelog_82c5888db98.log
(on Linux),
where /home/john/.cache
is the location to a temporary folder
(on Linux) and tracelog_82c5888db98.log
the filename.
The filename ends with a hex string (as is common for temporary files,
as tempfile does so).
Because beautier puts an underscore
between the filename description (tracelog
) and the hex
string, this function removes both.
get_remove_hex_fun()
get_remove_hex_fun()
a function to remove the hex string from filenames
Richèl J.C. Bilderbeek
check_empty_beautier_folder() f <- get_remove_hex_fun() # /home/john/beast2.xml.state f("/home/john/beast2_186c7404208c.xml.state") # beast2.xml.state f("beast2_186c7404208c.xml.state") # NA f(NA) check_empty_beautier_folder()
check_empty_beautier_folder() f <- get_remove_hex_fun() # /home/john/beast2.xml.state f("/home/john/beast2_186c7404208c.xml.state") # beast2.xml.state f("beast2_186c7404208c.xml.state") # NA f(NA) check_empty_beautier_folder()
Get a function to replace the directory of a filename
get_replace_dir_fun(new_dir_name = "")
get_replace_dir_fun(new_dir_name = "")
new_dir_name |
the new directory name |
a function to replace the directory of a filename
Richèl J.C. Bilderbeek
Get the number of distributions a site model has
get_site_model_n_distrs(site_model)
get_site_model_n_distrs(site_model)
site_model |
a site model,
as returned by |
the number of distributions a site model has
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # 5: rates AC, AG, AT, CG and GT get_site_model_n_distrs(create_gtr_site_model()) # 1: kappa get_site_model_n_distrs(create_hky_site_model()) # 0: npne get_site_model_n_distrs(create_jc69_site_model()) # 2: kappa 1 and kappa 2 get_site_model_n_distrs(create_tn93_site_model()) check_empty_beautier_folder()
check_empty_beautier_folder() # 5: rates AC, AG, AT, CG and GT get_site_model_n_distrs(create_gtr_site_model()) # 1: kappa get_site_model_n_distrs(create_hky_site_model()) # 0: npne get_site_model_n_distrs(create_jc69_site_model()) # 2: kappa 1 and kappa 2 get_site_model_n_distrs(create_tn93_site_model()) check_empty_beautier_folder()
Get the number of distributions a site model has
get_site_model_n_params(site_model)
get_site_model_n_params(site_model)
site_model |
a site model,
as returned by |
the number of parameters a site model has
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # Ten get_site_model_n_params(create_gtr_site_model()) # Two get_site_model_n_params(create_hky_site_model()) # Zero get_site_model_n_params(create_jc69_site_model()) # Four get_site_model_n_params(create_tn93_site_model()) check_empty_beautier_folder()
check_empty_beautier_folder() # Ten get_site_model_n_params(create_gtr_site_model()) # Two get_site_model_n_params(create_hky_site_model()) # Zero get_site_model_n_params(create_jc69_site_model()) # Four get_site_model_n_params(create_tn93_site_model()) check_empty_beautier_folder()
Get the site models' names
get_site_model_names()
get_site_model_names()
the site model names
Richèl J.C. Bilderbeek
Use create_site_models to get all site models
check_empty_beautier_folder() get_site_model_names() check_empty_beautier_folder()
check_empty_beautier_folder() get_site_model_names() check_empty_beautier_folder()
Get the number of distributions a site model has
get_site_models_n_distrs(site_models)
get_site_models_n_distrs(site_models)
site_models |
one or more site models,
as returned by |
the number of distributions the site models have
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # 5 get_site_models_n_distrs(list(create_gtr_site_model())) # 1 get_site_models_n_distrs(list(create_hky_site_model())) # 0 get_site_models_n_distrs(list(create_jc69_site_model())) # 2 get_site_models_n_distrs(list(create_tn93_site_model())) check_empty_beautier_folder()
check_empty_beautier_folder() # 5 get_site_models_n_distrs(list(create_gtr_site_model())) # 1 get_site_models_n_distrs(list(create_hky_site_model())) # 0 get_site_models_n_distrs(list(create_jc69_site_model())) # 2 get_site_models_n_distrs(list(create_tn93_site_model())) check_empty_beautier_folder()
Get the number of distributions one or more site models have
get_site_models_n_params(site_models)
get_site_models_n_params(site_models)
site_models |
one or more site models,
as returned by |
the number of parameters the site models have
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # Ten get_site_models_n_params(list(create_gtr_site_model())) # Two get_site_models_n_params(list(create_hky_site_model())) # Zero get_site_models_n_params(list(create_jc69_site_model())) # Four get_site_models_n_params(list(create_tn93_site_model())) check_empty_beautier_folder()
check_empty_beautier_folder() # Ten get_site_models_n_params(list(create_gtr_site_model())) # Two get_site_models_n_params(list(create_hky_site_model())) # Zero get_site_models_n_params(list(create_jc69_site_model())) # Four get_site_models_n_params(list(create_tn93_site_model())) check_empty_beautier_folder()
Extract the names of taxa from a file
get_taxa_names(filename)
get_taxa_names(filename)
filename |
name of a FASTA file |
the taxa names
Richèl J.C. Bilderbeek
check_empty_beautier_folder() get_taxa_names(get_beautier_path("anthus_aco_sub.fas")) check_empty_beautier_folder()
check_empty_beautier_folder() get_taxa_names(get_beautier_path("anthus_aco_sub.fas")) check_empty_beautier_folder()
Get the number of distributions a tree prior has
get_tree_prior_n_distrs(tree_prior)
get_tree_prior_n_distrs(tree_prior)
tree_prior |
a tree priors,
as returned by |
the number of distributions a tree prior has
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # 2: birth_rate_distr and death_rate_distr get_tree_prior_n_distrs(create_bd_tree_prior()) # 0:none get_tree_prior_n_distrs(create_cbs_tree_prior()) # 1: pop_size_distr get_tree_prior_n_distrs(create_ccp_tree_prior()) # 2:pop_size_distr and growth_rate_distr get_tree_prior_n_distrs(create_cep_tree_prior()) # 1: birth_rate_distr get_tree_prior_n_distrs(create_yule_tree_prior()) check_empty_beautier_folder()
check_empty_beautier_folder() # 2: birth_rate_distr and death_rate_distr get_tree_prior_n_distrs(create_bd_tree_prior()) # 0:none get_tree_prior_n_distrs(create_cbs_tree_prior()) # 1: pop_size_distr get_tree_prior_n_distrs(create_ccp_tree_prior()) # 2:pop_size_distr and growth_rate_distr get_tree_prior_n_distrs(create_cep_tree_prior()) # 1: birth_rate_distr get_tree_prior_n_distrs(create_yule_tree_prior()) check_empty_beautier_folder()
Get the number of parameters a tree prior has
get_tree_prior_n_params(tree_prior)
get_tree_prior_n_params(tree_prior)
tree_prior |
a tree_prior,
as created by |
the number of parameters a tree prior has
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # birth_rate_distr is uniform, which has zero parameters # death_rate_distr is uniform, which has zero parameters get_tree_prior_n_params(create_bd_tree_prior()) # no distributions, no parameters get_tree_prior_n_params(create_cbs_tree_prior()) # pop_size_distr is 1/x, which has zero parameters get_tree_prior_n_params(create_ccp_tree_prior()) # pop_size_distr is 1/x, which has zero parameters # growth_rate_distr is Laplace, which has two parameters get_tree_prior_n_params(create_cep_tree_prior()) # birth_rate_distr is uniform, which has zero parameters get_tree_prior_n_params(create_yule_tree_prior()) check_empty_beautier_folder()
check_empty_beautier_folder() # birth_rate_distr is uniform, which has zero parameters # death_rate_distr is uniform, which has zero parameters get_tree_prior_n_params(create_bd_tree_prior()) # no distributions, no parameters get_tree_prior_n_params(create_cbs_tree_prior()) # pop_size_distr is 1/x, which has zero parameters get_tree_prior_n_params(create_ccp_tree_prior()) # pop_size_distr is 1/x, which has zero parameters # growth_rate_distr is Laplace, which has two parameters get_tree_prior_n_params(create_cep_tree_prior()) # birth_rate_distr is uniform, which has zero parameters get_tree_prior_n_params(create_yule_tree_prior()) check_empty_beautier_folder()
Get the tree prior names
get_tree_prior_names()
get_tree_prior_names()
the tree prior names
Richèl J.C. Bilderbeek
Use create_tree_priors to get all tree priors
check_empty_beautier_folder() get_tree_prior_names() check_empty_beautier_folder()
check_empty_beautier_folder() get_tree_prior_names() check_empty_beautier_folder()
Get the number of distributions a tree prior has
get_tree_priors_n_distrs(tree_priors)
get_tree_priors_n_distrs(tree_priors)
tree_priors |
one or more tree priors,
as returned by |
the number of distributions a tree prior has
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # Three distrubutions get_tree_priors_n_distrs( list( create_bd_tree_prior(), # has two distributions create_ccp_tree_prior() # has one distribution ) ) check_empty_beautier_folder()
check_empty_beautier_folder() # Three distrubutions get_tree_priors_n_distrs( list( create_bd_tree_prior(), # has two distributions create_ccp_tree_prior() # has one distribution ) ) check_empty_beautier_folder()
Get the number of parameters a list of tree priors has
get_tree_priors_n_params(tree_priors)
get_tree_priors_n_params(tree_priors)
tree_priors |
one or more tree priors,
as returned by |
the number of parameters the tree priors have
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # Two get_tree_priors_n_params( list( create_bd_tree_prior(), # zero create_cep_tree_prior() # two ) ) check_empty_beautier_folder()
check_empty_beautier_folder() # Two get_tree_priors_n_params( list( create_bd_tree_prior(), # zero create_cep_tree_prior() # two ) ) check_empty_beautier_folder()
Get the XML closing tag
get_xml_closing_tag(text)
get_xml_closing_tag(text)
text |
lines of XML to extract the XML closing tag from |
the closing tag if found, else NA
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # my_tag get_xml_closing_tag("<my_tag text=something></my_tag>") # Will return NA get_xml_closing_tag("<my_tag text=something/>") get_xml_closing_tag("no_xml") check_empty_beautier_folder()
check_empty_beautier_folder() # my_tag get_xml_closing_tag("<my_tag text=something></my_tag>") # Will return NA get_xml_closing_tag("<my_tag text=something/>") get_xml_closing_tag("no_xml") check_empty_beautier_folder()
Get the XML opening tag
get_xml_opening_tag(text)
get_xml_opening_tag(text)
text |
text to be determined to be valid |
the opening tag if found, else NA
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # my_tag get_xml_opening_tag("<my_tag text=something/>") # NA when there is no opening tag get_xml_opening_tag("no_xml") check_empty_beautier_folder()
check_empty_beautier_folder() # my_tag get_xml_opening_tag("<my_tag text=something/>") # NA when there is no opening tag get_xml_opening_tag("no_xml") check_empty_beautier_folder()
Converts a GTR site model to XML,
used in the prior
section
gtr_site_model_to_xml_prior_distr(site_model, beauti_options)
gtr_site_model_to_xml_prior_distr(site_model, beauti_options)
site_model |
a site model,
as returned by |
beauti_options |
one BEAUti options object,
as returned by |
the site model as XML text
Richèl J.C. Bilderbeek
gtr_site_model_to_xml_prior_distr( site_model = create_gtr_site_model( id = 1, rate_ac_prior_distr = create_uniform_distr(id = 2), rate_ag_prior_distr = create_uniform_distr(id = 3), rate_at_prior_distr = create_uniform_distr(id = 4), rate_cg_prior_distr = create_uniform_distr(id = 5), rate_gt_prior_distr = create_uniform_distr(id = 6) ), beauti_options = create_beauti_options() )
gtr_site_model_to_xml_prior_distr( site_model = create_gtr_site_model( id = 1, rate_ac_prior_distr = create_uniform_distr(id = 2), rate_ag_prior_distr = create_uniform_distr(id = 3), rate_at_prior_distr = create_uniform_distr(id = 4), rate_cg_prior_distr = create_uniform_distr(id = 5), rate_gt_prior_distr = create_uniform_distr(id = 6) ), beauti_options = create_beauti_options() )
state
sectionConverts a site model to XML,
used in the state
section
gtr_site_model_to_xml_state( site_model, beauti_options = create_beauti_options() )
gtr_site_model_to_xml_state( site_model, beauti_options = create_beauti_options() )
site_model |
a site model,
as returned by |
beauti_options |
one BEAUti options object,
as returned by |
the site model as XML text
Richèl J.C. Bilderbeek
Will stop if the inference model is invalid
has_mrca_prior(inference_model)
has_mrca_prior(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
TRUE if the inference model has an MRCA prior, FALSE otherwise
MRCA: 'Most Recent Common Ancestor'
Richèl J.C. Bilderbeek
create_inference_model
: create an inference model
create_mrca_prior
: create an MRCA prior
check_empty_beautier_folder() # No MRCA prior inference_model <- create_inference_model( mrca_prior = NA ) has_mrca_prior(inference_model) # Returns FALSE # A default MRCA prior inference_model <- create_inference_model( mrca_prior = create_mrca_prior() ) has_mrca_prior(inference_model) # Returns TRUE check_empty_beautier_folder()
check_empty_beautier_folder() # No MRCA prior inference_model <- create_inference_model( mrca_prior = NA ) has_mrca_prior(inference_model) # Returns FALSE # A default MRCA prior inference_model <- create_inference_model( mrca_prior = create_mrca_prior() ) has_mrca_prior(inference_model) # Returns TRUE check_empty_beautier_folder()
See if the inference model has one MRCA prior with a distribution
has_mrca_prior_with_distr(inference_model)
has_mrca_prior_with_distr(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
TRUE if the inference model has one MRCA prior with a distribution, FALSE otherwise
Richèl J.C. Bilderbeek
inference_model
uses
a relaxed log-normal clock model.Determine if the inference_model
uses
a relaxed log-normal clock model.
has_rln_clock_model(inference_model)
has_rln_clock_model(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
TRUE if the inference_model
uses
a relaxed log-normal clock model,
FALSE otherwise
Richèl J.C. Bilderbeek
if (is_on_ci()) { check_empty_beautier_folder() # Yes, has a RLN clock model has_rln_clock_model( create_inference_model(clock_model = create_rln_clock_model()) ) # No RLN clock model has_rln_clock_model( create_inference_model(clock_model = create_strict_clock_model()) ) check_empty_beautier_folder() }
if (is_on_ci()) { check_empty_beautier_folder() # Yes, has a RLN clock model has_rln_clock_model( create_inference_model(clock_model = create_rln_clock_model()) ) # No RLN clock model has_rln_clock_model( create_inference_model(clock_model = create_strict_clock_model()) ) check_empty_beautier_folder() }
inference_model
uses a strict clock model.Determine if the inference_model
uses a strict clock model
has_strict_clock_model(inference_model)
has_strict_clock_model(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
TRUE if the inference_model
uses a strict clock model,
FALSE otherwise
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # Yes, has a strict clock model has_strict_clock_model( create_inference_model(clock_model = create_strict_clock_model()) ) # No strict clock model has_strict_clock_model( create_inference_model(clock_model = create_rln_clock_model()) ) check_empty_beautier_folder()
check_empty_beautier_folder() # Yes, has a strict clock model has_strict_clock_model( create_inference_model(clock_model = create_strict_clock_model()) ) # No strict clock model has_strict_clock_model( create_inference_model(clock_model = create_rln_clock_model()) ) check_empty_beautier_folder()
inference_model
uses tip dating.Determine if the inference_model
uses tip dating
has_tip_dating(inference_model)
has_tip_dating(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
TRUE if the inference_model
uses tip dating,
FALSE otherwise
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # Yes, has tip dating has_strict_clock_model( create_inference_model( tipdates_filename = get_beautier_path("test_output_0_tipdates.tsv") ) ) # No tip dating has_strict_clock_model( create_inference_model() ) check_empty_beautier_folder()
check_empty_beautier_folder() # Yes, has tip dating has_strict_clock_model( create_inference_model( tipdates_filename = get_beautier_path("test_output_0_tipdates.tsv") ) ) # No tip dating has_strict_clock_model( create_inference_model() ) check_empty_beautier_folder()
section
present among the lines of
the text?Is an XML closing tag with the value of section
present among the lines of
the text?
has_xml_closing_tag(lines, section)
has_xml_closing_tag(lines, section)
lines |
lines of the XML text |
section |
the XML section |
TRUE if there is an XML closing tag with the value of
section
present. FALSE otherwise
Richèl J.C. Bilderbeek
Is an XML opening tag with value 'section' present among the lines of the text?
has_xml_opening_tag(lines, section = NA)
has_xml_opening_tag(lines, section = NA)
lines |
lines of an XML text |
section |
if NA, this function returns TRUE if there is any
XML opening tag. If |
lines of XML text
Richèl J.C. Bilderbeek
Is an XML closing tag with short closing text in one of the lines of the text?
has_xml_short_closing_tag(lines)
has_xml_short_closing_tag(lines)
lines |
lines of an XML text |
TRUE if there is an XML tag that also closes present in the lines of text, FALSE otherwise
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # TRUE has_xml_short_closing_tag("<my_tag id=1/>") # FALSE has_xml_short_closing_tag("<my_tag id=1>text</my_tag>") check_empty_beautier_folder()
check_empty_beautier_folder() # TRUE has_xml_short_closing_tag("<my_tag id=1/>") # FALSE has_xml_short_closing_tag("<my_tag id=1>text</my_tag>") check_empty_beautier_folder()
Converts an HKY site model to XML,
used in the prior
section
hky_site_model_to_xml_prior_distr(site_model, beauti_options)
hky_site_model_to_xml_prior_distr(site_model, beauti_options)
site_model |
a site model,
as returned by |
beauti_options |
one BEAUti options object,
as returned by |
the site model as XML text
Richèl J.C. Bilderbeek
hky_site_model_to_xml_prior_distr( site_model = create_hky_site_model( id = 1, kappa_prior_distr = create_uniform_distr(id = 2) ), beauti_options = create_beauti_options() )
hky_site_model_to_xml_prior_distr( site_model = create_hky_site_model( id = 1, kappa_prior_distr = create_uniform_distr(id = 2) ), beauti_options = create_beauti_options() )
state
sectionConverts a site model to XML,
used in the state
section
hky_site_model_to_xml_state( site_model, beauti_options = create_beauti_options() )
hky_site_model_to_xml_state( site_model, beauti_options = create_beauti_options() )
site_model |
a site model,
as returned by |
beauti_options |
one BEAUti options object,
as returned by |
the site model as XML text
Richèl J.C. Bilderbeek
Indent text for a certain number of spaces. If the text is only whitespace, leave it as such
indent(text, n_spaces = 4)
indent(text, n_spaces = 4)
text |
the text to indent |
n_spaces |
the number of spaces to add before the text. BEAUti uses four spaces by default |
the indented text
Richèl J.C. Bilderbeek
Initializes a Birth-Death tree prior
init_bd_tree_prior(bd_tree_prior, distr_id, param_id)
init_bd_tree_prior(bd_tree_prior, distr_id, param_id)
bd_tree_prior |
a Birth-Death tree prior, as created
by |
distr_id |
a distributions' ID |
param_id |
a parameter's ID |
an initialized Birth-Death tree prior
Richèl J.C. Bilderbeek
Initializes a beta distribution
init_beta_distr(beta_distr, distr_id = 0, param_id = 0)
init_beta_distr(beta_distr, distr_id = 0, param_id = 0)
beta_distr |
a beta distribution, using create_beta_distr |
distr_id |
the first distribution's ID |
param_id |
the first parameter's ID |
an initialized beta distribution
Richèl J.C. Bilderbeek
Initializes a Coalescent Constant Population tree prior
init_ccp_tree_prior(ccp_tree_prior, distr_id, param_id)
init_ccp_tree_prior(ccp_tree_prior, distr_id, param_id)
ccp_tree_prior |
a Coalescent Constant Population tree prior,
as returned by |
distr_id |
a distributions' ID |
param_id |
a parameter's ID |
an initialized Coalescent Constant Population tree prior
Richèl J.C. Bilderbeek
Initializes a Coalescent Exponential Population tree prior
init_cep_tree_prior(cep_tree_prior, distr_id, param_id)
init_cep_tree_prior(cep_tree_prior, distr_id, param_id)
cep_tree_prior |
a Coalescent Exponential Population tree prior,
as returned by |
distr_id |
a distributions' ID |
param_id |
a parameter's ID |
an initialized Coalescent Exponential Population tree prior
Richèl J.C. Bilderbeek
Initializes all clock models
init_clock_models(fasta_filenames, clock_models, distr_id = 0, param_id = 0)
init_clock_models(fasta_filenames, clock_models, distr_id = 0, param_id = 0)
fasta_filenames |
One or more FASTA filenames.
Use |
clock_models |
a list of one or more clock models,
as returned by |
distr_id |
the first distributions' ID |
param_id |
the first parameter's ID |
a list of initialized clock models
Richèl J.C. Bilderbeek
Initializes a distribution
init_distr(distr, distr_id = 0, param_id = 0)
init_distr(distr, distr_id = 0, param_id = 0)
distr |
a distribution,
using |
distr_id |
the first distribution's ID |
param_id |
the first parameter's ID |
an initialized distribution
Richèl J.C. Bilderbeek
Initializes an exponential distribution
init_exp_distr(exp_distr, distr_id = 0, param_id = 0)
init_exp_distr(exp_distr, distr_id = 0, param_id = 0)
exp_distr |
a exponential distribution, using create_exp_distr |
distr_id |
the first distribution's ID |
param_id |
the first parameter's ID |
an initialized exponential distribution
Richèl J.C. Bilderbeek
Initializes a gamma distribution
init_gamma_distr(gamma_distr, distr_id = 0, param_id = 0)
init_gamma_distr(gamma_distr, distr_id = 0, param_id = 0)
gamma_distr |
a gamma distribution, using create_gamma_distr |
distr_id |
the first distribution's ID |
param_id |
the first parameter's ID |
an initialized gamma distribution
Richèl J.C. Bilderbeek
Initializes a gamma site model
init_gamma_site_model(gamma_site_model, distr_id = 0, param_id = 0)
init_gamma_site_model(gamma_site_model, distr_id = 0, param_id = 0)
gamma_site_model |
a site model's gamma site model,
as returned by |
distr_id |
the first distributions' ID |
param_id |
the first parameter's ID |
an initialized gamma site model
Richèl J.C. Bilderbeek
check_empty_beautier_folder() gamma_site_model <- create_gamma_site_model( gamma_cat_count = 2, gamma_shape_prior_distr = create_one_div_x_distr(id = NA) ) # FALSE: not yet initialized is_init_gamma_site_model(gamma_site_model) gamma_site_model <- init_gamma_site_model(gamma_site_model) # TRUE: now it is initialized is_init_gamma_site_model(gamma_site_model) check_empty_beautier_folder()
check_empty_beautier_folder() gamma_site_model <- create_gamma_site_model( gamma_cat_count = 2, gamma_shape_prior_distr = create_one_div_x_distr(id = NA) ) # FALSE: not yet initialized is_init_gamma_site_model(gamma_site_model) gamma_site_model <- init_gamma_site_model(gamma_site_model) # TRUE: now it is initialized is_init_gamma_site_model(gamma_site_model) check_empty_beautier_folder()
Initializes a GTR site model
init_gtr_site_model(gtr_site_model, distr_id = 0, param_id = 0)
init_gtr_site_model(gtr_site_model, distr_id = 0, param_id = 0)
gtr_site_model |
a GTR site model,
as returned by |
distr_id |
a distributions' ID |
param_id |
a parameter's ID |
an initialized GTR site model
Richèl J.C. Bilderbeek
check_empty_beautier_folder() gtr_site_model <- create_gtr_site_model() # FALSE is_init_gtr_site_model(gtr_site_model) gtr_site_model <- init_gtr_site_model(gtr_site_model) # TRUE is_init_gtr_site_model(gtr_site_model) check_empty_beautier_folder()
check_empty_beautier_folder() gtr_site_model <- create_gtr_site_model() # FALSE is_init_gtr_site_model(gtr_site_model) gtr_site_model <- init_gtr_site_model(gtr_site_model) # TRUE is_init_gtr_site_model(gtr_site_model) check_empty_beautier_folder()
Initializes an HKY site model
init_hky_site_model(hky_site_model, distr_id = 0, param_id = 0)
init_hky_site_model(hky_site_model, distr_id = 0, param_id = 0)
hky_site_model |
an HKY site model,
as returned by |
distr_id |
a distributions' ID |
param_id |
a parameter's ID |
an initialized HKY site model
Richèl J.C. Bilderbeek
check_empty_beautier_folder() hky_site_model <- create_hky_site_model() is_init_hky_site_model(hky_site_model) hky_site_model <- init_hky_site_model(hky_site_model) is_init_hky_site_model(hky_site_model) check_empty_beautier_folder()
check_empty_beautier_folder() hky_site_model <- create_hky_site_model() is_init_hky_site_model(hky_site_model) hky_site_model <- init_hky_site_model(hky_site_model) is_init_hky_site_model(hky_site_model) check_empty_beautier_folder()
Initialize an inference model
init_inference_model(input_filename, inference_model)
init_inference_model(input_filename, inference_model)
input_filename |
A FASTA filename.
Use |
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
an initialized inference model
Richèl J.C. Bilderbeek
Initializes an inverse gamma distribution
init_inv_gamma_distr(inv_gamma_distr, distr_id = 0, param_id = 0)
init_inv_gamma_distr(inv_gamma_distr, distr_id = 0, param_id = 0)
inv_gamma_distr |
an inverse gamma distribution, using create_inv_gamma_distr |
distr_id |
the first distribution's ID |
param_id |
the first parameter's ID |
an initialized inverse gamma distribution
Richèl J.C. Bilderbeek
Initializes a JC69 site model
init_jc69_site_model(jc69_site_model, distr_id = 0, param_id = 0)
init_jc69_site_model(jc69_site_model, distr_id = 0, param_id = 0)
jc69_site_model |
a JC69 site model,
as returned by |
distr_id |
a distributions' ID |
param_id |
a parameter's ID |
an initialized HKY site model
Richèl J.C. Bilderbeek
check_empty_beautier_folder() hky_site_model <- create_hky_site_model() is_init_hky_site_model(hky_site_model) hky_site_model <- init_hky_site_model(hky_site_model) is_init_hky_site_model(hky_site_model) check_empty_beautier_folder()
check_empty_beautier_folder() hky_site_model <- create_hky_site_model() is_init_hky_site_model(hky_site_model) hky_site_model <- init_hky_site_model(hky_site_model) is_init_hky_site_model(hky_site_model) check_empty_beautier_folder()
Initializes an Laplace distribution
init_laplace_distr(laplace_distr, distr_id = 0, param_id = 0)
init_laplace_distr(laplace_distr, distr_id = 0, param_id = 0)
laplace_distr |
a Laplace distribution, using create_laplace_distr |
distr_id |
the first distribution's ID |
param_id |
the first parameter's ID |
an initialized Laplace distribution
Richèl J.C. Bilderbeek
Initializes an log-normal distribution
init_log_normal_distr(log_normal_distr, distr_id = 0, param_id = 0)
init_log_normal_distr(log_normal_distr, distr_id = 0, param_id = 0)
log_normal_distr |
a log-normal distribution, using create_log_normal_distr |
distr_id |
the first distribution's ID |
param_id |
the first parameter's ID |
an initialized log-normal distribution
Richèl J.C. Bilderbeek
Initialized by
if no alignment ID is set, it is set by reading it from the alignment file
if no taxa names are set, these are set by reading these from the alignment file
init_mrca_prior(input_filename, inference_model)
init_mrca_prior(input_filename, inference_model)
input_filename |
A FASTA filename.
Use |
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
an initialized MRCA prior
Richèl J.C. Bilderbeek
Initializes all MRCA priors
init_mrca_priors(mrca_priors, distr_id = 0, param_id = 0, beauti_options)
init_mrca_priors(mrca_priors, distr_id = 0, param_id = 0, beauti_options)
mrca_priors |
a list of one or more Most Recent Common Ancestor priors,
as returned by |
distr_id |
the first distributions' ID |
param_id |
the first parameter's ID |
beauti_options |
one BEAUti options object,
as returned by |
a list of initialized MRCA priors
Richèl J.C. Bilderbeek
Initializes an normal distribution
init_normal_distr(normal_distr, distr_id = 0, param_id = 0)
init_normal_distr(normal_distr, distr_id = 0, param_id = 0)
normal_distr |
a normal distribution, using create_normal_distr |
distr_id |
the first distribution's ID |
param_id |
the first parameter's ID |
an initialized normal distribution
Richèl J.C. Bilderbeek
Initializes an one-divided-by-x distribution
init_one_div_x_distr(one_div_x_distr, distr_id = 0)
init_one_div_x_distr(one_div_x_distr, distr_id = 0)
one_div_x_distr |
a one-divided-by-x distribution, using create_one_div_x_distr |
distr_id |
the first distribution's ID |
an initialized one-divided-by-x distribution
Richèl J.C. Bilderbeek
Initializes a parameter
init_param(param, id)
init_param(param, id)
param |
a parameter,
using |
id |
the parameter's ID. Will be ignored if the parameter already has an ID |
an initialized parameter
Richèl J.C. Bilderbeek
Initializes an Poisson distribution
init_poisson_distr(poisson_distr, distr_id = 0, param_id = 0)
init_poisson_distr(poisson_distr, distr_id = 0, param_id = 0)
poisson_distr |
a Poisson distribution, using create_poisson_distr |
distr_id |
the first distribution's ID |
param_id |
the first parameter's ID |
an initialized Poisson distribution
Richèl J.C. Bilderbeek
Initializes a Relaxed Log-Normal clock model
init_rln_clock_model(rln_clock_model, distr_id = 0, param_id = 0)
init_rln_clock_model(rln_clock_model, distr_id = 0, param_id = 0)
rln_clock_model |
a Relaxed Log-Normal clock model,
as returned by |
distr_id |
a distributions' ID |
param_id |
a parameter's ID |
an initialized Relaxed Log-Normal clock model
Richèl J.C. Bilderbeek
check_empty_beautier_folder() rln_clock_model <- create_rln_clock_model() # FALSE: not yet initialized is_init_rln_clock_model(rln_clock_model) rln_clock_model <- init_rln_clock_model(rln_clock_model) # Dimension is set to NA by default, for unknown reasons. # Because 'init_rln_clock_model' does not initialize it (for # unknown reasons), set it manually rln_clock_model$dimension <- 42 # TRUE: now it is initialized is_init_rln_clock_model(rln_clock_model) check_empty_beautier_folder()
check_empty_beautier_folder() rln_clock_model <- create_rln_clock_model() # FALSE: not yet initialized is_init_rln_clock_model(rln_clock_model) rln_clock_model <- init_rln_clock_model(rln_clock_model) # Dimension is set to NA by default, for unknown reasons. # Because 'init_rln_clock_model' does not initialize it (for # unknown reasons), set it manually rln_clock_model$dimension <- 42 # TRUE: now it is initialized is_init_rln_clock_model(rln_clock_model) check_empty_beautier_folder()
Initializes all site models
init_site_models(site_models, ids, distr_id = 0, param_id = 0)
init_site_models(site_models, ids, distr_id = 0, param_id = 0)
site_models |
one or more site models,
as returned by |
ids |
one or more alignments' IDs.
IDs can be extracted from their FASTA filenames
with |
distr_id |
the first distributions' ID |
param_id |
the first parameter's ID |
a list of initialized site models
Richèl J.C. Bilderbeek
Initializes a strict clock model
init_strict_clock_model(strict_clock_model, distr_id = 0, param_id = 0)
init_strict_clock_model(strict_clock_model, distr_id = 0, param_id = 0)
strict_clock_model |
a strict clock model,
as returned by |
distr_id |
a distributions' ID |
param_id |
a parameter's ID |
an initialized strict clock model
Richèl J.C. Bilderbeek
check_empty_beautier_folder() strict_clock_model <- create_strict_clock_model() # FALSE: not yet initialized is_init_strict_clock_model(strict_clock_model) strict_clock_model <- init_strict_clock_model(strict_clock_model) # TRUE: initialized is_init_strict_clock_model(strict_clock_model) check_empty_beautier_folder()
check_empty_beautier_folder() strict_clock_model <- create_strict_clock_model() # FALSE: not yet initialized is_init_strict_clock_model(strict_clock_model) strict_clock_model <- init_strict_clock_model(strict_clock_model) # TRUE: initialized is_init_strict_clock_model(strict_clock_model) check_empty_beautier_folder()
Initializes a TN93 site model
init_tn93_site_model(tn93_site_model, distr_id = 0, param_id = 0)
init_tn93_site_model(tn93_site_model, distr_id = 0, param_id = 0)
tn93_site_model |
a TN93 site model,
as returned by |
distr_id |
a distributions' ID |
param_id |
a parameter's ID |
an initialized TN93 site model
Richèl J.C. Bilderbeek
check_empty_beautier_folder() tn93_site_model <- create_tn93_site_model() is_init_tn93_site_model(tn93_site_model) tn93_site_model <- init_tn93_site_model(tn93_site_model) is_init_tn93_site_model(tn93_site_model) check_empty_beautier_folder()
check_empty_beautier_folder() tn93_site_model <- create_tn93_site_model() is_init_tn93_site_model(tn93_site_model) tn93_site_model <- init_tn93_site_model(tn93_site_model) is_init_tn93_site_model(tn93_site_model) check_empty_beautier_folder()
Initializes all tree priors
init_tree_priors(tree_priors, ids, distr_id = 0, param_id = 0)
init_tree_priors(tree_priors, ids, distr_id = 0, param_id = 0)
tree_priors |
one or more tree priors,
as returned by |
ids |
one or more alignments' IDs.
IDs can be extracted from their FASTA filenames
with |
distr_id |
the first distributions' ID |
param_id |
the first parameter's ID |
a list of initialized tree priors
Richèl J.C. Bilderbeek
Initializes a uniform distribution
init_uniform_distr(uniform_distr, distr_id = 0)
init_uniform_distr(uniform_distr, distr_id = 0)
uniform_distr |
a uniform distribution, using create_uniform_distr |
distr_id |
the first distribution's ID |
an initialized uniform distribution
Richèl J.C. Bilderbeek
Initializes a Yule tree prior
init_yule_tree_prior(yule_tree_prior, distr_id, param_id)
init_yule_tree_prior(yule_tree_prior, distr_id, param_id)
yule_tree_prior |
a Yule tree_prior,
as created by |
distr_id |
a distributions' ID |
param_id |
a parameter's ID |
an initialized Yule tree prior
Richèl J.C. Bilderbeek
Puts spaces in between the lines
interspace(lines)
interspace(lines)
lines |
lines of text |
interspaced lines of text
Richèl J.C. Bilderbeek
Determine if the object is a valid alpha parameter
is_alpha_param(x)
is_alpha_param(x)
x |
an object, to be determined if it is a valid alpha parameter |
TRUE if x is a valid alpha parameter, FALSE otherwise
Richèl J.C. Bilderbeek
check_empty_beautier_folder() is_alpha_param(create_alpha_param()) is_alpha_param(create_beta_param()) is_alpha_param(create_clock_rate_param()) is_alpha_param(create_kappa_1_param()) is_alpha_param(create_kappa_2_param()) is_alpha_param(create_lambda_param()) is_alpha_param(create_m_param()) is_alpha_param(create_mean_param()) is_alpha_param(create_mu_param()) is_alpha_param(create_rate_ac_param()) is_alpha_param(create_rate_ag_param()) is_alpha_param(create_rate_at_param()) is_alpha_param(create_rate_cg_param()) is_alpha_param(create_rate_ct_param()) is_alpha_param(create_rate_gt_param()) is_alpha_param(create_s_param()) is_alpha_param(create_scale_param()) is_alpha_param(create_sigma_param()) is_alpha_param(NA) is_alpha_param(NULL) is_alpha_param("nonsense") is_alpha_param(create_jc69_site_model()) is_alpha_param(create_strict_clock_model()) is_alpha_param(create_yule_tree_prior()) is_alpha_param(create_mcmc()) check_empty_beautier_folder()
check_empty_beautier_folder() is_alpha_param(create_alpha_param()) is_alpha_param(create_beta_param()) is_alpha_param(create_clock_rate_param()) is_alpha_param(create_kappa_1_param()) is_alpha_param(create_kappa_2_param()) is_alpha_param(create_lambda_param()) is_alpha_param(create_m_param()) is_alpha_param(create_mean_param()) is_alpha_param(create_mu_param()) is_alpha_param(create_rate_ac_param()) is_alpha_param(create_rate_ag_param()) is_alpha_param(create_rate_at_param()) is_alpha_param(create_rate_cg_param()) is_alpha_param(create_rate_ct_param()) is_alpha_param(create_rate_gt_param()) is_alpha_param(create_s_param()) is_alpha_param(create_scale_param()) is_alpha_param(create_sigma_param()) is_alpha_param(NA) is_alpha_param(NULL) is_alpha_param("nonsense") is_alpha_param(create_jc69_site_model()) is_alpha_param(create_strict_clock_model()) is_alpha_param(create_yule_tree_prior()) is_alpha_param(create_mcmc()) check_empty_beautier_folder()
Determine if the object is a valid b_pop_sizes parameter
is_b_pop_sizes_param(x)
is_b_pop_sizes_param(x)
x |
an object, to be determined if it is a valid b_pop_sizes parameter |
TRUE if x is a valid b_pop_sizes parameter, FALSE otherwise
Richèl J.C. Bilderbeek
check_empty_beautier_folder() is_b_pop_sizes_param(create_alpha_param()) is_b_pop_sizes_param(create_b_pop_sizes_param()) is_b_pop_sizes_param(create_beta_param()) is_b_pop_sizes_param(create_clock_rate_param()) is_b_pop_sizes_param(create_kappa_1_param()) is_b_pop_sizes_param(create_kappa_2_param()) is_b_pop_sizes_param(create_lambda_param()) is_b_pop_sizes_param(create_m_param()) is_b_pop_sizes_param(create_mean_param()) is_b_pop_sizes_param(create_mu_param()) is_b_pop_sizes_param(create_rate_ac_param()) is_b_pop_sizes_param(create_rate_ag_param()) is_b_pop_sizes_param(create_rate_at_param()) is_b_pop_sizes_param(create_rate_cg_param()) is_b_pop_sizes_param(create_rate_ct_param()) is_b_pop_sizes_param(create_rate_gt_param()) is_b_pop_sizes_param(create_s_param()) is_b_pop_sizes_param(create_scale_param()) is_b_pop_sizes_param(create_sigma_param()) is_b_pop_sizes_param(NA) is_b_pop_sizes_param(NULL) is_b_pop_sizes_param("nonsense") is_b_pop_sizes_param(create_jc69_site_model()) is_b_pop_sizes_param(create_strict_clock_model()) is_b_pop_sizes_param(create_yule_tree_prior()) is_b_pop_sizes_param(create_mcmc()) check_empty_beautier_folder()
check_empty_beautier_folder() is_b_pop_sizes_param(create_alpha_param()) is_b_pop_sizes_param(create_b_pop_sizes_param()) is_b_pop_sizes_param(create_beta_param()) is_b_pop_sizes_param(create_clock_rate_param()) is_b_pop_sizes_param(create_kappa_1_param()) is_b_pop_sizes_param(create_kappa_2_param()) is_b_pop_sizes_param(create_lambda_param()) is_b_pop_sizes_param(create_m_param()) is_b_pop_sizes_param(create_mean_param()) is_b_pop_sizes_param(create_mu_param()) is_b_pop_sizes_param(create_rate_ac_param()) is_b_pop_sizes_param(create_rate_ag_param()) is_b_pop_sizes_param(create_rate_at_param()) is_b_pop_sizes_param(create_rate_cg_param()) is_b_pop_sizes_param(create_rate_ct_param()) is_b_pop_sizes_param(create_rate_gt_param()) is_b_pop_sizes_param(create_s_param()) is_b_pop_sizes_param(create_scale_param()) is_b_pop_sizes_param(create_sigma_param()) is_b_pop_sizes_param(NA) is_b_pop_sizes_param(NULL) is_b_pop_sizes_param("nonsense") is_b_pop_sizes_param(create_jc69_site_model()) is_b_pop_sizes_param(create_strict_clock_model()) is_b_pop_sizes_param(create_yule_tree_prior()) is_b_pop_sizes_param(create_mcmc()) check_empty_beautier_folder()
Determine if the object is a valid Birth Death tree prior
is_bd_tree_prior(x)
is_bd_tree_prior(x)
x |
an object, to be determined if it is a valid birth death tree prior |
TRUE if x is a valid birth death tree prior, FALSE otherwise
Richèl J.C. Bilderbeek
Use create_bd_tree_prior
to create a valid
Birth-Death tree prior
check_empty_beautier_folder() is_bd_tree_prior(create_bd_tree_prior()) !is_bd_tree_prior(create_cbs_tree_prior()) !is_bd_tree_prior(create_ccp_tree_prior()) !is_bd_tree_prior(create_cep_tree_prior()) !is_bd_tree_prior(create_yule_tree_prior()) check_empty_beautier_folder()
check_empty_beautier_folder() is_bd_tree_prior(create_bd_tree_prior()) !is_bd_tree_prior(create_cbs_tree_prior()) !is_bd_tree_prior(create_ccp_tree_prior()) !is_bd_tree_prior(create_cep_tree_prior()) !is_bd_tree_prior(create_yule_tree_prior()) check_empty_beautier_folder()
beauti_options
Determine if the object is a valid beauti_options
is_beauti_options(x)
is_beauti_options(x)
x |
an object, to be determined if it is a |
TRUE if the object is a valid beauti_options
,
FALSE otherwise
Richèl J.C. Bilderbeek
use create_beauti_options to create a valid
beauti_options
object
check_empty_beautier_folder() # TRUE is_beauti_options(create_beauti_options()) # FALSE is_beauti_options("nonsense") is_beauti_options(NA) is_beauti_options(NULL) is_beauti_options("") is_beauti_options(c()) check_empty_beautier_folder()
check_empty_beautier_folder() # TRUE is_beauti_options(create_beauti_options()) # FALSE is_beauti_options("nonsense") is_beauti_options(NA) is_beauti_options(NULL) is_beauti_options("") is_beauti_options(c()) check_empty_beautier_folder()
create_beta_distr
Determine if the object is a valid
beta distribution,
as created by create_beta_distr
is_beta_distr(x)
is_beta_distr(x)
x |
an object, to be determined if it is a valid beta distribution, |
TRUE if x is a valid beta distribution, FALSE otherwise
Richèl J.C. Bilderbeek
use is_distr
to see if x is any
distribution
check_empty_beautier_folder() # TRUE is_beta_distr(create_beta_distr()) # FALSE is_beta_distr(create_exp_distr()) is_beta_distr(NA) is_beta_distr(NULL) is_beta_distr("nonsense") check_empty_beautier_folder()
check_empty_beautier_folder() # TRUE is_beta_distr(create_beta_distr()) # FALSE is_beta_distr(create_exp_distr()) is_beta_distr(NA) is_beta_distr(NULL) is_beta_distr("nonsense") check_empty_beautier_folder()
Determine if the object is a valid beta parameter
is_beta_param(x)
is_beta_param(x)
x |
an object, to be determined if it is a valid beta parameter |
TRUE if x is a valid beta parameter, FALSE otherwise
Richèl J.C. Bilderbeek
check_empty_beautier_folder() is_beta_param(create_alpha_param()) is_beta_param(create_beta_param()) is_beta_param(create_clock_rate_param()) is_beta_param(create_kappa_1_param()) is_beta_param(create_kappa_2_param()) is_beta_param(create_lambda_param()) is_beta_param(create_m_param()) is_beta_param(create_mean_param()) is_beta_param(create_mu_param()) is_beta_param(create_rate_ac_param()) is_beta_param(create_rate_ag_param()) is_beta_param(create_rate_at_param()) is_beta_param(create_rate_cg_param()) is_beta_param(create_rate_ct_param()) is_beta_param(create_rate_gt_param()) is_beta_param(create_s_param()) is_beta_param(create_scale_param()) is_beta_param(create_sigma_param()) is_beta_param(NA) is_beta_param(NULL) is_beta_param("nonsense") is_beta_param(create_jc69_site_model()) is_beta_param(create_strict_clock_model()) is_beta_param(create_yule_tree_prior()) is_beta_param(create_mcmc()) check_empty_beautier_folder()
check_empty_beautier_folder() is_beta_param(create_alpha_param()) is_beta_param(create_beta_param()) is_beta_param(create_clock_rate_param()) is_beta_param(create_kappa_1_param()) is_beta_param(create_kappa_2_param()) is_beta_param(create_lambda_param()) is_beta_param(create_m_param()) is_beta_param(create_mean_param()) is_beta_param(create_mu_param()) is_beta_param(create_rate_ac_param()) is_beta_param(create_rate_ag_param()) is_beta_param(create_rate_at_param()) is_beta_param(create_rate_cg_param()) is_beta_param(create_rate_ct_param()) is_beta_param(create_rate_gt_param()) is_beta_param(create_s_param()) is_beta_param(create_scale_param()) is_beta_param(create_sigma_param()) is_beta_param(NA) is_beta_param(NULL) is_beta_param("nonsense") is_beta_param(create_jc69_site_model()) is_beta_param(create_strict_clock_model()) is_beta_param(create_yule_tree_prior()) is_beta_param(create_mcmc()) check_empty_beautier_folder()
Determine if the object is a valid constant coalescent Bayesian skyline prior
is_cbs_tree_prior(x)
is_cbs_tree_prior(x)
x |
an object, to be determined if it is a valid constant coalescent Bayesian skyline prior |
'TRUE' if 'x' is a valid constant coalescent Bayesian skyline prior, 'FALSE' otherwise
Richèl J.C. Bilderbeek
Use create_cbs_tree_prior
to create a valid
coalescent Bayes skyline tree prior
check_empty_beautier_folder() # TRUE is_cbs_tree_prior(create_cbs_tree_prior()) # FALSE is_cbs_tree_prior(create_bd_tree_prior()) is_cbs_tree_prior(create_ccp_tree_prior()) is_cbs_tree_prior(create_cep_tree_prior()) is_cbs_tree_prior(create_yule_tree_prior()) check_empty_beautier_folder()
check_empty_beautier_folder() # TRUE is_cbs_tree_prior(create_cbs_tree_prior()) # FALSE is_cbs_tree_prior(create_bd_tree_prior()) is_cbs_tree_prior(create_ccp_tree_prior()) is_cbs_tree_prior(create_cep_tree_prior()) is_cbs_tree_prior(create_yule_tree_prior()) check_empty_beautier_folder()
Determine if the object is a valid constant coalescence population tree prior
is_ccp_tree_prior(x)
is_ccp_tree_prior(x)
x |
an object, to be determined if it is a valid constant coalescence population tree prior |
TRUE if x is a valid constant coalescence population tree prior, FALSE otherwise
Richèl J.C. Bilderbeek
Use create_ccp_tree_prior
to create a valid
constant coalescence population tree prior
check_empty_beautier_folder() !is_ccp_tree_prior(create_bd_tree_prior()) !is_ccp_tree_prior(create_cbs_tree_prior()) is_ccp_tree_prior(create_ccp_tree_prior()) !is_ccp_tree_prior(create_cep_tree_prior()) !is_ccp_tree_prior(create_yule_tree_prior()) check_empty_beautier_folder()
check_empty_beautier_folder() !is_ccp_tree_prior(create_bd_tree_prior()) !is_ccp_tree_prior(create_cbs_tree_prior()) is_ccp_tree_prior(create_ccp_tree_prior()) !is_ccp_tree_prior(create_cep_tree_prior()) !is_ccp_tree_prior(create_yule_tree_prior()) check_empty_beautier_folder()
Determine if the object is a valid coalescent exponential population tree prior
is_cep_tree_prior(x)
is_cep_tree_prior(x)
x |
an object, to be determined if it is a valid constant coalescent exponential population tree prior |
TRUE if x is a valid coalescent exponential population tree prior, FALSE otherwise
Richèl J.C. Bilderbeek
Use create_cep_tree_prior
to create a valid
coalescent exponential population tree prior
check_empty_beautier_folder() !is_cep_tree_prior(create_bd_tree_prior()) !is_cep_tree_prior(create_cbs_tree_prior()) !is_cep_tree_prior(create_ccp_tree_prior()) is_cep_tree_prior(create_cep_tree_prior()) !is_cep_tree_prior(create_yule_tree_prior()) check_empty_beautier_folder()
check_empty_beautier_folder() !is_cep_tree_prior(create_bd_tree_prior()) !is_cep_tree_prior(create_cbs_tree_prior()) !is_cep_tree_prior(create_ccp_tree_prior()) is_cep_tree_prior(create_cep_tree_prior()) !is_cep_tree_prior(create_yule_tree_prior()) check_empty_beautier_folder()
Determine if the object is a valid clock_model
is_clock_model(x)
is_clock_model(x)
x |
an object, to be determined if it is a clock_model |
TRUE if the clock_model is a valid clock_model, FALSE otherwise
Richèl J.C. Bilderbeek
see create_clock_model
for an overview of functions
to create valid clock model
check_empty_beautier_folder() # TRUE is_clock_model(create_strict_clock_model()) is_clock_model(create_rln_clock_model()) # FALSE is_clock_model(NA) is_clock_model(NULL) is_clock_model("nonsense") is_clock_model(create_jc69_site_model()) is_clock_model(create_mcmc()) check_empty_beautier_folder()
check_empty_beautier_folder() # TRUE is_clock_model(create_strict_clock_model()) is_clock_model(create_rln_clock_model()) # FALSE is_clock_model(NA) is_clock_model(NULL) is_clock_model("nonsense") is_clock_model(create_jc69_site_model()) is_clock_model(create_mcmc()) check_empty_beautier_folder()
Determines if the name is a valid clock model name
is_clock_model_name(name)
is_clock_model_name(name)
name |
the name to be tested |
TRUE if the name is a valid clock_model name, FALSE otherwise
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # TRUE is_clock_model_name("relaxed_log_normal") is_clock_model_name("strict") check_empty_beautier_folder()
check_empty_beautier_folder() # TRUE is_clock_model_name("relaxed_log_normal") is_clock_model_name("strict") check_empty_beautier_folder()
Determine if the object is a valid clock_rate parameter
is_clock_rate_param(x)
is_clock_rate_param(x)
x |
an object, to be determined if it is a valid clock_rate parameter |
TRUE if x is a valid clock_rate parameter, FALSE otherwise
Richèl J.C. Bilderbeek
check_empty_beautier_folder() is_clock_rate_param(create_alpha_param()) is_clock_rate_param(create_beta_param()) is_clock_rate_param(create_clock_rate_param()) is_clock_rate_param(create_kappa_1_param()) is_clock_rate_param(create_kappa_2_param()) is_clock_rate_param(create_lambda_param()) is_clock_rate_param(create_m_param()) is_clock_rate_param(create_mean_param()) is_clock_rate_param(create_mu_param()) is_clock_rate_param(create_rate_ac_param()) is_clock_rate_param(create_rate_ag_param()) is_clock_rate_param(create_rate_at_param()) is_clock_rate_param(create_rate_cg_param()) is_clock_rate_param(create_rate_ct_param()) is_clock_rate_param(create_rate_gt_param()) is_clock_rate_param(create_s_param()) is_clock_rate_param(create_scale_param()) is_clock_rate_param(create_sigma_param()) is_clock_rate_param(NA) is_clock_rate_param(NULL) is_clock_rate_param("nonsense") is_clock_rate_param(create_jc69_site_model()) is_clock_rate_param(create_strict_clock_model()) is_clock_rate_param(create_yule_tree_prior()) is_clock_rate_param(create_mcmc()) check_empty_beautier_folder()
check_empty_beautier_folder() is_clock_rate_param(create_alpha_param()) is_clock_rate_param(create_beta_param()) is_clock_rate_param(create_clock_rate_param()) is_clock_rate_param(create_kappa_1_param()) is_clock_rate_param(create_kappa_2_param()) is_clock_rate_param(create_lambda_param()) is_clock_rate_param(create_m_param()) is_clock_rate_param(create_mean_param()) is_clock_rate_param(create_mu_param()) is_clock_rate_param(create_rate_ac_param()) is_clock_rate_param(create_rate_ag_param()) is_clock_rate_param(create_rate_at_param()) is_clock_rate_param(create_rate_cg_param()) is_clock_rate_param(create_rate_ct_param()) is_clock_rate_param(create_rate_gt_param()) is_clock_rate_param(create_s_param()) is_clock_rate_param(create_scale_param()) is_clock_rate_param(create_sigma_param()) is_clock_rate_param(NA) is_clock_rate_param(NULL) is_clock_rate_param("nonsense") is_clock_rate_param(create_jc69_site_model()) is_clock_rate_param(create_strict_clock_model()) is_clock_rate_param(create_yule_tree_prior()) is_clock_rate_param(create_mcmc()) check_empty_beautier_folder()
Determine if the MCMC is a default MCMC
is_default_mcmc(mcmc)
is_default_mcmc(mcmc)
mcmc |
one MCMC.
Use |
TRUE if the MCMC is a default MCMC
Richèl J.C. Bilderbeek
if (is_on_ci()) { check_empty_beautier_folder() # TRUE: An MCMC created by 'create_mcmc' is default. is_default_mcmc(create_mcmc()) # FALSE: An MCMC created by 'create_ns_mcmc' is not is_default_mcmc(create_ns_mcmc()) check_empty_beautier_folder() }
if (is_on_ci()) { check_empty_beautier_folder() # TRUE: An MCMC created by 'create_mcmc' is default. is_default_mcmc(create_mcmc()) # FALSE: An MCMC created by 'create_ns_mcmc' is not is_default_mcmc(create_ns_mcmc()) check_empty_beautier_folder() }
Determine if the object is a valid distribution
is_distr(x)
is_distr(x)
x |
an object, to be determined if it is a valid distribution |
TRUE if x is a valid distribution, FALSE otherwise
Richèl J.C. Bilderbeek
use
is_beta_distr
,
is_exp_distr
,
is_gamma_distr
,
is_inv_gamma_distr
,
is_laplace_distr
,
is_log_normal_distr
,
is_normal_distr
,
is_one_div_x_distr
,
is_poisson_distr
,
or is_uniform_distr
,
to check for more specific distribution
check_empty_beautier_folder() # TRUE is_distr(create_beta_distr()) is_distr(create_exp_distr()) is_distr(create_gamma_distr()) is_distr(create_inv_gamma_distr()) is_distr(create_laplace_distr()) is_distr(create_log_normal_distr()) is_distr(create_normal_distr()) is_distr(create_one_div_x_distr()) is_distr(create_poisson_distr()) is_distr(create_uniform_distr()) # FALSE is_distr(NA) is_distr(NULL) is_distr("nonsense") check_empty_beautier_folder()
check_empty_beautier_folder() # TRUE is_distr(create_beta_distr()) is_distr(create_exp_distr()) is_distr(create_gamma_distr()) is_distr(create_inv_gamma_distr()) is_distr(create_laplace_distr()) is_distr(create_log_normal_distr()) is_distr(create_normal_distr()) is_distr(create_one_div_x_distr()) is_distr(create_poisson_distr()) is_distr(create_uniform_distr()) # FALSE is_distr(NA) is_distr(NULL) is_distr("nonsense") check_empty_beautier_folder()
Determines if the name is a valid distribution name
is_distr_name(name)
is_distr_name(name)
name |
the name to be tested |
TRUE if the name is a valid distribution name, FALSE otherwise
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # TRUE is_distr_name("uniform") is_distr_name("normal") is_distr_name("one_div_x") is_distr_name("log_normal") is_distr_name("exponential") is_distr_name("gamma") is_distr_name("beta") is_distr_name("laplace") is_distr_name("inv_gamma") is_distr_name("poisson") # FALSE is_distr_name("nonsense") check_empty_beautier_folder()
check_empty_beautier_folder() # TRUE is_distr_name("uniform") is_distr_name("normal") is_distr_name("one_div_x") is_distr_name("log_normal") is_distr_name("exponential") is_distr_name("gamma") is_distr_name("beta") is_distr_name("laplace") is_distr_name("inv_gamma") is_distr_name("poisson") # FALSE is_distr_name("nonsense") check_empty_beautier_folder()
create_exp_distr
Determine if the object is a valid
exponential distribution
as created by create_exp_distr
is_exp_distr(x)
is_exp_distr(x)
x |
an object, to be determined if it is a valid exponential distribution |
TRUE if x is a valid exponential distribution, FALSE otherwise
Richèl J.C. Bilderbeek
use is_distr
to see if x is any
distribution
check_empty_beautier_folder() # TRUE is_exp_distr(create_exp_distr()) # FALSE is_exp_distr(create_gamma_distr()) is_exp_distr(NA) is_exp_distr(NULL) is_exp_distr("nonsense") check_empty_beautier_folder()
check_empty_beautier_folder() # TRUE is_exp_distr(create_exp_distr()) # FALSE is_exp_distr(create_gamma_distr()) is_exp_distr(NA) is_exp_distr(NULL) is_exp_distr("nonsense") check_empty_beautier_folder()
name
is a valid freq_equilibrium
argument valueChecks if name
is a valid freq_equilibrium
argument value
is_freq_equilibrium_name(name)
is_freq_equilibrium_name(name)
name |
the name to check if it is a valid |
TRUE if the name is a valid freq_equilibrium
value
Richèl J.C. Bilderbeek
the freq_equilibrium
argument is used by
create_gtr_site_model
,
create_hky_site_model
,
and create_tn93_site_model
check_empty_beautier_folder() # TRUE is_freq_equilibrium_name("estimated") is_freq_equilibrium_name("empirical") is_freq_equilibrium_name("all_equal") # FALSE is_freq_equilibrium_name("nonsense") check_empty_beautier_folder()
check_empty_beautier_folder() # TRUE is_freq_equilibrium_name("estimated") is_freq_equilibrium_name("empirical") is_freq_equilibrium_name("all_equal") # FALSE is_freq_equilibrium_name("nonsense") check_empty_beautier_folder()
Determine if the object is a valid freq parameter
is_freq_param(x)
is_freq_param(x)
x |
an object, to be determined if it is a valid freq parameter |
TRUE if x is a valid freq parameter, FALSE otherwise
Richèl J.C. Bilderbeek
freq parameters are returned by
create_freq_param
check_empty_beautier_folder() is_freq_param(create_alpha_param()) is_freq_param(create_beta_param()) is_freq_param(create_clock_rate_param()) is_freq_param(create_freq_param()) is_freq_param(create_freq_param()) is_freq_param(create_kappa_param()) is_freq_param(create_kappa_1_param()) is_freq_param(create_kappa_2_param()) is_freq_param(create_lambda_param()) is_freq_param(create_m_param()) is_freq_param(create_mean_param()) is_freq_param(create_mu_param()) is_freq_param(create_rate_ac_param()) is_freq_param(create_rate_ag_param()) is_freq_param(create_rate_at_param()) is_freq_param(create_rate_cg_param()) is_freq_param(create_rate_ct_param()) is_freq_param(create_rate_gt_param()) is_freq_param(create_s_param()) is_freq_param(create_scale_param()) is_freq_param(create_sigma_param()) is_freq_param(NA) is_freq_param(NULL) is_freq_param("nonsense") is_freq_param(create_jc69_site_model()) is_freq_param(create_strict_clock_model()) is_freq_param(create_yule_tree_prior()) is_freq_param(create_mcmc()) check_empty_beautier_folder()
check_empty_beautier_folder() is_freq_param(create_alpha_param()) is_freq_param(create_beta_param()) is_freq_param(create_clock_rate_param()) is_freq_param(create_freq_param()) is_freq_param(create_freq_param()) is_freq_param(create_kappa_param()) is_freq_param(create_kappa_1_param()) is_freq_param(create_kappa_2_param()) is_freq_param(create_lambda_param()) is_freq_param(create_m_param()) is_freq_param(create_mean_param()) is_freq_param(create_mu_param()) is_freq_param(create_rate_ac_param()) is_freq_param(create_rate_ag_param()) is_freq_param(create_rate_at_param()) is_freq_param(create_rate_cg_param()) is_freq_param(create_rate_ct_param()) is_freq_param(create_rate_gt_param()) is_freq_param(create_s_param()) is_freq_param(create_scale_param()) is_freq_param(create_sigma_param()) is_freq_param(NA) is_freq_param(NULL) is_freq_param("nonsense") is_freq_param(create_jc69_site_model()) is_freq_param(create_strict_clock_model()) is_freq_param(create_yule_tree_prior()) is_freq_param(create_mcmc()) check_empty_beautier_folder()
create_gamma_distr
Determine if the object is a valid
gamma distribution,
as created by create_gamma_distr
is_gamma_distr(x)
is_gamma_distr(x)
x |
an object, to be determined if it is a valid gamma distribution |
TRUE if x is a valid gamma distribution, FALSE otherwise
Richèl J.C. Bilderbeek
use is_distr
to see if x is any
distribution
check_empty_beautier_folder() # TRUE is_gamma_distr(create_gamma_distr()) # FALSE is_gamma_distr(create_inv_gamma_distr()) is_gamma_distr(NA) is_gamma_distr(NULL) is_gamma_distr("nonsense") check_empty_beautier_folder()
check_empty_beautier_folder() # TRUE is_gamma_distr(create_gamma_distr()) # FALSE is_gamma_distr(create_inv_gamma_distr()) is_gamma_distr(NA) is_gamma_distr(NULL) is_gamma_distr("nonsense") check_empty_beautier_folder()
Is object x a gamma site model?
is_gamma_site_model(x)
is_gamma_site_model(x)
x |
the object to be determined if it is a valid gamma site object |
TRUE if x is a valid gamma site object, FALSE otherwise
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # TRUE is_gamma_site_model(create_gamma_site_model()) # FALSE is_gamma_site_model("nonsense") is_gamma_site_model(NA) is_gamma_site_model(NULL) is_gamma_site_model("") is_gamma_site_model(c()) check_empty_beautier_folder()
check_empty_beautier_folder() # TRUE is_gamma_site_model(create_gamma_site_model()) # FALSE is_gamma_site_model("nonsense") is_gamma_site_model(NA) is_gamma_site_model(NULL) is_gamma_site_model("") is_gamma_site_model(c()) check_empty_beautier_folder()
create_gtr_site_model
Determine if the object is a valid GTR site model,
as created by create_gtr_site_model
is_gtr_site_model(x)
is_gtr_site_model(x)
x |
an object, to be determined if it is a valid GTR site model |
TRUE if x is a valid GTR site model, FALSE otherwise
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # site models is_gtr_site_model(create_gtr_site_model()) is_gtr_site_model(create_hky_site_model()) is_gtr_site_model(create_jc69_site_model()) is_gtr_site_model(create_tn93_site_model()) # other models is_gtr_site_model(NA) is_gtr_site_model(NULL) is_gtr_site_model("nonsense") is_gtr_site_model(create_strict_clock_model()) is_gtr_site_model(create_bd_tree_prior()) is_gtr_site_model(create_mcmc()) check_empty_beautier_folder()
check_empty_beautier_folder() # site models is_gtr_site_model(create_gtr_site_model()) is_gtr_site_model(create_hky_site_model()) is_gtr_site_model(create_jc69_site_model()) is_gtr_site_model(create_tn93_site_model()) # other models is_gtr_site_model(NA) is_gtr_site_model(NULL) is_gtr_site_model("nonsense") is_gtr_site_model(create_strict_clock_model()) is_gtr_site_model(create_bd_tree_prior()) is_gtr_site_model(create_mcmc()) check_empty_beautier_folder()
create_hky_site_model
Determine if the object is a valid HKY site model,
as created by create_hky_site_model
is_hky_site_model(x)
is_hky_site_model(x)
x |
an object, to be determined if it is a valid HKY site model |
TRUE if x is a valid HKY site model, FALSE otherwise
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # site models is_hky_site_model(create_hky_site_model()) is_hky_site_model(create_gtr_site_model()) is_hky_site_model(create_jc69_site_model()) is_hky_site_model(create_tn93_site_model()) # other models is_hky_site_model(NA) is_hky_site_model(NULL) is_hky_site_model("nonsense") is_hky_site_model(create_strict_clock_model()) is_hky_site_model(create_bd_tree_prior()) is_hky_site_model(create_mcmc()) check_empty_beautier_folder()
check_empty_beautier_folder() # site models is_hky_site_model(create_hky_site_model()) is_hky_site_model(create_gtr_site_model()) is_hky_site_model(create_jc69_site_model()) is_hky_site_model(create_tn93_site_model()) # other models is_hky_site_model(NA) is_hky_site_model(NULL) is_hky_site_model("nonsense") is_hky_site_model(create_strict_clock_model()) is_hky_site_model(create_bd_tree_prior()) is_hky_site_model(create_mcmc()) check_empty_beautier_folder()
Determine if the object is a valid ID
is_id(x)
is_id(x)
x |
an object, to be determined if it is a valid ID |
TRUE if x is a valid ID, FALSE otherwise
Richèl J.C. Bilderbeek
to check multiple IDs, use are_ids
check_empty_beautier_folder() # TRUE is_id("anthus_aco") is_id(3) # FALSE is_id(ape::rcoal(3)) is_id(NULL) is_id(NA) check_empty_beautier_folder()
check_empty_beautier_folder() # TRUE is_id("anthus_aco") is_id(3) # FALSE is_id(ape::rcoal(3)) is_id(NULL) is_id(NA) check_empty_beautier_folder()
Is there at least one regular expression having a match with the line?
is_in_patterns(line, patterns)
is_in_patterns(line, patterns)
line |
a line of text |
patterns |
one or more regular expression patterns |
TRUE if there is at least one match found
Richèl J.C. Bilderbeek
Determine if the input is an inference model
is_inference_model(x)
is_inference_model(x)
x |
object to be determined of if it is an inference model |
TRUE if the object is an inference model
Determine if x is an initialized Birth-Death tree_prior object
is_init_bd_tree_prior(x)
is_init_bd_tree_prior(x)
x |
the object to check if it is an initialized Birth-Death tree prior object |
TRUE if x is an initialized Birth-Death tree_prior object
Richèl J.C. Bilderbeek
create_beta_distr
Determine if x is an initialized beta distribution object
as created by create_beta_distr
is_init_beta_distr(x)
is_init_beta_distr(x)
x |
the object to check if it is an initialized beta distribution object |
TRUE if x is an initialized beta distribution object
Richèl J.C. Bilderbeek
Determine if x is an initialized Coalescent Bayesian Skyline tree_prior object
is_init_cbs_tree_prior(x)
is_init_cbs_tree_prior(x)
x |
the object to check if it is an initialized Coalescent Bayesian Skyline tree prior object |
TRUE if x is an initialized Coalescent Bayesian Skyline tree prior object
Richèl J.C. Bilderbeek
Determine if x is an initialized Coalescent Constant Population tree_prior object
is_init_ccp_tree_prior(x)
is_init_ccp_tree_prior(x)
x |
the object to check if it is an initialized Coalescent Constant Population tree prior object |
TRUE if x is an initialized Coalescent Constant Population tree prior object
Richèl J.C. Bilderbeek
Determine if x is an initialized Coalescent Exponential Population tree_prior object
is_init_cep_tree_prior(x)
is_init_cep_tree_prior(x)
x |
the object to check if it is an initialized Coalescent Exponential Population tree prior object |
TRUE if x is an initialized Coalescent Exponential Population tree prior object
Richèl J.C. Bilderbeek
create_clock_model
Determine if x is an initialized clock_model object,
as created by create_clock_model
is_init_clock_model(x)
is_init_clock_model(x)
x |
the object to check if it is an initialized clock_models object |
TRUE if x is an initialized clock_model object
Richèl J.C. Bilderbeek
create_distr
Determine if x is an initialized distribution object
as created by create_distr
is_init_distr(x)
is_init_distr(x)
x |
the object to check if it is an initialized distribution object |
TRUE if x is an initialized distribution object
Richèl J.C. Bilderbeek
create_exp_distr
Determine if x is an initialized exponential distribution object
as created by create_exp_distr
is_init_exp_distr(x)
is_init_exp_distr(x)
x |
the object to check if it is an initialized exponential distribution object |
TRUE if x is an initialized exponential distribution object
Richèl J.C. Bilderbeek
Determine if x is an initialized gamma distribution object
is_init_gamma_distr(x)
is_init_gamma_distr(x)
x |
the object to check if it is an initialized gamma distribution object |
TRUE if x is an initialized gamma distribution object
Richèl J.C. Bilderbeek
create_gamma_site_model
Determine if x is an initialized gamma site model,
as created by create_gamma_site_model
is_init_gamma_site_model(x)
is_init_gamma_site_model(x)
x |
the object to check if it is an initialized gamma site_models object |
TRUE if x is an initialized gamma site model
Richèl J.C. Bilderbeek
create_gtr_site_model
Determine if x is an initialized GTR site model
as created by create_gtr_site_model
is_init_gtr_site_model(x)
is_init_gtr_site_model(x)
x |
the object to check if it is an initialized GTR site model |
TRUE if x is an initialized GTR site model
Richèl J.C. Bilderbeek
check_empty_beautier_folder() gtr_site_model <- create_gtr_site_model() # FALSE: not yet initialized is_init_gtr_site_model(gtr_site_model) gtr_site_model <- init_gtr_site_model(gtr_site_model) # TRUE: now it is initialized is_init_gtr_site_model(gtr_site_model) check_empty_beautier_folder()
check_empty_beautier_folder() gtr_site_model <- create_gtr_site_model() # FALSE: not yet initialized is_init_gtr_site_model(gtr_site_model) gtr_site_model <- init_gtr_site_model(gtr_site_model) # TRUE: now it is initialized is_init_gtr_site_model(gtr_site_model) check_empty_beautier_folder()
create_hky_site_model
Determine if x is an initialized HKY site model
as created by create_hky_site_model
is_init_hky_site_model(x)
is_init_hky_site_model(x)
x |
the object to check if it is an initialized HKY site model |
TRUE if x is an initialized HKY site model
Richèl J.C. Bilderbeek
check_empty_beautier_folder() hky_site_model <- create_hky_site_model() # FALSE: not yet initialized is_init_hky_site_model(hky_site_model) hky_site_model <- init_hky_site_model(hky_site_model) # TRUE: now it is initialized is_init_hky_site_model(hky_site_model) check_empty_beautier_folder()
check_empty_beautier_folder() hky_site_model <- create_hky_site_model() # FALSE: not yet initialized is_init_hky_site_model(hky_site_model) hky_site_model <- init_hky_site_model(hky_site_model) # TRUE: now it is initialized is_init_hky_site_model(hky_site_model) check_empty_beautier_folder()
create_inv_gamma_distr
Determine if x is an initialized inverse-gamma distribution
as created by create_inv_gamma_distr
is_init_inv_gamma_distr(x)
is_init_inv_gamma_distr(x)
x |
the object to check if it is an initialized inverse-gamma distribution |
TRUE if x is an initialized inverse-gamma distribution
Richèl J.C. Bilderbeek
create_jc69_site_model
Determine if x is an initialized JC69 site model
as created by create_jc69_site_model
is_init_jc69_site_model(x)
is_init_jc69_site_model(x)
x |
the object to check if it is an initialized JC69 site model |
TRUE if x is an initialized JC69 site model
Richèl J.C. Bilderbeek
check_empty_beautier_folder() jc69_site_model <- create_jc69_site_model( gamma_site_model = create_gamma_site_model( gamma_cat_count = 2, gamma_shape_prior_distr = create_normal_distr() ) ) # FALSE: not yet initialized is_init_jc69_site_model(jc69_site_model) jc69_site_model <- init_jc69_site_model(jc69_site_model) # TRUE: now it is initialized is_init_jc69_site_model(jc69_site_model) check_empty_beautier_folder()
check_empty_beautier_folder() jc69_site_model <- create_jc69_site_model( gamma_site_model = create_gamma_site_model( gamma_cat_count = 2, gamma_shape_prior_distr = create_normal_distr() ) ) # FALSE: not yet initialized is_init_jc69_site_model(jc69_site_model) jc69_site_model <- init_jc69_site_model(jc69_site_model) # TRUE: now it is initialized is_init_jc69_site_model(jc69_site_model) check_empty_beautier_folder()
create_laplace_distr
Determine if x is an initialized Laplace distribution
as created by create_laplace_distr
is_init_laplace_distr(x)
is_init_laplace_distr(x)
x |
the object to check if it is an initialized Laplace distribution |
TRUE if x is an initialized Laplace distribution
Richèl J.C. Bilderbeek
create_log_normal_distr
Determine if x is an initialized log_normal distribution object
as created by create_log_normal_distr
is_init_log_normal_distr(x)
is_init_log_normal_distr(x)
x |
the object to check if it is an initialized log_normal distribution object |
TRUE if x is an initialized log_normal distribution object
Richèl J.C. Bilderbeek
Determine if x is an initialized MRCA prior
is_init_mrca_prior(x)
is_init_mrca_prior(x)
x |
the object to check if it is an initialized MRCA prior |
TRUE if x is an initialized MRCA prior
Richèl J.C. Bilderbeek
create_normal_distr
Determine if x is an initialized normal distribution object
as created by create_normal_distr
is_init_normal_distr(x)
is_init_normal_distr(x)
x |
the object to check if it is an initialized normal distribution object |
TRUE if x is an initialized normal distribution object
Richèl J.C. Bilderbeek
create_one_div_x_distr
Determine if x is an initialized one_div_x distribution object
as created by create_one_div_x_distr
is_init_one_div_x_distr(x)
is_init_one_div_x_distr(x)
x |
the object to check if it is an initialized one_div_x distribution object |
TRUE if x is an initialized one_div_x distribution object
Richèl J.C. Bilderbeek
Determine if x is an initialized parameter, as created by create_param
is_init_param(x)
is_init_param(x)
x |
the object to check if it is an initialized parameter |
TRUE if x is an initialized parameter, FALSE otherwise
Richèl J.C. Bilderbeek
create_poisson_distr
Determine if x is an initialized Poisson distribution object
as created by create_poisson_distr
is_init_poisson_distr(x)
is_init_poisson_distr(x)
x |
the object to check if it is an initialized Poisson distribution object |
TRUE if x is an initialized Poisson distribution object
Richèl J.C. Bilderbeek
Determine if x is an initialized relaxed log-normal clock_model object
is_init_rln_clock_model(rln_clock_model)
is_init_rln_clock_model(rln_clock_model)
rln_clock_model |
a Relaxed Log-Normal clock model,
as returned by |
TRUE if x is an initialized relaxed log-normal clock_model object, FALSE otherwise
Richèl J.C. Bilderbeek
create_site_model
Determine if x is an initialized site model,
as created by create_site_model
is_init_site_model(x)
is_init_site_model(x)
x |
the object to check if it is an initialized site_models object |
TRUE if x is an initialized site model
Richèl J.C. Bilderbeek
Determine if x is an initialized strict clock_model object
is_init_strict_clock_model(strict_clock_model)
is_init_strict_clock_model(strict_clock_model)
strict_clock_model |
a strict clock model,
as returned by |
TRUE if x is an initialized strict clock_model object
Richèl J.C. Bilderbeek
create_tn93_site_model
Determine if x is an initialized tn93 site model
as created by create_tn93_site_model
is_init_tn93_site_model(x)
is_init_tn93_site_model(x)
x |
the object to check if it is an initialized TN93 site model |
TRUE if x is an initialized TN93 site model
Richèl J.C. Bilderbeek
check_empty_beautier_folder() tn93_site_model <- create_tn93_site_model() # FALSE: not yet initialized is_init_tn93_site_model(tn93_site_model) tn93_site_model <- init_tn93_site_model(tn93_site_model) # TRUE: now it is initialized is_init_tn93_site_model(tn93_site_model) check_empty_beautier_folder()
check_empty_beautier_folder() tn93_site_model <- create_tn93_site_model() # FALSE: not yet initialized is_init_tn93_site_model(tn93_site_model) tn93_site_model <- init_tn93_site_model(tn93_site_model) # TRUE: now it is initialized is_init_tn93_site_model(tn93_site_model) check_empty_beautier_folder()
Determine if x is an initialized tree_prior objects
is_init_tree_prior(x)
is_init_tree_prior(x)
x |
the object to check if it is an initialized tree_priors object |
TRUE if x is an initialized tree_prior object
Richèl J.C. Bilderbeek
create_uniform_distr
Determine if x is an initialized uniform distribution object
as created by create_uniform_distr
is_init_uniform_distr(x)
is_init_uniform_distr(x)
x |
the object to check if it is an initialized uniform distribution object |
TRUE if x is an initialized uniform distribution object
Richèl J.C. Bilderbeek
Determine if x is an initialized Yule tree_prior object
is_init_yule_tree_prior(x)
is_init_yule_tree_prior(x)
x |
the object to check if it is an initialized Yule tree prior object |
TRUE if x is an initialized Yule tree_prior object
Richèl J.C. Bilderbeek
create_inv_gamma_distr
Determine if the object is a valid
inverse-gamma distribution
as created by create_inv_gamma_distr
is_inv_gamma_distr(x)
is_inv_gamma_distr(x)
x |
an object, to be determined if it is a valid inverse-gamma distribution |
TRUE if x is a valid inverse-gamma distribution, FALSE otherwise
Richèl J.C. Bilderbeek
use is_distr
to see if x is any
distribution
check_empty_beautier_folder() # TRUE is_inv_gamma_distr(create_inv_gamma_distr()) # FALSE is_inv_gamma_distr(create_laplace_distr()) is_inv_gamma_distr(NA) is_inv_gamma_distr(NULL) is_inv_gamma_distr("nonsense") check_empty_beautier_folder()
check_empty_beautier_folder() # TRUE is_inv_gamma_distr(create_inv_gamma_distr()) # FALSE is_inv_gamma_distr(create_laplace_distr()) is_inv_gamma_distr(NA) is_inv_gamma_distr(NULL) is_inv_gamma_distr("nonsense") check_empty_beautier_folder()
Determine if the object is a valid JC69 site model
is_jc69_site_model(x)
is_jc69_site_model(x)
x |
an object, to be determined if it is a valid JC69 site model |
TRUE if x is a valid JC69 site model, FALSE otherwise
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # site models is_jc69_site_model(create_gtr_site_model()) is_jc69_site_model(create_hky_site_model()) is_jc69_site_model(create_jc69_site_model()) is_jc69_site_model(create_tn93_site_model()) # other models is_jc69_site_model(NA) is_jc69_site_model(NULL) is_jc69_site_model("nonsense") is_jc69_site_model(create_strict_clock_model()) is_jc69_site_model(create_bd_tree_prior()) is_jc69_site_model(create_mcmc()) check_empty_beautier_folder()
check_empty_beautier_folder() # site models is_jc69_site_model(create_gtr_site_model()) is_jc69_site_model(create_hky_site_model()) is_jc69_site_model(create_jc69_site_model()) is_jc69_site_model(create_tn93_site_model()) # other models is_jc69_site_model(NA) is_jc69_site_model(NULL) is_jc69_site_model("nonsense") is_jc69_site_model(create_strict_clock_model()) is_jc69_site_model(create_bd_tree_prior()) is_jc69_site_model(create_mcmc()) check_empty_beautier_folder()
Determine if the object is a valid kappa 1 parameter
is_kappa_1_param(x)
is_kappa_1_param(x)
x |
an object, to be determined if it is a valid kappa 1 parameter |
TRUE if x is a valid kappa 1 parameter, FALSE otherwise
Richèl J.C. Bilderbeek
kappa 1 parameters are returned by
create_kappa_1_param
check_empty_beautier_folder() is_kappa_1_param(create_alpha_param()) is_kappa_1_param(create_beta_param()) is_kappa_1_param(create_clock_rate_param()) is_kappa_1_param(create_kappa_param()) is_kappa_1_param(create_kappa_1_param()) is_kappa_1_param(create_kappa_2_param()) is_kappa_1_param(create_lambda_param()) is_kappa_1_param(create_m_param()) is_kappa_1_param(create_mean_param()) is_kappa_1_param(create_mu_param()) is_kappa_1_param(create_rate_ac_param()) is_kappa_1_param(create_rate_ag_param()) is_kappa_1_param(create_rate_at_param()) is_kappa_1_param(create_rate_cg_param()) is_kappa_1_param(create_rate_ct_param()) is_kappa_1_param(create_rate_gt_param()) is_kappa_1_param(create_s_param()) is_kappa_1_param(create_scale_param()) is_kappa_1_param(create_sigma_param()) is_kappa_1_param(NA) is_kappa_1_param(NULL) is_kappa_1_param("nonsense") is_kappa_1_param(create_jc69_site_model()) is_kappa_1_param(create_strict_clock_model()) is_kappa_1_param(create_yule_tree_prior()) is_kappa_1_param(create_mcmc()) check_empty_beautier_folder()
check_empty_beautier_folder() is_kappa_1_param(create_alpha_param()) is_kappa_1_param(create_beta_param()) is_kappa_1_param(create_clock_rate_param()) is_kappa_1_param(create_kappa_param()) is_kappa_1_param(create_kappa_1_param()) is_kappa_1_param(create_kappa_2_param()) is_kappa_1_param(create_lambda_param()) is_kappa_1_param(create_m_param()) is_kappa_1_param(create_mean_param()) is_kappa_1_param(create_mu_param()) is_kappa_1_param(create_rate_ac_param()) is_kappa_1_param(create_rate_ag_param()) is_kappa_1_param(create_rate_at_param()) is_kappa_1_param(create_rate_cg_param()) is_kappa_1_param(create_rate_ct_param()) is_kappa_1_param(create_rate_gt_param()) is_kappa_1_param(create_s_param()) is_kappa_1_param(create_scale_param()) is_kappa_1_param(create_sigma_param()) is_kappa_1_param(NA) is_kappa_1_param(NULL) is_kappa_1_param("nonsense") is_kappa_1_param(create_jc69_site_model()) is_kappa_1_param(create_strict_clock_model()) is_kappa_1_param(create_yule_tree_prior()) is_kappa_1_param(create_mcmc()) check_empty_beautier_folder()
Determine if the object is a valid kappa 2 parameter
is_kappa_2_param(x)
is_kappa_2_param(x)
x |
an object, to be determined if it is a valid kappa 2 parameter |
TRUE if x is a valid kappa_2 parameter, FALSE otherwise
Richèl J.C. Bilderbeek
kappa 2 parameters are returned by
create_kappa_2_param
check_empty_beautier_folder() is_kappa_2_param(create_alpha_param()) is_kappa_2_param(create_beta_param()) is_kappa_2_param(create_clock_rate_param()) is_kappa_2_param(create_kappa_1_param()) is_kappa_2_param(create_kappa_2_param()) is_kappa_2_param(create_lambda_param()) is_kappa_2_param(create_m_param()) is_kappa_2_param(create_mean_param()) is_kappa_2_param(create_mu_param()) is_kappa_2_param(create_rate_ac_param()) is_kappa_2_param(create_rate_ag_param()) is_kappa_2_param(create_rate_at_param()) is_kappa_2_param(create_rate_cg_param()) is_kappa_2_param(create_rate_ct_param()) is_kappa_2_param(create_rate_gt_param()) is_kappa_2_param(create_s_param()) is_kappa_2_param(create_scale_param()) is_kappa_2_param(create_sigma_param()) is_kappa_2_param(NA) is_kappa_2_param(NULL) is_kappa_2_param("nonsense") is_kappa_2_param(create_jc69_site_model()) is_kappa_2_param(create_strict_clock_model()) is_kappa_2_param(create_yule_tree_prior()) is_kappa_2_param(create_mcmc()) check_empty_beautier_folder()
check_empty_beautier_folder() is_kappa_2_param(create_alpha_param()) is_kappa_2_param(create_beta_param()) is_kappa_2_param(create_clock_rate_param()) is_kappa_2_param(create_kappa_1_param()) is_kappa_2_param(create_kappa_2_param()) is_kappa_2_param(create_lambda_param()) is_kappa_2_param(create_m_param()) is_kappa_2_param(create_mean_param()) is_kappa_2_param(create_mu_param()) is_kappa_2_param(create_rate_ac_param()) is_kappa_2_param(create_rate_ag_param()) is_kappa_2_param(create_rate_at_param()) is_kappa_2_param(create_rate_cg_param()) is_kappa_2_param(create_rate_ct_param()) is_kappa_2_param(create_rate_gt_param()) is_kappa_2_param(create_s_param()) is_kappa_2_param(create_scale_param()) is_kappa_2_param(create_sigma_param()) is_kappa_2_param(NA) is_kappa_2_param(NULL) is_kappa_2_param("nonsense") is_kappa_2_param(create_jc69_site_model()) is_kappa_2_param(create_strict_clock_model()) is_kappa_2_param(create_yule_tree_prior()) is_kappa_2_param(create_mcmc()) check_empty_beautier_folder()
Determine if the object is a valid kappa parameter
is_kappa_param(x)
is_kappa_param(x)
x |
an object, to be determined if it is a valid kappa parameter |
TRUE if x is a valid kappa parameter, FALSE otherwise
Richèl J.C. Bilderbeek
kappa parameters are returned by
create_kappa_param
check_empty_beautier_folder() is_kappa_param(create_alpha_param()) is_kappa_param(create_beta_param()) is_kappa_param(create_clock_rate_param()) is_kappa_param(create_kappa_param()) is_kappa_param(create_kappa_1_param()) is_kappa_param(create_kappa_2_param()) is_kappa_param(create_lambda_param()) is_kappa_param(create_m_param()) is_kappa_param(create_mean_param()) is_kappa_param(create_mu_param()) is_kappa_param(create_rate_ac_param()) is_kappa_param(create_rate_ag_param()) is_kappa_param(create_rate_at_param()) is_kappa_param(create_rate_cg_param()) is_kappa_param(create_rate_ct_param()) is_kappa_param(create_rate_gt_param()) is_kappa_param(create_s_param()) is_kappa_param(create_scale_param()) is_kappa_param(create_sigma_param()) is_kappa_param(NA) is_kappa_param(NULL) is_kappa_param("nonsense") is_kappa_param(create_jc69_site_model()) is_kappa_param(create_strict_clock_model()) is_kappa_param(create_yule_tree_prior()) is_kappa_param(create_mcmc()) check_empty_beautier_folder()
check_empty_beautier_folder() is_kappa_param(create_alpha_param()) is_kappa_param(create_beta_param()) is_kappa_param(create_clock_rate_param()) is_kappa_param(create_kappa_param()) is_kappa_param(create_kappa_1_param()) is_kappa_param(create_kappa_2_param()) is_kappa_param(create_lambda_param()) is_kappa_param(create_m_param()) is_kappa_param(create_mean_param()) is_kappa_param(create_mu_param()) is_kappa_param(create_rate_ac_param()) is_kappa_param(create_rate_ag_param()) is_kappa_param(create_rate_at_param()) is_kappa_param(create_rate_cg_param()) is_kappa_param(create_rate_ct_param()) is_kappa_param(create_rate_gt_param()) is_kappa_param(create_s_param()) is_kappa_param(create_scale_param()) is_kappa_param(create_sigma_param()) is_kappa_param(NA) is_kappa_param(NULL) is_kappa_param("nonsense") is_kappa_param(create_jc69_site_model()) is_kappa_param(create_strict_clock_model()) is_kappa_param(create_yule_tree_prior()) is_kappa_param(create_mcmc()) check_empty_beautier_folder()
Determine if the object is a valid lambda parameter
is_lambda_param(x)
is_lambda_param(x)
x |
an object, to be determined if it is a valid lambda parameter |
TRUE if x is a valid lambda parameter, FALSE otherwise
Richèl J.C. Bilderbeek
lambda parameters are returned by create_lambda_param
check_empty_beautier_folder() is_lambda_param(create_alpha_param()) is_lambda_param(create_beta_param()) is_lambda_param(create_clock_rate_param()) is_lambda_param(create_kappa_1_param()) is_lambda_param(create_kappa_2_param()) is_lambda_param(create_lambda_param()) is_lambda_param(create_m_param()) is_lambda_param(create_mean_param()) is_lambda_param(create_mu_param()) is_lambda_param(create_rate_ac_param()) is_lambda_param(create_rate_ag_param()) is_lambda_param(create_rate_at_param()) is_lambda_param(create_rate_cg_param()) is_lambda_param(create_rate_ct_param()) is_lambda_param(create_rate_gt_param()) is_lambda_param(create_s_param()) is_lambda_param(create_scale_param()) is_lambda_param(create_sigma_param()) is_lambda_param(NA) is_lambda_param(NULL) is_lambda_param("nonsense") is_lambda_param(create_jc69_site_model()) is_lambda_param(create_strict_clock_model()) is_lambda_param(create_yule_tree_prior()) is_lambda_param(create_mcmc()) check_empty_beautier_folder()
check_empty_beautier_folder() is_lambda_param(create_alpha_param()) is_lambda_param(create_beta_param()) is_lambda_param(create_clock_rate_param()) is_lambda_param(create_kappa_1_param()) is_lambda_param(create_kappa_2_param()) is_lambda_param(create_lambda_param()) is_lambda_param(create_m_param()) is_lambda_param(create_mean_param()) is_lambda_param(create_mu_param()) is_lambda_param(create_rate_ac_param()) is_lambda_param(create_rate_ag_param()) is_lambda_param(create_rate_at_param()) is_lambda_param(create_rate_cg_param()) is_lambda_param(create_rate_ct_param()) is_lambda_param(create_rate_gt_param()) is_lambda_param(create_s_param()) is_lambda_param(create_scale_param()) is_lambda_param(create_sigma_param()) is_lambda_param(NA) is_lambda_param(NULL) is_lambda_param("nonsense") is_lambda_param(create_jc69_site_model()) is_lambda_param(create_strict_clock_model()) is_lambda_param(create_yule_tree_prior()) is_lambda_param(create_mcmc()) check_empty_beautier_folder()
create_laplace_distr
Determine if the object is a valid
Laplace distribution,
as created by create_laplace_distr
is_laplace_distr(x)
is_laplace_distr(x)
x |
an object, to be determined if it is a valid Laplace distribution |
TRUE if x is a valid Laplace distribution, FALSE otherwise
Richèl J.C. Bilderbeek
use is_distr
to see if x is any
distribution
# TRUE is_laplace_distr(create_laplace_distr()) # FALSE is_laplace_distr(create_log_normal_distr()) is_laplace_distr(NA) is_laplace_distr(NULL) is_laplace_distr("nonsense")
# TRUE is_laplace_distr(create_laplace_distr()) # FALSE is_laplace_distr(create_log_normal_distr()) is_laplace_distr(NA) is_laplace_distr(NULL) is_laplace_distr("nonsense")
create_log_normal_distr
Determine if the object is a valid
log-normal distribution,
as created by create_log_normal_distr
is_log_normal_distr(x)
is_log_normal_distr(x)
x |
an object, to be determined if it is a valid log-normal distribution |
TRUE if x is a valid log-normal distribution, FALSE otherwise
Richèl J.C. Bilderbeek
use is_distr
to see if x is any
distribution
check_empty_beautier_folder() # TRUE is_log_normal_distr(create_log_normal_distr()) # FALSE is_log_normal_distr(create_normal_distr()) is_distr(NA) is_distr(NULL) is_distr("nonsense") check_empty_beautier_folder()
check_empty_beautier_folder() # TRUE is_log_normal_distr(create_log_normal_distr()) # FALSE is_log_normal_distr(create_normal_distr()) is_distr(NA) is_distr(NULL) is_distr("nonsense") check_empty_beautier_folder()
Determine if the object is a valid m parameter
is_m_param(m_param)
is_m_param(m_param)
m_param |
an m parameter, as created by create_m_param |
TRUE if x is a valid m parameter, FALSE otherwise
Richèl J.C. Bilderbeek
check_empty_beautier_folder() is_m_param(create_alpha_param()) is_m_param(create_beta_param()) is_m_param(create_clock_rate_param()) is_m_param(create_kappa_1_param()) is_m_param(create_kappa_2_param()) is_m_param(create_lambda_param()) is_m_param(create_m_param()) is_m_param(create_mean_param()) is_m_param(create_mu_param()) is_m_param(create_rate_ac_param()) is_m_param(create_rate_ag_param()) is_m_param(create_rate_at_param()) is_m_param(create_rate_cg_param()) is_m_param(create_rate_ct_param()) is_m_param(create_rate_gt_param()) is_m_param(create_s_param()) is_m_param(create_scale_param()) is_m_param(create_sigma_param()) is_m_param(NA) is_m_param(NULL) is_m_param("nonsense") is_m_param(create_jc69_site_model()) is_m_param(create_strict_clock_model()) is_m_param(create_yule_tree_prior()) is_m_param(create_mcmc()) check_empty_beautier_folder()
check_empty_beautier_folder() is_m_param(create_alpha_param()) is_m_param(create_beta_param()) is_m_param(create_clock_rate_param()) is_m_param(create_kappa_1_param()) is_m_param(create_kappa_2_param()) is_m_param(create_lambda_param()) is_m_param(create_m_param()) is_m_param(create_mean_param()) is_m_param(create_mu_param()) is_m_param(create_rate_ac_param()) is_m_param(create_rate_ag_param()) is_m_param(create_rate_at_param()) is_m_param(create_rate_cg_param()) is_m_param(create_rate_ct_param()) is_m_param(create_rate_gt_param()) is_m_param(create_s_param()) is_m_param(create_scale_param()) is_m_param(create_sigma_param()) is_m_param(NA) is_m_param(NULL) is_m_param("nonsense") is_m_param(create_jc69_site_model()) is_m_param(create_strict_clock_model()) is_m_param(create_yule_tree_prior()) is_m_param(create_mcmc()) check_empty_beautier_folder()
Determine if the object is a valid MCMC
is_mcmc(x)
is_mcmc(x)
x |
an object, to be determined if it is a valid MCMC |
TRUE if x is a valid MCMC, FALSE otherwise
Richèl J.C. Bilderbeek
Use create_mcmc
to create an MCMC
if (is_on_ci()) { check_empty_beautier_folder() # Returns TRUE is_mcmc(create_mcmc()) is_mcmc(create_ns_mcmc()) # Returns FALSE is_mcmc("nonsense") is_mcmc(NULL) is_mcmc(NA) is_mcmc("") is_mcmc(c()) check_empty_beautier_folder() }
if (is_on_ci()) { check_empty_beautier_folder() # Returns TRUE is_mcmc(create_mcmc()) is_mcmc(create_ns_mcmc()) # Returns FALSE is_mcmc("nonsense") is_mcmc(NULL) is_mcmc(NA) is_mcmc("") is_mcmc(c()) check_empty_beautier_folder() }
Determine if the object is a valid Nested-Sampling MCMC, as used in [1]
is_mcmc_nested_sampling(x)
is_mcmc_nested_sampling(x)
x |
an object, to be determined if it is a valid MCMC |
TRUE if x is a valid Nested-Sampling MCMC, FALSE otherwise
Richèl J.C. Bilderbeek
* [1] Patricio Maturana Russel, Brendon J Brewer, Steffen Klaere, Remco R Bouckaert; Model Selection and Parameter Inference in Phylogenetics Using Nested Sampling, Systematic Biology, 2018, syy050, https://doi.org/10.1093/sysbio/syy050
Use create_ns_mcmc to create an NS MCMC
if (is_on_ci()) { check_empty_beautier_folder() # TRUE is_nested_sampling_mcmc(create_ns_mcmc()) # FALSE is_nested_sampling_mcmc(create_mcmc()) is_nested_sampling_mcmc("nonsense") check_empty_beautier_folder() }
if (is_on_ci()) { check_empty_beautier_folder() # TRUE is_nested_sampling_mcmc(create_ns_mcmc()) # FALSE is_nested_sampling_mcmc(create_mcmc()) is_nested_sampling_mcmc("nonsense") check_empty_beautier_folder() }
Determine if the object is a valid mean parameter
is_mean_param(x)
is_mean_param(x)
x |
an object, to be determined if it is a valid mean parameter,
as created by |
TRUE if x is a valid mean parameter, FALSE otherwise
Richèl J.C. Bilderbeek
check_empty_beautier_folder() is_mean_param(create_alpha_param()) is_mean_param(create_beta_param()) is_mean_param(create_clock_rate_param()) is_mean_param(create_kappa_1_param()) is_mean_param(create_kappa_2_param()) is_mean_param(create_lambda_param()) is_mean_param(create_m_param()) is_mean_param(create_mean_param()) is_mean_param(create_mu_param()) is_mean_param(create_rate_ac_param()) is_mean_param(create_rate_ag_param()) is_mean_param(create_rate_at_param()) is_mean_param(create_rate_cg_param()) is_mean_param(create_rate_ct_param()) is_mean_param(create_rate_gt_param()) is_mean_param(create_s_param()) is_mean_param(create_scale_param()) is_mean_param(create_sigma_param()) is_mean_param(NA) is_mean_param(NULL) is_mean_param("nonsense") is_mean_param(create_jc69_site_model()) is_mean_param(create_strict_clock_model()) is_mean_param(create_yule_tree_prior()) is_mean_param(create_mcmc()) check_empty_beautier_folder()
check_empty_beautier_folder() is_mean_param(create_alpha_param()) is_mean_param(create_beta_param()) is_mean_param(create_clock_rate_param()) is_mean_param(create_kappa_1_param()) is_mean_param(create_kappa_2_param()) is_mean_param(create_lambda_param()) is_mean_param(create_m_param()) is_mean_param(create_mean_param()) is_mean_param(create_mu_param()) is_mean_param(create_rate_ac_param()) is_mean_param(create_rate_ag_param()) is_mean_param(create_rate_at_param()) is_mean_param(create_rate_cg_param()) is_mean_param(create_rate_ct_param()) is_mean_param(create_rate_gt_param()) is_mean_param(create_s_param()) is_mean_param(create_scale_param()) is_mean_param(create_sigma_param()) is_mean_param(NA) is_mean_param(NULL) is_mean_param("nonsense") is_mean_param(create_jc69_site_model()) is_mean_param(create_strict_clock_model()) is_mean_param(create_yule_tree_prior()) is_mean_param(create_mcmc()) check_empty_beautier_folder()
Determine if an MRCA prior's alignment IDs is present in the FASTA file
is_mrca_align_id_in_fasta(mrca_prior, fasta_filename)
is_mrca_align_id_in_fasta(mrca_prior, fasta_filename)
mrca_prior |
a Most Recent Common Ancestor prior,
as returned by |
fasta_filename |
a FASTA filename.
Use |
TRUE if the MRCA prior's alignment IDs is present in the FASTA file. Returns FALSE otherwise
Richèl J.C. Bilderbeek
Determine if an MRCA prior's alignment IDs are present in the FASTA files
is_mrca_align_ids_in_fastas(mrca_prior, fasta_filenames)
is_mrca_align_ids_in_fastas(mrca_prior, fasta_filenames)
mrca_prior |
a Most Recent Common Ancestor prior,
as returned by |
fasta_filenames |
One or more FASTA filenames.
Use |
TRUE if the MRCA prior's alignment IDs is present in the FASTA files. Returns FALSE otherwise
Richèl J.C. Bilderbeek
NA
) or valid MRCA prior.Determine of the object is an empty (NA
) or valid MRCA prior.
is_mrca_prior(mrca_prior)
is_mrca_prior(mrca_prior)
mrca_prior |
a Most Recent Common Ancestor prior,
as returned by |
TRUE if x
is an MRCA prior, FALSE otherwise
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # TRUE is_mrca_prior(create_mrca_prior()) # Also 'NA' is a valid MRCA prior, # denoting that there no MRCA priors is_mrca_prior(NA) # FALSE is_mrca_prior(NULL) is_mrca_prior("nonsense") check_empty_beautier_folder()
check_empty_beautier_folder() # TRUE is_mrca_prior(create_mrca_prior()) # Also 'NA' is a valid MRCA prior, # denoting that there no MRCA priors is_mrca_prior(NA) # FALSE is_mrca_prior(NULL) is_mrca_prior("nonsense") check_empty_beautier_folder()
See if x is one MRCA prior with a distribution
is_mrca_prior_with_distr(x)
is_mrca_prior_with_distr(x)
x |
the object to be tested |
TRUE if x is one MRCA prior with a distribution, FALSE otherwise
Richèl J.C. Bilderbeek
Determine if the object is a valid mu parameter
is_mu_param(x)
is_mu_param(x)
x |
an object, to be determined if it is a valid mu parameter |
TRUE if x is a valid mu parameter, FALSE otherwise
Richèl J.C. Bilderbeek
create_mu_param
creates a mu parameter
check_empty_beautier_folder() is_mu_param(create_alpha_param()) is_mu_param(create_beta_param()) is_mu_param(create_clock_rate_param()) is_mu_param(create_kappa_1_param()) is_mu_param(create_kappa_2_param()) is_mu_param(create_lambda_param()) is_mu_param(create_m_param()) is_mu_param(create_mean_param()) is_mu_param(create_mu_param()) is_mu_param(create_rate_ac_param()) is_mu_param(create_rate_ag_param()) is_mu_param(create_rate_at_param()) is_mu_param(create_rate_cg_param()) is_mu_param(create_rate_ct_param()) is_mu_param(create_rate_gt_param()) is_mu_param(create_s_param()) is_mu_param(create_scale_param()) is_mu_param(create_sigma_param()) is_mu_param(NA) is_mu_param(NULL) is_mu_param("nonsense") is_mu_param(create_jc69_site_model()) is_mu_param(create_strict_clock_model()) is_mu_param(create_yule_tree_prior()) is_mu_param(create_mcmc()) check_empty_beautier_folder()
check_empty_beautier_folder() is_mu_param(create_alpha_param()) is_mu_param(create_beta_param()) is_mu_param(create_clock_rate_param()) is_mu_param(create_kappa_1_param()) is_mu_param(create_kappa_2_param()) is_mu_param(create_lambda_param()) is_mu_param(create_m_param()) is_mu_param(create_mean_param()) is_mu_param(create_mu_param()) is_mu_param(create_rate_ac_param()) is_mu_param(create_rate_ag_param()) is_mu_param(create_rate_at_param()) is_mu_param(create_rate_cg_param()) is_mu_param(create_rate_ct_param()) is_mu_param(create_rate_gt_param()) is_mu_param(create_s_param()) is_mu_param(create_scale_param()) is_mu_param(create_sigma_param()) is_mu_param(NA) is_mu_param(NULL) is_mu_param("nonsense") is_mu_param(create_jc69_site_model()) is_mu_param(create_strict_clock_model()) is_mu_param(create_yule_tree_prior()) is_mu_param(create_mcmc()) check_empty_beautier_folder()
create_normal_distr
Determine if the object is a valid
normal distribution
as created by create_normal_distr
is_normal_distr(x)
is_normal_distr(x)
x |
an object, to be determined if it is a valid normal distribution |
TRUE if x is a valid normal distribution, FALSE otherwise
Richèl J.C. Bilderbeek
use is_distr
to see if x is any
distribution
check_empty_beautier_folder() # TRUE is_normal_distr(create_normal_distr()) # FALSE is_normal_distr(create_one_div_x_distr()) is_normal_distr(NA) is_normal_distr(NULL) is_normal_distr("nonsense") check_empty_beautier_folder()
check_empty_beautier_folder() # TRUE is_normal_distr(create_normal_distr()) # FALSE is_normal_distr(create_one_div_x_distr()) is_normal_distr(NA) is_normal_distr(NULL) is_normal_distr("nonsense") check_empty_beautier_folder()
Determines if the environment is AppVeyor
is_on_appveyor()
is_on_appveyor()
TRUE if run on AppVeyor, FALSE otherwise
Richèl J.C. Bilderbeek
if (is_on_appveyor()) { message("Running on AppVeyor") }
if (is_on_appveyor()) { message("Running on AppVeyor") }
Determines if the environment is a continuous integration service
is_on_ci()
is_on_ci()
TRUE if run on AppVeyor or Travis CI, FALSE otherwise
It is possible to fake being on continuous integration service, in this case GitHub Actions, using:
“'r Sys.setenv(GITHUB_ACTIONS = "I fake being on GitHub Actions") is_on_ci() # Will be true “'
To undo this, do
“'r Sys.setenv(GITHUB_ACTIONS = "") is_on_ci() # Will be false “'
Richèl J.C. Bilderbeek
is_on_ci()
is_on_ci()
Determines if the environment is GitHub Actions
is_on_github_actions()
is_on_github_actions()
TRUE if run on GitHub Actions, FALSE otherwise
It is possible to fake being on GitHub Actions, using:
“'r Sys.setenv(GITHUB_ACTIONS = "I fake being on GitHub Actions") is_on_github_actions() # Will be true “'
To undo this, do
“'r Sys.setenv(GITHUB_ACTIONS = "") is_on_github_actions() # Will be false “'
Richèl J.C. Bilderbeek
if (is_on_github_actions()) { message("Running on GitHub Actions") }
if (is_on_github_actions()) { message("Running on GitHub Actions") }
Determines if the environment is Travis CI
is_on_travis()
is_on_travis()
TRUE if run on Travis CI, FALSE otherwise
Richèl J.C. Bilderbeek
if (is_on_ci()) { message("Running on Travis CI") }
if (is_on_ci()) { message("Running on Travis CI") }
Check if the argument is one boolean
is_one_bool(x)
is_one_bool(x)
x |
the argument to be tested to be boolean |
TRUE if the argument is one boolean, FALSE otherwise
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # TRUE is_one_bool(TRUE) is_one_bool(FALSE) # FALSE is_one_bool(NULL) is_one_bool(NA) is_one_bool(c()) is_one_bool("nonsense") is_one_bool(is_one_bool) is_one_bool(c(TRUE, FALSE)) check_empty_beautier_folder()
check_empty_beautier_folder() # TRUE is_one_bool(TRUE) is_one_bool(FALSE) # FALSE is_one_bool(NULL) is_one_bool(NA) is_one_bool(c()) is_one_bool("nonsense") is_one_bool(is_one_bool) is_one_bool(c(TRUE, FALSE)) check_empty_beautier_folder()
create_one_div_x_distr
Determine if the object is a valid
1/x distribution,
as created by create_one_div_x_distr
is_one_div_x_distr(x)
is_one_div_x_distr(x)
x |
an object, to be determined if it is a valid 1/x distribution |
TRUE if x is a valid 1/x distribution, FALSE otherwise
Richèl J.C. Bilderbeek
use is_distr
to see if x is any
distribution
check_empty_beautier_folder() # TRUE is_one_div_x_distr(create_one_div_x_distr()) # FALSE is_one_div_x_distr(create_poisson_distr()) is_one_div_x_distr(NA) is_one_div_x_distr(NULL) is_one_div_x_distr("nonsense") check_empty_beautier_folder()
check_empty_beautier_folder() # TRUE is_one_div_x_distr(create_one_div_x_distr()) # FALSE is_one_div_x_distr(create_poisson_distr()) is_one_div_x_distr(NA) is_one_div_x_distr(NULL) is_one_div_x_distr("nonsense") check_empty_beautier_folder()
Determines if the argument is a double
is_one_double(x)
is_one_double(x)
x |
the object to be determined of if it is one double |
TRUE if the argument is one floating point value, FALSE otherwise
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # TRUE is_one_double(314) is_one_double(0) is_one_double(-314) is_one_double(3.14) # FALSE is_one_double(NULL) is_one_double(NA) is_one_double(Inf) is_one_double("nonsense") is_one_double(is_one_double) is_one_double(c()) is_one_double(c(1, 2)) check_empty_beautier_folder()
check_empty_beautier_folder() # TRUE is_one_double(314) is_one_double(0) is_one_double(-314) is_one_double(3.14) # FALSE is_one_double(NULL) is_one_double(NA) is_one_double(Inf) is_one_double("nonsense") is_one_double(is_one_double) is_one_double(c()) is_one_double(c(1, 2)) check_empty_beautier_folder()
Determine if an object is one empty string
is_one_empty_string(x)
is_one_empty_string(x)
x |
the object that may be one string that may be empty |
TRUE is 'x' is one string that is empty
Richèl J.C. Bilderbeek
# TRUE is_one_empty_string("") # FALSE is_one_empty_string("3.14") is_one_empty_string(c("", "")) is_one_empty_string(42) is_one_empty_string("nonsense")
# TRUE is_one_empty_string("") # FALSE is_one_empty_string("3.14") is_one_empty_string(c("", "")) is_one_empty_string(42) is_one_empty_string("nonsense")
Determines if the argument is a whole number
is_one_int(x, tolerance = .Machine$double.eps^0.5)
is_one_int(x, tolerance = .Machine$double.eps^0.5)
x |
the object to be determined of if it is one integer |
tolerance |
tolerance to rounding errors |
TRUE if the argument is one int, FALSE otherwise
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # TRUE is_one_int(314) is_one_int(0) is_one_int(-314) # FALSE is_one_int(3.14) is_one_int(NULL) is_one_int(NA) is_one_int(Inf) is_one_int("nonsense") is_one_int(c()) is_one_int(c(1, 2)) check_empty_beautier_folder()
check_empty_beautier_folder() # TRUE is_one_int(314) is_one_int(0) is_one_int(-314) # FALSE is_one_int(3.14) is_one_int(NULL) is_one_int(NA) is_one_int(Inf) is_one_int("nonsense") is_one_int(c()) is_one_int(c(1, 2)) check_empty_beautier_folder()
Determines if x is one NA
is_one_na(x)
is_one_na(x)
x |
the object to be determined if it is one NA |
TRUE if x is one NA, FALSE otherwise
Richèl J.C. Bilderbeek
check_empty_beautier_folder() check_empty_beautier_folder()
check_empty_beautier_folder() check_empty_beautier_folder()
Determines if the argument is one string
is_one_string(x)
is_one_string(x)
x |
the object to be determined of if it is one string |
TRUE if the argument is one string, FALSE otherwise
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # TRUE is_one_string("This is one string") # FALSE is_one_string(NULL) is_one_string(NA) is_one_string(Inf) is_one_string(314) is_one_string(0) is_one_string(-314) is_one_string(3.14) is_one_string(c("a", "b")) is_one_string(is_one_string) is_one_string(c()) is_one_string(c(1, 2)) check_empty_beautier_folder()
check_empty_beautier_folder() # TRUE is_one_string("This is one string") # FALSE is_one_string(NULL) is_one_string(NA) is_one_string(Inf) is_one_string(314) is_one_string(0) is_one_string(-314) is_one_string(3.14) is_one_string(c("a", "b")) is_one_string(is_one_string) is_one_string(c()) is_one_string(c(1, 2)) check_empty_beautier_folder()
General function to create a distribution.
is_one_string_that_is_a_number(x)
is_one_string_that_is_a_number(x)
x |
the object that may be one string that may be a number |
TRUE is 'x' is one string that is a number
Richèl J.C. Bilderbeek
# TRUE is_one_string_that_is_a_number("3.14") # FALSE is_one_string_that_is_a_number(c("3.14", "42")) is_one_string_that_is_a_number("") is_one_string_that_is_a_number(42) is_one_string_that_is_a_number("nonsense")
# TRUE is_one_string_that_is_a_number("3.14") # FALSE is_one_string_that_is_a_number(c("3.14", "42")) is_one_string_that_is_a_number("") is_one_string_that_is_a_number(42) is_one_string_that_is_a_number("nonsense")
Determine if the object is a valid parameter
is_param(x)
is_param(x)
x |
an object, to be determined if it is a valid parameter,
as created by |
TRUE if x is a valid parameter, FALSE otherwise
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # TRUE is_param(create_alpha_param()) is_param(create_beta_param()) is_param(create_clock_rate_param()) is_param(create_kappa_1_param()) is_param(create_kappa_2_param()) is_param(create_lambda_param()) is_param(create_m_param()) is_param(create_mean_param()) is_param(create_mu_param()) is_param(create_rate_ac_param()) is_param(create_rate_ag_param()) is_param(create_rate_at_param()) is_param(create_rate_cg_param()) is_param(create_rate_ct_param()) is_param(create_rate_gt_param()) is_param(create_s_param()) is_param(create_scale_param()) is_param(create_sigma_param()) # FALSE is_param(NA) is_param(NULL) is_param("nonsense") is_param(create_jc69_site_model()) is_param(create_strict_clock_model()) is_param(create_yule_tree_prior()) is_param(create_mcmc()) check_empty_beautier_folder()
check_empty_beautier_folder() # TRUE is_param(create_alpha_param()) is_param(create_beta_param()) is_param(create_clock_rate_param()) is_param(create_kappa_1_param()) is_param(create_kappa_2_param()) is_param(create_lambda_param()) is_param(create_m_param()) is_param(create_mean_param()) is_param(create_mu_param()) is_param(create_rate_ac_param()) is_param(create_rate_ag_param()) is_param(create_rate_at_param()) is_param(create_rate_cg_param()) is_param(create_rate_ct_param()) is_param(create_rate_gt_param()) is_param(create_s_param()) is_param(create_scale_param()) is_param(create_sigma_param()) # FALSE is_param(NA) is_param(NULL) is_param("nonsense") is_param(create_jc69_site_model()) is_param(create_strict_clock_model()) is_param(create_yule_tree_prior()) is_param(create_mcmc()) check_empty_beautier_folder()
Determines if the name is a valid parameter name
is_param_name(name)
is_param_name(name)
name |
the name to be tested |
TRUE if the name is a valid parameter name, FALSE otherwise
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # TRUE is_param_name("alpha") is_param_name("beta") is_param_name("clock_rate") is_param_name("kappa_1") is_param_name("kappa_2") is_param_name("lambda") is_param_name("m") is_param_name("mean") is_param_name("mu") is_param_name("rate_ac") is_param_name("rate_ag") is_param_name("rate_at") is_param_name("rate_cg") is_param_name("rate_ct") is_param_name("rate_gt") is_param_name("s") is_param_name("scale") is_param_name("sigma") # FALSE is_param_name("nonsense") is_param_name(NA) is_param_name(NULL) is_param_name("") is_param_name(c()) check_empty_beautier_folder()
check_empty_beautier_folder() # TRUE is_param_name("alpha") is_param_name("beta") is_param_name("clock_rate") is_param_name("kappa_1") is_param_name("kappa_2") is_param_name("lambda") is_param_name("m") is_param_name("mean") is_param_name("mu") is_param_name("rate_ac") is_param_name("rate_ag") is_param_name("rate_at") is_param_name("rate_cg") is_param_name("rate_ct") is_param_name("rate_gt") is_param_name("s") is_param_name("scale") is_param_name("sigma") # FALSE is_param_name("nonsense") is_param_name(NA) is_param_name(NULL) is_param_name("") is_param_name(c()) check_empty_beautier_folder()
Checks if the input is a phylogeny
is_phylo(x)
is_phylo(x)
x |
input to be checked |
TRUE or FALSE
Richèl J.C. Bilderbeek
Use check_phylogeny to check for a phylogeny
check_empty_beautier_folder() # TRUE phylogeny <- ape::read.tree(text = "(a:15,b:15):1;") is_phylo(phylogeny) # FALSE is_phylo("nonsense") is_phylo(NA) is_phylo(NULL) check_empty_beautier_folder()
check_empty_beautier_folder() # TRUE phylogeny <- ape::read.tree(text = "(a:15,b:15):1;") is_phylo(phylogeny) # FALSE is_phylo("nonsense") is_phylo(NA) is_phylo(NULL) check_empty_beautier_folder()
create_poisson_distr
Determine if the object is a valid
Poisson distribution
as created by create_poisson_distr
is_poisson_distr(x)
is_poisson_distr(x)
x |
an object, to be determined if it is a valid Poisson distribution |
TRUE if x is a valid Poisson distribution, FALSE otherwise
Richèl J.C. Bilderbeek
use is_distr
to see if x is any
distribution
check_empty_beautier_folder() # TRUE is_poisson_distr(create_poisson_distr()) # FALSE is_poisson_distr(create_uniform_distr()) is_distr(NA) is_distr(NULL) is_distr("nonsense") check_empty_beautier_folder()
check_empty_beautier_folder() # TRUE is_poisson_distr(create_poisson_distr()) # FALSE is_poisson_distr(create_uniform_distr()) is_distr(NA) is_distr(NULL) is_distr("nonsense") check_empty_beautier_folder()
Determine if the object is a valid 'rate AC' parameter
is_rate_ac_param(x)
is_rate_ac_param(x)
x |
an object, to be determined if it is a valid 'rate AC' parameter |
TRUE if x is a valid 'rate AC' parameter, FALSE otherwise
Richèl J.C. Bilderbeek
create_rate_ac_param
creates a 'rate AC' parameter
check_empty_beautier_folder() is_rate_ac_param(create_alpha_param()) is_rate_ac_param(create_beta_param()) is_rate_ac_param(create_clock_rate_param()) is_rate_ac_param(create_kappa_1_param()) is_rate_ac_param(create_kappa_2_param()) is_rate_ac_param(create_lambda_param()) is_rate_ac_param(create_m_param()) is_rate_ac_param(create_mean_param()) is_rate_ac_param(create_mu_param()) is_rate_ac_param(create_rate_ac_param()) is_rate_ac_param(create_rate_ag_param()) is_rate_ac_param(create_rate_at_param()) is_rate_ac_param(create_rate_cg_param()) is_rate_ac_param(create_rate_ct_param()) is_rate_ac_param(create_rate_gt_param()) is_rate_ac_param(create_s_param()) is_rate_ac_param(create_scale_param()) is_rate_ac_param(create_sigma_param()) is_rate_ac_param(NA) is_rate_ac_param(NULL) is_rate_ac_param("nonsense") is_rate_ac_param(create_jc69_site_model()) is_rate_ac_param(create_strict_clock_model()) is_rate_ac_param(create_yule_tree_prior()) is_rate_ac_param(create_mcmc()) check_empty_beautier_folder()
check_empty_beautier_folder() is_rate_ac_param(create_alpha_param()) is_rate_ac_param(create_beta_param()) is_rate_ac_param(create_clock_rate_param()) is_rate_ac_param(create_kappa_1_param()) is_rate_ac_param(create_kappa_2_param()) is_rate_ac_param(create_lambda_param()) is_rate_ac_param(create_m_param()) is_rate_ac_param(create_mean_param()) is_rate_ac_param(create_mu_param()) is_rate_ac_param(create_rate_ac_param()) is_rate_ac_param(create_rate_ag_param()) is_rate_ac_param(create_rate_at_param()) is_rate_ac_param(create_rate_cg_param()) is_rate_ac_param(create_rate_ct_param()) is_rate_ac_param(create_rate_gt_param()) is_rate_ac_param(create_s_param()) is_rate_ac_param(create_scale_param()) is_rate_ac_param(create_sigma_param()) is_rate_ac_param(NA) is_rate_ac_param(NULL) is_rate_ac_param("nonsense") is_rate_ac_param(create_jc69_site_model()) is_rate_ac_param(create_strict_clock_model()) is_rate_ac_param(create_yule_tree_prior()) is_rate_ac_param(create_mcmc()) check_empty_beautier_folder()
Determine if the object is a valid 'rate AG' parameter
is_rate_ag_param(x)
is_rate_ag_param(x)
x |
an object, to be determined if it is a valid 'rate AG' parameter |
TRUE if x is a valid 'rate AG' parameter, FALSE otherwise
Richèl J.C. Bilderbeek
create_rate_ag_param
creates a 'rate AG' parameter
check_empty_beautier_folder() is_rate_ag_param(create_alpha_param()) is_rate_ag_param(create_beta_param()) is_rate_ag_param(create_clock_rate_param()) is_rate_ag_param(create_kappa_1_param()) is_rate_ag_param(create_kappa_2_param()) is_rate_ag_param(create_lambda_param()) is_rate_ag_param(create_m_param()) is_rate_ag_param(create_mean_param()) is_rate_ag_param(create_mu_param()) is_rate_ag_param(create_rate_ac_param()) is_rate_ag_param(create_rate_ag_param()) is_rate_ag_param(create_rate_at_param()) is_rate_ag_param(create_rate_cg_param()) is_rate_ag_param(create_rate_ct_param()) is_rate_ag_param(create_rate_gt_param()) is_rate_ag_param(create_s_param()) is_rate_ag_param(create_scale_param()) is_rate_ag_param(create_sigma_param()) is_rate_ag_param(NA) is_rate_ag_param(NULL) is_rate_ag_param("nonsense") is_rate_ag_param(create_jc69_site_model()) is_rate_ag_param(create_strict_clock_model()) is_rate_ag_param(create_yule_tree_prior()) is_rate_ag_param(create_mcmc()) check_empty_beautier_folder()
check_empty_beautier_folder() is_rate_ag_param(create_alpha_param()) is_rate_ag_param(create_beta_param()) is_rate_ag_param(create_clock_rate_param()) is_rate_ag_param(create_kappa_1_param()) is_rate_ag_param(create_kappa_2_param()) is_rate_ag_param(create_lambda_param()) is_rate_ag_param(create_m_param()) is_rate_ag_param(create_mean_param()) is_rate_ag_param(create_mu_param()) is_rate_ag_param(create_rate_ac_param()) is_rate_ag_param(create_rate_ag_param()) is_rate_ag_param(create_rate_at_param()) is_rate_ag_param(create_rate_cg_param()) is_rate_ag_param(create_rate_ct_param()) is_rate_ag_param(create_rate_gt_param()) is_rate_ag_param(create_s_param()) is_rate_ag_param(create_scale_param()) is_rate_ag_param(create_sigma_param()) is_rate_ag_param(NA) is_rate_ag_param(NULL) is_rate_ag_param("nonsense") is_rate_ag_param(create_jc69_site_model()) is_rate_ag_param(create_strict_clock_model()) is_rate_ag_param(create_yule_tree_prior()) is_rate_ag_param(create_mcmc()) check_empty_beautier_folder()
Determine if the object is a valid 'rate AT' parameter
is_rate_at_param(x)
is_rate_at_param(x)
x |
an object, to be determined if it is a valid 'rate AT' parameter |
TRUE if x is a valid 'rate AT' parameter, FALSE otherwise
Richèl J.C. Bilderbeek
create_rate_at_param
creates a 'rate AT' parameter
check_empty_beautier_folder() is_rate_at_param(create_alpha_param()) is_rate_at_param(create_beta_param()) is_rate_at_param(create_clock_rate_param()) is_rate_at_param(create_kappa_1_param()) is_rate_at_param(create_kappa_2_param()) is_rate_at_param(create_lambda_param()) is_rate_at_param(create_m_param()) is_rate_at_param(create_mean_param()) is_rate_at_param(create_mu_param()) is_rate_at_param(create_rate_ac_param()) is_rate_at_param(create_rate_ag_param()) is_rate_at_param(create_rate_at_param()) is_rate_at_param(create_rate_cg_param()) is_rate_at_param(create_rate_ct_param()) is_rate_at_param(create_rate_gt_param()) is_rate_at_param(create_s_param()) is_rate_at_param(create_scale_param()) is_rate_at_param(create_sigma_param()) is_rate_at_param(NA) is_rate_at_param(NULL) is_rate_at_param("nonsense") is_rate_at_param(create_jc69_site_model()) is_rate_at_param(create_strict_clock_model()) is_rate_at_param(create_yule_tree_prior()) is_rate_at_param(create_mcmc()) check_empty_beautier_folder()
check_empty_beautier_folder() is_rate_at_param(create_alpha_param()) is_rate_at_param(create_beta_param()) is_rate_at_param(create_clock_rate_param()) is_rate_at_param(create_kappa_1_param()) is_rate_at_param(create_kappa_2_param()) is_rate_at_param(create_lambda_param()) is_rate_at_param(create_m_param()) is_rate_at_param(create_mean_param()) is_rate_at_param(create_mu_param()) is_rate_at_param(create_rate_ac_param()) is_rate_at_param(create_rate_ag_param()) is_rate_at_param(create_rate_at_param()) is_rate_at_param(create_rate_cg_param()) is_rate_at_param(create_rate_ct_param()) is_rate_at_param(create_rate_gt_param()) is_rate_at_param(create_s_param()) is_rate_at_param(create_scale_param()) is_rate_at_param(create_sigma_param()) is_rate_at_param(NA) is_rate_at_param(NULL) is_rate_at_param("nonsense") is_rate_at_param(create_jc69_site_model()) is_rate_at_param(create_strict_clock_model()) is_rate_at_param(create_yule_tree_prior()) is_rate_at_param(create_mcmc()) check_empty_beautier_folder()
Determine if the object is a valid 'rate CG' parameter
is_rate_cg_param(x)
is_rate_cg_param(x)
x |
an object, to be determined if it is a valid 'rate CG' parameter |
TRUE if x is a valid 'rate CG' parameter, FALSE otherwise
Richèl J.C. Bilderbeek
create_rate_cg_param
creates a 'rate CG' parameter
check_empty_beautier_folder() is_rate_cg_param(create_alpha_param()) is_rate_cg_param(create_beta_param()) is_rate_cg_param(create_clock_rate_param()) is_rate_cg_param(create_kappa_1_param()) is_rate_cg_param(create_kappa_2_param()) is_rate_cg_param(create_lambda_param()) is_rate_cg_param(create_m_param()) is_rate_cg_param(create_mean_param()) is_rate_cg_param(create_mu_param()) is_rate_cg_param(create_rate_ac_param()) is_rate_cg_param(create_rate_ag_param()) is_rate_cg_param(create_rate_at_param()) is_rate_cg_param(create_rate_cg_param()) is_rate_cg_param(create_rate_ct_param()) is_rate_cg_param(create_rate_gt_param()) is_rate_cg_param(create_s_param()) is_rate_cg_param(create_scale_param()) is_rate_cg_param(create_sigma_param()) is_rate_cg_param(NA) is_rate_cg_param(NULL) is_rate_cg_param("nonsense") is_rate_cg_param(create_jc69_site_model()) is_rate_cg_param(create_strict_clock_model()) is_rate_cg_param(create_yule_tree_prior()) is_rate_cg_param(create_mcmc()) check_empty_beautier_folder()
check_empty_beautier_folder() is_rate_cg_param(create_alpha_param()) is_rate_cg_param(create_beta_param()) is_rate_cg_param(create_clock_rate_param()) is_rate_cg_param(create_kappa_1_param()) is_rate_cg_param(create_kappa_2_param()) is_rate_cg_param(create_lambda_param()) is_rate_cg_param(create_m_param()) is_rate_cg_param(create_mean_param()) is_rate_cg_param(create_mu_param()) is_rate_cg_param(create_rate_ac_param()) is_rate_cg_param(create_rate_ag_param()) is_rate_cg_param(create_rate_at_param()) is_rate_cg_param(create_rate_cg_param()) is_rate_cg_param(create_rate_ct_param()) is_rate_cg_param(create_rate_gt_param()) is_rate_cg_param(create_s_param()) is_rate_cg_param(create_scale_param()) is_rate_cg_param(create_sigma_param()) is_rate_cg_param(NA) is_rate_cg_param(NULL) is_rate_cg_param("nonsense") is_rate_cg_param(create_jc69_site_model()) is_rate_cg_param(create_strict_clock_model()) is_rate_cg_param(create_yule_tree_prior()) is_rate_cg_param(create_mcmc()) check_empty_beautier_folder()
Determine if the object is a valid 'rate CT' parameter
is_rate_ct_param(x)
is_rate_ct_param(x)
x |
an object, to be determined if it is a valid 'rate CT' parameter |
TRUE if x is a valid 'rate CG' parameter, FALSE otherwise
Richèl J.C. Bilderbeek
create_rate_ct_param
creates a 'rate CT' parameter
check_empty_beautier_folder() is_rate_ct_param(create_alpha_param()) is_rate_ct_param(create_beta_param()) is_rate_ct_param(create_clock_rate_param()) is_rate_ct_param(create_kappa_1_param()) is_rate_ct_param(create_kappa_2_param()) is_rate_ct_param(create_lambda_param()) is_rate_ct_param(create_m_param()) is_rate_ct_param(create_mean_param()) is_rate_ct_param(create_mu_param()) is_rate_ct_param(create_rate_ac_param()) is_rate_ct_param(create_rate_ag_param()) is_rate_ct_param(create_rate_at_param()) is_rate_ct_param(create_rate_cg_param()) is_rate_ct_param(create_rate_ct_param()) is_rate_ct_param(create_rate_gt_param()) is_rate_ct_param(create_s_param()) is_rate_ct_param(create_scale_param()) is_rate_ct_param(create_sigma_param()) is_rate_ct_param(NA) is_rate_ct_param(NULL) is_rate_ct_param("nonsense") is_rate_ct_param(create_jc69_site_model()) is_rate_ct_param(create_strict_clock_model()) is_rate_ct_param(create_yule_tree_prior()) is_rate_ct_param(create_mcmc()) check_empty_beautier_folder()
check_empty_beautier_folder() is_rate_ct_param(create_alpha_param()) is_rate_ct_param(create_beta_param()) is_rate_ct_param(create_clock_rate_param()) is_rate_ct_param(create_kappa_1_param()) is_rate_ct_param(create_kappa_2_param()) is_rate_ct_param(create_lambda_param()) is_rate_ct_param(create_m_param()) is_rate_ct_param(create_mean_param()) is_rate_ct_param(create_mu_param()) is_rate_ct_param(create_rate_ac_param()) is_rate_ct_param(create_rate_ag_param()) is_rate_ct_param(create_rate_at_param()) is_rate_ct_param(create_rate_cg_param()) is_rate_ct_param(create_rate_ct_param()) is_rate_ct_param(create_rate_gt_param()) is_rate_ct_param(create_s_param()) is_rate_ct_param(create_scale_param()) is_rate_ct_param(create_sigma_param()) is_rate_ct_param(NA) is_rate_ct_param(NULL) is_rate_ct_param("nonsense") is_rate_ct_param(create_jc69_site_model()) is_rate_ct_param(create_strict_clock_model()) is_rate_ct_param(create_yule_tree_prior()) is_rate_ct_param(create_mcmc()) check_empty_beautier_folder()
Determine if the object is a valid 'rate GT' parameter
is_rate_gt_param(x)
is_rate_gt_param(x)
x |
an object, to be determined if it is a valid 'rate GT' parameter |
TRUE if x is a valid 'rate GT' parameter, FALSE otherwise
Richèl J.C. Bilderbeek
create_rate_gt_param
creates a 'rate GT' parameter
check_empty_beautier_folder() is_rate_gt_param(create_alpha_param()) is_rate_gt_param(create_beta_param()) is_rate_gt_param(create_clock_rate_param()) is_rate_gt_param(create_kappa_1_param()) is_rate_gt_param(create_kappa_2_param()) is_rate_gt_param(create_lambda_param()) is_rate_gt_param(create_m_param()) is_rate_gt_param(create_mean_param()) is_rate_gt_param(create_mu_param()) is_rate_gt_param(create_rate_ac_param()) is_rate_gt_param(create_rate_ag_param()) is_rate_gt_param(create_rate_at_param()) is_rate_gt_param(create_rate_cg_param()) is_rate_gt_param(create_rate_ct_param()) is_rate_gt_param(create_rate_gt_param()) is_rate_gt_param(create_s_param()) is_rate_gt_param(create_scale_param()) is_rate_gt_param(create_sigma_param()) is_rate_gt_param(NA) is_rate_gt_param(NULL) is_rate_gt_param("nonsense") is_rate_gt_param(create_jc69_site_model()) is_rate_gt_param(create_strict_clock_model()) is_rate_gt_param(create_yule_tree_prior()) is_rate_gt_param(create_mcmc()) check_empty_beautier_folder()
check_empty_beautier_folder() is_rate_gt_param(create_alpha_param()) is_rate_gt_param(create_beta_param()) is_rate_gt_param(create_clock_rate_param()) is_rate_gt_param(create_kappa_1_param()) is_rate_gt_param(create_kappa_2_param()) is_rate_gt_param(create_lambda_param()) is_rate_gt_param(create_m_param()) is_rate_gt_param(create_mean_param()) is_rate_gt_param(create_mu_param()) is_rate_gt_param(create_rate_ac_param()) is_rate_gt_param(create_rate_ag_param()) is_rate_gt_param(create_rate_at_param()) is_rate_gt_param(create_rate_cg_param()) is_rate_gt_param(create_rate_ct_param()) is_rate_gt_param(create_rate_gt_param()) is_rate_gt_param(create_s_param()) is_rate_gt_param(create_scale_param()) is_rate_gt_param(create_sigma_param()) is_rate_gt_param(NA) is_rate_gt_param(NULL) is_rate_gt_param("nonsense") is_rate_gt_param(create_jc69_site_model()) is_rate_gt_param(create_strict_clock_model()) is_rate_gt_param(create_yule_tree_prior()) is_rate_gt_param(create_mcmc()) check_empty_beautier_folder()
Determine if the object is a valid relaxed log normal clock model
is_rln_clock_model(x)
is_rln_clock_model(x)
x |
an object, to be determined if it is a valid
relaxed log normal clock model,
as created by |
TRUE if x is a valid relaxed log normal clock model, FALSE otherwise
Richèl J.C. Bilderbeek
create_clock_model
shows an overview of
functions to create a clock model
check_empty_beautier_folder() is_rln_clock_model(create_strict_clock_model()) is_rln_clock_model(create_rln_clock_model()) is_rln_clock_model(NA) is_rln_clock_model(NULL) is_rln_clock_model("nonsense") is_rln_clock_model(create_jc69_site_model()) is_rln_clock_model(create_mcmc()) check_empty_beautier_folder()
check_empty_beautier_folder() is_rln_clock_model(create_strict_clock_model()) is_rln_clock_model(create_rln_clock_model()) is_rln_clock_model(NA) is_rln_clock_model(NULL) is_rln_clock_model("nonsense") is_rln_clock_model(create_jc69_site_model()) is_rln_clock_model(create_mcmc()) check_empty_beautier_folder()
Determine if the object is a valid s parameter
is_s_param(x)
is_s_param(x)
x |
an object, to be determined if it is a valid s parameter |
TRUE if x is a valid s parameter, FALSE otherwise
Richèl J.C. Bilderbeek
check_empty_beautier_folder() is_s_param(create_alpha_param()) is_s_param(create_beta_param()) is_s_param(create_clock_rate_param()) is_s_param(create_kappa_1_param()) is_s_param(create_kappa_2_param()) is_s_param(create_lambda_param()) is_s_param(create_m_param()) is_s_param(create_mean_param()) is_s_param(create_mu_param()) is_s_param(create_rate_ac_param()) is_s_param(create_rate_ag_param()) is_s_param(create_rate_at_param()) is_s_param(create_rate_cg_param()) is_s_param(create_rate_ct_param()) is_s_param(create_rate_gt_param()) is_s_param(create_s_param()) is_s_param(create_scale_param()) is_s_param(create_sigma_param()) is_s_param(NA) is_s_param(NULL) is_s_param("nonsense") is_s_param(create_jc69_site_model()) is_s_param(create_strict_clock_model()) is_s_param(create_yule_tree_prior()) is_s_param(create_mcmc()) check_empty_beautier_folder()
check_empty_beautier_folder() is_s_param(create_alpha_param()) is_s_param(create_beta_param()) is_s_param(create_clock_rate_param()) is_s_param(create_kappa_1_param()) is_s_param(create_kappa_2_param()) is_s_param(create_lambda_param()) is_s_param(create_m_param()) is_s_param(create_mean_param()) is_s_param(create_mu_param()) is_s_param(create_rate_ac_param()) is_s_param(create_rate_ag_param()) is_s_param(create_rate_at_param()) is_s_param(create_rate_cg_param()) is_s_param(create_rate_ct_param()) is_s_param(create_rate_gt_param()) is_s_param(create_s_param()) is_s_param(create_scale_param()) is_s_param(create_sigma_param()) is_s_param(NA) is_s_param(NULL) is_s_param("nonsense") is_s_param(create_jc69_site_model()) is_s_param(create_strict_clock_model()) is_s_param(create_yule_tree_prior()) is_s_param(create_mcmc()) check_empty_beautier_folder()
Determine if the object is a valid scale parameter
is_scale_param(x)
is_scale_param(x)
x |
an object, to be determined if it is a valid scale parameter |
TRUE if x is a valid scale parameter, FALSE otherwise
Richèl J.C. Bilderbeek
check_empty_beautier_folder() is_scale_param(create_alpha_param()) is_scale_param(create_beta_param()) is_scale_param(create_clock_rate_param()) is_scale_param(create_kappa_1_param()) is_scale_param(create_kappa_2_param()) is_scale_param(create_lambda_param()) is_scale_param(create_m_param()) is_scale_param(create_mean_param()) is_scale_param(create_mu_param()) is_scale_param(create_rate_ac_param()) is_scale_param(create_rate_ag_param()) is_scale_param(create_rate_at_param()) is_scale_param(create_rate_cg_param()) is_scale_param(create_rate_ct_param()) is_scale_param(create_rate_gt_param()) is_scale_param(create_s_param()) is_scale_param(create_scale_param()) is_scale_param(create_sigma_param()) is_scale_param(NA) is_scale_param(NULL) is_scale_param("nonsense") is_scale_param(create_jc69_site_model()) is_scale_param(create_strict_clock_model()) is_scale_param(create_yule_tree_prior()) is_scale_param(create_mcmc()) check_empty_beautier_folder()
check_empty_beautier_folder() is_scale_param(create_alpha_param()) is_scale_param(create_beta_param()) is_scale_param(create_clock_rate_param()) is_scale_param(create_kappa_1_param()) is_scale_param(create_kappa_2_param()) is_scale_param(create_lambda_param()) is_scale_param(create_m_param()) is_scale_param(create_mean_param()) is_scale_param(create_mu_param()) is_scale_param(create_rate_ac_param()) is_scale_param(create_rate_ag_param()) is_scale_param(create_rate_at_param()) is_scale_param(create_rate_cg_param()) is_scale_param(create_rate_ct_param()) is_scale_param(create_rate_gt_param()) is_scale_param(create_s_param()) is_scale_param(create_scale_param()) is_scale_param(create_sigma_param()) is_scale_param(NA) is_scale_param(NULL) is_scale_param("nonsense") is_scale_param(create_jc69_site_model()) is_scale_param(create_strict_clock_model()) is_scale_param(create_yule_tree_prior()) is_scale_param(create_mcmc()) check_empty_beautier_folder()
Determine if the object is a valid sigma parameter
is_sigma_param(x)
is_sigma_param(x)
x |
an object, to be determined if it is a valid sigma parameter |
TRUE if x is a valid sigma parameter, FALSE otherwise
Richèl J.C. Bilderbeek
check_empty_beautier_folder() is_sigma_param(create_alpha_param()) is_sigma_param(create_beta_param()) is_sigma_param(create_clock_rate_param()) is_sigma_param(create_kappa_1_param()) is_sigma_param(create_kappa_2_param()) is_sigma_param(create_lambda_param()) is_sigma_param(create_m_param()) is_sigma_param(create_mean_param()) is_sigma_param(create_mu_param()) is_sigma_param(create_rate_ac_param()) is_sigma_param(create_rate_ag_param()) is_sigma_param(create_rate_at_param()) is_sigma_param(create_rate_cg_param()) is_sigma_param(create_rate_ct_param()) is_sigma_param(create_rate_gt_param()) is_sigma_param(create_s_param()) is_sigma_param(create_scale_param()) is_sigma_param(create_sigma_param()) is_sigma_param(NA) is_sigma_param(NULL) is_sigma_param("nonsense") is_sigma_param(create_jc69_site_model()) is_sigma_param(create_strict_clock_model()) is_sigma_param(create_yule_tree_prior()) is_sigma_param(create_mcmc()) check_empty_beautier_folder()
check_empty_beautier_folder() is_sigma_param(create_alpha_param()) is_sigma_param(create_beta_param()) is_sigma_param(create_clock_rate_param()) is_sigma_param(create_kappa_1_param()) is_sigma_param(create_kappa_2_param()) is_sigma_param(create_lambda_param()) is_sigma_param(create_m_param()) is_sigma_param(create_mean_param()) is_sigma_param(create_mu_param()) is_sigma_param(create_rate_ac_param()) is_sigma_param(create_rate_ag_param()) is_sigma_param(create_rate_at_param()) is_sigma_param(create_rate_cg_param()) is_sigma_param(create_rate_ct_param()) is_sigma_param(create_rate_gt_param()) is_sigma_param(create_s_param()) is_sigma_param(create_scale_param()) is_sigma_param(create_sigma_param()) is_sigma_param(NA) is_sigma_param(NULL) is_sigma_param("nonsense") is_sigma_param(create_jc69_site_model()) is_sigma_param(create_strict_clock_model()) is_sigma_param(create_yule_tree_prior()) is_sigma_param(create_mcmc()) check_empty_beautier_folder()
Determine if the object is a valid site_model
is_site_model(x)
is_site_model(x)
x |
an object, to be determined if it is a site_model |
TRUE if the site_model is a valid site_model, FALSE otherwise
A site model can be created using create_site_model
check_empty_beautier_folder() # TRUE is_site_model(create_gtr_site_model()) is_site_model(create_hky_site_model()) is_site_model(create_jc69_site_model()) is_site_model(create_tn93_site_model()) # FALSE is_site_model(NA) is_site_model(NULL) is_site_model("nonsense") is_site_model(create_strict_clock_model()) is_site_model(create_bd_tree_prior()) is_site_model(create_mcmc()) check_empty_beautier_folder()
check_empty_beautier_folder() # TRUE is_site_model(create_gtr_site_model()) is_site_model(create_hky_site_model()) is_site_model(create_jc69_site_model()) is_site_model(create_tn93_site_model()) # FALSE is_site_model(NA) is_site_model(NULL) is_site_model("nonsense") is_site_model(create_strict_clock_model()) is_site_model(create_bd_tree_prior()) is_site_model(create_mcmc()) check_empty_beautier_folder()
Determines if the name is a valid site_model name
is_site_model_name(name)
is_site_model_name(name)
name |
the name to be tested |
TRUE if the name is a valid site_model name, FALSE otherwise
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # TRUE is_site_model_name("JC69") is_site_model_name("HKY") is_site_model_name("TN93") is_site_model_name("GTR") # FALSE is_site_model_name("nonsense") check_empty_beautier_folder()
check_empty_beautier_folder() # TRUE is_site_model_name("JC69") is_site_model_name("HKY") is_site_model_name("TN93") is_site_model_name("GTR") # FALSE is_site_model_name("nonsense") check_empty_beautier_folder()
create_strict_clock_model
Determine if the object is a valid strict clock model,
as returned by create_strict_clock_model
is_strict_clock_model(x)
is_strict_clock_model(x)
x |
an object, to be determined if it is a valid strict clock model |
TRUE if x is a valid strict clock model, FALSE otherwise
Richèl J.C. Bilderbeek
create_clock_model
shows an overview of
functions to create a clock model
check_empty_beautier_folder() is_strict_clock_model(create_strict_clock_model()) is_strict_clock_model(create_rln_clock_model()) is_strict_clock_model(NA) is_strict_clock_model(NULL) is_strict_clock_model("nonsense") is_strict_clock_model(create_jc69_site_model()) is_strict_clock_model(create_mcmc()) check_empty_beautier_folder()
check_empty_beautier_folder() is_strict_clock_model(create_strict_clock_model()) is_strict_clock_model(create_rln_clock_model()) is_strict_clock_model(NA) is_strict_clock_model(NULL) is_strict_clock_model("nonsense") is_strict_clock_model(create_jc69_site_model()) is_strict_clock_model(create_mcmc()) check_empty_beautier_folder()
Determine if the object is a valid TN93 site model,
is_tn93_site_model(x)
is_tn93_site_model(x)
x |
an object, to be determined if it is a valid TN93 site model,
as created by |
TRUE if x is a valid TN93 site model, FALSE otherwise
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # site models is_tn93_site_model(create_gtr_site_model()) is_tn93_site_model(create_hky_site_model()) is_tn93_site_model(create_jc69_site_model()) is_tn93_site_model(create_tn93_site_model()) # other models is_tn93_site_model(NA) is_tn93_site_model(NULL) is_tn93_site_model("nonsense") is_tn93_site_model("") is_tn93_site_model(c()) is_tn93_site_model(create_strict_clock_model()) is_tn93_site_model(create_bd_tree_prior()) is_tn93_site_model(create_mcmc()) check_empty_beautier_folder()
check_empty_beautier_folder() # site models is_tn93_site_model(create_gtr_site_model()) is_tn93_site_model(create_hky_site_model()) is_tn93_site_model(create_jc69_site_model()) is_tn93_site_model(create_tn93_site_model()) # other models is_tn93_site_model(NA) is_tn93_site_model(NULL) is_tn93_site_model("nonsense") is_tn93_site_model("") is_tn93_site_model(c()) is_tn93_site_model(create_strict_clock_model()) is_tn93_site_model(create_bd_tree_prior()) is_tn93_site_model(create_mcmc()) check_empty_beautier_folder()
Determine if an object is a valid tree prior
is_tree_prior(x)
is_tree_prior(x)
x |
an object |
TRUE if x is a valid tree_prior, FALSE otherwise
Richèl J.C. Bilderbeek
tree priors can be created by create_tree_prior
check_empty_beautier_folder() is_tree_prior(create_bd_tree_prior()) is_tree_prior(create_yule_tree_prior()) !is_tree_prior("nonsense") check_empty_beautier_folder()
check_empty_beautier_folder() is_tree_prior(create_bd_tree_prior()) is_tree_prior(create_yule_tree_prior()) !is_tree_prior("nonsense") check_empty_beautier_folder()
Determines if the name is a valid tree prior name
is_tree_prior_name(name)
is_tree_prior_name(name)
name |
the name to be tested |
TRUE if the name is a valid tree_prior name, FALSE otherwise
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # TRUE is_tree_prior_name("birth_death") is_tree_prior_name("coalescent_bayesian_skyline") is_tree_prior_name("coalescent_constant_population") is_tree_prior_name("coalescent_exp_population") is_tree_prior_name("yule") # FALSE is_tree_prior_name("nonsense") check_empty_beautier_folder()
check_empty_beautier_folder() # TRUE is_tree_prior_name("birth_death") is_tree_prior_name("coalescent_bayesian_skyline") is_tree_prior_name("coalescent_constant_population") is_tree_prior_name("coalescent_exp_population") is_tree_prior_name("yule") # FALSE is_tree_prior_name("nonsense") check_empty_beautier_folder()
create_uniform_distr
Determine if the object is a valid
uniform distribution
as created by create_uniform_distr
is_uniform_distr(x)
is_uniform_distr(x)
x |
an object, to be determined if it is a valid uniform distribution |
TRUE if x is a valid uniform distribution, FALSE otherwise
Richèl J.C. Bilderbeek
use is_distr
to see if x is any
distribution
check_empty_beautier_folder() # TRUE is_uniform_distr(create_uniform_distr()) # FALSE is_uniform_distr(create_beta_distr()) is_uniform_distr(NA) is_uniform_distr(NULL) is_uniform_distr("nonsense") check_empty_beautier_folder()
check_empty_beautier_folder() # TRUE is_uniform_distr(create_uniform_distr()) # FALSE is_uniform_distr(create_beta_distr()) is_uniform_distr(NA) is_uniform_distr(NULL) is_uniform_distr("nonsense") check_empty_beautier_folder()
Checks if the text is a valid XML node, that is, it has a opening and matching closing tag
is_xml(text)
is_xml(text)
text |
text to be determined to be valid |
TRUE if the text is valid XML, FALSE otherwise
Richèl J.C. Bilderbeek
Determine if the object is a valid Yule tree prior,
is_yule_tree_prior(x)
is_yule_tree_prior(x)
x |
an object, to be determined if it is a valid Yule tree prior |
TRUE if x is a valid Yule tree prior, FALSE otherwise
Richèl J.C. Bilderbeek
Use create_yule_tree_prior
to create a valid
Yule tree prior
check_empty_beautier_folder() # TRUE is_yule_tree_prior(create_yule_tree_prior()) # FALSE is_yule_tree_prior(create_bd_tree_prior()) is_yule_tree_prior(create_cbs_tree_prior()) is_yule_tree_prior(create_ccp_tree_prior()) is_yule_tree_prior(create_cep_tree_prior()) check_empty_beautier_folder()
check_empty_beautier_folder() # TRUE is_yule_tree_prior(create_yule_tree_prior()) # FALSE is_yule_tree_prior(create_bd_tree_prior()) is_yule_tree_prior(create_cbs_tree_prior()) is_yule_tree_prior(create_ccp_tree_prior()) is_yule_tree_prior(create_cep_tree_prior()) check_empty_beautier_folder()
state
sectionConverts a site model to XML,
used in the state
section
jc69_site_model_to_xml_state( site_model, beauti_options = create_beauti_options() )
jc69_site_model_to_xml_state( site_model, beauti_options = create_beauti_options() )
site_model |
a site model,
as returned by |
beauti_options |
one BEAUti options object,
as returned by |
the site model as XML text
Richèl J.C. Bilderbeek
Converts an kappa parameter to XML
kappa_param_to_xml(kappa_param, beauti_options = create_beauti_options())
kappa_param_to_xml(kappa_param, beauti_options = create_beauti_options())
kappa_param |
a kappa parameter, as created by create_kappa_param |
beauti_options |
one BEAUti options object,
as returned by |
the parameter as XML text
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # The kappa parameter must be initialized, i.e. have an ID kappa_param_to_xml(kappa_param = create_kappa_param(id = "1")) check_empty_beautier_folder()
check_empty_beautier_folder() # The kappa parameter must be initialized, i.e. have an ID kappa_param_to_xml(kappa_param = create_kappa_param(id = "1")) check_empty_beautier_folder()
Converts an m parameter to XML
m_param_to_xml(m_param, beauti_options = create_beauti_options())
m_param_to_xml(m_param, beauti_options = create_beauti_options())
m_param |
an m parameter, as created by create_m_param |
beauti_options |
one BEAUti options object,
as returned by |
the parameter as XML text
Richèl J.C. Bilderbeek
Converts an MCMC object to the run section's XML
mcmc_to_xml_run(mcmc)
mcmc_to_xml_run(mcmc)
mcmc |
one MCMC.
Use |
the XML as text
Richèl J.C. Bilderbeek
if (is_on_ci()) { check_empty_beautier_folder() # <run id=\"mcmc\" spec=\"MCMC\" chainLength=\"1e+07\"> mcmc_to_xml_run(create_mcmc()) check_empty_beautier_folder() }
if (is_on_ci()) { check_empty_beautier_folder() # <run id=\"mcmc\" spec=\"MCMC\" chainLength=\"1e+07\"> mcmc_to_xml_run(create_mcmc()) check_empty_beautier_folder() }
Converts an MCMC object to the run section's XML for a default MCMC
mcmc_to_xml_run_default(mcmc)
mcmc_to_xml_run_default(mcmc)
mcmc |
one MCMC.
Use |
the XML as text
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # <run id=\"mcmc\" spec=\"MCMC\" chainLength=\"1e+07\"> xml <- mcmc_to_xml_run_default(create_mcmc()) check_empty_beautier_folder()
check_empty_beautier_folder() # <run id=\"mcmc\" spec=\"MCMC\" chainLength=\"1e+07\"> xml <- mcmc_to_xml_run_default(create_mcmc()) check_empty_beautier_folder()
Converts an MCMC object to the run section's XML for a Nested-Sampling MCMC
mcmc_to_xml_run_nested_sampling(mcmc)
mcmc_to_xml_run_nested_sampling(mcmc)
mcmc |
one MCMC.
Use |
the XML as text
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # "<run id=\"mcmc\" spec=\"beast.gss.NS\" chainLength=\"1e+07\" " # "particleCount=\"1\" subChainLength=\"5000\" epsilon=\"1e-12\">" mcmc_to_xml_run_nested_sampling(create_ns_mcmc()) check_empty_beautier_folder()
check_empty_beautier_folder() # "<run id=\"mcmc\" spec=\"beast.gss.NS\" chainLength=\"1e+07\" " # "particleCount=\"1\" subChainLength=\"5000\" epsilon=\"1e-12\">" mcmc_to_xml_run_nested_sampling(create_ns_mcmc()) check_empty_beautier_folder()
These lines start with '<distribution id='
mrca_prior_to_xml_prior_distr(inference_model)
mrca_prior_to_xml_prior_distr(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
lines of XML text
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # <distribution id="posterior" spec="util.CompoundDistribution"> # <distribution id="prior" spec="util.CompoundDistribution"> # HERE, where the ID of the distribution is 'prior' # </distribution> # <distribution id="likelihood" ...> # </distribution> # </distribution> check_empty_beautier_folder()
check_empty_beautier_folder() # <distribution id="posterior" spec="util.CompoundDistribution"> # <distribution id="prior" spec="util.CompoundDistribution"> # HERE, where the ID of the distribution is 'prior' # </distribution> # <distribution id="likelihood" ...> # </distribution> # </distribution> check_empty_beautier_folder()
state
sectionInternal function to create the XML of an MRCA prior,
as used in the state
section
mrca_prior_to_xml_state(inference_model)
mrca_prior_to_xml_state(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
the tree prior as XML text
Richèl J.C. Bilderbeek
check_empty_beautier_folder() mrca_prior_to_xml_state( inference_model = create_inference_model( mrca_prior = create_mrca_prior( alignment_id = "test_output_0", mrca_distr = create_normal_distr(id = 42) ), clock_model = create_strict_clock_model() ) ) check_empty_beautier_folder()
check_empty_beautier_folder() mrca_prior_to_xml_state( inference_model = create_inference_model( mrca_prior = create_mrca_prior( alignment_id = "test_output_0", mrca_distr = create_normal_distr(id = 42) ), clock_model = create_strict_clock_model() ) ) check_empty_beautier_folder()
taxonset
section in the prior section of the
distribution section of a BEAST2 XML parameter file.Creates the taxonset
section in the prior section of the
distribution section of a BEAST2 XML parameter file.
mrca_prior_to_xml_taxonset(mrca_prior, taxa_names_with_ids = NULL)
mrca_prior_to_xml_taxonset(mrca_prior, taxa_names_with_ids = NULL)
mrca_prior |
a Most Recent Common Ancestor prior,
as returned by |
taxa_names_with_ids |
taxa names that already have received
an ID. Causes the XML to |
<taxonset id="all" spec="TaxonSet">
<taxon id="626029_aco" spec="Taxon"/>
<taxon id="630116_aco" spec="Taxon"/>
<taxon id="630210_aco" spec="Taxon"/>
<taxon id="B25702_aco" spec="Taxon"/>
<taxon id="61430_aco" spec="Taxon"/>
</taxonset>
lines of XML text
Richèl J.C. Bilderbeek
Internal function to creates the MRCA prior's XML for the tracelog section.
mrca_prior_to_xml_tracelog(inference_model)
mrca_prior_to_xml_tracelog(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
<logger id="tracelog" ...>
# Here
</logger>
lines of XML text
Richèl J.C. Bilderbeek
distribution
's prior section (which is part of
a posterior distribution section) of a BEAST2 XML parameter file.These lines start with '<distribution id="prior"
'
mrca_priors_to_xml_prior_distr(inference_model)
mrca_priors_to_xml_prior_distr(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
<distribution id="posterior" spec="util.CompoundDistribution">
<distribution id="prior" spec="util.CompoundDistribution">
HERE, where the ID of the distribution is 'prior'
</distribution>
<distribution id="likelihood" ...>
</distribution>
</distribution>
lines of XML text
Richèl J.C. Bilderbeek
Creates the 'tree
' section of a BEAST2 XML parameter file,
which is part of a 'state
' section,
without being indented,
when there is no tip-dating
no_taxa_to_xml_tree(inference_model)
no_taxa_to_xml_tree(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
The tree
tag has these elements:
<tree[...]> <taxonset[...]> [...] </taxonset> </run>
the random phylogeny as XML text
Richèl J.C. Bilderbeek
Converts a parameter to XML
parameter_to_xml(parameter, beauti_options)
parameter_to_xml(parameter, beauti_options)
parameter |
a parameter,
as created by |
beauti_options |
one BEAUti options object,
as returned by |
the parameter as XML text
Richèl J.C. Bilderbeek
check_empty_beautier_folder() parameter_to_xml( create_alpha_param(id = 1), beauti_options = create_beauti_options() ) check_empty_beautier_folder()
check_empty_beautier_folder() parameter_to_xml( create_alpha_param(id = 1), beauti_options = create_beauti_options() ) check_empty_beautier_folder()
Converts a kappa 1 parameter to XML
parameter_to_xml_kappa_1(parameter, beauti_options = create_beauti_options())
parameter_to_xml_kappa_1(parameter, beauti_options = create_beauti_options())
parameter |
a kappa 1 parameter,
a numeric value.
For advanced usage, use the structure
as created by |
beauti_options |
one BEAUti options object,
as returned by |
the parameter as XML text
Richèl J.C. Bilderbeek
Converts a kappa 2 parameter to XML
parameter_to_xml_kappa_2(parameter, beauti_options = create_beauti_options())
parameter_to_xml_kappa_2(parameter, beauti_options = create_beauti_options())
parameter |
a kappa 2 parameter,
a numeric value.
For advanced usage, use the structure
as created by |
beauti_options |
one BEAUti options object,
as returned by |
the parameter as XML text
Richèl J.C. Bilderbeek
Converts a lambda parameter to XML
parameter_to_xml_lambda(parameter, beauti_options = create_beauti_options())
parameter_to_xml_lambda(parameter, beauti_options = create_beauti_options())
parameter |
a lambda parameter,
a numeric value.
For advanced usage, use the structure
as created by |
beauti_options |
one BEAUti options object,
as returned by |
the parameter as XML text
Richèl J.C. Bilderbeek
Converts a mean parameter to XML
parameter_to_xml_mean(parameter, beauti_options = create_beauti_options())
parameter_to_xml_mean(parameter, beauti_options = create_beauti_options())
parameter |
a mean parameter,
a numeric value.
For advanced usage, use the structure
as created by |
beauti_options |
one BEAUti options object,
as returned by |
the parameter as XML text
Richèl J.C. Bilderbeek
Converts a mu parameter to XML
parameter_to_xml_mu(parameter, beauti_options = create_beauti_options())
parameter_to_xml_mu(parameter, beauti_options = create_beauti_options())
parameter |
a mu parameter,
a numeric value.
For advanced usage, use the structure
as created by |
beauti_options |
one BEAUti options object,
as returned by |
the parameter as XML text
Richèl J.C. Bilderbeek
Converts a 'rate AC' parameter to XML
parameter_to_xml_rate_ac( parameter, beauti_options = create_beauti_options(), which_name = "state_node" )
parameter_to_xml_rate_ac( parameter, beauti_options = create_beauti_options(), which_name = "state_node" )
parameter |
a 'rate AC' parameter,
a numeric value.
For advanced usage, use the structure
as created by |
beauti_options |
one BEAUti options object,
as returned by |
which_name |
the name, can be |
the parameter as XML text
Richèl J.C. Bilderbeek
Converts a 'rate AG' parameter to XML
parameter_to_xml_rate_ag( parameter, beauti_options = create_beauti_options(), which_name = "state_node" )
parameter_to_xml_rate_ag( parameter, beauti_options = create_beauti_options(), which_name = "state_node" )
parameter |
a 'rate AG' parameter,
a numeric value.
For advanced usage, use the structure
as created by |
beauti_options |
one BEAUti options object,
as returned by |
which_name |
the name, can be |
the parameter as XML text
Richèl J.C. Bilderbeek
Converts a 'rate AT' parameter to XML
parameter_to_xml_rate_at( parameter, beauti_options = create_beauti_options(), which_name = "state_node" )
parameter_to_xml_rate_at( parameter, beauti_options = create_beauti_options(), which_name = "state_node" )
parameter |
a 'rate AT' parameter,
a numeric value.
For advanced usage, use the structure
as created by |
beauti_options |
one BEAUti options object,
as returned by |
which_name |
the name, can be |
the parameter as XML text
Richèl J.C. Bilderbeek
Converts a 'rate CG' parameter to XML
parameter_to_xml_rate_cg( parameter, beauti_options = create_beauti_options(), which_name = "state_node" )
parameter_to_xml_rate_cg( parameter, beauti_options = create_beauti_options(), which_name = "state_node" )
parameter |
a 'rate CG' parameter,
a numeric value.
For advanced usage, use the structure
as created by |
beauti_options |
one BEAUti options object,
as returned by |
which_name |
the name, can be |
the parameter as XML text
Richèl J.C. Bilderbeek
Converts a 'rate CT' parameter to XML
parameter_to_xml_rate_ct( parameter, beauti_options = create_beauti_options(), which_name = "state_node" )
parameter_to_xml_rate_ct( parameter, beauti_options = create_beauti_options(), which_name = "state_node" )
parameter |
a 'rate CT' parameter,
a numeric value.
For advanced usage, use the structure
as created by |
beauti_options |
one BEAUti options object,
as returned by |
which_name |
the name, can be |
the parameter as XML text
Richèl J.C. Bilderbeek
Converts a 'rate GT' parameter to XML
parameter_to_xml_rate_gt( parameter, beauti_options = create_beauti_options(), which_name = "state_node" )
parameter_to_xml_rate_gt( parameter, beauti_options = create_beauti_options(), which_name = "state_node" )
parameter |
a 'rate GT' parameter,
a numeric value.
For advanced usage, use the structure
as created by |
beauti_options |
one BEAUti options object,
as returned by |
which_name |
the name, can be |
the parameter as XML text
Richèl J.C. Bilderbeek
Converts a scale parameter to XML
parameter_to_xml_scale(parameter, beauti_options = create_beauti_options())
parameter_to_xml_scale(parameter, beauti_options = create_beauti_options())
parameter |
a scale parameter,
a numeric value.
For advanced usage, use the structure
as created by |
beauti_options |
one BEAUti options object,
as returned by |
the parameter as XML text
Richèl J.C. Bilderbeek
Converts a sigma parameter to XML
parameter_to_xml_sigma(parameter, beauti_options = create_beauti_options())
parameter_to_xml_sigma(parameter, beauti_options = create_beauti_options())
parameter |
a sigma parameter,
a numeric value.
For advanced usage, use the structure
as created by |
beauti_options |
one BEAUti options object,
as returned by |
the parameter as XML text
Richèl J.C. Bilderbeek
Check there are no files in the default beautier folder. The goal is to make sure no temporary files are left undeleted. Will stop if there are files in the beautier folder.
remove_beautier_folder()
remove_beautier_folder()
No return value, called for side effects.
Richèl J.C. Bilderbeek
use remove_beautier_folder to remove the default 'beautier' folder
check_empty_beautier_folder() remove_beautier_folder() check_empty_beautier_folder()
check_empty_beautier_folder() remove_beautier_folder() check_empty_beautier_folder()
Remove all lines that are only whitespace
remove_empty_lines(lines, trim = FALSE)
remove_empty_lines(lines, trim = FALSE)
lines |
character vector with text |
trim |
FALSE if indentation must be preserved, TRUE will remove all surrounding whitespace |
the lines with text
Richèl J.C. Bilderbeek
Remove consecutive lines
remove_multiline(text, lines_to_remove)
remove_multiline(text, lines_to_remove)
text |
lines of characters |
lines_to_remove |
lines of character that need to be removed from text |
lines of text
Richèl J.C. Bilderbeek
Rename the filenames in an inference model
rename_inference_model_filenames(inference_model, rename_fun)
rename_inference_model_filenames(inference_model, rename_fun)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
rename_fun |
a function to rename a filename, as can be checked by check_rename_fun. This function should have one argument, which will be a filename or NA. The function should return one filename (when passed one filename) or one NA (when passed one NA). Example rename functions are:
|
an inference model with the renamed filenames
check_empty_beautier_folder() inference_model <- create_inference_model() inference_model$mcmc$tracelog$filename <- "trace.log" inference_model$mcmc$screenlog$filename <- "screen.log" inference_model$mcmc$treelog$filename <- "tree.log" inference_model$tipdates_filename <- "tipdates.csv" # Nah, put the files in a folder inference_model <- rename_inference_model_filenames( inference_model = inference_model, rename_fun = get_replace_dir_fun("/home/john") ) # Nah, put the files in anoth folder inference_model <- rename_inference_model_filenames( inference_model = inference_model, rename_fun = get_replace_dir_fun("/home/doe") ) # Nah, store the files locally rename_inference_model_filenames( inference_model = inference_model, rename_fun = get_remove_dir_fun() ) check_empty_beautier_folder()
check_empty_beautier_folder() inference_model <- create_inference_model() inference_model$mcmc$tracelog$filename <- "trace.log" inference_model$mcmc$screenlog$filename <- "screen.log" inference_model$mcmc$treelog$filename <- "tree.log" inference_model$tipdates_filename <- "tipdates.csv" # Nah, put the files in a folder inference_model <- rename_inference_model_filenames( inference_model = inference_model, rename_fun = get_replace_dir_fun("/home/john") ) # Nah, put the files in anoth folder inference_model <- rename_inference_model_filenames( inference_model = inference_model, rename_fun = get_replace_dir_fun("/home/doe") ) # Nah, store the files locally rename_inference_model_filenames( inference_model = inference_model, rename_fun = get_remove_dir_fun() ) check_empty_beautier_folder()
Rename the filenames within an MCMC
rename_mcmc_filenames(mcmc, rename_fun)
rename_mcmc_filenames(mcmc, rename_fun)
mcmc |
one MCMC.
Use |
rename_fun |
a function to rename a filename, as can be checked by check_rename_fun. This function should have one argument, which will be a filename or NA. The function should return one filename (when passed one filename) or one NA (when passed one NA). Example rename functions are:
|
an 'mcmc' (see create_mcmc) with renamed filenames
check_empty_beautier_folder() # Create an MCMC with local filenames mcmc <- create_mcmc() mcmc$tracelog$filename <- "trace.log" mcmc$screenlog$filename <- "screen.log" mcmc$treelog$filename <- "tree.log" # Nah, files should be put in '/home/john' folder mcmc <- rename_mcmc_filenames( mcmc = mcmc, rename_fun = get_replace_dir_fun("/home/john") ) # Nah, files should be put in '/home/doe' folder instead mcmc <- rename_mcmc_filenames( mcmc = mcmc, rename_fun = get_replace_dir_fun("/home/doe") ) # Nah, files should be put in local folder instead mcmc <- rename_mcmc_filenames( mcmc = mcmc, rename_fun = get_remove_dir_fun() ) check_empty_beautier_folder()
check_empty_beautier_folder() # Create an MCMC with local filenames mcmc <- create_mcmc() mcmc$tracelog$filename <- "trace.log" mcmc$screenlog$filename <- "screen.log" mcmc$treelog$filename <- "tree.log" # Nah, files should be put in '/home/john' folder mcmc <- rename_mcmc_filenames( mcmc = mcmc, rename_fun = get_replace_dir_fun("/home/john") ) # Nah, files should be put in '/home/doe' folder instead mcmc <- rename_mcmc_filenames( mcmc = mcmc, rename_fun = get_replace_dir_fun("/home/doe") ) # Nah, files should be put in local folder instead mcmc <- rename_mcmc_filenames( mcmc = mcmc, rename_fun = get_remove_dir_fun() ) check_empty_beautier_folder()
Internal function
rln_clock_model_to_xml_mean_rate_prior(rln_clock_model, beauti_options)
rln_clock_model_to_xml_mean_rate_prior(rln_clock_model, beauti_options)
rln_clock_model |
a Relaxed Log-Normal clock model,
as returned by |
beauti_options |
one BEAUti options object,
as returned by |
lines of XML text
Richèl J.C. Bilderbeek
Converts an RLN clock model to the operators
section of the
XML as text
rln_clock_model_to_xml_operators(inference_model)
rln_clock_model_to_xml_operators(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
a character vector of XML strings
Richèl J.C. Bilderbeek
Internal function to converts a relaxed log-normal clock model
to the prior
section of the XML as text
rln_clock_model_to_xml_prior_distr(inference_model)
rln_clock_model_to_xml_prior_distr(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
a character vector of XML strings
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # <distribution id="posterior" spec="util.CompoundDistribution"> # <distribution id="prior" spec="util.CompoundDistribution"> # HERE, where the ID of the distribution is 'prior' # </distribution> # <distribution id="likelihood" ...> # </distribution> # </distribution> # Must be an initialized inference model inference_model <- create_inference_model( clock_model = create_rln_clock_model( id = "test_output_0", ucldstdev_distr = create_gamma_distr( id = 0, alpha = create_alpha_param(id = 2, value = "0.5396"), beta = create_beta_param(id = 3, value = "0.3819") ), mean_rate_prior_distr = create_uniform_distr(id = 1), mparam_id = 1 ) ) rln_clock_model_to_xml_prior_distr(inference_model) check_empty_beautier_folder()
check_empty_beautier_folder() # <distribution id="posterior" spec="util.CompoundDistribution"> # <distribution id="prior" spec="util.CompoundDistribution"> # HERE, where the ID of the distribution is 'prior' # </distribution> # <distribution id="likelihood" ...> # </distribution> # </distribution> # Must be an initialized inference model inference_model <- create_inference_model( clock_model = create_rln_clock_model( id = "test_output_0", ucldstdev_distr = create_gamma_distr( id = 0, alpha = create_alpha_param(id = 2, value = "0.5396"), beta = create_beta_param(id = 3, value = "0.3819") ), mean_rate_prior_distr = create_uniform_distr(id = 1), mparam_id = 1 ) ) rln_clock_model_to_xml_prior_distr(inference_model) check_empty_beautier_folder()
Converts an RLN clock model to the 'state' section of the XML as text
rln_clock_model_to_xml_state(inference_model)
rln_clock_model_to_xml_state(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
lines of XML text, without indentation nor state
tags
Richèl J.C. Bilderbeek
Creates the RLN clock model's XML for the tracelog section
rln_clock_model_to_xml_tracelog(inference_model)
rln_clock_model_to_xml_tracelog(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
a character vector of XML strings
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # <logger id="tracelog" ...> #' # Here # </logger> check_empty_beautier_folder()
check_empty_beautier_folder() # <logger id="tracelog" ...> #' # Here # </logger> check_empty_beautier_folder()
init
sectionCreates the XML text for the beast
tag of a BEAST2 parameter file,
which is directly after the XML
declaration (created by create_xml_declaration.
rnd_phylo_to_xml_init(inference_model)
rnd_phylo_to_xml_init(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
The init
tag has these elements:
<init id=\"RandomTree.t:[...]> <populationModel[...]> [...] </populationModel> </init>
the phylogeny as XML text
Richèl J.C. Bilderbeek
Converts an 's_param' to XML
s_parameter_to_xml(parameter, beauti_options)
s_parameter_to_xml(parameter, beauti_options)
parameter |
a s parameter,
a numeric value.
For advanced usage, use the structure
as created by |
beauti_options |
one BEAUti options object,
as returned by |
the parameter as XML text
Richèl J.C. Bilderbeek
s_parameter_to_xml( create_s_param(id = 4, value = 1.25), beauti_options = create_beauti_options_v2_4() ) s_parameter_to_xml( create_s_param(id = 4, value = 1.25), beauti_options = create_beauti_options_v2_6() )
s_parameter_to_xml( create_s_param(id = 4, value = 1.25), beauti_options = create_beauti_options_v2_4() ) s_parameter_to_xml( create_s_param(id = 4, value = 1.25), beauti_options = create_beauti_options_v2_6() )
operators
sectionConverts a site model to XML,
used in the operators
section
site_model_to_xml_operators(site_model)
site_model_to_xml_operators(site_model)
site_model |
a site model,
as returned by |
the site model as XML text
Richèl J.C. Bilderbeek
Converts a site model to XML,
used in the prior
section
site_model_to_xml_prior_distr(site_model, beauti_options)
site_model_to_xml_prior_distr(site_model, beauti_options)
site_model |
a site model,
as returned by |
beauti_options |
one BEAUti options object,
as returned by |
the site model as XML text
Richèl J.C. Bilderbeek
site_model_to_xml_prior_distr( site_model = create_jc69_site_model(id = 1), beauti_options = create_beauti_options() ) site_model_to_xml_prior_distr( site_model = create_hky_site_model( id = 1, kappa_prior_distr = create_uniform_distr(id = 2) ), beauti_options = create_beauti_options() ) site_model_to_xml_prior_distr( site_model = create_tn93_site_model( id = 1, kappa_1_prior_distr = create_uniform_distr(id = 2), kappa_2_prior_distr = create_uniform_distr(id = 3) ), beauti_options = create_beauti_options() ) site_model_to_xml_prior_distr( site_model = create_gtr_site_model( id = 1, rate_ac_prior_distr = create_uniform_distr(id = 2), rate_ag_prior_distr = create_uniform_distr(id = 3), rate_at_prior_distr = create_uniform_distr(id = 4), rate_cg_prior_distr = create_uniform_distr(id = 5), rate_gt_prior_distr = create_uniform_distr(id = 6) ), beauti_options = create_beauti_options() )
site_model_to_xml_prior_distr( site_model = create_jc69_site_model(id = 1), beauti_options = create_beauti_options() ) site_model_to_xml_prior_distr( site_model = create_hky_site_model( id = 1, kappa_prior_distr = create_uniform_distr(id = 2) ), beauti_options = create_beauti_options() ) site_model_to_xml_prior_distr( site_model = create_tn93_site_model( id = 1, kappa_1_prior_distr = create_uniform_distr(id = 2), kappa_2_prior_distr = create_uniform_distr(id = 3) ), beauti_options = create_beauti_options() ) site_model_to_xml_prior_distr( site_model = create_gtr_site_model( id = 1, rate_ac_prior_distr = create_uniform_distr(id = 2), rate_ag_prior_distr = create_uniform_distr(id = 3), rate_at_prior_distr = create_uniform_distr(id = 4), rate_cg_prior_distr = create_uniform_distr(id = 5), rate_gt_prior_distr = create_uniform_distr(id = 6) ), beauti_options = create_beauti_options() )
Internal function to convert a site model to XML, used in the 'state' section
site_model_to_xml_state(site_model, beauti_options = create_beauti_options())
site_model_to_xml_state(site_model, beauti_options = create_beauti_options())
site_model |
a site model,
as returned by |
beauti_options |
one BEAUti options object,
as returned by |
the site model as XML text
Richèl J.C. Bilderbeek
Creates the site model's XML for the tracelog section
site_model_to_xml_tracelog(site_model)
site_model_to_xml_tracelog(site_model)
site_model |
a site model,
as returned by |
lines of XML text
Richèl J.C. Bilderbeek
all site models' tracelog section is created
by site_models_to_xml_tracelog
check_empty_beautier_folder() # <logger id="tracelog" ...> #' # Here # </logger> check_empty_beautier_folder()
check_empty_beautier_folder() # <logger id="tracelog" ...> #' # Here # </logger> check_empty_beautier_folder()
operators
section from the site models.Write the XML operators
section from the site models.
site_models_to_xml_operators(site_models)
site_models_to_xml_operators(site_models)
site_models |
one or more site models,
as returned by |
lines of XML text
Richèl J.C. Bilderbeek
Represent the site models as XML
site_models_to_xml_prior_distr(site_models, beauti_options)
site_models_to_xml_prior_distr(site_models, beauti_options)
site_models |
one or more site models,
as returned by |
beauti_options |
one BEAUti options object,
as returned by |
lines of XML text
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # <distribution id="posterior" spec="util.CompoundDistribution"> # <distribution id="prior" spec="util.CompoundDistribution"> # HERE, where the ID of the distribution is 'prior' # </distribution> # <distribution id="likelihood" ...> # </distribution> # </distribution> check_empty_beautier_folder()
check_empty_beautier_folder() # <distribution id="posterior" spec="util.CompoundDistribution"> # <distribution id="prior" spec="util.CompoundDistribution"> # HERE, where the ID of the distribution is 'prior' # </distribution> # <distribution id="likelihood" ...> # </distribution> # </distribution> check_empty_beautier_folder()
Creates the site models' XML for the tracelog section
site_models_to_xml_tracelog(site_models)
site_models_to_xml_tracelog(site_models)
site_models |
one or more site models,
as returned by |
lines of XML text
Richèl J.C. Bilderbeek
the complete tracelog section is created
by create_tracelog_xml
check_empty_beautier_folder() # <logger id="tracelog" ...> #' # Here # </logger> check_empty_beautier_folder()
check_empty_beautier_folder() # <logger id="tracelog" ...> #' # Here # </logger> check_empty_beautier_folder()
Converts a clock model to the operators
section of the
XML as text
strict_clock_model_to_xml_operators(inference_model)
strict_clock_model_to_xml_operators(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
a character vector of XML strings
Richèl J.C. Bilderbeek
Internal function to converts a strict clock model
to the prior
section of the XML as text
strict_clock_model_to_xml_prior_distr(inference_model)
strict_clock_model_to_xml_prior_distr(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
a character vector of XML strings
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # <distribution id="posterior" spec="util.CompoundDistribution"> # <distribution id="prior" spec="util.CompoundDistribution"> # HERE, where the ID of the distribution is 'prior' # </distribution> # <distribution id="likelihood" ...> # </distribution> # </distribution> strict_clock_model_to_xml_prior_distr( inference_model = create_inference_model() ) check_empty_beautier_folder()
check_empty_beautier_folder() # <distribution id="posterior" spec="util.CompoundDistribution"> # <distribution id="prior" spec="util.CompoundDistribution"> # HERE, where the ID of the distribution is 'prior' # </distribution> # <distribution id="likelihood" ...> # </distribution> # </distribution> strict_clock_model_to_xml_prior_distr( inference_model = create_inference_model() ) check_empty_beautier_folder()
Converts a strict clock model to the 'state' section of the XML as text
strict_clock_model_to_xml_state(inference_model)
strict_clock_model_to_xml_state(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
lines of XML text, without indentation nor state
tags
Richèl J.C. Bilderbeek
Creates a strict clock model's XML for the tracelog section
strict_clock_model_to_xml_tracelog(inference_model)
strict_clock_model_to_xml_tracelog(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
a character vector of XML strings
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # <logger id="tracelog" ...> #' # Here # </logger> check_empty_beautier_folder()
check_empty_beautier_folder() # <logger id="tracelog" ...> #' # Here # </logger> check_empty_beautier_folder()
Internal function to creates the 'tree
' section
of a BEAST2 XML parameter file,
which is part of a 'state
' section,
without being indented.
taxa_to_xml_tree(inference_model)
taxa_to_xml_tree(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
The tree
tag has these elements:
<tree[...]> <taxonset[...]> [...] </taxonset> </run>
lines of XML text
Richèl J.C. Bilderbeek
Internal function to creates the 'trait
' section
of a BEAST2 XML parameter file,
which is part of a 'tree
' section,
without being indented.
tipdate_taxa_to_xml_trait(inference_model)
tipdate_taxa_to_xml_trait(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
The tree
tag has these elements:
<run[...]> <state[...]> <tree[...]> <trait[...]> This part </trait> </tree> </run> </state>
lines of XML text
Richèl J.C. Bilderbeek
Creates the tree
section
(part of the state
section)
when there is tip-dating
tipdate_taxa_to_xml_tree(inference_model)
tipdate_taxa_to_xml_tree(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
the random phylogeny as XML text
Richèl J.C. Bilderbeek
Converts a TN93 site model to XML,
used in the prior
section
tn93_site_model_to_xml_prior_distr(site_model, beauti_options)
tn93_site_model_to_xml_prior_distr(site_model, beauti_options)
site_model |
a site model,
as returned by |
beauti_options |
one BEAUti options object,
as returned by |
the site model as XML text
Richèl J.C. Bilderbeek
tn93_site_model_to_xml_prior_distr( site_model = create_tn93_site_model( id = 1, kappa_1_prior_distr = create_uniform_distr(id = 2), kappa_2_prior_distr = create_uniform_distr(id = 3) ), beauti_options = create_beauti_options() )
tn93_site_model_to_xml_prior_distr( site_model = create_tn93_site_model( id = 1, kappa_1_prior_distr = create_uniform_distr(id = 2), kappa_2_prior_distr = create_uniform_distr(id = 3) ), beauti_options = create_beauti_options() )
state
sectionConverts a site model to XML,
used in the state
section
tn93_site_model_to_xml_state( site_model, beauti_options = create_beauti_options() )
tn93_site_model_to_xml_state( site_model, beauti_options = create_beauti_options() )
site_model |
a site model,
as returned by |
beauti_options |
one BEAUti options object,
as returned by |
the site model as XML text
Richèl J.C. Bilderbeek
Creates the tree models' XML for the tracelog section. That is, all XML tags that have the word 'tree' in them.
tree_model_to_tracelog_xml(inference_model)
tree_model_to_tracelog_xml(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
lines of XML text
use site_models just because it contains all IDs
Richèl J.C. Bilderbeek
the complete tracelog section is created
by create_tracelog_xml
check_empty_beautier_folder() # <logger id="tracelog" ...> #' # Here # </logger> check_empty_beautier_folder()
check_empty_beautier_folder() # <logger id="tracelog" ...> #' # Here # </logger> check_empty_beautier_folder()
Creates the XML of a tree prior,
as used in the operators
section
tree_prior_to_xml_operators(inference_model)
tree_prior_to_xml_operators(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
the tree prior as XML text
Richèl J.C. Bilderbeek
These lines start with '<distribution id='
tree_prior_to_xml_prior_distr(tree_prior, beauti_options)
tree_prior_to_xml_prior_distr(tree_prior, beauti_options)
tree_prior |
a tree priors,
as returned by |
beauti_options |
one BEAUti options object,
as returned by |
lines of XML text
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # <distribution id="posterior" spec="util.CompoundDistribution"> # <distribution id="prior" spec="util.CompoundDistribution"> # HERE, where the ID of the distribution is 'prior' # </distribution> # <distribution id="likelihood" ...> # </distribution> # </distribution> check_empty_beautier_folder()
check_empty_beautier_folder() # <distribution id="posterior" spec="util.CompoundDistribution"> # <distribution id="prior" spec="util.CompoundDistribution"> # HERE, where the ID of the distribution is 'prior' # </distribution> # <distribution id="likelihood" ...> # </distribution> # </distribution> check_empty_beautier_folder()
state
sectionCreates the XML of a tree prior,
as used in the state
section
tree_prior_to_xml_state(inference_model)
tree_prior_to_xml_state(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
the tree prior as XML text
Richèl J.C. Bilderbeek
Creates the tree prior's XML for the tracelog section
tree_prior_to_xml_tracelog(tree_prior)
tree_prior_to_xml_tracelog(tree_prior)
tree_prior |
a tree priors,
as returned by |
lines of XML text
Richèl J.C. Bilderbeek
all tree priors' tracelog section is created
by tree_priors_to_xml_tracelog
check_empty_beautier_folder() # <logger id="tracelog" ...> #' # Here # </logger> check_empty_beautier_folder()
check_empty_beautier_folder() # <logger id="tracelog" ...> #' # Here # </logger> check_empty_beautier_folder()
These lines start with '<distribution id='
tree_priors_to_xml_prior_distr(tree_priors, beauti_options)
tree_priors_to_xml_prior_distr(tree_priors, beauti_options)
tree_priors |
one or more tree priors,
as returned by |
beauti_options |
one BEAUti options object,
as returned by |
lines of XML text
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # <distribution id="posterior" spec="util.CompoundDistribution"> # <distribution id="prior" spec="util.CompoundDistribution"> # HERE, where the ID of the distribution is 'prior' # </distribution> # <distribution id="likelihood" ...> # </distribution> # </distribution> check_empty_beautier_folder()
check_empty_beautier_folder() # <distribution id="posterior" spec="util.CompoundDistribution"> # <distribution id="prior" spec="util.CompoundDistribution"> # HERE, where the ID of the distribution is 'prior' # </distribution> # <distribution id="likelihood" ...> # </distribution> # </distribution> check_empty_beautier_folder()
Creates the tree priors' XML for the tracelog section
tree_priors_to_xml_tracelog(tree_priors)
tree_priors_to_xml_tracelog(tree_priors)
tree_priors |
one or more tree priors,
as returned by |
lines of XML text
Richèl J.C. Bilderbeek
the complete tracelog section is created
by create_tracelog_xml
check_empty_beautier_folder() # <logger id="tracelog" ...> #' # Here # </logger> check_empty_beautier_folder()
check_empty_beautier_folder() # <logger id="tracelog" ...> #' # Here # </logger> check_empty_beautier_folder()
Unindents text
unindent(text)
unindent(text)
text |
one or more lines of text |
unindented lines of text
Richèl J.C. Bilderbeek
Creates the XML of a Yule tree prior,
as used in the operators
section
yule_tree_prior_to_xml_operators(inference_model)
yule_tree_prior_to_xml_operators(inference_model)
inference_model |
a Bayesian phylogenetic inference model. An inference model is the complete model setup in which a site model, clock model, tree prior and more are specified. Use create_inference_model to create an inference model. Use check_inference_model to check if an inference model is valid. Use rename_inference_model_filenames to rename the files in an inference model. |
the tree prior as XML text
Richèl J.C. Bilderbeek
prior
section in the prior section of
the prior section of the distribution section
of a BEAST2 XML parameter file for a Yule tree priorCreates the prior
section in the prior section of
the prior section of the distribution section
of a BEAST2 XML parameter file for a Yule tree prior
yule_tree_prior_to_xml_prior_distr( yule_tree_prior, beauti_options = create_beauti_options() )
yule_tree_prior_to_xml_prior_distr( yule_tree_prior, beauti_options = create_beauti_options() )
yule_tree_prior |
a Yule tree_prior,
as created by |
beauti_options |
one BEAUti options object,
as returned by |
lines of XML text
Richèl J.C. Bilderbeek
check_empty_beautier_folder() # <distribution id="posterior" spec="util.CompoundDistribution"> # <distribution id="prior" spec="util.CompoundDistribution"> # HERE, where the ID of the distribution is 'prior' # </distribution> # <distribution id="likelihood" ...> # </distribution> # </distribution> check_empty_beautier_folder()
check_empty_beautier_folder() # <distribution id="posterior" spec="util.CompoundDistribution"> # <distribution id="prior" spec="util.CompoundDistribution"> # HERE, where the ID of the distribution is 'prior' # </distribution> # <distribution id="likelihood" ...> # </distribution> # </distribution> check_empty_beautier_folder()