Package: ape
-Version: 3.0-4
-Date: 2012-05-03
+Version: 3.0-5
+Date: 2012-06-22
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>
+ CHANGES IN APE VERSION 3.0-5
+
+
+OTHER CHANGES
+
+ o write.dna(format = "fasta") now conforms more closely to the
+ FASTA standard thanks to François Michonneau.
+
+ o print.DNAbin() does not print base compositions if there are more
+ than one million nucleotides.
+
+
+
CHANGES IN APE VERSION 3.0-4
tabulations instead of white spaces.
o read.dna() failed to read Phylip or Clustal files with less than
- 10 nucleotides failed. (See other changes in this function
- below.)
+ 10 nucleotides. (See other changes in this function below.)
OTHER CHANGES
taxa names and the sequences (whatever the length of taxa
names). write.dna() now follows the same rule.
+ o The option 'seq.names' of read.dna has been removed.
+
o The files ape-defunct.R and ape-defunct.Rd, which have not been
modified for almost two years, have been removed.
-## DNA.R (2012-02-14)
+## DNA.R (2012-06-19)
## Manipulations and Comparisons of DNA Sequences
nms <- names(x)
if (n == 1) {
cat("1 DNA sequence in binary format stored in a list.\n\n")
- cat("Sequence length:", length(x[[1]]), "\n\n")
+ nTot <- length(x[[1]])
+ cat("Sequence length:", nTot, "\n\n")
cat("Label:", nms, "\n\n")
} else {
cat(n, "DNA sequences in binary format stored in a list.\n\n")
tmp <- unlist(lapply(x, length))
- mini <- min(tmp)
- maxi <- max(tmp)
+ nTot <- sum(tmp)
+ mini <- range(tmp)
+ maxi <- mini[2]
+ mini <- mini[1]
if (mini == maxi)
cat("All sequences of same length:", maxi, "\n")
else {
}
cat("\nLabels:", paste(nms, collapse = " "), TAIL)
}
- } else if (is.matrix(x)) {
- nd <- dim(x)
- nms <- rownames(x)
- cat(nd[1], "DNA sequences in binary format stored in a matrix.\n\n")
- cat("All sequences of same length:", nd[2], "\n")
- TAIL <- "\n\n"
- if (printlen < nd[1]) {
- nms <- nms[1:printlen]
- TAIL <- "...\n\n"
- }
- cat("\nLabels:", paste(nms, collapse = " "), TAIL)
} else {
- cat("1 DNA sequence in binary format stored in a vector.\n\n")
- cat("Sequence length:", length(x), "\n\n")
+ nTot <- length(x)
+ if (is.matrix(x)) {
+ nd <- dim(x)
+ nms <- rownames(x)
+ cat(nd[1], "DNA sequences in binary format stored in a matrix.\n\n")
+ cat("All sequences of same length:", nd[2], "\n")
+ TAIL <- "\n\n"
+ if (printlen < nd[1]) {
+ nms <- nms[1:printlen]
+ TAIL <- "...\n\n"
+ }
+ cat("\nLabels:", paste(nms, collapse = " "), TAIL)
+ } else {
+ cat("1 DNA sequence in binary format stored in a vector.\n\n")
+ cat("Sequence length:", nTot, "\n\n")
+ }
}
- cat("Base composition:\n")
- print(round(base.freq(x), digits))
+ if (nTot <= 1e6) {
+ cat("Base composition:\n")
+ print(round(base.freq(x), digits))
+ } else cat("More than 1 million nucleotides: not printing base composition\n")
}
as.DNAbin <- function(x, ...) UseMethod("as.DNAbin")
phy$edge <- rbind(phy$edge[a, ], c(ROOT, newnod),
phy$edge[b, ])
if (!is.null(phy$edge.length))
- phy$edge.length <-
- c(phy$edge.length[a], 0, phy$edge.length[b])
+ phy$edge.length <-
+ c(phy$edge.length[a], 0, phy$edge.length[b])
phy$Nnode <- phy$Nnode + 1L
## node renumbering (see comments below)
newNb <- integer(n + oldNnode)
newNb[newroot] <- n + 1L
sndcol <- phy$edge[, 2] > n
## executed from right to left, so newNb is modified before phy$edge:
- phy$edge[sndcol, 2] <- newNb[phy$edge[sndcol, 2]] <-
- (n + 2):(n + phy$Nnode)
+ phy$edge[sndcol, 2] <- newNb[phy$edge[sndcol, 2]] <- n + 2:phy$Nnode
phy$edge[, 1] <- newNb[phy$edge[, 1]]
if (!is.null(phy$node.label)) {
-## write.dna.R (2012-05-03)
+## write.dna.R (2012-06-22)
## Write DNA Sequences in a File
fmt <- paste("%-", max.nc + 1, "s", sep = "")
names(x) <- sprintf(fmt, names(x))
}
- if (format == "interleaved") {
+ switch(format, "interleaved" = {
## Write the first block with the taxon names
colsel <- if (nb.block == 1) 1:totalcol else 1:nbcol
for (i in 1:N) {
}
}
- }
- if (format == "sequential") {
+ }, "sequential" = {
if (nb.block == 1) {
for (i in 1:N) {
cat(names(x)[i], file = zz)
}
}
}
- }
- if (format == "fasta") {
+ }, "fasta" = {
for (i in 1:N) {
- cat(">", names(x)[i], file = zz)
+ cat(">", names(x)[i], file = zz, sep = "")
cat("\n", file = zz)
X <- paste(x[[i]], collapse = "")
S <- length(x[[i]])
cat("\n", file = zz)
}
}
- }
+ })
}
}
\arguments{
\item{birth, death}{a numeric value or a (vectorized) function
- specifying how speciation and extinction through time.}
+ specifying how speciation and extinction rates vary through time.}
\item{Tmax}{a numeric value giving the length of the simulation.}
\item{BIRTH, DEATH}{a (vectorized) function which is the primitive
of \code{birth} or \code{death}. This can be used to speed-up the
described in Kendall (1948). Speciation (birth) and extinction (death)
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} may be used if the primitives of \code{birth} and
\code{death} are known. In these functions time is the formal argument
and must be named \code{t}.
}
\alias{rcoal}
\alias{rmtree}
\title{Generates Random Trees}
+\description{
+ These functions generate trees by splitting randomly the edges
+ (\code{rtree}) or randomly clustering the tips (\code{rcoal}).
+ \code{rtree} generates general trees, and \code{rcoal} generates
+ coalescent trees. The algorithms are described in Paradis (2012).
+}
\usage{
rtree(n, rooted = TRUE, tip.label = NULL, br = runif, ...)
rcoal(n, tip.label = NULL, br = "coalescent", ...)
\item{\dots}{further argument(s) to be passed to \code{br}.}
\item{N}{an integer giving the number of trees to generate.}
}
-\description{
- These functions generate trees by splitting randomly the edges
- (\code{rtree}) or randomly clustering the tips (\code{rcoal}).
- \code{rtree} generates general (non-ultrametric) trees, and
- \code{rcoal} generates coalescent (ultrametric) trees.
-}
\details{
The trees generated are bifurcating. If \code{rooted = FALSE} in
(\code{rtree}), the tree is trifurcating at its root.
An object of class \code{"phylo"} or of class \code{"multiPhylo"} in
the case of \code{rmtree}.
}
+\references{
+ Paradis, E. (2012) \emph{Analysis of Phylogenetics and Evolution with
+ R (Second Edition).} New York: Springer.
+}
\author{Emmanuel Paradis}
\seealso{
\code{\link{stree}}, \code{\link{rlineage}}
an object of class \code{"multiPhylo"} which is a list of objects of
class \code{"phylo"}.
}
-\author{Emmanuel Paradis \email{Emmanuel.Paradis@mpl.ird.fr}}
+\author{Emmanuel Paradis}
\seealso{
\code{all.equal.phylo}, \code{\link[base]{unique}} for the generic R
function, \code{read.tree}, \code{read.nexus}
/* This file is part of the R-package `ape'. */
/* See the file ../COPYING for licensing issues. */
-##include "me.h"
+#include "me.h"
void BalWFext(edge *e, double **A) /*works except when e is the one edge
inserted to new vertex v by firstInsert*/