plot.phylo.HPD: plot.phylo.HPD

Description Usage Arguments Details Value See Also Examples

View source: R/plot.phylo.HPD.R

Description

This function plots a phylo BEAST tree read by read.annot.beast with its 95 intervals and adds a x-axis scale.

Usage

1
2
3
plot.phylo.HPD(x, nodes = NULL, pb = FALSE, bar.width = 0.3,
  bar.col = NA, border = NULL, at = NULL, minor = NULL,
  vline = TRUE, ...)

Arguments

x

annotated phylo object

nodes

a vector with node numbers to plot. Default is NULL

pb

TRUE if the tree is a chronogram from PhyloBayes with HPD

bar.width

fraction of 1 for bar thickness

bar.col

bar color

border

if bar borders should be drawn. See ?rect.

vline

add a vertical lines (default: TRUE)

...

further arguments passed by phylo.plot

Details

** Now includes support for PhyloBayes chronograms **

Value

plot

See Also

plot.phylo rect

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
file <- system.file("data/mcc.tre", package="rBt")
tr <- read.annot.beast(file)
# plot HPD heights on all nodes:
plot.phylo.HPD(tr, cex=0.5, bar.width=0.4, bar.col="red", border=NA)
# with library(scales) for transparency
# plot.phylo.HPD(tr, cex=0.5, bar.width=0.4, bar.col=alpha("red",0.5), border=NA)
# plot HPD heights on specific nodes:
tips <- tr$tip.label
tipsfac <- factor(sapply(tips, function(x) strsplit(x, "__")[[1]][1] ))
names(tipsfac) <- NULL
tipslist <- split(tips, tipsfac)
allanc <- c(unlist(sapply(tipslist, function(x, y=tr) Ancestors(tr, which.node(y, x)) )), 
            sapply(tipslist, function(x) which.node(tr, x)))
allanc <- sort(allanc)
allanc <- allanc[ !duplicated(allanc) ]
names(allanc) <- NULL
plot.phylo.HPD(tr, cex=0.5, bar.width=0.4, bar.col="red", border=NA, nodes=allanc)

santiagosnchez/rBt documentation built on Aug. 9, 2021, 11:52 p.m.