]> git.donarmstrong.com Git - ape.git/commitdiff
various bug fixes
authorparadis <paradis@6e262413-ae40-0410-9e79-b911bd7a66b7>
Sat, 24 Mar 2012 14:17:54 +0000 (14:17 +0000)
committerparadis <paradis@6e262413-ae40-0410-9e79-b911bd7a66b7>
Sat, 24 Mar 2012 14:17:54 +0000 (14:17 +0000)
git-svn-id: https://svn.mpl.ird.fr/ape/dev/ape@182 6e262413-ae40-0410-9e79-b911bd7a66b7

DESCRIPTION
NEWS
R/dbd.R
R/dist.topo.R
R/is.monophyletic.R
R/mantel.test.R
R/plot.phylo.R
man/yule.time.Rd

index a69b65a57a30943bacfb8ed575ae97e64c9adffb..903c8b1638cce8ab1b08adefd1e0ece4772c717c 100644 (file)
@@ -1,6 +1,6 @@
 Package: ape
 Version: 3.0-2
-Date: 2012-03-05
+Date: 2012-03-22
 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>
diff --git a/NEWS b/NEWS
index 87f4ffa73ae62dc802aa1b1b0006335d9048c378..de2da102a4fb09c042fc641ee32726b0accbf29d 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -17,6 +17,15 @@ BUG FIXES
 
     o mltt.plot(, backward = FALSE) did not set the x-axis correctly.
 
+    o A bug was introduced in prop.clades() with ape 3.0.
+
+    o mantel.test() printed a useless warning message.
+
+    o plot.phylo(, direction = "downward") ignored 'y.lim'.
+
+    o is.monophyletic() did not work correctly if 'tips' was not stored
+      as integers
+
 
 
                CHANGES IN APE VERSION 3.0-1
diff --git a/R/dbd.R b/R/dbd.R
index b6df41865cbb06313bce2df9946d320b5abea74f..3a325dc6fcee654815446b6aa57c19e59b48893a 100644 (file)
--- a/R/dbd.R
+++ b/R/dbd.R
@@ -1,4 +1,4 @@
-## dbd.R (2012-02-01)
+## dbd.R (2012-03-19)
 
 ##   Probability Density Under Birth--Death Models
 
@@ -32,7 +32,7 @@ dbd <- function(x, lambda, mu, t, conditional = FALSE, log = FALSE)
         warning("only the first value of 't' was considered")
     }
 
-    if (mu == 0) return(ryule(x, lambda, t, log))
+    if (mu == 0) return(dyule(x, lambda, t, log))
 
     ## for the unconditional case, we have to consider x=0 separately:
     if (!conditional) {
index d4791c333089bf5cd9a64a846e070a3d40e35a0d..5777482c35a1555a7abe2865f532e361af7b80d0 100644 (file)
@@ -1,4 +1,4 @@
-## dist.topo.R (2012-02-03)
+## dist.topo.R (2012-03-13)
 
 ##      Topological Distances, Tree Bipartitions,
 ##   Consensus Trees, and Bootstrapping Phylogenies
@@ -170,7 +170,11 @@ prop.clades <- function(phy, ..., part = NULL, rooted = FALSE)
     }
 
     bp <- prop.part(phy)
-    if (!rooted) bp <- postprocess.prop.part(bp)
+    if (!rooted) {
+        bp <- postprocess.prop.part(bp)
+        part <- postprocess.prop.part(part) # fix by Klaus Schliep
+        ## actually the above line in not needed if called from boot.phylo()
+    }
 
     n <- numeric(phy$Nnode)
     for (i in seq_along(bp)) {
@@ -202,7 +206,8 @@ boot.phylo <- function(phy, x, FUN, B = 100, block = 1,
         }
     }
     boot.tree <- vector("list", B)
-    if (!quiet) progbar <- utils::txtProgressBar(style = 3) # suggestion by Alastair Potts
+    if (!quiet) # suggestion by Alastair Potts
+        progbar <- utils::txtProgressBar(style = 3)
     for (i in 1:B) {
         if (block > 1) {
             y <- seq(block, ncol(x), block)
index d25264b6af502c297b9cf8a85b91e01b79cf037a..06ee9c164d06f0d4a10aaa4fabbe36fad5755da7 100644 (file)
@@ -1,8 +1,8 @@
-## ace.R (2009-06-19)
+## is.monophyletic.R (2012-03-23)
 
-##   Ancestral Character Estimation
+##   Test Monophyly
 
-## Copyright 2009 Johan Nylander and Emmanuel Paradis
+## Copyright 2009-2012 Johan Nylander and Emmanuel Paradis
 
 ## This file is part of the R-package `ape'.
 ## See the file ../COPYING for licensing issues.
@@ -12,14 +12,13 @@ is.monophyletic <-
 {
     if (!inherits(phy, "phylo"))
         stop("object 'phy' is not of class 'phylo'")
-    if (length(tips) == 1) return(TRUE)
     n <- length(phy$tip.label)
-    if (length(tips) == n) return(TRUE)
-    ROOT <- n + 1
+    if (length(tips) %in% c(1L, n)) return(TRUE)
+    ROOT <- n + 1L
     if (is.numeric(tips)) {
         if (any(tips > n))
             stop("incorrect tip#: should not be greater than the number of tips")
-        tips <- sort(tips)
+        tips <- sort(as.integer(tips))
     }
     if (is.character(tips))
         tips <- which(phy$tip.label %in% tips)
@@ -50,4 +49,4 @@ is.monophyletic <-
     }
     ## assuming that both vectors are sorted:
     identical(tips, desc)
-} # end of is.monophyletic
+}
index c5c1da21455718d6224468795dc5e3f66ece1e81..0de2ad9693e2218fb0caf36b25cff08d67422bb0 100644 (file)
@@ -1,4 +1,4 @@
-## mantel.test.R (2011-11-11)
+## mantel.test.R (2012-03-16)
 
 ##   Mantel Test for Similarity of Two Matrices
 
@@ -18,7 +18,7 @@ mant.zstat <- function(m1, m2) sum(lower.triang(m1 * m2))
 
 lower.triang <- function(m)
 {
-    if (!diff(dim(m))) print("Warning: non-square matrix")
+    if (diff(dim(m))) print("Warning: non-square matrix")
     m[col(m) <= row(m)]
 }
 
index 32e5506903e412704b147b9e53705f68b4233f1a..3fd0637295d84063afd81cbe2bea7d5509bbe7d4 100644 (file)
@@ -1,8 +1,8 @@
-## plot.phylo.R (2011-12-03)
+## plot.phylo.R (2012-03-22)
 
 ##   Plot Phylogenies
 
-## 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.
@@ -260,12 +260,12 @@ plot.phylo <-
         y.lim <- c(0, y.lim)
         if (phyloORclado && horizontal) y.lim[1] <- 1
         if (type %in% c("fan", "unrooted") && show.tip.label)
-          y.lim[1] <- -max(nchar(x$tip.label) * 0.018 * max(yy) * cex)
+            y.lim[1] <- -max(nchar(x$tip.label) * 0.018 * max(yy) * cex)
         if (type == "radial")
-          y.lim[1] <- if (show.tip.label) -1 - max(nchar(x$tip.label) * 0.018 * max(yy) * cex) else -1
+            y.lim[1] <- if (show.tip.label) -1 - max(nchar(x$tip.label) * 0.018 * max(yy) * cex) else -1
     }
     ## mirror the yy:
-    if (phyloORclado && direction == "downwards") yy <- y.lim[2] - yy
+    if (phyloORclado && direction == "downwards") yy <- max(yy) - yy
     if (phyloORclado && root.edge) {
         if (direction == "leftwards") x.lim[2] <- x.lim[2] + x$root.edge
         if (direction == "downwards") y.lim[2] <- y.lim[2] + x$root.edge
index 5092c2f7a769d877861858bfaf99801718d1ba27..ccc0d5a44bda8b34abf7b0086ec55727ec5845ec 100644 (file)
@@ -50,7 +50,7 @@ yule.time(phy, birth, BIRTH = NULL, root.time = 0, opti = "nlm", start = 0.01)
 \references{
   Hubert, N., Paradis, E., Bruggemann, H. & Planes, S. (2011) Community
   assembly and diversification in Indo-Pacific coral reef
-  fishes. \emph{Ecology and Evolution} (in press).
+  fishes. \emph{Ecology and Evolution}, \bold{1}, 229--277.
 }
 \seealso{
   \code{\link{branching.times}}, \code{\link{ltt.plot}},