5 \alias{skylineplot.deluxe}
7 \title{Drawing Skyline Plot Graphs}
9 \method{plot}{skyline}(x, show.years=FALSE, subst.rate, present.year, \dots)
10 \method{lines}{skyline}(x, show.years=FALSE, subst.rate, present.year, \dots)
12 skylineplot.deluxe(tree, \dots)
15 \item{x}{skyline plot data (i.e. an object of class \code{"skyline"}).}
17 \item{z}{Either an ultrametric tree (i.e. an object of class \code{"phylo"}),
18 or coalescent intervals (i.e. an object of class \code{"coalescentIntervals"}), or
19 collapsed coalescent intervals (i.e. an object of class \code{"collapsedIntervals"}).}
22 \item{tree}{ultrametric tree (i.e. an object of class \code{"phylo"}).}
25 \item{show.years}{option that determines whether the time is plotted in units of
26 of substitutions (default) or in years (requires specification of substution rate
27 and year of present).}
30 \item{subst.rate}{substitution rate (see option show.years).}
31 \item{present.year}{present year (see option show.years).}
33 \item{\dots}{further arguments to be passed on to \code{skyline()} and \code{plot()}.}
38 These functions provide various ways to draw \emph{skyline plot} graphs
39 on the current graphical device. Note that \code{skylineplot(z, \dots)} is simply
40 a shortcut for \code{plot(skyline(z, \dots))}.
41 The skyline plot itself is an estimate of effective population size through time,
42 and is computed using the function \code{\link{skyline}}.
46 See \code{\link{skyline}} for more details (incl. references) about the skyline plot method.
50 \author{Korbinian Strimmer (\url{http://www.stat.uni-muenchen.de/~strimmer/})}
53 \code{\link[graphics]{plot}} and \code{\link[graphics]{lines}} for the basic plotting
54 function in R, \code{\link{coalescent.intervals}}, \code{\link{skyline}}
59 data("hivtree.newick") # example tree in NH format
60 tree.hiv <- read.tree(text = hivtree.newick) # load tree
63 #### classic skyline plot
64 skylineplot(tree.hiv) # shortcut
67 #### plot classic and generalized skyline plots and estimate epsilon
68 sk.opt <- skylineplot.deluxe(tree.hiv)
72 #### classic and generalized skyline plot ####
73 sk1 <- skyline(tree.hiv)
74 sk2 <- skyline(tree.hiv, 0.0119)
76 # use years rather than substitutions as unit for the time axis
77 plot(sk1, show.years=TRUE, subst.rate=0.0023, present.year = 1997, col=c(grey(.8),1))
78 lines(sk2, show.years=TRUE, subst.rate=0.0023, present.year = 1997)
79 legend(.15,500, c("classic", "generalized"), col=c(grey(.8),1),lty=1)
82 #### various skyline plots for different epsilons
83 layout(mat= matrix(1:6,2,3,byrow=TRUE))
84 ci <- coalescent.intervals(tree.hiv)
85 plot(skyline(ci, 0.0));title(main="0.0")
86 plot(skyline(ci, 0.007));title(main="0.007")
87 plot(skyline(ci, 0.0119),col=4);title(main="0.0119")
88 plot(skyline(ci, 0.02));title(main="0.02")
89 plot(skyline(ci, 0.05));title(main="0.05")
90 plot(skyline(ci, 0.1));title(main="0.1")
91 layout(mat= matrix(1:1,1,1,byrow=TRUE))