Package: ape
Version: 3.0-8
-Date: 2013-03-30
+Date: 2013-04-02
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>
Depends: R (>= 2.6.0)
Suggests: gee, expm
-Imports: gee, nlme, lattice, expm
+Imports: nlme, lattice
ZipData: no
Description: ape provides functions for reading, writing, plotting, and manipulating phylogenetic trees, analyses of comparative data in a phylogenetic framework, ancestral character analyses, analyses of diversification and macroevolution, computing distances from allelic and nucleotide data, reading and writing nucleotide sequences, and several tools such as Mantel's test, minimum spanning tree, generalized skyline plots, graphical exploration of phylogenetic data (alex, trex, kronoviz), estimation of absolute evolutionary rates and clock-like trees using mean path lengths and penalized likelihood. Phylogeny estimation can be done with the NJ, BIONJ, ME, MVR, SDM, and triangle methods, and several methods handling incomplete distance matrices (NJ*, BIONJ*, MVR*, and the corresponding triangle method). Some functions call external applications (PhyML, Clustal, T-Coffee, Muscle) whose results are returned into R.
License: GPL (>= 2)
+++ /dev/null
-Licence
-=======
-
-This is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
\ No newline at end of file
exportPattern(".+")
-import(gee, nlme)
+import(nlme)
importFrom(lattice, xyplot, panel.lines, panel.points)
importFrom(stats, as.hclust, cophenetic, reorder)
-importFrom(expm, expm)
S3method(print, phylo)
S3method(plot, phylo)
S3method(labels, DNAbin)
S3method(as.character, DNAbin)
S3method(as.matrix, DNAbin)
+S3method(c, DNAbin)
+S3method(image, DNAbin)
+S3method(as.list, DNAbin)
NEW FEATURES
- o The new function ewLasso whether tests an incomplete set of
+ o The new function ewLasso tests whether an incomplete set of
distances uniquely determines the edge weights of a given
unrooted topology using the 'Lasso' method by Dress et
al. (2012, J. Math. Biol. 65:77).
indicating that no test of significance is computed between a
distance matrix and itself.
+ o rtree(n, rooted = FALSE) returned trees with an 'edge' matrix
+ stored as doubles instead of integers for n > 4.
+
OTHER CHANGES
o ace() has a new default for its option 'method': this is "REML"
for continuous characters and "ML" for discrete ones.
- o ape now imports the package expm so this one must be installed.
+ o ape does not import gee anymore so the latter doesn't need to
+ be installed.
liks[cbind(TIPS, x)] <- 1
phy <- reorder(phy, "pruningwise")
- E <- if (use.expm) expm::expm else ape::matexpo
+ ## E <- if (use.expm) expm::expm else ape::matexpo
+ E <- if (use.expm) {
+ library(expm)
+ get("expm", "package:expm")
+ } else ape::matexpo
Q <- matrix(0, nl, nl)
dev <- function(p, output.liks = FALSE) {
function(formula, data = NULL, family = gaussian, phy,
corStruct, scale.fix = FALSE, scale.value = 1)
{
- require(gee, quietly = TRUE)
+ library(gee)
if (!missing(corStruct)) {
if (!missing(phy))
-## ewLasso.R (2013-03-30)
+## ewLasso.R (2013-04-02)
## Lasso Tree
X[X < 0] <- -1
X[is.nan(X)] <- -1
+ if (is.rooted(phy)) {
+ phy <- unroot(phy)
+ warning("'phy' is rooted: it was unrooted for this operation")
+ }
+
N <- attr(X, "Size")
labels <- attr(X, "Labels")
if (is.null(labels)) labels <- as.character(1:N)
ans <- .C("ewLasso", as.double(X), as.integer(N),
- phy$edge[, 1], phy$edge[, 2],
+ as.integer(phy$edge[, 1]), as.integer(phy$edge[, 2]),
DUP = FALSE, NAOK = TRUE, PACKAGE = "ape")
}
-## read.dna.R (2013-01-31)
+## read.dna.R (2013-04-02)
## Read DNA Sequences in a File
sz <- file.info(file)$size
x <- readBin(file, "raw", sz)
icr <- which(x == as.raw(0x0d)) # CR
- x <- x[-icr]
+ if (length(icr)) x <- x[-icr]
res <- .Call("rawStreamToDNAbin", x, PACKAGE = "ape")
names(res) <- sub("^ +", "", names(res)) # to permit phylosim
class(res) <- "DNAbin"
-## rtree.R (2012-09-14)
+## rtree.R (2013-04-02)
## Generates Trees
-## Copyright 2004-2012 Emmanuel Paradis
+## Copyright 2004-2013 Emmanuel Paradis
## This file is part of the R-package `ape'.
## See the file ../COPYING for licensing issues.
i <- which(is.na(edge[, 2]))
edge[i, 2] <- 1:n
} else { # n > 4
- n1 <- sample.int(n - 2, 1, FALSE, NULL)
- if (n1 == n - 2) {
- n2 <- n3 <- 1
+ n1 <- sample.int(n - 2L, 1L)
+ if (n1 == n - 2L) {
+ n2 <- n3 <- 1L
} else {
- n2 <- sample.int(n - n1 - 1, 1, FALSE, NULL)
+ n2 <- sample.int(n - n1 - 1L, 1L)
n3 <- n - n1 - n2
}
- po2 <- 2*n1
- po3 <- 2*(n1 + n2) - 1
- edge[c(1, po2, po3), 1] <- nod
- nod <- nod + 1
- if (n1 > 2) {
- edge[1, 2] <- nod
- foo(n1, 2)
- } else if (n1 == 2) {
- edge[2:3, 1] <- edge[1, 2] <- nod
+ po2 <- 2L * n1
+ po3 <- 2L * (n1 + n2) - 1L
+ edge[c(1, po2, po3), 1L] <- nod
+ nod <- nod + 1L
+ if (n1 > 2L) {
+ edge[1L, 2L] <- nod
+ foo(n1, 2L)
+ } else if (n1 == 2L) {
+ edge[2:3, 1L] <- edge[1L, 2L] <- nod
nod <- nod + 1L
}
- if (n2 > 2) {
- edge[po2, 2] <- nod
- foo(n2, po2 + 1)
- } else if (n2 == 2) {
- edge[c(po2 + 1, po2 + 2), 1] <- edge[po2, 2] <- nod
+ if (n2 > 2L) {
+ edge[po2, 2L] <- nod
+ foo(n2, po2 + 1L)
+ } else if (n2 == 2L) {
+ edge[c(po2 + 1L, po2 + 2), 1L] <- edge[po2, 2L] <- nod
nod <- nod + 1L
}
if (n3 > 2) {
- edge[po3, 2] <- nod
- foo(n3, po3 + 1)
- } else if (n3 == 2) {
- edge[c(po3 + 1, po3 + 2), 1] <- edge[po3, 2] <- nod
+ edge[po3, 2L] <- nod
+ foo(n3, po3 + 1L)
+ } else if (n3 == 2L) {
+ edge[c(po3 + 1L, po3 + 2), 1L] <- edge[po3, 2L] <- nod
## nod <- nod + 1L
}
- i <- which(is.na(edge[, 2]))
+ i <- which(is.na(edge[, 2L]))
edge[i, 2] <- 1:n
}
}
{
if(!sSoFar[j])continue;//not in set so far
if(!a[i*(n+1)+j]){//if not, then i is not a good candidate for this side
- //Rprintf("failed to find distance between %i and %i, a[%i][%i]=%i \n",i,j,i,j,a[i*(n+1)+j]);
+ //Rprintf("failed to find distance between %i and %i, a[%i][%i]=%i \n",i,j,i,j,a[i*(n+1)+j]);
sw=0;
}
}
{
a[i*(n+1)+j]=a[j*(n+1)+i]=0;
}
- else
- {
+ else
+ {
a[i*(n+1)+j]=a[j*(n+1)+i]=1;// otherwise edge between pair of taxa (i,j) in G
}
}
while(comp)
{
q[p]=ini;
- v[ini]=1;
+ v[ini]=1;
comp=0;
int stNBipartiteLoc=0;//check if current connected component is bipartite
while(p<u)//BFS
//adjencency matrix of tree, 1 to n are leaves
int *at= R_alloc((2*n-1)*(2*n-1), sizeof(int));
-
+
for(i=1;i<=2*n-2;i++)
{
for(j=1;j<=2*n-2;j++)at[i*(2*n-1)+j]=0;
}*/
for(i=n+1;i<=2*n-2;i++)//for each interior vertex
- {
+ {
for(j=1;j<2*n-1;j++)//reset queue and visited veectors
{
v[j]=-1;
}
v[i]=1;//'disconnect' graph at i
- int *l=(int*)R_alloc(2*n-2, sizeof(int));//vertices adjacent to i
+ int *l=(int*)R_alloc(2*n-2, sizeof(int));//vertices adjacent to i
int nmb=0;//number of found adjacent vertices of i
p++;
}
}
-
+
/*Rprintf("sides for %i\n",i);
for(j=0;j<nmb;j++)
{