]> git.donarmstrong.com Git - ape.git/commitdiff
bug fix in read.dna + change the default of tol in drop.fossil
authorparadis <paradis@6e262413-ae40-0410-9e79-b911bd7a66b7>
Tue, 1 Feb 2011 03:15:05 +0000 (03:15 +0000)
committerparadis <paradis@6e262413-ae40-0410-9e79-b911bd7a66b7>
Tue, 1 Feb 2011 03:15:05 +0000 (03:15 +0000)
git-svn-id: https://svn.mpl.ird.fr/ape/dev/ape@144 6e262413-ae40-0410-9e79-b911bd7a66b7

ChangeLog
DESCRIPTION
R/CDF.birth.death.R
R/read.dna.R
man/rlineage.Rd

index dd37289ac4ec445157506520a0b9f9011057931b..a4985e5dfcc71b19f3d191007abe15da6ec9bbab 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -14,6 +14,14 @@ BUG FIXES
     o as.hclust.phylo() failed with trees with node labels (thanks to
       Jinlong Zhang for pointing this bug out).
 
+    o read.dna(, "fasta") failed if sequences were not all of the same
+      length.
+
+
+OTHER CHANGES
+
+    o In drop.fossil() the default tol = 0 has been raised to 1e-8.
+
 
 
                CHANGES IN APE VERSION 2.6-2
index f5a28e08e7fee1242ddcb27aa5ece21afa707e10..c3f4954717e7867f561c4641ae534185b64cda1b 100644 (file)
@@ -1,6 +1,6 @@
 Package: ape
 Version: 2.6-3
-Date: 2010-12-24
+Date: 2011-02-01
 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, Klaus Schliep, Korbinian Strimmer, Damien de Vienne
 Maintainer: Emmanuel Paradis <Emmanuel.Paradis@ird.fr>
index 5fa088a9140edd69916ea00be76f7adcd90b21b6..847c37dcd20dd60ecc4649a725ff27ccfe27fd59 100644 (file)
@@ -287,7 +287,7 @@ rlineage <-
     .makePhylo(edge[1:j, ], edge.length[1:j], i)
 }
 
-drop.fossil <- function(phy, tol = 0)
+drop.fossil <- function(phy, tol = 1e-8)
 {
     n <- Ntip(phy)
     x <- dist.nodes(phy)[n + 1, ][1:n]
index 98ebd65ca71c67e2812a50dec6bf118e3b023f5e..88f3d61abd7a17757dae0a8d85e80cae07f08d48 100644 (file)
@@ -1,8 +1,8 @@
-## read.dna.R (2010-05-17)
+## read.dna.R (2011-02-01)
 
 ##   Read DNA Sequences in a File
 
-## Copyright 2003-2010 Emmanuel Paradis
+## Copyright 2003-2011 Emmanuel Paradis
 
 ## This file is part of the R-package `ape'.
 ## See the file ../COPYING for licensing issues.
@@ -107,10 +107,12 @@ read.dna <- function(file, format = "interleaved", skip = 0,
         obj <- lapply(obj, tolower)
         LENGTHS <- unique(unlist(lapply(obj, length)))
         allSameLength <- length(LENGTHS) == 1
-        if (is.logical(as.matrix) && as.matrix && !allSameLength)
-            stop("sequences in FASTA file not of the same length")
-        if (is.null(as.matrix) && allSameLength)
-            as.matrix <- TRUE
+        if (is.logical(as.matrix)) {
+            if (as.matrix && !allSameLength)
+                stop("sequences in FASTA file not of the same length")
+        } else {
+            as.matrix <- allSameLength
+        }
         if (as.matrix) {
             obj <- matrix(unlist(obj), ncol = LENGTHS, byrow = TRUE)
             rownames(obj) <- seq.names
index b2b1aed354c2fb780689216142543d5ef444dc22..5b2056808ebfd31e8e1070fb82e15da3004c4cd2 100644 (file)
@@ -15,7 +15,7 @@ rlineage(birth, death, Tmax = 50, BIRTH = NULL,
          DEATH = NULL, eps = 1e-6)
 rbdtree(birth, death, Tmax = 50, BIRTH = NULL,
         DEATH = NULL, eps = 1e-6)
-drop.fossil(phy, tol = 0)
+drop.fossil(phy, tol = 1e-8)
 }
 \arguments{
   \item{birth, death}{a numeric value or a (vectorized) function