ReadMrBayesTrees: Read posterior tree sample produced by MrBayes

View source: R/ReadMrBayes.R

ReadMrBayesTreesR Documentation

Read posterior tree sample produced by MrBayes

Description

Read posterior trees from 'MrBayes' output files, discarding burn-in generations.

Usage

ReadMrBayesTrees(filepath, n = NULL, burninFrac = NULL)

ReadMrBayes(filepath, n = NULL, burninFrac = NULL)

MrBayesTrees(filepath, n = NULL, burninFrac = NULL)

Arguments

filepath

character string specifying path to .nex input file used to initialize the MrBayes analysis, relative to the R working directory (visible with getwd()).

n

Integer specifying number of trees to sample from posterior.

burninFrac

Fraction of trees to discard from each run as burn-in. If NULL (the default), this will be read from the last mcmc or mcmcp command in filepath.

Details

ReadMrBayesTrees() samples trees from the posterior distributions computed using the Bayesian inference software 'MrBayes'

Value

ReadMrBayesTrees() returns a 'multiPhylo' object containing n trees sampled evenly from all runs generated by analysis of filepath, or NULL if no trees are found.

Author(s)

Martin R. Smith (martin.smith@durham.ac.uk)

See Also

Other tree import functions: ReadTntTree()

Examples

## Not run:  # Download will take a few seconds
  url <- 
  "https://raw.githubusercontent.com/ms609/hyoliths/master/MrBayes/hyo.nex"
  trees <- ReadMrBayesTrees(url, n = 40)
  plot(Consensus(trees, p = 0.5))

## End(Not run)

TreeTools documentation built on June 22, 2024, 9:27 a.m.