create_pir_params: Create the parameters for pirouette

View source: R/create_pir_params.R

create_pir_paramsR Documentation

Create the parameters for pirouette

Description

Create the parameters for pirouette

Usage

create_pir_params(
  alignment_params,
  twinning_params = NA,
  experiments = list(create_experiment()),
  error_measure_params = create_error_measure_params(),
  evidence_filename = NA,
  verbose = FALSE
)

Arguments

alignment_params

parameters to simulate an alignment, as can be created by create_alignment_params

twinning_params

can be NA if no twinning is desired, or can be the twinning parameters, as can be created by create_twinning_params

experiments

a list of one or more pirouette experiments, as can be created by create_experiment. If more than one experiment is provided and a "generative" experiment is part of them, the "generative" one has to be the first in the list. See also:

  • Use check_experiments to check the list of experiments for validity

  • Use create_all_experiments to create experiments with all combinations of tree model, clock model and tree priors

  • Use create_all_bd_experiments to create experiments with all combinations of tree model, clock model and tree priors, except for only using birth-death tree priors

  • Use create_all_coal_experiments to create all experiments with all combinations of tree model, clock model and tree priors, except for only coalescent tree priors

  • Use shorten_experiments to shorten the run time of the list of experiments

error_measure_params

parameter set to specify how the error between the given phylogeny and the Bayesian posterior is determined. Use create_error_measure_params to create such a parameter set

evidence_filename

filename to store the estimated evidences (aka marginal likelihoods), as can be created by get_temp_evidence_filename. Must be NA if there is evidence estimation (as determined by will_measure_evidence).

verbose

if TRUE, show more output

Value

a list with all pirouette parameters

Author(s)

Giovanni Laudanno, Richèl J.C. Bilderbeek

See Also

  • Use pir_run to run the pirouette pipeline

  • Use create_test_pir_params to create a test pir_params

  • Use create_test_pir_params_setup to create a test pir_params following a specific setup, such as having a candidate experiemnt and/or use twinning.

Examples

if (beautier::is_on_ci()) {

  # Create all elements to create a pirouette parameter set
  alignment_params <- create_test_alignment_params()
  twinning_params <- create_twinning_params()
  experiments <- list(create_test_gen_experiment())
  error_measure_params <- create_error_measure_params()
  evidence_filename <- NA
  verbose <- FALSE

  # Create the pirouette parameter set
  pir_params <- create_pir_params(
    alignment_params = alignment_params,
    twinning_params = twinning_params,
    experiments = experiments,
    error_measure_params = error_measure_params,
    evidence_filename = evidence_filename,
    verbose = verbose
  )

  # Run that experiment on a continuous integration service,
  # only when BEAST2 is unstalled
  if (rappdirs::app_dir()$os != "win" &&
    beautier::is_on_ci() && beastier::is_beast2_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)
  }
}

richelbilderbeek/pirouette documentation built on Oct. 18, 2023, 3:09 p.m.