]> git.donarmstrong.com Git - ape.git/commitdiff
bug fix in read.nexus()
authorparadis <paradis@6e262413-ae40-0410-9e79-b911bd7a66b7>
Wed, 9 Jul 2008 07:36:08 +0000 (07:36 +0000)
committerparadis <paradis@6e262413-ae40-0410-9e79-b911bd7a66b7>
Wed, 9 Jul 2008 07:36:08 +0000 (07:36 +0000)
git-svn-id: https://svn.mpl.ird.fr/ape/dev/ape@41 6e262413-ae40-0410-9e79-b911bd7a66b7

Changes
DESCRIPTION
R/read.nexus.R

diff --git a/Changes b/Changes
index 86d013187c44865657ece0081afa18c55ee5401a..2392e8a4a873be99cd4391785326d5e0a25b17b3 100644 (file)
--- a/Changes
+++ b/Changes
@@ -30,6 +30,9 @@ BUG FIXES
     o read.nexus() failed to read a file with a single tree and no
       translation of tip labels.
 
+    o read.nexus() failed to place correctly tip labels when reading
+      a single tree with no edge lengths.
+
 
 OTHER CHANGES
 
index c511656194621494aeee27f418c75bb2ecfc5df9..6b1df814b9c1e33a76485ae485104321dc0a4484 100644 (file)
@@ -1,6 +1,6 @@
 Package: ape
 Version: 2.2-1
-Date: 2008-07-03
+Date: 2008-07-09
 Title: Analyses of Phylogenetics and Evolution
 Author: Emmanuel Paradis, Ben Bolker, Julien Claude, Hoa Sien Cuong,
   Richard Desper, Benoit Durand, Julien Dutheil, Olivier Gascuel,
index 54384561166cad5e3e272b36cc01d7e23a70bb3e..06acd2fb39e4bbb6bf3b76780ff7525d3c37afa3 100644 (file)
@@ -1,4 +1,4 @@
-## read.nexus.R (2008-07-04)
+## read.nexus.R (2008-07-09)
 
 ##   Read Tree File in Nexus Format
 
@@ -110,7 +110,7 @@ read.nexus <- function(file, tree.names = NULL)
         if (any(w)) { # in case all comments use at least 2 lines
             s <- LEFT[w]
             X[s] <- gsub("\\[[^]]*\\]", "", X[s])
-            ## The previous regexp was quite tough to find: it makes
+            ## The above regexp was quite tough to find: it makes
             ## possible to delete series of comments on the same line:
             ##       ...[...]xxx[...]...
             ## without deleting the "xxx". This regexp is in three parts:
@@ -208,7 +208,8 @@ read.nexus <- function(file, tree.names = NULL)
     }
     if (Ntree == 1) {
         trees <- trees[[1]]
-        if (translation) trees$tip.label <- TRANS[, 2]
+        if (translation)
+            trees$tip.label <- TRANS[, 2][as.numeric(trees$tip.label)]
     } else {
         if (!is.null(tree.names)) names(trees) <- tree.names
         if (translation) attr(trees, "TipLabel") <- TRANS[, 2]