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 bammshifts.

ephy

An object of class bammdata.

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 plot.bammdata.

rank

The rank of the core shift configuration to plot. For the default (NULL) a random configuration is chosen.

index

The posterior sample to plot. For the default (NULL) a random sample is chosen.

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 ephy$type = "trait".

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 assignColorBreaks.

color.interval

Min and max value for the mapping of rates. One of the two values can be NA. See details in plot.bammdata for further details.

JenksSubset

If breaksmethod = "jenks", the number of regularly-spaced samples to subset from the full rates vector. Only relevant for large datasets. See help file for assignColorBreaks.

...

Other arguments to plot.bammdata.

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

http://bamm-project.org/

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)

[Package BAMMtools version 2.1.11 Index]