Package: ape
-Version: 2.8
-Date: 2011-10-20
+Version: 2.8-1
+Date: 2011-11-10
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>
+ CHANGES IN APE VERSION 2.8-1
+
+
+BUG FIXES
+
+ o mantel.test() could return P-values > 1 with the default
+ two-tailed test.
+
+
+OTHER CHANGES
+
+ o The code of yule() has been simplified and is now much faster for
+ big trees.
+
+
+
CHANGES IN APE VERSION 2.8
the new function ltt.plot.coords.
+BUG FIXES
+
+ o prop.part() crashed if some trees had some multichotomies.
+
+
CHANGES IN APE VERSION 2.7-3
-## mantel.test.R (2011-06-22)
+## mantel.test.R (2011-11-10)
## Mantel Test for Similarity of Two Matrices
lower.triang <- function(m)
{
- d <- dim(m)
- if (d[1] != d[2]) print("Warning: non-square matrix")
+ if (!diff(dim(m))) print("Warning: non-square matrix")
m[col(m) <= row(m)]
}
-mantel.test <- function (m1, m2, nperm = 1000, graph = FALSE,
- alternative = "two.sided", ...)
+mantel.test <- function(m1, m2, nperm = 1000, graph = FALSE,
+ alternative = "two.sided", ...)
{
alternative <- match.arg(alternative, c("two.sided", "less", "greater"))
n <- nrow(m1)
realz <- mant.zstat(m1, m2)
nullstats <- replicate(nperm, mant.zstat(m1, perm.rowscols(m2, n)))
pval <- switch(alternative,
- "two.sided" = 2 * sum(abs(nullstats) > abs(realz)),
+ "two.sided" = 2 * min(sum(nullstats > realz), sum(nullstats < realz)),
"less" = sum(nullstats < realz),
"greater" = sum(nullstats > realz))
pval <- pval / nperm
-## yule.R (2009-06-08)
+## yule.R (2011-11-03)
## Fits Yule Model to a Phylogenetic Tree
## yule: standard Yule model (constant birth rate)
## yule.cov: Yule model with covariates
-## Copyright 2003-2009 Emmanuel Paradis
+## Copyright 2003-2011 Emmanuel Paradis
## This file is part of the R-package `ape'.
## See the file ../COPYING for licensing issues.
yule <- function(phy, use.root.edge = FALSE)
{
if (!is.binary.tree(phy))
- stop("tree must be dichotomous to fit the Yule model.")
- bt <- rev(sort(branching.times(phy))) # branching times from past to present
- ni <- cumsum(rev(table(bt))) + 1
+ stop("tree must be dichotomous to fit the Yule model.")
+
X <- sum(phy$edge.length)
nb.node <- phy$Nnode
- if (!is.null(phy$root.edge) && use.root.edge) {
- X <- X + phy$root.edge
- ni <- c(1, ni)
- } else nb.node <- nb.node - 1
+
+ if (!is.null(phy$root.edge) && use.root.edge) X <- X + phy$root.edge
+ else nb.node <- nb.node - 1
+
lambda <- nb.node/X
se <- lambda/sqrt(nb.node)
- loglik <- -lambda*X + lfactorial(phy$Nnode) + nb.node*log(lambda)
+ loglik <- -lambda * X + lfactorial(phy$Nnode) + nb.node * log(lambda)
obj <- list(lambda = lambda, se = se, loglik = loglik)
class(obj) <- "yule"
obj
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, Naim Matasci, Nick Matzke, Michael
+FitzJohn, Jos Käfer, Bret Larget, 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.
10, 14, 5, 7, 10, 7, 11, 8, 11, 8, 12,
5, 6, 10, 9, 13, 8)
M <- matrix(0, 8, 8)
-M[row(M) > col(M)] <- x
-M[row(M) < col(M)] <- x
-rownames(M) <- colnames(M) <- 1:8
+M[lower.tri(M)] <- x
+M <- t(M)
+M[lower.tri(M)] <- x
+dimnames(M) <- list(1:8, 1:8)
tr <- bionj(M)
plot(tr, "u")
### a less theoretical example
10, 14, 5, 7, 10, 7, 11, 8, 11, 8, 12,
5, 6, 10, 9, 13, 8)
M <- matrix(0, 8, 8)
-M[row(M) > col(M)] <- x
-M[row(M) < col(M)] <- x
-rownames(M) <- colnames(M) <- 1:8
+M[lower.tri(M)] <- x
+M <- t(M)
+M[lower.tri(M)] <- x
+dimnames(M) <- list(1:8, 1:8)
tr <- fastme.bal(M)
plot(tr, "u")
### a less theoretical example
10, 14, 5, 7, 10, 7, 11, 8, 11, 8, 12,
5, 6, 10, 9, 13, 8)
M <- matrix(0, 8, 8)
-M[row(M) > col(M)] <- x
-M[row(M) < col(M)] <- x
-rownames(M) <- colnames(M) <- 1:8
+M[lower.tri(M)] <- x
+M <- t(M)
+M[lower.tri(M)] <- x
+dimnames(M) <- list(1:8, 1:8)
tr <- nj(M)
plot(tr, "u")
### a less theoretical example
-/* bipartition.c 2011-06-23 */
+/* bipartition.c 2011-10-22 */
/* Copyright 2005-2011 Emmanuel Paradis, and 2007 R Development Core Team */
/* We start on the 2nd tree: */
for (k = 1; k < Ntree; k++) {
+
+/* in case there are trees with multichotomies: */
+ nbnode = getListElement(VECTOR_ELT(TREES, k), "Nnode");
+ Nnode = INTEGER(nbnode)[0];
+
PROTECT(bp = bipartition(getListElement(VECTOR_ELT(TREES, k), "edge"),
nbtip, nbnode));
for (i = 1; i < Nnode; i++) {