Learn R Programming

ips (version 0.0-7)

mrbayes: Bayesian MCMC Tree Search with MrBayes

Description

This function is a wrapper for Bayesian phylogenetic tree search through MrBayes (Ronquist & Huelsenbeck, 2003) with either DNA (mrbayes) or morphological (mrbayes.mixed) data.

Usage

mrbayes(x, file = "", nst = 6, rates = "invgamma", ngammacat = 4, 
    nruns = 2, ngen = 1e+06, printfreq = 100, samplefreq = 10, 
    nchains = 4, savebrlens = "yes", temp = 0.2, burnin = 10, 
    contype = "allcompat", run = FALSE)

mrbayes.mixed(x, file, nst = 6, rates = "invgamma", ngammacat = 4, nruns = 2, ngen = 1e+06, printfreq = 100, samplefreq = 10, nchains = 4, savebrlens = "yes", temp = 0.2, burnin = 10, contype = "allcompat", run = TRUE)

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.

nst

An integer giving the number of rates in the model of sequence evolution.

rates

A character string; allowed are "equal", "gamma", "propinv", "invgamma", and "adgamma"; the default is "equal".

ngammacat

An integer; the number rate categories for the discretized Gamma distribution; the default is 4.

nruns

An integer; the number of runs.

ngen

An integer; the number of states of the MCMC.

printfreq

An integer; the interval between states of the MCMC to be printed on the screen

samplefreq

An integer; the interval between states of the MCMC to be sampled.

nchains

An integer; number of Metropolis coupled MCMCs in each run.

savebrlens

Logical; shall branch lengths be saved.

temp

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).

run

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

Value

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

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.

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

Run this code
# NOT RUN {
# DNA sequence data:
# ------------------
data(ips.cox1)
x <- ips.cox1[, 100:140] # tiny alignment

# print NEXUS file with MrBayes block to working directory
# --------------------------------------------------------
mrbayes(x, file = "", ngen = 100, run = FALSE)
    
# }

Run the code above in your browser using DataLab