get_posterior_tree: Extract a BEAST2 posterior tree from a file

Description Usage Arguments Value Author(s) Examples

Description

Extract a BEAST2 posterior tree from a file

Usage

1
get_posterior_tree(file, sti, ai, pi, si)

Arguments

file

A loaded parameter file

sti

the species tree index, a value from 1 to and including 2

ai

the alignment index, the ai-th alignment of that species tree, a value from 1 to and including the number of alignments per species tree

pi

the posterior index, the pi-th posterior of that alignment, a value from 1 to and including the number of posteriors per alignment

si

the posterior state index, the si-th state in the posterior, a value from 1 to and including the number of posterior states per posterior

Value

the posterior

Author(s)

Richel Bilderbeek

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
  # Read a file with one or more posteriors
  file <- read_file(find_path("toy_example_1.RDa"))
  # Pick the indices of the posterior to extract
  sti  <- 1 # Species tree index
  ai   <- 1 # Alignment index
  pi   <- 1 # Posterior index
  si   <- 1 # Posterior state index
  # Extract the posterior
  tree <- get_posterior_tree(file = file, sti = sti, ai = 1, pi = 1, si = 1)
  # Check that it is indeed a phylogeny
  testit::assert(ribir::is_phylogeny(tree))

richelbilderbeek/wiritttes documentation built on May 27, 2019, 8:14 a.m.