Last data update: 2014.03.03

R: Plot distinct rate shift configurations on a phylogeny
plot.bammshiftsR 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)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(BAMMtools)
Loading required package: ape
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/BAMMtools/plot.bammshifts.Rd_%03d_medium.png", width=480, height=480)
> ### Name: plot.bammshifts
> ### Title: Plot distinct rate shift configurations on a phylogeny
> ### Aliases: plot.bammshifts
> 
> ### ** Examples
> 
> data(whales, events.whales)
> 
> ed <- getEventData(whales, events.whales, burnin=0.25, nsamples=500)
Processing event data from data.frame

Discarded as burnin: GENERATIONS <  2495000
Analyzing  500  samples from posterior

Setting recursive sequence on tree...

Done with recursive sequence

> 
> sc <- distinctShiftConfigurations(ed, expectedNumberOfShifts = 1,
+                                   threshold = 5)
> 
> plot(sc, ed)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>