]> git.donarmstrong.com Git - ape.git/blob - man/collapsed.intervals.Rd
new code for reading FASTA files
[ape.git] / man / collapsed.intervals.Rd
1 \name{collapsed.intervals}
2 \alias{collapsed.intervals}
3
4 \title{Collapsed Coalescent Intervals}
5 \usage{
6 collapsed.intervals(ci, epsilon=0)
7 }
8 \arguments{
9   \item{ci}{coalescent intervals (i.e. an object of class \code{"coalescentIntervals"}).}
10   \item{epsilon}{collapsing parameter that controls the amount of smoothing
11   (allowed range: from \code{0} to \code{ci$total.depth})}
12 }
13 \description{
14  This function takes a \code{"coalescentIntervals"} objects and collapses neighbouring
15  coalescent intervals into a single combined interval so that every collapsed interval is
16  larger than \code{epsilon}. Collapsed coalescent intervals are used, e.g., to obtain the
17  generalized skyline plot (\code{\link{skyline}}). For \code{epsilon = 0} no interval
18  is collapsed.
19 }
20 \details{
21 Proceeding from the tips to the root of the tree each small
22 interval is pooled with the neighboring interval closer to the root. If the
23 neighboring interval is also small, then pooling continues until the composite
24 interval is larger than \code{epsilon}. Note that this approach prevents the
25 occurrence of zero-length intervals at the present.
26 For more details see Strimmer and Pybus (2001).
27 }
28
29 \value{
30 An object of class \code{"collapsedIntervals"} with the following entries:
31
32   \item{lineages}{ A vector with the number of lineages at the start of each coalescent
33     interval.}
34   \item{interval.length}{ A vector with the length of each coalescent
35     interval.}
36    \item{collapsed.interval}{A vector indicating for each coalescent interval to which
37      collapsed interval it belongs.}
38   \item{interval.count}{ The total number of coalescent
39     intervals.}
40    \item{collapsed.interval.count}{The number of collapsed intervals.}
41   \item{total.depth}{ The sum of the lengths of all coalescent
42     intervals.}
43   \item{epsilon}{The value of the underlying smoothing parameter.}
44 }
45
46 \author{Korbinian Strimmer (\url{http://www.stat.uni-muenchen.de/~strimmer/})}
47
48 \seealso{
49 \code{\link{coalescent.intervals}},\code{\link{skyline}}.
50 }
51
52
53 \references{
54   Strimmer, K. and Pybus, O. G. (2001) Exploring the demographic history
55   of DNA sequences using the generalized skyline plot. \emph{Molecular
56     Biology and Evolution}, \bold{18}, 2298--2305.
57 }
58
59 \examples{
60 data("hivtree.table") # example tree
61
62 # colescent intervals from vector of interval lengths
63 ci <- coalescent.intervals(hivtree.table$size)
64 ci
65
66 # collapsed intervals
67 cl1 <- collapsed.intervals(ci,0)
68 cl2 <- collapsed.intervals(ci,0.0119)
69
70 cl1
71 cl2
72
73 }
74 \keyword{manip}