Package: ape
Version: 3.0-2
-Date: 2012-02-27
+Date: 2012-03-05
Title: Analyses of Phylogenetics and Evolution
Author: Emmanuel Paradis, Ben Bolker, Julien Claude, Hoa Sien Cuong, Richard Desper, Benoit Durand, Julien Dutheil, Olivier Gascuel, Christoph Heibl, Daniel Lawson, Vincent Lefort, Pierre Legendre, Jim Lemon, Yvonnick Noel, Johan Nylander, Rainer Opgen-Rhein, Andrei-Alin Popescu, Klaus Schliep, Korbinian Strimmer, Damien de Vienne
Maintainer: Emmanuel Paradis <Emmanuel.Paradis@ird.fr>
alignment and opens the result in a new window.
+BUG FIXES
+
+ o compute.brtime() did not completely randomized the order of the
+ branching times.
+
+ o write.nexus() did not work correctly with rooted trees (thanks
+ to Matt Johnson for the fix).
+
+ o mltt.plot(, backward = FALSE) did not set the x-axis correctly.
+
+
CHANGES IN APE VERSION 3.0-1
o read.GenBank() has been updated to work with EFetch 2.0.
o unroot() on trees in "pruningwise" order did not respect this
- attribute
+ attribute.
-## compute.brtime.R (2011-07-26)
+## compute.brtime.R (2012-03-02)
## Compute and Set Branching Times
-## Copyright 2011 Emmanuel Paradis
+## Copyright 2011-2012 Emmanuel Paradis
## This file is part of the R-package `ape'.
## See the file ../COPYING for licensing issues.
y <- c(rep(0, n), x) # for all nodes (terminal and internal)
- phy <- reorder(phy, "pruningwise")
- e1 <- phy$edge[, 1L] # local copies of the pointer
+ e1 <- phy$edge[, 1L] # local copies of the pointers
e2 <- phy$edge[, 2L] #
- el <- numeric(N)
- if (force.positive) y[unique(e1)] <- sort(x)
- for (i in 1:N) el[i] <- y[e1[i]] - y[e2[i]]
+ if (force.positive) {
+ o <- .Call("seq_root2tip", phy$edge, n, m, PACKAGE = "ape")
+ list.nodes <- list(n + 1L)
+ i <- 2L
+ repeat {
+ z <- sapply(o, "[", i)
+ z <- unique(z[!(z <= n | is.na(z))])
+ if (!length(z)) break
+ list.nodes[[i]] <- z
+ i <- i + 1L
+ }
+ nodes <- unlist(lapply(list.nodes, function(x) x[sample(length(x))]))
+ y[nodes] <- sort(x, decreasing = TRUE)
+ }
- phy$edge.length <- el
- reorder(phy)
+ phy$edge.length <- y[e1] - y[e2]
+ phy
}
-
-## ltt.plot.R (2011-09-24)
+## ltt.plot.R (2012-03-05)
## Lineages Through Time Plot
-## Copyright 2002-2011 Emmanuel Paradis
+## Copyright 2002-2012 Emmanuel Paradis
## This file is part of the R-package `ape'.
## See the file ../COPYING for licensing issues.
a <- lapply(dts[[i]], ltt.plot.coords, backward = backward, tol = tol)
names(a) <- names(dts[[i]])
if (is.null(names(a)))
- names(a) <- paste(deparse(substitute(phy)), "-", 1:length(a))
+ names(a) <- paste(deparse(substitute(phy)), "-", seq_along(a))
}
TREES <- c(TREES, a)
}
}
n <- length(TREES)
- xl <- c(min(unlist(lapply(TREES, function(x) min(x[, 1])))), 0)
- yl <- c(1, max(unlist(lapply(TREES, function(x) max(x[, 2])))))
+ range.each.tree <- sapply(TREES, function(x) range(x[, 1]))
+ xl <- range(range.each.tree)
+ yl <- c(1, max(sapply(TREES, function(x) max(x[, 2]))))
+
+ ## if backward is FALSE, we have to rescale the time scales of each tree:
+ if (!backward) {
+ for (i in seq_along(TREES)) {
+ tmp <- TREES[[i]]
+ tmp[, 1] <- tmp[, 1] + xl[2] - range.each.tree[2, i]
+ TREES[[i]] <- tmp
+ }
+ }
plot.default(NA, type = "n", xlim = xl, ylim = yl, xaxs = "r",
yaxs = "r", xlab = xlab, ylab = ylab, log = log)
-## write.nexus.R (2012-02-09)
+## write.nexus.R (2012-03-02)
## Write Tree File in Nexus Format
for (i in 1:ntree) {
if (class(obj[[i]]) != "phylo") next
- if (is.rooted(obj[[i]]))
- cat("\tTREE *,", title[i], "= [&R] ", file = file, append = TRUE)
- else cat("\tTREE *", title[i], "= [&U] ", file = file, append = TRUE)
+ root.tag <- if (is.rooted(obj[[i]])) "= [&R] " else "= [&U] "
+ cat("\tTREE *", title[i], root.tag, file = file, append = TRUE)
cat(write.tree(obj[[i]], file = ""),
"\n", sep = "", file = file, append = TRUE)
}
Significant bug fixes were provided by Cécile Ané, Jeremy Beaulieu,
James Bullard, Otto Cordero, Éric Durand, Olivier François, Rich
-FitzJohn, Jos Käfer, Bret Larget, Ludovic Mallet, Mahendra
-Mariadassou, Naim Matasci, Nick Matzke, Michael Phelan, Elizabeth
-Purdom, Dan Rabosky, Filipe Vieira, Tim Wallstrom, Li-San Wang, Yan
-Wong, Peter Wragg, Janet Young, and Jinlong Zhang. Contact me if I
-forgot someone.
+FitzJohn, Matt Johnson, Jos Käfer, Bret Larget, Ludovic Mallet,
+Mahendra Mariadassou, Naim Matasci, Nick Matzke, Michael Phelan,
+Elizabeth Purdom, Dan Rabosky, Filipe Vieira, Tim Wallstrom, Li-San
+Wang, Yan Wong, Peter Wragg, Janet Young, and Jinlong Zhang. Contact
+me if I forgot someone.
Kurt Hornik, of the R Core Team, helped in several occasions to
fix some problems and bugs.
Systems of IRD in form a "SPIRALES" project (2006).
Financial support was provided by Google to Andrei-Alin Popescu during
-the 2011 Google Summer of Code (GSoC 2011).
\ No newline at end of file
+the 2011 Google Summer of Code (GSoC 2011).
The option \code{tol} is used as follows: first the most distant tip
from the root is found, then all tips whose distance to the root is
- not more different from the previous one than \code{tol} are
- considered to be contemporaneous with it.
+ not different from the previous one than \code{tol} are considered to
+ be contemporaneous with it.
If the tree is not ultrametric, the plot is done assuming the tips,
except the most distant from the root, represent extinction events. If
\code{"phylo"} (single trees) and/or \code{"multiPhylo"} (multiple
trees). Any number of objects may be given. This function is mainly
for exploratory analyses with the advantages that the axes are set
- properly to view all lines, and the legend is plotted by default. For
- more flexible settings of line drawings, it may be better to combine
+ properly to view all lines, and the legend is plotted by default. The
+ plot will certainly make sense if all trees have their
+ most-distant-from-the-root tips contemporaneous (i.e., trees with only
+ extinct lineages will not be represented properly). For more flexible
+ settings of line drawings, it may be better to combine
\code{ltt.plot()} with successive calls of \code{ltt.lines()} (see
examples).
}
\author{Emmanuel Paradis}
\seealso{
- \code{\link{skyline}}, \code{\link{branching.times}},
- \code{\link{birthdeath}}, \code{\link{bd.ext}},
- \code{\link{yule.cov}}, \code{\link{bd.time}};
+ \code{\link{kronoviz}}, \code{\link{skyline}},
+ \code{\link{branching.times}}, \code{\link{birthdeath}},
+ \code{\link{bd.ext}}, \code{\link{yule.cov}}, \code{\link{bd.time}};
\code{\link[graphics]{plot}} for the basic plotting function in R
}
\examples{