pir_run_twin_tree: Measure the error BEAST2 makes from a phylogeny

View source: R/pir_run_twin_tree.R

pir_run_twin_treeR Documentation

Measure the error BEAST2 makes from a phylogeny

Description

The phylogeny can be the true tree or its twin.

Usage

pir_run_twin_tree(twin_phylogeny, pir_params = create_test_pir_params())

Arguments

twin_phylogeny

a phylogeny of class phylo

pir_params

the parameters of pirouette. They are created by create_pir_params.

Value

a data frame with errors, with as many rows as model selection parameter sets

Author(s)

Richèl J.C. Bilderbeek, Giovanni Laudanno

Examples

if (beautier::is_on_ci() && beastier::is_beast2_installed()) {

  # Create a true phylogeny to simulate the DNA sequences on
  n_taxa <- 5
  set.seed(1)
  phylogeny <- ape::rcoal(n_taxa)

  # Simulate and save the true alignment
  alignment_params <- create_test_alignment_params()
  create_tral_file(
    phylogeny = phylogeny,
    alignment_params = alignment_params
  )

  # Create a twin phylogeny to simulate the DNA sequences on
  set.seed(2)
  twin_phylogeny <- ape::rcoal(n_taxa)
  twinning_params <- create_twinning_params()

  # Simulate and save the twin alignment
  alignment <- create_twal_file(
    twin_phylogeny = twin_phylogeny,
    alignment_params = alignment_params,
    twinning_params = twinning_params
  )

  # Bundle parameters in pir_params
  pir_params <- create_test_pir_params()
  pir_params$alignment_params <- alignment_params
  pir_params$twinning_params <- twinning_params
  pir_params <- init_pir_params(pir_params)

  pir_run_twin_tree(
    twin_phylogeny = twin_phylogeny,
    pir_params = pir_params
  )
}

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