pir_to_pics: Create all pictures created by the pirouette pipeline

View source: R/pir_to_pics.R

pir_to_picsR Documentation

Create all pictures created by the pirouette pipeline

Description

These are the files created:

  • true_tree.png the true/given phylogeny

  • true_alignment.png the alignment simulated from the true/given phylogeny

  • twin_tree.png the twin tree [1]

  • twin_alignment.png the alignment simulated from the twin phylogeny

  • true_posterior_gen.png the phylogenies of the Bayesian posterior, using a generative inference model, based on the alignment based on the true tree

  • twin_posterior_gen.png the phylogenies of the Bayesian posterior, using a generative inference model, based on the alignment based on the twin tree

  • true_error_histogram_gen.png the errors between the Bayesian posterior and true/given tree, using a generative inference model, plotted as a histogram

  • twin_error_histogram_gen.png the errors between the Bayesian posterior and twin tree, using a generative inference model, plotted as a histogram

  • true_error_violin_gen.png the errors between the Bayesian posterior and true/given tree, using a generative inference model, plotted as a violin plot

  • twin_error_violin_gen.png the errors between the Bayesian posterior and twin tree, using a generative inference model, plotted as a violin plot

  • true_posterior_best.png the phylogenies of the Bayesian posterior, using the best candidate inference model, based on the alignment based on the true tree

  • twin_posterior_best.png the phylogenies of the Bayesian posterior, using the best candidate inference model, based on the alignment based on the twin tree

  • true_error_histogram_best.png the errors between the Bayesian posterior and true/given tree, using the best candidate inference model, plotted as a histogram

  • twin_error_histogram_best.png the errors between the Bayesian posterior and twin tree, using the best candidate inference model, plotted as a histogram

  • true_error_violin_best.png the errors between the Bayesian posterior and true/given tree, using the best candidate inference model, plotted as a violin plot

  • twin_error_violin_best.png the errors between the Bayesian posterior and twin tree, using the best candidate inference model, plotted as a violin plot

Items marked [1] are created dependent on the setup.

Usage

pir_to_pics(
  phylogeny,
  pir_params,
  consensus = rev(sort(phylogeny$tip.label)),
  folder = tempdir()
)

Arguments

phylogeny

a phylogeny of class phylo

pir_params

the parameters of pirouette. They are created by create_pir_params.

consensus

the order of which the taxon labels are plotted

folder

folder where the files are stored in. By default, this is a temporary folder

Value

the names of all files created

Author(s)

Richèl J.C. Bilderbeek

Examples

if (beautier::is_on_ci()) {

  phylogeny <- ape::read.tree(text = "((A:1, B:1):1, C:2);")

  pir_params <- create_test_pir_params(
    twinning_params = create_twinning_params()
  )

  if (rappdirs::app_dir()$os != "win" &&
    beautier::is_on_ci() && beastier::is_beast2_installed()
  ) {

    pir_out <- pir_run(phylogeny = phylogeny, pir_params = pir_params)

    folder <- tempdir()
    expected_filenames <- c(
      file.path(folder, "true_tree.png"),
      file.path(folder, "true_alignment.png"),
      file.path(folder, "twin_tree.png"),
      file.path(folder, "twin_alignment.png"),
      file.path(folder, "true_posterior_gen.png"),
      file.path(folder, "twin_posterior_gen.png"),
      file.path(folder, "true_error_histogram_gen.png"),
      file.path(folder, "twin_error_histogram_gen.png"),
      file.path(folder, "true_error_violin_gen.png"),
      file.path(folder, "twin_error_violin_gen.png")
    )

    # created_filenames are the filenames of the pictures
    created_filenames <- pir_to_pics(
      phylogeny = phylogeny,
      pir_params = pir_params,
      folder = folder
    )

  }
}

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