Description Usage Arguments Details Author(s) References Examples
View source: R/plotPhyloTrans.R
Plots a phybreak
-object as a transmission tree with coloured phylogenetic trees for each host. The default
is to plot the current state, but any posterior sample can be chosen, as well as various consensus trees.
1 2 3 4 5 6 7 8 9 10 11 12 13 | plotPhyloTrans(x, plot.which = c("sample", "mpc", "mtcc", "mcc"),
samplenr = 0, select.how = "trees", select.who = "index",
showmutations = FALSE, mar = 0.1 + c(4, 0, 0, 0), tree.lwd = 1,
tree.col = NULL, hostlabel = TRUE, hostlabel.cex = NULL,
hostlabel.pos = "adjacent", hostlabel.col = tree.col,
samplelabel = FALSE, samplelabel.cex = NULL,
samplelabel.pos = "right", samplelabel.col = tree.col,
mutationlabel = FALSE, mutationlabel.cex = NULL,
mutationlabel.pos = "right", label.space = 0.15,
host.col = tree.col, host.alpha = 0.2, cline.lty = 3,
cline.lwd = 1, cline.col = "black", cpoint.pch = 20,
cpoint.cex = 1, cpoint.col = tree.col, xlab = "Time",
axis.cex = 1, title.cex = 1, ...)
|
x |
An object of class |
plot.which |
Either |
samplenr |
If |
select.how |
Method to select subset of hosts to plot, in combination with
|
select.who |
Vector of hosts used to select subset of hosts to plot, in combination with |
mar |
Plot margins. |
tree.lwd |
Line width of phylogenetic trees. |
tree.col |
Colours of the host phylogenetic trees. Defaults to evenly spaced hues in |
hostlabel |
Whether to print the host names. |
hostlabel.cex |
Size of host names. Defaults to a value between 0.5 and 1 depending on outbreak size. |
hostlabel.pos |
Position of host names, either just right from the host's phylogenetic tree,
or aligned at the right hand side of the plot ( |
hostlabel.col |
Colours of the host names. Defaults to same as tree colours. |
samplelabel |
Whether to print the sample names. |
samplelabel.cex |
Size of sample names. Defaults to a value between 0.4 and 0.8 depending on outbreak size. |
samplelabel.pos |
Position of sample names, either just right from the host's phylogenetic tree,
or aligned at the right hand side of the plot ( |
samplelabel.col |
Colours of the sample names. Defaults to same as tree colours, matching the host. |
mutationlabel |
Whether to print the number of mutations on each edge in the phylogenetic trees,
calculated with parsimony reconstruction using |
mutationlabel.cex |
Size of mutation labels. Defaults to same as sample label. |
mutationlabel.pos |
Position of mutation label on edge. Default is |
label.space |
Scales the space at the right-hand side to place the host and sample names. |
host.col |
Colour of shading behind the host phylogenetic trees. Defaults to same as tree colours. |
host.alpha |
Transparancy of shading behind the host phylogenetic trees. |
cline.lty |
Line type of vertical lines showing the transmission contacts. |
cline.lwd |
Line width of vertical lines showing the transmission contacts. |
cline.col |
Colour of vertical lines showing the transmission contacts. If |
cpoint.pch |
Character |
cpoint.cex |
Size of transmission contact points. |
cpoint.col |
Colour of points indicating the transmission contacts, associated with the secondary case, both at the tips and roots of the phylogenetic trees. Defaults to same as tree colours. |
xlab |
X-axis title. |
axis.cex |
Size of tick labels. |
title.cex |
Size of X-axis title. |
... |
Further graphical parameters (see details). |
Graphical parameters can be added by using names in the format prefix.parameter
for the
different parts of the plot. The parameter
will then be passed on to the appropriate
graphics function, e.g. tree.lty
to change the line type of the phylogenetic tree. The following
prefixes can be used: tree
for the phylogenetic trees, hostlabel
for the host names,
samplelabel
for the sample names, host
for the host's shading areas, cline
for
the vertical contact lines, cpoint
for the transmission contact points, axis
for
the X-axis, and title
for the X-axis title.
Don Klinkenberg don@xs4all.nl
Klinkenberg et al. (2017) Simultaneous inference of phylogenetic and transmission trees in infectious disease outbreaks. PLoS Comput Biol, 13(5): e1005495.
1 2 3 4 5 6 7 | #First build a phybreak-object containing samples.
simulation <- sim_phybreak(obsize = 5)
MCMCstate <- phybreak(dataset = simulation)
MCMCstate <- burnin_phybreak(MCMCstate, ncycles = 20)
MCMCstate <- sample_phybreak(MCMCstate, nsample = 50, thin = 2)
plot(MCMCstate, plot.which = "mpc")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.