mcmc2densitree | R Documentation |
Plot a densi-tree from an MCMC sample from a BPP or MCMCTree analysis
mcmc2densitree(
tree,
mcmc,
time.name,
thin,
col = "blue",
alpha = 1,
y.offset = 0,
pfract = 0.1,
plot.labels = TRUE,
axis = TRUE,
add = FALSE,
tip.ages = NULL
)
tree |
an object of class phylo. |
mcmc |
data frame with an MCMC sample from MCMCTree or a BPP A00 analysis. |
time.name |
character vector of length one. |
thin |
numeric, the fraction of MCMC samples to keep. |
col |
character, the color for branches. |
alpha |
numeric, between 0 and 1, the branch color transparency. |
y.offset |
numeric, the vertical offset for plotting the tree. |
pfract |
numeric, how much of the plotting space to used for plotting
the tip labels. If |
plot.labels |
logical, whether to plot the tip labels. Ignored if
|
axis |
logical, whether to plot the x axis. |
add |
logical, if TRUE add the trees to an existing plot, otherwise create a new plot. |
tip.ages |
numeric, the ages of the tips, with the most recent tip
having age zero, and the oldest tip having the largest age. If |
The function will reduce the MCMC sample to dim(mcmc)[1] *
thin
observations. Then the node ages in each observarion are used to plot
each tree in the sample. For a tree with s
species. The y
coordinates of the tips are given by 0:(s - 1) + y.offset
.
The tree
must be rooted, strictly bifurcating, and be the same tree
used to genarate the BPP (A00) or MCMCTree MCMC samples.
Mario dos Reis
data(microcebus)
mcmc2densitree(microcebus$tree, microcebus$mcmc, time.name="tau_", thin=0.05,
alpha=0.01, col="blue")
title(xlab="Distance (substitutions per site)")
data(hominids)
# Calibrate the hominid phylogeny with a uniform fossil calibration of
# between 6.5 to 10 Ma for the human-chimp divergence, and plot the
# calibrated sample
calmsc <- msc2time.t(mcmc=hominids$mcmc, node="7humanchimp", calf=runif,
min=6.5, max=10)
mcmc2densitree(hominids$tree, calmsc, "t_", thin=0.05, alpha=0.01)
title(xlab="Divergence time (Ma)")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.