]> git.donarmstrong.com Git - ape.git/commitdiff
some big fixes for ape 2.7-1
authorparadis <paradis@6e262413-ae40-0410-9e79-b911bd7a66b7>
Mon, 21 Mar 2011 12:08:02 +0000 (12:08 +0000)
committerparadis <paradis@6e262413-ae40-0410-9e79-b911bd7a66b7>
Mon, 21 Mar 2011 12:08:02 +0000 (12:08 +0000)
git-svn-id: https://svn.mpl.ird.fr/ape/dev/ape@152 6e262413-ae40-0410-9e79-b911bd7a66b7

25 files changed:
ChangeLog
DESCRIPTION
R/DNA.R
R/read.nexus.R
man/DNAbin.Rd
man/all.equal.phylo.Rd
man/as.phylo.Rd
man/base.freq.Rd
man/bd.time.Rd
man/bionj.Rd
man/clustal.Rd
man/image.DNAbin.Rd
man/is.ultrametric.Rd
man/lmorigin.Rd
man/mantel.test.Rd
man/mcmc.popsize.Rd
man/mixedFontLabel.Rd
man/parafit.Rd
man/phymltest.Rd
man/print.phylo.Rd
man/richness.yule.test.Rd
man/rlineage.Rd
man/rtree.Rd
man/yule.cov.Rd
src/dist_dna.c

index eb386db6d31e34f9f896d3b5664ff61235ada3b8..cfc7f0772abfdbe1daeaf05ecf61bed37e113b9a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+               CHANGES IN APE VERSION 2.7-1
+
+
+BUG FIXES
+
+    o A bug was introduced in read.nexus() in ape 2.7.
+
+    o image.DNAbin() did not colour correctly the bases if there were
+      '-' and no 'N' in the alignment.
+
+
+
                CHANGES IN APE VERSION 2.7
 
 
index 3646a5211d98faf2bd39092999d22c734a604279..3c499852f1bc0532eaf94d57ef7bbb0639d3c639 100644 (file)
@@ -1,6 +1,6 @@
 Package: ape
-Version: 2.7
-Date: 2011-03-17
+Version: 2.7-1
+Date: 2011-03-18
 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>
diff --git a/R/DNA.R b/R/DNA.R
index 747117d9600e3d7f0a94a85292e45750c9a41a79..63306ef9cc78e3c2556c8196f71520e931ca625e 100644 (file)
--- a/R/DNA.R
+++ b/R/DNA.R
@@ -1,4 +1,4 @@
-## DNA.R (2011-03-16)
+## DNA.R (2011-03-21)
 
 ##   Manipulations and Comparisons of DNA Sequences
 
@@ -418,16 +418,18 @@ image.DNAbin <- function(x, what, col, bg = "white", xlab = "", ylab = "",
     y <- integer(N <- length(x))
     ncl <- length(what)
     col <- rep(col, length.out = ncl)
+    brks <- 0.5:(ncl + 0.5)
     sm <- 0L
     for (i in ncl:1) {
         k <- ._bs_[._cs_ == what[i]]
         sel <- which(x == k)
-        if (ll <- length(sel)) {
+        if (L <- length(sel)) {
             y[sel] <- i
-            sm <- sm + ll
+            sm <- sm + L
         } else {
             what <- what[-i]
             col <- col[-i]
+            brks <- brks[-i]
         }
     }
     dim(y) <- dx
@@ -439,10 +441,11 @@ image.DNAbin <- function(x, what, col, bg = "white", xlab = "", ylab = "",
         co <- c(bg, col)
         leg.txt <- c(toupper(what), "others")
         leg.co <- c(col, bg)
+        brks <- c(-0.5, brks)
     }
     yaxt <- if (show.labels) "n" else "s"
-    image(1:s, 1:n, t(y), col = co, xlab = xlab,
-          ylab = ylab, yaxt = yaxt, ...)
+    graphics::image.default(1:s, 1:n, t(y), col = co, xlab = xlab,
+                            ylab = ylab, yaxt = yaxt, breaks = brks, ...)
     if (show.labels)
         mtext(rownames(x), side = 2, line = 0.1, at = 1:n,
               cex = cex.lab, adj = 1, las = 1)
index 03aa34bc9bf53c43b55745fd2955dee4d79988e7..117b31f36ce61b33178734b3715dff078e23cb9e 100644 (file)
@@ -1,4 +1,4 @@
-## read.nexus.R (2011-02-28)
+## read.nexus.R (2011-03-18)
 
 ##   Read Tree File in Nexus Format
 
@@ -9,7 +9,7 @@
 
 .treeBuildWithTokens <- function(x)
 {
-    phy <- .Call("treeBuildWithTokens", x, PACKAGE = "apex")
+    phy <- .Call("treeBuildWithTokens", x, PACKAGE = "ape")
     dim(phy[[1]]) <- c(length(phy[[1]])/2, 2)
     nms <- c("edge", "edge.length", "Nnode", "node.label", "root.edge")
     if (length(phy) == 4) nms <- nms[-5]
index 8892853ffa41717bf4910283894d62deb7cf9e73..e9535306f1ec2f4dd2a16f4d7b34fe73c7793707 100644 (file)
@@ -42,7 +42,7 @@
     are dropped.}
   \item{i, j}{indices of the rows and/or columns to select or to drop.
     They may be numeric, logical, or character (in the same way than for
-    standard R objects).}
+    standard \R objects).}
   \item{drop}{logical; if \code{TRUE}, the returned object is of the
     lowest possible dimension.}
   \item{recursive}{for compatibility with the generic (unused).}
@@ -50,7 +50,7 @@
 \details{
   These are all `methods' of generic functions which are here applied to
   DNA sequences stored as objects of class \code{"DNAbin"}. They are
-  used in the same way than the standard R functions to manipulate
+  used in the same way than the standard \R functions to manipulate
   vectors, matrices, and lists. Additionally, the operators \code{[[}
   and \code{$} may be used to extract a vector from a list. Note that
   the default of \code{drop} is not the same than the generic operator:
index 7c1003de174a447ae95d5f119fa2921cfaa60cce..0fce2e0c4ed5e068845f6b5de886e3d4fc8c5188 100644 (file)
@@ -43,7 +43,7 @@
 }
 \author{\enc{BenoĆ®t}{Benoit} \email{b.durand@alfort.AFSSA.FR}}
 \seealso{
-  \code{\link[base]{all.equal}} for the generic R function
+  \code{\link[base]{all.equal}} for the generic \R function
 }
 \examples{
 ### maybe the simplest example of two representations
index 86b48ba6988aa1b0d03c19d32f4f90e949d89106..4124046b3f71427064df77ea2e5d79b665be6895 100644 (file)
@@ -83,8 +83,9 @@ layout(matrix(1:2, 2, 1))
 plot(bird.orders, font = 1, no.margin = TRUE)
 par(mar = c(0, 0, 0, 8))
 plot(dend, horiz = TRUE)
-layout(matrix(1, 1, 1))
+layout(matrix(1))
 
+\dontrun{
 ### convert into networks:
 if (require(network)) {
     x <- as.network(rtree(10))
@@ -100,4 +101,5 @@ if (require(igraph)) {
     print(as.igraph(tr, FALSE, FALSE))
 }
 }
+}
 \keyword{manip}
index bef852991d3c322fce28f83d32895196edfd1361..56a5e2e7f39774a22eff64aea8cba6e84de2b399 100644 (file)
@@ -11,7 +11,7 @@
   frequencies of the DNA bases from a pair of sequences.
 }
 \usage{
-base.freq(x, freq = FALSE)
+base.freq(x, freq = FALSE, all = FALSE)
 Ftab(x, y = NULL)
 }
 \arguments{
@@ -20,6 +20,9 @@ Ftab(x, y = NULL)
   \item{y}{a vector with a single DNA sequence.}
   \item{freq}{a logical specifying whether to return the proportions
     (the default) or the absolute frequencies (counts).}
+  \item{all}{a logical; by default only the counts of A, C, G, and T are
+    returned. If \code{all = TRUE}, all counts of bases, ambiguous codes,
+    missing data, and alignment gaps are returned.}
 }
 \details{
   The base frequencies are computed over all sequences in the
index b33d8d05a1a0200ca2addcb90d2ea77bd5e58ed2..6e0975e1ff3de650e251565d70ab743f6d9cdf73 100644 (file)
@@ -57,9 +57,9 @@ bd.time(phy, birth, death, BIRTH = NULL, DEATH = NULL,
   \item{evaluations}{id.}
 }}
 \references{
-  Paradis, E. (2010) Time-dependent speciation and extinction from
-  phylogenies: a least squares approach. \emph{Evolution} (in press)
-  %, \bold{59}, 1--12.
+  Paradis, E. (2011) Time-dependent speciation and extinction from
+  phylogenies: a least squares approach. \emph{Evolution}, \bold{65},
+  661--672.
 }
 \author{Emmanuel Paradis}
 \seealso{
index 85083de9948b5a2e6281959536c92473b46e4e19..261542a382e5295615b794992c85609f04a0991d 100644 (file)
@@ -22,7 +22,7 @@ bionj(X)
 }
 \author{
   original C code by Hoa Sien Cuong and Olivier Gascuel; adapted and
-  ported to R by Vincent Lefort \email{vincent.lefort@lirmm.fr}
+  ported to \R by Vincent Lefort \email{vincent.lefort@lirmm.fr}
 }
 \seealso{
   \code{\link{nj}}, \code{\link{fastme}},
index 8bb5cfbe3d0352fc0d3e487c26bfd2d61ca63127..78f07fc717d31cdc1f46c31a7cc4e6283da52f5f 100644 (file)
@@ -48,19 +48,16 @@ tcoffee(x, exec = "t_coffee", MoreArgs = "", quiet = TRUE)
   Higgins, D. G. and Thompson, J. D. (2003) Multiple sequence alignment
   with the Clustal series of programs. \emph{Nucleic Acids Research}
   \bold{31}, 3497--3500.
-
   \url{http://www.clustal.org/}
 
   Edgar, R. C. (2004) MUSCLE: Multiple sequence alignment with high
   accuracy and high throughput. \emph{Nucleic Acids Research},
   \bold{32}, 1792--1797.
-
   \url{http://www.drive5.com/muscle/muscle_userguide3.8.html}
 
   Notredame, C., Higgins, D. and Heringa, J. (2000) T-Coffee: A novel
   method for multiple sequence alignments. \emph{Journal of Molecular
   Biology}, \bold{302}, 205--217.
-
   \url{http://www.tcoffee.org/Documentation/t_coffee/t_coffee_technical.htm}
 }
 \author{Emmanuel Paradis}
index 26059de63ef713214a4e3ec7f97746460b20d021..9bb04a11ed8042f16ae9202f53bc2fed0e7c2d68 100644 (file)
@@ -31,7 +31,7 @@
     \code{\link[graphics]{image.default}} (e.g., \code{cex.axis}).}
 }
 \details{
-  The idea of this function is to allow fleixble plotting and colouring
+  The idea of this function is to allow flexible plotting and colouring
   of a nucleotide alignment. By default, the most common bases (a, g, c,
   t, and n) and alignment gap are plotted using a standard colour
   scheme.
index 767cde9dc9b2b1b8397ecbf8e152ffb893733e1a..b3fdab48ea1953503de300d6faecf5f3e5929af1 100644 (file)
@@ -20,7 +20,7 @@ is.ultrametric(phy, tol = .Machine$double.eps^0.5)
 }
 \details{
   The default value for \code{tol} is based on the numerical
-  characteristics of the machine R is running on.
+  characteristics of the machine \R is running on.
 }
 \author{Emmanuel Paradis}
 \seealso{
index 9ed8b855fd77e5f902ac05857513d191c452a5e0..d21d484e0af55148c438fd2f16824ceb5794dc6a 100644 (file)
@@ -21,7 +21,7 @@ lmorigin(formula, data, origin=TRUE, nperm=999, method=NULL, silent=FALSE)
   \item{nperm}{ Number of permutations for the tests. If \code{nperm =
    0}, permutation tests will not be computed. The default value is \code{nperm = 999}. For large data files, the permutation test is rather slow since the permutation procedure is not compiled. }
   \item{method}{ \code{method = "raw"} computes t-tests of the regression coefficients by permutation of the raw data. \code{method = "residuals"} computes t-tests of the regression coefficients by permutation of the residuals of the full model. If \code{method = NULL}, permutation of the raw data is used to test the regression coefficients in regression through the origin; permutation of the residuals of the full model is used to test the regression coefficients in ordinary multiple regression. }
-  \item{silent}{ Informative messages and the time to compute the tests will not be written to the R console if silent=TRUE. Useful when the function is called by a numerical simulation function. }
+  \item{silent}{ Informative messages and the time to compute the tests will not be written to the \R console if silent=TRUE. Useful when the function is called by a numerical simulation function. }
 }
 
 \details{
index 72a6009070cc4c92582d925f4dcc468b3ee769ec..5364952c46d25a213dfada17557f03203d6f3f98 100644 (file)
@@ -50,7 +50,7 @@ mantel.test(m1, m2, nperm = 1000, graph = FALSE, ...)
   London: Chapman & Hall.
 }
 \author{Original code in S by Ben Bolker \email{bolker@zoo.ufl.edu}, ported
-  to R by Julien Claude \email{claude@isem.univ-montp2.fr}
+  to \R by Julien Claude \email{claude@isem.univ-montp2.fr}
 }
 \examples{
 q1 <- matrix(runif(36), nrow = 6)
index 5d84e406dfd3505e29f8e1117c60f033f952e16d..b909eed235b6754006a5c64bd95caf29dbdf70af 100644 (file)
@@ -85,7 +85,7 @@ extract.popsize(mcmc.out, credible.interval=0.95, time.points=200, thinning=1, b
 
 \author{Rainer Opgen-Rhein and
         Korbinian Strimmer (\url{http://strimmerlab.org}).
-        Parts of the rjMCMC sampling procedure are adapted from R code by Karl Browman
+        Parts of the rjMCMC sampling procedure are adapted from \R code by Karl Browman
         (\url{http://www.biostat.wisc.edu/~kbroman/})}
 
 \seealso{
index 03b9a2a4dc2d420eb94eb390d38718a52bec7a70..d4b62677bc8b8b9904c362d0320709189cc9464f 100644 (file)
@@ -27,7 +27,7 @@ mixedFontLabel(..., sep = " ", italic = NULL, bold = NULL,
 }
 \details{
   The idea is to have different bits of text in different vectors that
-  are put together to make a vector of R expressions. This vector is
+  are put together to make a vector of \R expressions. This vector is
   interpreted by graphical functions to format the text. A simple use
   may be \code{mixedFontLabel(genus, species), italic = 1:2}, but it is
   more interesting when mixing fonts (see examples).
index b819656c6971e134baf1eaee17f94b5d490657fe..9a1c1560eba792b2ff31d62587c02da79cc6f9de 100644 (file)
@@ -24,7 +24,7 @@ parafit(host.D, para.D, HP, nperm = 999, test.links = FALSE,
   \item{test.links }{ \code{test.links = TRUE} will test the significance of individual host-parasite links. Default: \code{test.links = FALSE}. }
   \item{seed }{ \code{seed = NULL} (default): a seed is chosen at random by the function. That seed is used as the starting point for all tests of significance, i.e. the global H-P test and the tests of individual H-P links if they are requested. Users can select a seed of their choice by giving any integer value to \code{seed}, for example \code{seed = -123456}. Running the function again with the same seed value will produce the exact same test results. }
   \item{correction}{ Correction methods for negative eigenvalues (details below): \code{correction="lingoes"} and \code{correction="cailliez"}. Default value: \code{"none"}.  }
-  \item{silent}{ Informative messages and the time to compute the tests will not be written to the R console if silent=TRUE. Useful when the function is called by a numerical simulation function. }
+  \item{silent}{ Informative messages and the time to compute the tests will not be written to the \R console if silent=TRUE. Useful when the function is called by a numerical simulation function. }
 }
 
 \details{
index 6a1cd74affb2bb14ffe47b8f369b544d6adf21c2..365620fd2e4a0dfa3c8bb9830dc66947a3f6f2c6 100644 (file)
@@ -42,7 +42,7 @@ phymltest(seqfile, format = "interleaved", itree = NULL,
 \description{
   This function calls PhyML and fits successively 28 models of DNA
   evolution. The results are saved on disk, as PhyML usually does, and
-  returned in R as a vector with the log-likelihood value of each model.
+  returned in \R as a vector with the log-likelihood value of each model.
 }
 \details{
   The present function requires version 3.0.1 of PhyML; it won't work with
index 68aa40519d8a5d45e30337a856d18180ed1b46f6..91917f8b3fb598409ec320ebfc74d66869afeecb 100644 (file)
@@ -26,7 +26,7 @@
 \author{Ben Bolker \email{bolker@zoo.ufl.edu} and Emmanuel Paradis}
 \seealso{
   \code{\link{read.tree}}, \code{\link{summary.phylo}},
-  \code{\link[base]{print}} for the generic R function
+  \code{\link[base]{print}} for the generic \R function
 }
 \examples{
 x <- rtree(10)
index f71200deffe5103631602f1bd865a9a709e32aff..b9ba89825e588cd54511402c330ea0ad1ba6d0c4 100644 (file)
@@ -1,6 +1,6 @@
 \name{richness.yule.test}
 \alias{richness.yule.test}
-\title{}
+\title{Test of Diversification-Shift With the Yule Process}
 \description{
   This function performs a test of shift in diversification rate using
   probabilities from the Yule process.
index 5b2056808ebfd31e8e1070fb82e15da3004c4cd2..c37bd6d405ec21ad627d4d621bd08a5d79cfffbd 100644 (file)
@@ -35,7 +35,7 @@ drop.fossil(phy, tol = 1e-8)
   Both functions use continuous-time algorithms described in the
   references. The models are time-dependent birth--death models as
   described in Kendall (1948). Speciation (birth) and extinction (death)
-  rates may be constant or vary through time according to an R function
+  rates may be constant or vary through time according to an \R function
   specified by the user. In the latter case, \code{BIRTH} and/or
   \code{DEATH} may be used of the primitives of \code{birth} and
   \code{death} are known. In these functions time is the formal argument
@@ -48,9 +48,9 @@ drop.fossil(phy, tol = 1e-8)
   Kendall, D. G. (1948) On the generalized ``birth-and-death''
   process. \emph{Annals of Mathematical Statistics}, \bold{19}, 1--15.
 
-  Paradis, E. (2010) Time-dependent speciation and extinction from
-  phylogenies: a least squares approach. \emph{Evolution} (in press)
-  %, \bold{59}, 1--12.
+  Paradis, E. (2011) Time-dependent speciation and extinction from
+  phylogenies: a least squares approach. \emph{Evolution}, \bold{65},
+  661--672.
 }
 \author{Emmanuel Paradis}
 \seealso{
index 0f2dbaaac474f1754aa1e6b7bf6d4018590481df..b30109cdcbf86eafcd99942067edb0ab04f497fb 100644 (file)
@@ -14,7 +14,7 @@ rmtree(N, n, rooted = TRUE, tip.label = NULL, br = runif, ...)
     (the default).}
   \item{tip.label}{a character vector giving the tip labels; if not
     specified, the tips "t1", "t2", ..., are given.}
-  \item{br}{one of the following: (i) an R function used to generate the
+  \item{br}{one of the following: (i) an \R function used to generate the
     branch lengths (\code{rtree}; use \code{NULL} to simulate only a
     topology), or the coalescence times (\code{rcoal}); (ii) a character
     to simulate a genuine coalescent tree for \code{rcoal} (the
index 10313c8d8c0e9bdb66a6af45a13d610851a3f863..94c090649b2e0811887953fc46dcf2b8e7cdd874 100644 (file)
@@ -43,7 +43,7 @@ yule.cov(phy, formula, data = NULL)
   \item a phylogenetic tree which may contain multichotomies;
 
   \item a formula which specifies the predictors of the model described
-  above: this is given as a standard R formula and has no response (no
+  above: this is given as a standard \R formula and has no response (no
   left-hand side term), for instance: \code{~ x + y}, it can include
   interactions (\code{~ x + a * b}) (see \code{\link[stats]{formula}}
   for details);
index 62f8f64c9b5b375a702063f7d11825527a5d6d8b..2eb88a6eb7dfa9abb2e2cb3e7c5dca058ffade6f 100644 (file)
@@ -987,7 +987,7 @@ 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)
 {