o rcoal() is now faster.
+ o klastorin() has been removed.
+
CHANGES IN APE VERSION 2.3
Package: ape
Version: 2.3-1
-Date: 2009-06-10
+Date: 2009-06-12
Title: Analyses of Phylogenetics and Evolution
Author: Emmanuel Paradis, Ben Bolker, Julien Claude, Hoa Sien Cuong, Richard Desper, Benoit Durand, Julien Dutheil, Olivier Gascuel, Gangolf Jobb, Christoph Heibl, Daniel Lawson, Vincent Lefort, Pierre Legendre, Jim Lemon, Yvonnick Noel, Johan Nylander, Rainer Opgen-Rhein, Korbinian Strimmer, Damien de Vienne
Maintainer: Emmanuel Paradis <Emmanuel.Paradis@ird.fr>
parameter theta based on various approaches, nucleotide diversity,
generalized skyline plots, estimation of absolute evolutionary rates
and clock-like trees using mean path lengths, non-parametric rate
- smoothing and penalized likelihood, classifying genes in trees using
- the Klastorin-Misawa-Tajima approach. Phylogeny estimation can be done
+ smoothing and penalized likelihood. Phylogeny estimation can be done
with the NJ, BIONJ, and ME methods.
License: GPL (>= 2)
URL: http://ape.mpl.ird.fr/
-## klastorin.R (2003-05-26)
-
-## Klastorin's (1982) classifification method, applied to
-## phylogenetic trees as suggested by Misawa and Tajima (2000)
-
-## Copyright 2003 Gangolf Jobb
-
-## This file is part of the R-package `ape'.
-## See the file ../COPYING for licensing issues.
-
-########### PRIVATE ##############
-
-getMisawaTajima <- function()
- .C("getMisawaTajima", result = integer(klastorin_nTips()),
- PACKAGE = "ape")$result
-
-### functions to set and extract phylo tree ###
-
-buildTreeFromPhylo <- function(tree) {
- lowerNodes <- tree$edge[,1]
- upperNodes <- tree$edge[,2]
- edgeLengths <- tree$edge.length
- tipLabels <- tree$tip.label
- .C("buildTreeFromPhylo", as.integer(lowerNodes),
- as.integer(upperNodes), as.double(edgeLengths),
- as.integer(length(edgeLengths)),
- as.character(tipLabels),
- as.integer(length(tipLabels)),
- result = integer(1), PACKAGE = "ape"
- )$result
-}
-
-destroyTree <- function()
- .C("destroyTree", result = integer(1),
- PACKAGE = "ape")$result
-
-getError <- function()
- .C("getError", result = integer(1),
- PACKAGE = "ape")$result
-
-klastorin_nTips <- function()
- .C("nTips", result = integer(1),
- PACKAGE = "ape")$result
-
-########### PUBLIC ##############
-
klastorin <- function(phy)
-{
- if (!inherits(phy, "phylo"))
- stop("object \"phy\" is not of class \"phylo\"")
- ## added by EP for the new coding of "phylo" (2006-10-04):
- phy <- new2old.phylo(phy)
- ## End
- buildTreeFromPhylo(phy)
- if (getError() !=0) stop("Could not load \"phylo\" object")
- tmp <- getMisawaTajima()
- destroyTree()
- tmp
-}
+ stop("the function klastorin has been removed from ape")
\alias{phylogram}
\alias{prepareTree}
\alias{setTree}
-\alias{buildTreeFromPhylo}
-\alias{destroyTree}
-\alias{getError}
\alias{nEdges}
\alias{nNodes}
-\alias{klastorin_nTips}
-\alias{getMisawaTajima}
\alias{phylogram.plot}
\alias{cladogram.plot}
\alias{circular.plot}
Internal ape functions.
}
\note{
- These are not to be called by the user (or in some cases are just
- waiting for proper documentation to be written).
+ These are not to be called by the user (unless you know what you're doing).
}
\keyword{internal}
+++ /dev/null
-\name{klastorin}
-\alias{klastorin}
-\title{Klastorin's (1982) method for classifying genes as suggested by Misawa
-and Tajima (2000)}
-\usage{
-klastorin(phy)
-}
-\arguments{
- \item{phy}{a phylogenetic tree, i.e. an object of class \code{"phy"}. The root of the tree should make
- sense biologically.
- }
-}
-\description{
- The function \code{klastorin} uses the method by Klastorin's (1982) as
- suggested by Misawa and Tajima (2000) for identifying groups within
- gene trees.
-}
-\value{
-A vector indication the class affiliation for each sequence/taxon in the tree.
-}
-\seealso{
-\code{\link{opsin}}.
-}
-\references{
- Klastorin T.D. (1982) An alternative method for hospital partition
- determination using hierarchical cluster analysis. \emph{Operations
- Research} \bold{30},1134--1147.
-
- Misawa, K. (2000) A simple method for classifying genes and a bootstrap
- test for classifications. \emph{Molecular Biology and Evolution},
- \bold{17}, 1879--1884.
-}
-\author{Gangolf Jobb (\url{http://www.treefinder.de})}
-\examples{
-# find groups in landplant tree
-data("landplants.newick")
-tree1 <- read.tree(text = landplants.newick)
-plot(tree1, label.offset = 0.001)
-klastorin(tree1)
-tree1$tip.label
-
-# find groups in opsin tree
-data("opsin.newick")
-tree2 <- read.tree(text = opsin.newick)
-plot(tree2,label.offset = 0.01)
-groups <- klastorin(tree2)
-groups
-tree2$tip.label[groups==1]
-tree2$tip.label[groups==2]
-tree2$tip.label[groups==3]
-tree2$tip.label[groups==4]
-tree2$tip.label[groups==5]
-}
-\keyword{manip}
+++ /dev/null
-/*
- * treefunc.c
- *
- * (c) 2003 Gangolf Jobb (http://www.treefinder.de)
- *
- * Various data structures and methods for manipulating
- * and traversing trees
- * (e.g., to classify genes)
- *
- * This code may be distributed under the GNU GPL
- */
-
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-
-/*============================================================================*/
-
-#define LABLEN 128
-
-typedef struct tree {
- char label[LABLEN];
- struct tree *branches,*next;
- double length;
- int mark;
-} Tree;
-
-/*....*/
-
-Tree *NewTree(void) {
- Tree *b;
-
- b=malloc(sizeof(Tree)); if(!b) return(NULL);
-
- *b->label='\0'; b->branches=NULL; b->next=NULL; b->length=0.0;
-
- return(b);
-}
-
-/*....*/
-
-void FreeTree(Tree *t) {
- Tree *b;
-
- while(t->branches) {b=t->branches; t->branches=b->next; FreeTree(b);}
-
- free(t);
-
-}
-
-/*============================================================================*/
-
-static Tree *current=NULL;
-
-static int tip_index;
-static int edge_index;
-static int node_index;
-
-enum {OK=0,ERROR}; /* one may invent more descriptive error codes */
-static int error=OK;
-
-/*============================================================================*/
-
-Tree *buildTreeFromPhylo_(
- int node,
- int *lowerNodes,
- int *upperNodes,
- double *edgeLengths,
- int nedges,
- char **tipLabels,
- int ntips
-) {
- Tree *t,*b,**bb;
- int i,j,n;
-
- t=NewTree();
-
- bb=&t->branches; n=0;
- for(i=0;i<nedges;i++) { if(lowerNodes[i]!=node) continue;
- j=upperNodes[i]; if(j==0) {error=ERROR; goto err;}
- if(j>0) { if(j>ntips) {error=ERROR; goto err;}
- b=NewTree(); strcpy(b->label,tipLabels[j-1]);
- } else { if(-j>nedges) {error=ERROR; goto err;}
- b=
- buildTreeFromPhylo_(j,lowerNodes,upperNodes,edgeLengths,nedges,tipLabels,ntips);
- }
- b->length=edgeLengths[i];
- *bb=b; bb=&b->next; n++;
- } if(n<2) {error=ERROR; goto err;}
- err:
- *bb=NULL;
-
- return(t);
-}
-
-/*....*/
-
-void buildTreeFromPhylo(
- int *lowerNodes,
- int *upperNodes,
- double *edgeLengths,
- int *nedges,
- char **tipLabels,
- int *ntips,
- int *result
-) {
-
- error=OK;
-
- if(current) {FreeTree(current); current=NULL;}
-
- if(*nedges<2||*ntips<2) {error=ERROR; *result=error; return;}
-
- current=buildTreeFromPhylo_(-1,lowerNodes,upperNodes,edgeLengths,*nedges,tipLabels,*ntips);
-
- if(error&¤t) {FreeTree(current); current=NULL;}
-
- *result=error;
-
-}
-
-/*============================================================================*/
-
-void destroyTree(int *result) {
-
- error=OK;
-
- if(current) {FreeTree(current); current=NULL;}
-
- *result=error;
-
-}
-
-/*============================================================================*/
-
-void getError(int *result) {
-
- *result=error;
-
- error=OK;
-
-}
-
-/*============================================================================*/
-
-int nTips_(Tree *t) {
- Tree *b;
- int n;
-
- if(!t->branches) return(1);
-
- n=0; for(b=t->branches;b;b=b->next) n+=nTips_(b);
-
- return(n);
-}
-
-/*....*/
-
-void nTips(int *result) {
-
- error=OK;
-
- if(!current) {error=ERROR; *result=0; return;}
-
- *result=nTips_(current);
-
-}
-
-/*============================================================================*/
-
-int nNodes_(Tree *t) {
- Tree *b;
- int n;
-
- if(!t->branches) return(1);
-
- n=1; for(b=t->branches;b;b=b->next) n+=nNodes_(b);
-
- return(n);
-}
-
-/*....*/
-
-void nNodes(int *result) {
-
- error=OK;
-
- if(!current) {error=ERROR; *result=0; return;}
-
- *result=nNodes_(current);
-
-}
-
-/*....*/
-
-void nEdges(int *result) {
-
- error=OK;
-
- if(!current) {error=ERROR; *result=0; return;}
-
- *result=nNodes_(current)-1;
-}
-
-/*============================================================================*/
-
-double markClasses_(Tree *t) {
- Tree *b; double destinct,sum;
-
- /* all tips above a marked ( == 1) node belong to the same class */
-
- if(!t->branches) {t->mark=1; return(t->length);}
-
- sum=0.; for(b=t->branches;b;b=b->next) sum+=markClasses_(b);
-
- destinct=nTips_(t)*(t->length); /* (t->length) == 0. at root */
-
- if(destinct>sum) { t->mark=1; return(destinct); }
-
- t->mark=0; return(sum);
-
-}
-
-/*....*/
-
-void getMisawaTajima__(Tree *t,int ignore,int *result) { /* maps tips to marked classes */
- Tree *b;
-
- if(t->mark&&!ignore) {node_index++; ignore=1;} /* marked nodes above a marked node will be ignored */
-
- if(!t->branches) {result[tip_index++]=node_index; return;}
-
- for(b=t->branches;b;b=b->next) getMisawaTajima__(b,ignore,result);
-
-}
-
-/*....*/
-
-void getMisawaTajima_(Tree *t,int *result) {
-
- markClasses_(t);
-
- tip_index=0; node_index=0;
-
- getMisawaTajima__(t,0,result);
-
-}
-
-/*....*/
-
-void getMisawaTajima(int *result) {
-
- error=OK;
-
- if(!current) {error=ERROR; return;}
-
- getMisawaTajima_(current,result);
-
-}