create_twinning_params: Create the parameters for the twinning simulation

View source: R/create_twinning_params.R

create_twinning_paramsR Documentation

Create the parameters for the twinning simulation

Description

The site model and clock models will be used and their combination will be called the generative model of the twinning.

Usage

create_twinning_params(
  rng_seed_twin_tree = 0,
  sim_twin_tree_fun = get_sim_bd_twin_tree_fun(),
  rng_seed_twin_alignment = 0,
  sim_twal_fun = get_sim_twal_with_std_nsm_fun(),
  twin_tree_filename = to_twin_filename(get_temp_tree_filename()),
  twin_alignment_filename = to_twin_filename(get_temp_fasta_filename()),
  twin_evidence_filename = NA
)

Arguments

rng_seed_twin_tree

the random number generator seed as used in the simulation of a twin tree

sim_twin_tree_fun

function to simulate a twin tree with. This function must have one argument called phylogeny of type phylo and have a return type of type phylo as well.

Some standard functions:

  • Use create_sim_yule_twin_tree_fun to use a Yule (aka Pure Birth) process

  • Use create_copy_twtr_from_true_fun to for a function that copies the true tree

  • Use get_sim_bd_twin_tree_fun to use a Birth-Death process

rng_seed_twin_alignment

the random number generator seed as used in the simulation of a twin alignment

sim_twal_fun

function to simulate a twin alignment with. This function must have two arguments called twin_phylogeny (which will hold the twin phylogeny) and true_alignment (which will hold the alignment simulated from the true phylogeny). The return type must be DNAbin.

Use check_sim_twal_fun to verify if the function has the right signature and output.

Some standard functions:

  • Use get_copy_tral_fun to get a function (copy_true_alignment) that copies a true to alignment to create a twin alignment

  • Use get_sim_twal_with_std_nsm_fun to get a function (sim_twal_with_std_nsm) that simulates a twin alignment using a standard site model

  • Use get_sim_twal_same_n_muts_fun to get a function (sim_twal_with_same_n_mutation) that simulates -using a standard model- a twin alignment with as much mutations compared to the root sequence as the true alignment has

  • Use sim_twal_with_lns_nsm that simulates a twin alignment using a linked node substitution model

  • Use sim_twal_with_uns_nsm that simulates a twin alignment using an unlinked node substitution model

twin_tree_filename

name of the (.newick) file the twin tree will be saved to

twin_alignment_filename

name of the FASTA file the twin alignment will be saved to

twin_evidence_filename

filename to store the estimated evidences (aka marginal likelihoods) of the twin tree

Value

a twinning parameter set

Author(s)

Richèl J.C. Bilderbeek, Giovanni Laudanno

Examples

if (beautier::is_on_ci()) {

  twinning_params <- create_twinning_params()

  check_twinning_params(twinning_params)

  pir_params <- create_test_pir_params(
    twinning_params = twinning_params
  )
  check_pir_params(pir_params)

  if (beautier::is_on_ci() &&
    rappdirs::app_dir()$os == "unix" &&
    beastier::is_beast2_installed()) {
    pir_out <- pir_run(
      phylogeny = ape::read.tree(text = "((A:1, B:1):1, C:2);"),
      pir_params = pir_params
    )
  }

}

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