plot.bammshifts {BAMMtools} | R Documentation |
Plot distinct rate shift configurations on a phylogeny
Description
Plots a random distinct rate shift configuration sampled by
BAMM
on a phylogeny.
Usage
## S3 method for class 'bammshifts'
plot(
x,
ephy,
method = "phylogram",
pal = "RdYlBu",
rank = NULL,
index = NULL,
spex = "s",
legend = TRUE,
add.freq.text = TRUE,
logcolor = FALSE,
breaksmethod = "linear",
color.interval = NULL,
JenksSubset = 20000,
...
)
Arguments
x |
An object of class |
ephy |
An object of class |
method |
A character string for which plotting method to use. "phylogram" uses rectangular coordinates. "polar" uses polar coordinates. |
pal |
The color palette to use in |
rank |
The rank of the core shift configuration to plot. For the
default ( |
index |
The posterior sample to plot. For the default ( |
spex |
A character string indicating what type of macroevolutionary
rates should be plotted. "s" (default) indicates speciation rates, "e"
indicates extinction rates, and 'netdiv' indicates net diversification
rates. Ignored if |
legend |
Logical indicating whether to plot a legend. |
add.freq.text |
A logical indicating whether the frequency of each sampled shift configuration should be added to each plot. |
logcolor |
Logical. Should colors be plotted on a log scale. |
breaksmethod |
Method used for determining color breaks. See help
file for |
color.interval |
Min and max value for the mapping of rates. One of
the two values can be |
JenksSubset |
If |
... |
Other arguments to |
Details
A rate shift configuration is the set of nodes of the phylogeny
where a shift occurs in the macroevolutionary rate dynamic of
diversification or trait evolution. Each posterior sample is a
potentially distinct rate shift configuration. Different
configurations may imply different macroevolutionary scenarios. This
function helps visualize the different distinct rate shift
configurations sampled by BAMM
.
A core shift configuration is defined by a set of nodes that have
shift probabilities that are substantially elevated relative to what
you expect under the prior alone. These core configurations are
inferred in distinctShiftConfigurations
. It is almost
certain that more than one core shift configuration will be sampled by
BAMM
. Moreover, each core shift configuration may contain many
subconfigurations. A subconfiguration contains the core shift node
configuration and zero or more additional shift nodes that occur with
low marginal probability.
Points are added to the branches subtending the nodes of each rate configuration. The size of the point is proportional to the marginal probability that a shift occurs on a specific branch. If the instantaneous rate at a shift's origin represents an initial increase above the ancestral instantaneous rate the point is red. If the instantaneous rate at a shift's origin represents an initial decrease below the ancestral instantaneous rate the point is blue.
Author(s)
Mike Grundler, Dan Rabosky
References
See Also
distinctShiftConfigurations
,
plot.bammdata
Examples
data(whales, events.whales)
ed <- getEventData(whales, events.whales, burnin=0.25, nsamples=500)
sc <- distinctShiftConfigurations(ed, expectedNumberOfShifts = 1,
threshold = 5)
plot(sc, ed)