From f3304b6f40610d9b7306a9275d593b5c038ab0a0 Mon Sep 17 00:00:00 2001 From: paradis Date: Mon, 21 Mar 2011 12:08:02 +0000 Subject: [PATCH] some big fixes for ape 2.7-1 git-svn-id: https://svn.mpl.ird.fr/ape/dev/ape@152 6e262413-ae40-0410-9e79-b911bd7a66b7 --- ChangeLog | 12 ++++++++++++ DESCRIPTION | 4 ++-- R/DNA.R | 13 ++++++++----- R/read.nexus.R | 4 ++-- man/DNAbin.Rd | 4 ++-- man/all.equal.phylo.Rd | 2 +- man/as.phylo.Rd | 4 +++- man/base.freq.Rd | 5 ++++- man/bd.time.Rd | 6 +++--- man/bionj.Rd | 2 +- man/clustal.Rd | 3 --- man/image.DNAbin.Rd | 2 +- man/is.ultrametric.Rd | 2 +- man/lmorigin.Rd | 2 +- man/mantel.test.Rd | 2 +- man/mcmc.popsize.Rd | 2 +- man/mixedFontLabel.Rd | 2 +- man/parafit.Rd | 2 +- man/phymltest.Rd | 2 +- man/print.phylo.Rd | 2 +- man/richness.yule.test.Rd | 2 +- man/rlineage.Rd | 8 ++++---- man/rtree.Rd | 2 +- man/yule.cov.Rd | 2 +- src/dist_dna.c | 2 +- 25 files changed, 55 insertions(+), 38 deletions(-) diff --git a/ChangeLog b/ChangeLog index eb386db..cfc7f07 100644 --- 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 diff --git a/DESCRIPTION b/DESCRIPTION index 3646a52..3c49985 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -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 diff --git a/R/DNA.R b/R/DNA.R index 747117d..63306ef 100644 --- 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) diff --git a/R/read.nexus.R b/R/read.nexus.R index 03aa34b..117b31f 100644 --- a/R/read.nexus.R +++ b/R/read.nexus.R @@ -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] diff --git a/man/DNAbin.Rd b/man/DNAbin.Rd index 8892853..e953530 100644 --- a/man/DNAbin.Rd +++ b/man/DNAbin.Rd @@ -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: diff --git a/man/all.equal.phylo.Rd b/man/all.equal.phylo.Rd index 7c1003d..0fce2e0 100644 --- a/man/all.equal.phylo.Rd +++ b/man/all.equal.phylo.Rd @@ -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 diff --git a/man/as.phylo.Rd b/man/as.phylo.Rd index 86b48ba..4124046 100644 --- a/man/as.phylo.Rd +++ b/man/as.phylo.Rd @@ -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} diff --git a/man/base.freq.Rd b/man/base.freq.Rd index bef8529..56a5e2e 100644 --- a/man/base.freq.Rd +++ b/man/base.freq.Rd @@ -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 diff --git a/man/bd.time.Rd b/man/bd.time.Rd index b33d8d0..6e0975e 100644 --- a/man/bd.time.Rd +++ b/man/bd.time.Rd @@ -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{ diff --git a/man/bionj.Rd b/man/bionj.Rd index 85083de..261542a 100644 --- a/man/bionj.Rd +++ b/man/bionj.Rd @@ -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}}, diff --git a/man/clustal.Rd b/man/clustal.Rd index 8bb5cfb..78f07fc 100644 --- a/man/clustal.Rd +++ b/man/clustal.Rd @@ -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} diff --git a/man/image.DNAbin.Rd b/man/image.DNAbin.Rd index 26059de..9bb04a1 100644 --- a/man/image.DNAbin.Rd +++ b/man/image.DNAbin.Rd @@ -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. diff --git a/man/is.ultrametric.Rd b/man/is.ultrametric.Rd index 767cde9..b3fdab4 100644 --- a/man/is.ultrametric.Rd +++ b/man/is.ultrametric.Rd @@ -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{ diff --git a/man/lmorigin.Rd b/man/lmorigin.Rd index 9ed8b85..d21d484 100644 --- a/man/lmorigin.Rd +++ b/man/lmorigin.Rd @@ -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{ diff --git a/man/mantel.test.Rd b/man/mantel.test.Rd index 72a6009..5364952 100644 --- a/man/mantel.test.Rd +++ b/man/mantel.test.Rd @@ -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) diff --git a/man/mcmc.popsize.Rd b/man/mcmc.popsize.Rd index 5d84e40..b909eed 100644 --- a/man/mcmc.popsize.Rd +++ b/man/mcmc.popsize.Rd @@ -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{ diff --git a/man/mixedFontLabel.Rd b/man/mixedFontLabel.Rd index 03b9a2a..d4b6267 100644 --- a/man/mixedFontLabel.Rd +++ b/man/mixedFontLabel.Rd @@ -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). diff --git a/man/parafit.Rd b/man/parafit.Rd index b819656..9a1c156 100644 --- a/man/parafit.Rd +++ b/man/parafit.Rd @@ -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{ diff --git a/man/phymltest.Rd b/man/phymltest.Rd index 6a1cd74..365620f 100644 --- a/man/phymltest.Rd +++ b/man/phymltest.Rd @@ -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 diff --git a/man/print.phylo.Rd b/man/print.phylo.Rd index 68aa405..91917f8 100644 --- a/man/print.phylo.Rd +++ b/man/print.phylo.Rd @@ -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) diff --git a/man/richness.yule.test.Rd b/man/richness.yule.test.Rd index f71200d..b9ba898 100644 --- a/man/richness.yule.test.Rd +++ b/man/richness.yule.test.Rd @@ -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. diff --git a/man/rlineage.Rd b/man/rlineage.Rd index 5b20568..c37bd6d 100644 --- a/man/rlineage.Rd +++ b/man/rlineage.Rd @@ -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{ diff --git a/man/rtree.Rd b/man/rtree.Rd index 0f2dbaa..b30109c 100644 --- a/man/rtree.Rd +++ b/man/rtree.Rd @@ -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 diff --git a/man/yule.cov.Rd b/man/yule.cov.Rd index 10313c8..94c0906 100644 --- a/man/yule.cov.Rd +++ b/man/yule.cov.Rd @@ -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); diff --git a/src/dist_dna.c b/src/dist_dna.c index 62f8f64..2eb88a6 100644 --- a/src/dist_dna.c +++ b/src/dist_dna.c @@ -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) { -- 2.39.2