Package: ape
-Version: 2.7-5
-Date: 2011-07-18
+Version: 2.7-3
+Date: 2011-08-08
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>
Schliep for the fix).
o root() failed in some cases with an outgroup made of several tips.
+ The help page has been clarified a bit.
format and in the \code{"phylo"} class of objects used in `ape'. One
aim of the present function is to be able to identify whether two
objects of class \code{"phylo"} represent the same phylogeny.
+}
+\note{
+ The algorithm used here does not work correctly for the comparison of
+ topologies (i.e., ignoring tip labels) of unrooted trees. This also
+ affects \code{\link{unique.multiPhylo}} which calls the present function. See:
- Only the labelled topologies are compared (i.e. branch lengths are not
- considered.
+ \url{https://stat.ethz.ch/pipermail/r-sig-phylo/2011-August/001562.html}
}
\value{
A logical value, or a two-column matrix.
\code{alpha}, and \code{theta}. This may be interesting for the last
one to model varying phenotypic optima. The exact updating formula
from Gillespie (1996) are used which are reduced to BM formula if
- \code{alpha = 0}.
+ \code{alpha = 0}.}
\item{A function:}{it must be of the form \code{foo(x, l)} where
\code{x} is the trait of the ancestor and \code{l} is the branch
\item{phy}{an object of class \code{"phylo"}.}
\item{outgroup}{a vector of mode numeric or character specifying the
new outgroup.}
- \item{node}{alternatively, a node number where to root the tree.}
+ \item{node}{alternatively, a node number where to root the tree (this
+ should give the MRCA of the ingroup).}
\item{resolve.root}{a logical specifying whether to resolve the new
root as a bifurcating node.}
\item{interactive}{if \code{TRUE} the user is asked to select the node
tree is rerooted using the node below this tip as the new root.
If \code{outgroup} is of length two or more, the most recent common
- ancestor (MRCA) is used as the new root. Note that the tree is really
- unrooted before being rerooted, so that if \code{outgroup} is already
- the outgroup, then the returned tree is not the same than the original
- one (see examples). If \code{outgroup} is not monophyletic, the
- operation fails and an error message is issued.
+ ancestor (MRCA) \emph{of the ingroup} is used as the new root. Note
+ that the tree is unrooted before being rerooted, so that if
+ \code{outgroup} is already the outgroup, then the returned tree is not
+ the same than the original one (see examples). If \code{outgroup} is
+ not monophyletic, the operation fails and an error message is issued.
If \code{resolve.root = TRUE}, \code{root} adds a zero-length branch
below the MRCA of the ingroup.
/*sib is tree C being passed by B*/
/*D is tree below etest*/
double D_AB, D_CD, D_AC, D_BD;
- /* double thisWeight; */
+ double thisWeight;
sib = siblingEdge(etest);
left = etest->head->leftEdge;
right = etest->head->rightEdge;
//void bNNI(tree *T, double **avgDistArray, int *count)
void bNNI(tree *T, double **avgDistArray, int *count, double **D, int numSpecies)
{
- edge *e; /* , *centerEdge; */
+ edge *e, *centerEdge;
edge **edgeArray;
int *p, *location, *q;
int i,j;
{
/* The tree must be in pruningwise order */
int i;
+ double alphaT, M, S;
switch(*model) {
case 1 : for (i = *Nedge - 1; i >= 0; i--) {
alphaT = alpha[i] * el[i];
M = exp(-alphaT);
S = sigma[i] * sqrt((1 - exp(-2 * alphaT))/(2 * alpha[i]));
- } else {
+ } else { /* same than if (alpha[i] ==0) */
M = 1;
S = sqrt(el[i]) * sigma[i];
}