]> git.donarmstrong.com Git - ape.git/commitdiff
some bug fixes
authorparadis <paradis@6e262413-ae40-0410-9e79-b911bd7a66b7>
Wed, 28 Oct 2009 03:21:37 +0000 (03:21 +0000)
committerparadis <paradis@6e262413-ae40-0410-9e79-b911bd7a66b7>
Wed, 28 Oct 2009 03:21:37 +0000 (03:21 +0000)
git-svn-id: https://svn.mpl.ird.fr/ape/dev/ape@96 6e262413-ae40-0410-9e79-b911bd7a66b7

ChangeLog
DESCRIPTION
R/bind.tree.R
R/plot.phylo.R
R/read.nexus.R
R/write.nexus.R

index 8cebd96c86bf6569fbc5cd3d409d035a0b59791f..296d65759937e493934285b52542f25a1c42f61c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+               CHANGES IN APE VERSION 2.4-1
+
+
+BUG FIXES
+
+    o bind.tree() failed when 'y' had no root edge.
+
+    o read.nexus() shuffled tip labels when the trees have no branch
+      lengths and there is a TRANSLATE block.
+
+    o plot.multiPhylo() crashed R when plotting a list of trees with
+      "compressed tip labels".
+
+    o write.nexus() did not translate the taxa names when asked for.
+
+
+
                CHANGES IN APE VERSION 2.4
 
 
@@ -206,7 +223,7 @@ BUG FIXES
 
 OTHER CHANGES
 
-    o There is now a general help page displayed with '?ape' 
+    o There is now a general help page displayed with '?ape'.
 
 
 
index f6ed1212ac6815766ed01b02924d40547921d9e0..be5a57a95a240a29a796217eb26efceeb62d8a9d 100644 (file)
@@ -1,6 +1,6 @@
 Package: ape
-Version: 2.4
-Date: 2009-10-03
+Version: 2.4-1
+Date: 2009-10-27
 Title: Analyses of Phylogenetics and Evolution
 Author: Emmanuel Paradis, Ben Bolker, Julien Claude, Hoa Sien Cuong, Richard Desper, Benoit Durand, Julien Dutheil, Olivier Gascuel, Gangolf Jobb, Christoph Heibl, Daniel Lawson, Vincent Lefort, Pierre Legendre, Jim Lemon, Yvonnick Noel, Johan Nylander, Rainer Opgen-Rhein, Korbinian Strimmer, Damien de Vienne
 Maintainer: Emmanuel Paradis <Emmanuel.Paradis@ird.fr>
index 18dfce4b689cce60e68bac272ffed976c64c1767..9df19b555fec8f4bf434841bd72d9599bbc6fe91 100644 (file)
@@ -1,8 +1,8 @@
-## bind.tree.R (2007-12-21)
+## bind.tree.R (2009-10-08)
 
 ##    Bind Trees
 
-## Copyright 2003-2007 Emmanuel Paradis
+## Copyright 2003-2009 Emmanuel Paradis
 
 ## This file is part of the R-package `ape'.
 ## See the file ../COPYING for licensing issues.
@@ -64,10 +64,11 @@ bind.tree <- function(x, y, where = "root", position = 0)
               stop("argument 'position' is larger than the specified edge.")
             x$edge.length[i] <- x$edge.length[i] - position
         }
-        if (yHasNoRootEdge ) y$root.edge <- position
-        else y$root.edge <- y$root.edge + position
+        y$root.edge <- if (yHasNoRootEdge) position else y$root.edge + position
     }
 
+    if (is.null(y$root.edge) && where > nb.tip) y$root.edge <- 0
+
     X <- write.tree(x)
     Y <- write.tree(y)
     Y <- substr(Y, 1, nchar(Y) - 1)
index eb3ad5c098d536da2ce0e174928b26aa7a9f7061..7798d286d0c5b395efefdc554979226d21d416f6 100644 (file)
@@ -1,4 +1,4 @@
-## plot.phylo.R (2009-09-30)
+## plot.phylo.R (2009-10-27)
 
 ##   Plot Phylogenies
 
@@ -590,5 +590,5 @@ plot.multiPhylo <- function(x, layout = 1, ...)
         par(ask = TRUE)
         on.exit(par(ask = FALSE))
     }
-    for (i in x) plot(i, ...)
+    for (i in 1:length(x)) plot(x[[i]], ...)
 }
index 3edcd3f5903b610f42edce93884ad2665cb640a0..8c9abc24002e57a27d36e064e92d5317d6f91fc5 100644 (file)
@@ -1,4 +1,4 @@
-## read.nexus.R (2009-04-01)
+## read.nexus.R (2009-10-27)
 
 ##   Read Tree File in Nexus Format
 
@@ -224,7 +224,16 @@ read.nexus <- function(file, tree.names = NULL)
         }
     } else {
         if (!is.null(tree.names)) names(trees) <- tree.names
-        if (translation) attr(trees, "TipLabel") <- TRANS[, 2]
+        if (translation) {
+            if (length(colon) == Ntree) # .treeBuildWithTokens() was used
+                attr(trees, "TipLabel") <- TRANS[, 2]
+            else { # reassign the tip labels then compress
+                for (i in 1:Ntree)
+                    trees[[i]]$tip.label <-
+                        TRANS[, 2][as.numeric(trees[[i]]$tip.label)]
+                trees <- .compressTipLabel(trees)
+            }
+        }
         class(trees) <- "multiPhylo"
     }
     if (length(grep("[\\/]", file)) == 1)
index 1a816f0573ff35d5b30d64e3e18c9619e775b073..14f77341c498bfcd4a2f3bfbadffd905bdc3de2d 100644 (file)
@@ -1,4 +1,4 @@
-## write.nexus.R (2009-07-27)
+## write.nexus.R (2009-10-27)
 
 ##   Write Tree File in Nexus Format
 
@@ -69,9 +69,11 @@ the original data won't be written with the tree."))
         token <- as.character(1:N)
         names(token) <- obj[[1]]$tip.label
         obj[[1]]$tip.label <- token
-        if (ntree > 1)
-          for (i in 2:ntree)
-            obj[[i]]$tip.label <- token[obj[[i]]$tip.label]
+        if (ntree > 1) {
+            for (i in 2:ntree)
+                obj[[i]]$tip.label <- token[obj[[i]]$tip.label]
+            class(obj) <- NULL
+        }
     } else {
         for (i in 1:ntree)
           obj[[i]]$tip.label <- checkLabel(obj[[i]]$tip.label)