Description Usage Arguments Value Author(s) See Also Examples
This function is intented for a graphical comparison of phylogenetic trees stored as objects of class phylo
. First, trees are pruned to those terminal nodes, which are shared by both trees. Second, the first tree is displayed on the current graphical device and the presence of each of its clades in the second tree is displayed as a colored internal nodelabel. Finally, if trees are ultrametric, time shift of internal nodes present in both phylogenies will be shown by colored arrows.
1 2 | compare.phylo(x, y, ts = "arrow", threshold, presCol = "green",
absCol = "red", tsCol = "blue", pch, pcex, tipcex, plottype, ...)
|
x |
An object of class |
y |
An object of class |
ts |
Either |
threshold |
Numeric: |
presCol |
A character string giving the coloring for internal nodes present in both trees; defaults to |
absCol |
A character string giving the coloring for internal nodes present in |
tsCol |
A character string giving color for arrows displaying the time shift of internal nodes.; defaults to |
pch |
Either an integer specifying a symbol or a single character defining the shape of the internal node labels. See |
pcex |
A real number giving the character expansion for the symbol: see |
tipcex |
A real number giving the character expansion for the tip labels: see |
plottype |
A character string: default behaviour is achieved with any string except for (1) |
... |
Graphical parameters such as |
None; the results are plotted on the current graphical device
Christoph Heibl
all.equal.phylo
: S3 method for global comparison of class phylo
objects.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | # 2 phylogenetic trees of Vipera
# ------------------------------
data(vipera)
# Have a look at both trees individually
# --------------------------------------
plot.phylo(vipera.bayes)
plot.phylo(vipera.ml)
# ... and compare them:
# --------------------
compare.phylo(vipera.bayes, vipera.ml, pcex = 1.5, lwd = 2)
# create modified Bayesian tree
# -----------------------------
vipera.modified <- shiftNodeAge(vipera.bayes, 14, 0.02)
vipera.modified <- shiftNodeAge(vipera.modified, 13, -0.03)
vipera.modified$tip.label[3:4] <- vipera.modified$tip.label[4:3]
# ... and again compare them:
# ---------------------------
compare.phylo(vipera.bayes, vipera.modified, pcex = 1.5, lwd = 2)
# use of the 'plot' argument:
# ---------------------------
compare.phylo(vipera.bayes, vipera.modified, pcex = 1.5, lwd = 2,
plot = "invisible")
# HPDbars(vipera.bayes) # tree has no HPD summary
box.clades(vipera.bayes, nodes = 15, border = "grey60")
compare.phylo(vipera.bayes, vipera.modified, pcex = 1.5, lwd = 2,
plot = "upon")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.