Learn R Programming

phybreak (version 0.2.0)

plot.phybreak: Plotting a phybreak object.

Description

Plots a phybreak-object twice: (1) as transmission tree and (2) as phylogenetic tree, using the default graphical parameters of plotTrans and plotPhylo. The default is to plot the current state, but any posterior sample can be chosen, as well as various consensus trees. Consensus tree "edmonds" plots only a transmission tree, consensus tree "mcc" only a phylogenetic tree.

Usage

# S3 method for phybreak
plot(x, plot.which = c("sample", "edmonds", "mpc", "mtcc",
  "mcc"), samplenr = 0, ...)

Arguments

x

An object of class phybreak.

plot.which

Either "sample" to plot the current state or a selected posterior sample, "mpc" or "mtcc" to plot a consensus transmission tree (see transtree) or "mcc" to plot the maximum clade credibility tree (see phylotree).

samplenr

If plot.which = "sample", this indicates which posterior tree should be plotted: samplenr = 0 to plot the current state.

...

Some methods for this generic require additional arguments. None are used in this method.

References

Klinkenberg et al. (2017) Simultaneous inference of phylogenetic and transmission trees in infectious disease outbreaks. PLoS Comput Biol, 13(5): e1005495.

Examples

Run this code
# NOT RUN {
#First build a phybreak-object containing samples.
simulation <- sim.phybreak(obsize = 5)
MCMCstate <- phybreak(data = simulation$sequences, times = simulation$sample.times)
MCMCstate <- burnin.phybreak(MCMCstate, ncycles = 20)
MCMCstate <- sample.phybreak(MCMCstate, nsample = 50, thin = 2)

plot(MCMCstate, plot.which = "mpc")
# }

Run the code above in your browser using DataLab