]> git.donarmstrong.com Git - ape.git/commitdiff
final wrap for ape 3.0
authorparadis <paradis@6e262413-ae40-0410-9e79-b911bd7a66b7>
Fri, 13 Jan 2012 01:47:39 +0000 (01:47 +0000)
committerparadis <paradis@6e262413-ae40-0410-9e79-b911bd7a66b7>
Fri, 13 Jan 2012 01:47:39 +0000 (01:47 +0000)
git-svn-id: https://svn.mpl.ird.fr/ape/dev/ape@175 6e262413-ae40-0410-9e79-b911bd7a66b7

DESCRIPTION
NEWS
R/DNA.R
R/clustal.R
R/read.nexus.R
R/read.tree.R
man/DNAbin.Rd
man/read.tree.Rd
src/dist_dna.c

index f63f9a38f2111ea6d3f6476b30c3710ddfccb877..d86b0c6279457612825fc836812426fc29ca48b6 100644 (file)
@@ -1,6 +1,6 @@
 Package: ape
-Version: 2.8-1
-Date: 2011-12-03
+Version: 3.0
+Date: 2012-01-13
 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 cc8d3af63c727603a15bf1ce227de83a0a10eace..55d0adc836df886582039bfc36a8f2d039694ada 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,4 @@
-               CHANGES IN APE VERSION 2.8-1
+               CHANGES IN APE VERSION 3.0
 
 
 NEW FEATURES
@@ -15,6 +15,8 @@ BUG FIXES
     o extract.clade() sometimes shuffled some tip labels (thanks to
       Ludovic Mallet and Mahendra Mariadassou for the fix).
 
+    o clustal() should now by default find the executable under Windows.
+
 
 OTHER CHANGES
 
@@ -24,6 +26,9 @@ OTHER CHANGES
     o The code of mantel.test() has been adjusted to be consistent
       with common permutation tests.
 
+    o The C code of base.freq() has been improved and is now nearly 8
+      times faster.
+
 
 
                CHANGES IN APE VERSION 2.8
diff --git a/R/DNA.R b/R/DNA.R
index df5b892192977628392406ecf0b52bd9a91ba1cf..54898cf4413358c94edf245d056baf1ab46b22b6 100644 (file)
--- a/R/DNA.R
+++ b/R/DNA.R
@@ -1,8 +1,8 @@
-## DNA.R (2011-03-21)
+## DNA.R (2012-01-10)
 
 ##   Manipulations and Comparisons of DNA Sequences
 
-## 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.
index 3cfd1c0373667aa4abf1ae66414975c069c825e8..656ecb2244e193d5f652bff4b13757d691e524bb 100644 (file)
@@ -1,8 +1,8 @@
-## clustal.R (2011-03-16)
+## clustal.R (2012-01-12)
 
 ##   Multiple Sequence Alignment with External Applications
 
-## Copyright 2011 Emmanuel Paradis
+## Copyright 2011-2012 Emmanuel Paradis
 
 ## This file is part of the R-package `ape'.
 ## See the file ../COPYING for licensing issues.
@@ -15,7 +15,7 @@ clustal <- function(x, pw.gapopen = 10, pw.gapext = 0.1,
     if (is.null(exec)) {
         if (os == "Linux") exec <- "clustalw"
         if (os == "Darwin") exec <- "clustalw2"
-        if (os == "Windows") exec <- "C:/Program Files/ClustalW2/clustalw2"
+        if (os == "Windows") shortPathName("C:/Program Files/ClustalW2/clustalw2.exe")
     }
 
     if (missing(x)) {
index cdbc291645823ac923f9db659f034e4194d277f7..642bee7d15c3dcc6c2066a138f7f4e05cfa1534a 100644 (file)
@@ -222,7 +222,7 @@ read.nexus <- function(file, tree.names = NULL)
         if (!translation) n <- length(tr$tip.label)
         ROOT <- n + 1
         if (sum(tr$edge[, 1] == ROOT) == 1 && dim(tr$edge)[1] > 1) {
-            stop(paste("There is apparently two root edges in your file: cannot read tree file.\n  Reading NEXUS file aborted at tree no.", i, sep = ""))
+            stop(paste("The tree has apparently singleton node(s): cannot read tree file.\n  Reading NEXUS file aborted at tree no.", i, sep = ""))
         }
     }
     if (Ntree == 1) {
index 87ae296e8f7d9fb33ff7843cb60c27fc15a062f6..cba51d10fd7a5641568b12480006bc6c7635078e 100644 (file)
@@ -158,7 +158,7 @@ read.tree <- function(file = "", text = NULL, tree.names = NULL, skip = 0,
         ## is a bifurcation at the root
         ROOT <- length(obj[[i]]$tip.label) + 1
         if(sum(obj[[i]]$edge[, 1] == ROOT) == 1 && dim(obj[[i]]$edge)[1] > 1)
-            stop(paste("There is apparently two root edges in your file: cannot read tree file.\n  Reading Newick file aborted at tree no.", i, sep = ""))
+            stop(paste("The tree has apparently singleton node(s): cannot read tree file.\n  Reading Newick file aborted at tree no.", i))
     }
     if (Ntree == 1 && !keep.multi) obj <- obj[[1]] else {
         if (!is.null(tree.names)) names(obj) <- tree.names
index eb6983ea48e8a6c669d662ffffd0cdba4387b871..bd9abcca093375984d690089c0e11d39d2fb1638 100644 (file)
@@ -83,7 +83,7 @@
   \url{http://ape.mpl.ird.fr/misc/BitLevelCodingScheme_20April2007.pdf}
 
   Paradis, E. (2012) \emph{Analysis of Phylogenetics and Evolution with
-  R (Second Edition)}. New York: Springer.
+  R (Second Edition).} New York: Springer.
 }
 \author{Emmanuel Paradis}
 \seealso{
index 5e31c55cc330fb418cd01ca371b4bf02761d0cc5..64bc829e02cf910f61f068b22ac13da378faea38 100644 (file)
@@ -48,7 +48,7 @@ read.tree(file = "", text = NULL, tree.names = NULL, skip = 0,
   message is issued.
 
   If there are any characters preceding the first "(" in a line then
-  this is assigned to the name. This is returned when a "multiphylo"
+  this is assigned to the name. This is returned when a "multiPhylo"
   object is returned and \code{tree.names = NULL}.
 }
 \value{
@@ -83,6 +83,9 @@ read.tree(file = "", text = NULL, tree.names = NULL, skip = 0,
 
   Paradis, E. (2008) Definition of Formats for Coding Phylogenetic Trees
   in R. \url{http://ape.mpl.ird.fr/misc/FormatTreeR_28July2008.pdf}
+
+  Paradis, E. (2012) \emph{Analysis of Phylogenetics and Evolution with
+    R (Second Edition).} New York: Springer.
 }
 
 \author{Emmanuel Paradis and Daniel Lawson \email{dan.lawson@bristol.ac.uk}}
index 210479e37b2ba29c623e9379d7dfffe621ba24db..7174af6d013d961c80dba33b453c78ad5e3c8bfe 100644 (file)
@@ -1,6 +1,6 @@
-/* dist_dna.c       2011-06-23 */
+/* dist_dna.c       2012-01-10 */
 
-/* Copyright 2005-2011 Emmanuel Paradis
+/* Copyright 2005-2012 Emmanuel Paradis
 
 /* This file is part of the R-package `ape'. */
 /* See the file ../COPYING for licensing issues. */
@@ -989,31 +989,60 @@ void distDNA_ParaLin_pairdel(unsigned char *x, int *n, int *s, double *d,
 /*     if (! *freq) for (i = 0; i < 4; i++) BF[i] /= m; */
 /* } */
 
+/* void BaseProportion(unsigned char *x, int *n, double *BF) */
+/* { */
+/*     int i; */
+
+/*     for (i = 0; i < *n; i++) { */
+/*         switch (x[i]) { */
+/*         case 136 : BF[0]++; break; */
+/*         case 40 : BF[1]++; break; */
+/*         case 72 : BF[2]++; break; */
+/*         case 24 : BF[3]++; break; */
+/*         case 192 : BF[4]++; break; */
+/*         case 160 : BF[5]++; break; */
+/*         case 144 : BF[6]++; break; */
+/*         case 96 : BF[7]++; break; */
+/*         case 80 : BF[8]++; break; */
+/*         case 48 : BF[9]++; break; */
+/*         case 224 : BF[10]++; break; */
+/*         case 176 : BF[11]++; break; */
+/*         case 208 : BF[12]++; break; */
+/*         case 112 : BF[13]++; break; */
+/*         case 240 : BF[14]++; break; */
+/*         case 4 : BF[15]++; break; */
+/*         case 2 : BF[16]++; break; */
+/*         } */
+/*     } */
+/* } */
+
+/* a hash table is much faster than switch (2012-01-10) */
 void BaseProportion(unsigned char *x, int *n, double *BF)
 {
-    int i;
-
-    for (i = 0; i < *n; i++) {
-           switch (x[i]) {
-           case 136 : BF[0]++; break;
-           case 40 : BF[1]++; break;
-           case 72 : BF[2]++; break;
-           case 24 : BF[3]++; break;
-           case 192 : BF[4]++; break;
-           case 160 : BF[5]++; break;
-           case 144 : BF[6]++; break;
-           case 96 : BF[7]++; break;
-           case 80 : BF[8]++; break;
-           case 48 : BF[9]++; break;
-           case 224 : BF[10]++; break;
-           case 176 : BF[11]++; break;
-           case 208 : BF[12]++; break;
-           case 112 : BF[13]++; break;
-           case 240 : BF[14]++; break;
-           case 4 : BF[15]++; break;
-           case 2 : BF[16]++; break;
-           }
-    }
+       int i;
+       double count[256];
+
+       memset(count, 0, 256*sizeof(double));
+
+       for (i = 0; i < *n; i++) count[x[i]]++;
+
+       BF[0] = count[136];
+       BF[1] = count[40];
+       BF[2] = count[72];
+       BF[3] = count[24];
+       BF[4] = count[192];
+       BF[5] = count[160];
+       BF[6] = count[144];
+       BF[7] = count[96];
+       BF[8] = count[80];
+       BF[9] = count[48];
+       BF[10] = count[224];
+       BF[11] = count[176];
+       BF[12] = count[208];
+       BF[13] = count[112];
+       BF[14] = count[240];
+       BF[15] = count[4];
+       BF[16] = count[2];
 }
 
 void SegSites(unsigned char *x, int *n, int *s, int *seg)