getBranchShiftPriors {BAMMtools}R Documentation

Compute prior odds of a rate shift on each branch of a phylogeny from BAMM output

Description

Computes the prior probability of a rate shift event for each branch. These results are important for identifying topological rate shift locations on phylogenies with marginal probabilities that exceed those predicted under the prior alone.

Usage

getBranchShiftPriors(phy, expectedNumberOfShifts)

Arguments

phy

An object of class phylo.

expectedNumberOfShifts

The expected number of shifts under the prior.

Details

This function computes the prior odds on the distribution of numbers of rate shift events per branch under the prior. It returns an object which is nothing more than a copy of the original phylogenetic tree but where each branch length has been replaced by the prior probability of a rate shift on each branch.

The significance of this function is that it lets us explicitly determine which branches have shift probabilities that are elevated relative to the prior expectation.

Value

A class phylo with all the components of the original class phylo object, with the following changes:

edge.length

Branch lengths now represent the prior probability of a rate shift on each branch.

Author(s)

Dan Rabosky

References

http://bamm-project.org/

See Also

distinctShiftConfigurations, plot.bammshifts, summary.credibleshiftset, plot.credibleshiftset, credibleShiftSet

Examples

data(whales)
prior_tree1 <- getBranchShiftPriors(whales, expectedNumberOfShifts = 1)
prior_tree10 <- getBranchShiftPriors(whales, expectedNumberOfShifts = 10)
# plot prior expectations for branches based on these two counts:
plot(prior_tree1$edge.length ~ prior_tree10$edge.length, xlim=c(0,0.05),
     ylim=c(0,0.05), asp=1)
lines(x=c(0,1), y=c(0,1))

[Package BAMMtools version 2.1.11 Index]