compare.phylo: Compare PHYLO Objects Graphically

Description Usage Arguments Value Author(s) See Also Examples

Description

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.

Usage

1
2
compare.phylo(x, y, ts = "arrow", threshold, presCol = "green", 
     absCol = "red", tsCol = "blue", pch, pcex, tipcex, plottype, ...)

Arguments

x

An object of class phylo.

y

An object of class phylo to be compared to x.

ts

Either "arrow" or "numbers". In the first case time shift of nodes is depicted by arrows, in the second case the amount and direction of the time shift is printed as a real number onto the internal nodes.

threshold

Numeric: threshold is the fraction of the root age below which node time shift are not plotted; defaults to 1 percent of the age of the root.

presCol

A character string giving the coloring for internal nodes present in both trees; defaults to "green".

absCol

A character string giving the coloring for internal nodes present in x, but absent in y; defaults to "red".

tsCol

A character string giving color for arrows displaying the time shift of internal nodes.; defaults to "blue".

pch

Either an integer specifying a symbol or a single character defining the shape of the internal node labels. See points for possible values and their interpretation. Note that only integers and single-character strings can be set as a graphics parameter (and not NA nor NULL).

pcex

A real number giving the character expansion for the symbol: see par; default: 1.

tipcex

A real number giving the character expansion for the tip labels: see par; default: 1.

plottype

A character string: default behaviour is achieved with any string except for (1) plot == invisible: nothing is plotted, only the ploting device is prepared; (2) plot == invisible: the plot is issued upon existing plots (e.g. HPD bars) in the graphical device (see plot.phylo.upon).

...

Graphical parameters such as lwd: see par.

Value

None; the results are plotted on the current graphical device

Author(s)

Christoph Heibl

See Also

all.equal.phylo: S3 method for global comparison of class phylo objects.

Examples

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

fmichonneau/phyloch documentation built on May 16, 2019, 1:45 p.m.