View source: R/create_inference_conditions.R
create_inference_conditions | R Documentation |
Create the parameters to determine how to choose a model for the inference
create_inference_conditions(
model_type = "generative",
run_if = "always",
do_measure_evidence = FALSE,
os = rappdirs::app_dir()$os
)
model_type |
type of inference model supplied for an experiment. Possible values:
|
run_if |
the condition for an experiment's inference model to be run. Possible values:
|
do_measure_evidence |
boolean to indicate if the evidence (aka marginal likelihood) of an experiment must be measured |
os |
name of the operating system, can be |
the inference conditions
Giovanni Laudanno, Richèl J.C. Bilderbeek
if (beautier::is_on_ci()) {
# Create the inference conditions parameter set
if (rappdirs::app_dir()$os != "win") {
# it does not work on Windows
# Model type can be 'generative' or 'candidate'
model_type <- "candidate"
# Run condition can be 'always' or 'best_candidate'
run_if <- "best_candidate"
# Evidence (aka marginal likelihood) can be measured yes or no
do_measure_evidence <- TRUE
} else {
# Model type can be 'generative' or 'candidate'
model_type <- "generative"
# Run condition can be 'always' or 'best_candidate'
run_if <- "always"
# Evidence (aka marginal likelihood) can be measured yes or no
do_measure_evidence <- FALSE
}
inference_conditions <- create_inference_conditions(
model_type = model_type,
run_if = run_if,
do_measure_evidence = do_measure_evidence
)
# Using the inference conditions, create a testing candidate experiment
experiment <- create_test_cand_experiment(
inference_conditions = inference_conditions
)
evidence_filename <- NA
if (do_measure_evidence) evidence_filename <- get_temp_evidence_filename()
# Use the experiment to create the full pirouette parameter set
pir_params <- create_pir_params(
alignment_params = create_test_alignment_params(),
experiments = list(experiment),
evidence_filename = evidence_filename
)
# Run that experiment on a continuous integration service,
# only when BEAST2 is installed
if (beautier::is_on_ci() &&
beastier::is_beast2_installed() &&
is_beast2_ns_pkg_installed()
) {
pir_out <- pir_run(
phylogeny = ape::read.tree(text = "((A:2, B:2):1, C:3);"),
pir_params = pir_params
)
pir_plot(pir_out)
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.