mrbayes: Bayesian MCMC Tree Search with MrBayes

View source: R/mrbayes.R

mrbayesR Documentation

Bayesian MCMC Tree Search with MrBayes

Description

Provides a wrapper for Bayesian phylogenetic tree search through MrBayes (Huelsenbeck & Ronquist, 2001; Ronquist & Huelsenbeck, 2003).

Usage

mrbayes(
  x,
  file = "",
  lset,
  prset,
  mcmc,
  unlink,
  constraint,
  burnin = 10,
  contype = "allcompat",
  exec,
  run = FALSE
)

Arguments

x

An object of class DNAbin in the case of mrbayes or a matrix of mode character in the case of mrbayes.mixed.

file

A character string, giving the name of the MrBayes input file.

lset

A list as returned by mrbayes.prset containing the parameter setting for the prior distirbutions.

prset

A list as returned by mrbayes.prset containing the parameter setting for the prior distributions.

mcmc

A list as returned by mrbayes.mcmc containing the parameter setting for the Markov chain Monte Carlo (MCMC).

unlink

xxx

constraint

xxx

burnin

An integer; the number of samples from the MCMC to be discarded prior to further analysis.

contype

A character string; the type of consensus tree calculated from the posterior distribution of trees: either "halfcompat" (majority-rule consensus tree) or "allcombat" (strict consensus tree).

exec

A character string giving the full path of the MrBayes program.

run

Logical; run = FALSE will only print the NEXUS file, run = TRUE will also start the MCMC runs, if exec is correctly specified.

Details

mrbayes was last updated and tested with MrBayes v3.2.2 under R 3.1.0 on a x86_64-apple-darwin10.8.0 (64-bit) platform. It is intended to offer a simply parameterized building block for larger scripts.

Value

None; a NEXUS file with MrBayes block is written to a file and, if run = TRUE, the MCMC runs in MrBayes are started.

References

J. P. Huelsenbeck & Ronquist F. 2001. MrBayes: Bayesian inference of phylogenetic trees. Bioinformatics 17: 754-755. Ronquist F. & J. P. Huelsenbeck. 2003. MrBayes 3: Bayesian phylogenetic inference under mixed models. Biometrics 19: 1572-1574. MrBayes website: http://mrbayes.sourceforge.net/.

See Also

mafft and prank for sequence alignment; raxml for maximum likelihood tree search.

Examples

data(ips.cox1)
x <- ips.cox1[, 100:140] # tiny alignment
mrbayes(x, file = "", mcmc = mrbayes.mcmc(ngen = 100), run = FALSE)
## Not run: 
library(phangorn)
tree <- rtree(10)
Y1 <- simSeq(tree, l = 20)
Y2 <- simSeq(tree, l = 20, type = "USER", levels=c("0", "1"))
Y <- cbind(as.character(Y1), as.character(Y2))

## End(Not run)

heibl/ips documentation built on April 18, 2024, 11:59 p.m.