node.support: Visualizing Node Support on Phylogenetic Trees

Description Usage Arguments Note Author(s) See Also Examples

Description

This function plots support values on phylogenetic trees drawn with plot.phylo. Support values above a given cut-off value can be depicted as numbers, colored dots, or thickened branches.

Usage

1
2
node.support(x, transfer, cutoff = 0, digits, mode = "numbers", font = 2, 
	pos = "pretty", cex = 0.8, col, legend = FALSE, node, ...)

Arguments

x

A vector of mode "numeric" containing node support values.

transfer

A list containing the two objects of class "phylo"; the first be the source tree, where x is taken from, the second being the target tree on which x will be plotted.

cutoff

A numeric, only support values >= cutoff will be considered for plotting.

digits

an integer giving the number of digits (see round)

mode

Either "numbers", "dots", or "edges" indicating the way how node support will be plotted (see Examples).

font

Fonts to be used for if mode = "numbers": 1 corresponds to plain text (the default), 2 to bold face, 3 to italic, and 4 to bold italic.

pos

Position of text if mode = "numbers": "above" or "below" the subtending edge or to the "right" of the node; if pos = "pretty", text is positioned in a way that tries to minimize touching or intersecting edges.

cex

A numeric giving font size, dot size, or thickness of braches depending on the choice of the mode argument.

col

A character string, giving one or more colors, depending on the choice of the mode argument.

legend

Logical, if TRUE and mode = "numbers" a legend is added to the plot.

node

A vector of integers giving the number of nodes for which support will displayed; default is all interior nodes.

...

Further graphical parameters (from par).

Note

node.support requires a previous call of plot.phylo in order to work.

The transfer argument has worked well with example cases I could think of, but has not been tested thoroughly with real data, so be careful and double-check the resulting output.

Author(s)

Natalie Cusimano, modified by Christoph Heibl

See Also

plot.phylo, raxml

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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# phylogenetic tree of wild barley
# --------------------------------
data(hordeum)
hordeum$tip.label <- gsub("H[a-z]+", "H._", hordeum$tip.label)

# plot tree and posterior node support 
# settingchange color, cut-off, and position:
# -------------------------------------------
plot(hordeum)
node.support(hordeum$posterior, cutoff = 0.9, pos = "right",
	col = "red")
	
# you can display up to three support values:
# -------------------------------------------
plot(hordeum)
node.support(hordeum $posterior, cutoff = 0.9, pos = "right",
	col = "red", font = 2)
node.support(hordeum $posterior, cutoff = 0.9, pos = "above",
	col = "blue", font = 1)
node.support(hordeum $posterior, cutoff = 0.9, pos = "below",
	col = "green", font = 3)
	
# the pretty option of the position argument:
# -------------------------------------------
plot(hordeum)
node.support(hordeum $posterior, pos = "pretty")
	
# display support as colored nodes ...
# ...by omitting nodes below threshold
# ------------------------------------
plot(hordeum)
node.support(hordeum $posterior, cutoff = 0.9, mode = "dots",
    col = "black")
# ... or with two colors:
# -----------------------
plot(hordeum)
node.support(hordeum $posterior, cutoff = 0.9, mode = "dots",
    col = c("black", "red"))
    
# display support as bold edges:
# ------------------------------
plot(hordeum)
node.support(hordeum $posterior, cutoff = 0.9, mode = "edges",
    col = "black", cex = 5)	
		
# display support values from a different source tree
# on a target tree:
# -----------------
data(vipera)
# plot maximum likelyhood tree and add 
# bootstrap values from the same tree:
# ------------------------------------
plot(vipera.ml)
node.support(vipera.ml$node.label, pos = "above")
# now transfer posterior probabilities 
# from a Bayesian tree:
# ---------------------
node.support(vipera.bayes$node.label, 
    transfer = list(vipera.bayes, vipera.ml), pos = "below")
    
# this would have been the result without 
# using the transfer argument:
# ----------------------------
node.support(vipera.bayes$node.label, col = "red", pos = "right")	

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