ape (version 4.0)

collapsed.intervals: Collapsed Coalescent Intervals

Description

This function takes a "coalescentIntervals" objects and collapses neighbouring coalescent intervals into a single combined interval so that every collapsed interval is larger than epsilon. Collapsed coalescent intervals are used, e.g., to obtain the generalized skyline plot (skyline). For epsilon = 0 no interval is collapsed.

Usage

collapsed.intervals(ci, epsilon=0)

Arguments

ci
coalescent intervals (i.e. an object of class "coalescentIntervals").
epsilon
collapsing parameter that controls the amount of smoothing (allowed range: from 0 to ci$total.depth)

Value

An object of class "collapsedIntervals" with the following entries:

Details

Proceeding from the tips to the root of the tree each small interval is pooled with the neighboring interval closer to the root. If the neighboring interval is also small, then pooling continues until the composite interval is larger than epsilon. Note that this approach prevents the occurrence of zero-length intervals at the present. For more details see Strimmer and Pybus (2001).

References

Strimmer, K. and Pybus, O. G. (2001) Exploring the demographic history of DNA sequences using the generalized skyline plot. Molecular Biology and Evolution, 18, 2298--2305.

See Also

coalescent.intervals,skyline.

Examples

Run this code
data("hivtree.table") # example tree
# colescent intervals from vector of interval lengths
ci <- coalescent.intervals(hivtree.table$size)
ci
# collapsed intervals
cl1 <- collapsed.intervals(ci,0)
cl2 <- collapsed.intervals(ci,0.0119)
cl1
cl2

Run the code above in your browser using DataLab