clade.bars: Plot Bars beside Clades in a Phylogeny

Description Usage Arguments Note Author(s) See Also Examples

Description

This functions can be used to highlight clades/lineages in a plot of a phylogenetic tree with bars, possibly accompanied by additional text.

Usage

1
2
3
clade.bars(phy, nodes, bars = TRUE, barcol, barwd, 
    text = NULL, textcol = "black", srt, 
    cex = 1, offset, align, s = "clade", ...)

Arguments

phy

an object of class phylo.

nodes

a vector of mode numeric giving the most recent common ancestor (MRCA) node of the clades to be highlighted. You can use noi to obtain this vector.

bars

logical indicating whether bars should be drawn.

barcol

a vector of mode character giving the color(s) of the bars; will be receycled if appropriate; default is "grey".

barwd

a vector of mode numeric giving the width of bars; will be receycled if appropriate; default is 5.

text

a string giving the text to be plotted to the right of the clade. Can be set to NULL (the default) to omit plotting of text.

textcol

a vector of mode character, giving the color(s) for the text; will be recycled if appropriate.

srt

numeric, the rotation of text in degrees.

cex

numeric character expansion factor; multiplied by par("cex") yield the final character size for text.

offset

a vector of length one or two giving the offset for plotting bars and their labels. If two offset values are given, the first is used for the spacing between tip labels (or other previously plotted elements) and bars, and the second offsets the bar labels from the bars. offset might be of mode "numeric" or "character"; in the latter case the character string's width is determined by string.dim and the result is used for spacing.

align

a vector with two possible values that controls the alignment of bars: "cladewise" finds the position of bars for each clade separately (default), whereas "all" means that bars will be aligned according to the "most evolved" clade, i.e. the clade with the highest root-tip distance.

s

a vector of mode "character": By default clade.bars prints strings in the text argument in italics, except for those given by the s argument.

...

further graphical parameters may also be supplied as arguments.

Note

Do not expect clade.bars to work with all flavors of plot.phylo: Currently, clade.bars works well only with types "phylogram" and "cladogram" in directions "rightwards", "leftwards", and "upwards". Further extensions of the code are always welcome!

Author(s)

Christoph Heibl

See Also

plot.phylo for plotting of phylogenetic trees; box.tips and box.clades for plotting boxes around tips/clades; tip.color and edge.color for coloring tips labels or braches/edges in a plotted tree.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## DATA: phylogentic relationships of bird orders:
## -----------------------------------------------
data(viperidae)
genera <- list("Montivipera", "Macrovipera", "Vipera", "Daboia")
genera.mrca <- noi(viperidae, regex = TRUE, genera)
cls <- c("yellow", "skyblue", "orange", "pink")

## EXAMPLE 1: the defaults
## -----------------------
plot(viperidae)
clade.bars(viperidae, genera.mrca)

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