[Adephylo-commits] r60 - in pkg: . R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Nov 28 13:07:17 CET 2008


Author: jombart
Date: 2008-11-28 13:07:16 +0100 (Fri, 28 Nov 2008)
New Revision: 60

Modified:
   pkg/R/distances.R
   pkg/R/orthobasis.R
   pkg/R/proximities.R
   pkg/TODO
   pkg/man/distRoot.Rd
   pkg/man/distTips.Rd
   pkg/man/orthobasis.Rd
   pkg/man/proxTips.Rd
   pkg/man/tithonia.Rd
Log:
Replaced "brlength" with the more appropriate 'patristic' for phylogenetic distances.


Modified: pkg/R/distances.R
===================================================================
--- pkg/R/distances.R	2008-11-28 11:54:20 UTC (rev 59)
+++ pkg/R/distances.R	2008-11-28 12:07:16 UTC (rev 60)
@@ -2,7 +2,7 @@
 # distTips
 ###########
 distTips <- function(x, tips="all",
-                      method=c("brlength","nNodes","Abouheif","sumDD")){
+                      method=c("patristic","nNodes","Abouheif","sumDD")){
 
     if(!require(phylobase)) stop("phylobase package is not installed")
 
@@ -36,7 +36,7 @@
     allPairs <- findAllPairs(tips) # this contains all possible pairs of tips
 
     ## get the shortest path between all pairs of tips
-    if(method != "brlength") {
+    if(method != "patristic") {
         allPath <- sp.tips(x, allPairs$i, allPairs$j, useTipNames=TRUE, quiet=TRUE)
     } else {
         allPath <- sp.tips(x, allPairs$i, allPairs$j, useTipNames=TRUE, quiet=TRUE,
@@ -44,7 +44,7 @@
     }
 
     ## compute distances
-    if(method=="brlength"){
+    if(method=="patristic"){
         if(!hasEdgeLength(x)) stop("x does not have branch length")
         ## add tip1 and tip2 to the paths, so that these edges are counted
         allPath.names <- names(allPath)
@@ -55,7 +55,7 @@
         edge.idx <- lapply(allPath, function(e) getedges(x, e) ) # list of indices of edges
         allEdgeLength <- edgeLength(x)
         res <- lapply(edge.idx, function(idx) sum(allEdgeLength[idx], na.rm=TRUE) )
-    } # end brlength
+    } # end patristic
 
     if(method=="nNodes"){
         res <- lapply(allPath, length)
@@ -102,7 +102,7 @@
 ###########
 # distRoot
 ###########
-distRoot <- function(x, tips="all", method=c("brlength","nNodes","Abouheif","sumDD") ){
+distRoot <- function(x, tips="all", method=c("patristic","nNodes","Abouheif","sumDD") ){
     if(!require(phylobase)) stop("phylobase package is not installed")
 
     ## handle arguments
@@ -126,7 +126,7 @@
     allPath <- lapply(tips, function(tip) .tipToRoot(x, tip, root))
 
     ## compute distances
-    if(method=="brlength"){
+    if(method=="patristic"){
         if(!hasEdgeLength(x)) stop("x does not have branch length")
         ## add the concerned tips to the paths, so that these edges are counted
         allPath.names <- names(allPath)
@@ -136,7 +136,7 @@
         edge.idx <- lapply(allPath, function(e) getedges(x, e) ) # list of indices of edges
         allEdgeLength <- edgeLength(x)
         res <- sapply(edge.idx, function(idx) sum(allEdgeLength[idx], na.rm=TRUE) )
-    } # end brlength
+    } # end patristic
 
     if(method=="nNodes"){
         res <- sapply(allPath, length)

Modified: pkg/R/orthobasis.R
===================================================================
--- pkg/R/orthobasis.R	2008-11-28 11:54:20 UTC (rev 59)
+++ pkg/R/orthobasis.R	2008-11-28 12:07:16 UTC (rev 60)
@@ -2,7 +2,7 @@
 # orthobasis.phylo
 ###################
 orthobasis.phylo <- function(x=NULL, prox=NULL,
-                             method=c("brlength","nNodes","Abouheif","sumDD"), a=1){
+                             method=c("patristic","nNodes","Abouheif","sumDD"), a=1){
     if(!require(phylobase)) stop("phylobase package is not installed")
     if(!require(ade4)) stop("ade4 package is not installed")
 

Modified: pkg/R/proximities.R
===================================================================
--- pkg/R/proximities.R	2008-11-28 11:54:20 UTC (rev 59)
+++ pkg/R/proximities.R	2008-11-28 12:07:16 UTC (rev 60)
@@ -2,7 +2,7 @@
 # proxTips
 ###########
 proxTips <- function(x, tips="all",
-                      method=c("brlength","nNodes","Abouheif","sumDD"),
+                      method=c("patristic","nNodes","Abouheif","sumDD"),
                      a=1, normalize=c("row","col","none"), symmetric=TRUE){
 
     if(!require(phylobase)) stop("phylobase package is not installed")

Modified: pkg/TODO
===================================================================
--- pkg/TODO	2008-11-28 11:54:20 UTC (rev 59)
+++ pkg/TODO	2008-11-28 12:07:16 UTC (rev 60)
@@ -45,14 +45,14 @@
 o add a orthobasis method for objects inheriting phylo4 or phylo. -- done(TJ)
 * orthogram and multivariate orthogram; use Stephane's version
 * ppca
-* migrate datasets from ade4 to adephylo:
+o migrate datasets from ade4 to adephylo: -- done (TJ)
 - carni19.Rd -- done
 - carni70.Rd -- done
 - lizards.Rd -- done
 - maples.Rd -- done
 - mjrochet.Rd -- done
 - palm.Rd -- done
-- procella.Rd
+- procella.Rd -- done
 - tithonia.Rd -- done
 * add a Moran's index and a test (is it needed, as we have morangeary ?)
 

Modified: pkg/man/distRoot.Rd
===================================================================
--- pkg/man/distRoot.Rd	2008-11-28 11:54:20 UTC (rev 59)
+++ pkg/man/distRoot.Rd	2008-11-28 12:07:16 UTC (rev 60)
@@ -6,7 +6,7 @@
   root. Several distances can be used, defaulting to the sum of branch lengths.
 }
 \usage{
-distRoot(x, tips, method=c("brlength","nNodes","Abouheif","sumDD"))
+distRoot(x, tips, method=c("patristic","nNodes","Abouheif","sumDD"))
 }
 \arguments{
   \item{x}{a tree of  class \code{\link[pkg:ape]{phylo}},
@@ -16,7 +16,7 @@
   \item{method}{a character string (full or abbreviated without
     ambiguity) specifying the method used to compute distances ;
     possible values are:\cr
-    - \code{brlength}: branch length \cr
+    - \code{patristic}: patristic distance, i.e. sum of branch lengths \cr
     - \code{nNodes}: number of nodes on the path between the nodes \cr
     - \code{Abouheif}: Abouheif's distance (see details) \cr
     - \code{sumDD}: sum of direct descendants of all nodes on the path
@@ -52,7 +52,7 @@
 ## make a tree
 x <- as(rtree(50),"phylo4")
 ## compute 4 different distances
-met <- c("brlength","nNodes","Abouheif","sumDD")
+met <- c("patristic","nNodes","Abouheif","sumDD")
 D <- lapply(met, function(e) distRoot(x, method=e) )
 names(D) <- met
 D <- as.data.frame(D)

Modified: pkg/man/distTips.Rd
===================================================================
--- pkg/man/distTips.Rd	2008-11-28 11:54:20 UTC (rev 59)
+++ pkg/man/distTips.Rd	2008-11-28 12:07:16 UTC (rev 60)
@@ -10,7 +10,7 @@
   sum of branch lengths (see argument \code{method}).
 }
 \usage{
-distTips(x, tips, method=c("brlength","nNodes","Abouheif","sumDD"))
+distTips(x, tips, method=c("patristic","nNodes","Abouheif","sumDD"))
 }
 \arguments{
   \item{x}{a tree of  class \code{\link[pkg:ape]{phylo}},
@@ -21,7 +21,7 @@
   \item{method}{a character string (full or abbreviated without
     ambiguity) specifying the method used to compute distances ;
     possible values are:\cr
-    - \code{brlength}: branch length \cr
+    - \code{patristic}: patristic distance, i.e. sum of branch lengths \cr
     - \code{nNodes}: number of nodes on the path between the nodes \cr
     - \code{Abouheif}: Abouheif's distance (see details) \cr
     - \code{sumDD}: sum of direct descendants of all nodes on the path

Modified: pkg/man/orthobasis.Rd
===================================================================
--- pkg/man/orthobasis.Rd	2008-11-28 11:54:20 UTC (rev 59)
+++ pkg/man/orthobasis.Rd	2008-11-28 12:07:16 UTC (rev 60)
@@ -21,8 +21,8 @@
   \code{\link{proxTips}}.
 }
 \usage{
-me.phylo(x=NULL, prox=NULL, method=c("brlength","nNodes","Abouheif","sumDD"), a=1)
-orthobasis.phylo(x=NULL, prox=NULL, method=c("brlength","nNodes","Abouheif","sumDD"), a=1)
+me.phylo(x=NULL, prox=NULL, method=c("patristic","nNodes","Abouheif","sumDD"), a=1)
+orthobasis.phylo(x=NULL, prox=NULL, method=c("patristic","nNodes","Abouheif","sumDD"), a=1)
 }
 \arguments{
   \item{x}{A tree of  class \code{\link[pkg:ape]{phylo}},
@@ -31,7 +31,7 @@
   \item{method}{a character string (full or abbreviated without
     ambiguity) specifying the method used to compute proximities;
     possible values are:\cr
-    - \code{brlength}: (inversed sum of) branch length \cr
+    - \code{patristic}: (inversed sum of) branch lengths \cr
     - \code{nNodes}: (inversed) number of nodes on the path between the nodes \cr
     - \code{Abouheif}: Abouheif's proximity (see details) \cr
     - \code{sumDD}: (inversed) sum of direct descendants of all nodes on the path

Modified: pkg/man/proxTips.Rd
===================================================================
--- pkg/man/proxTips.Rd	2008-11-28 11:54:20 UTC (rev 59)
+++ pkg/man/proxTips.Rd	2008-11-28 12:07:16 UTC (rev 60)
@@ -36,7 +36,7 @@
   where '...' is the non-autoregressive part of the model, and 'e' are residuals.
 }
 \usage{
-proxTips(x, tips, method=c("brlength","nNodes","Abouheif","sumDD"),
+proxTips(x, tips, method=c("patristic","nNodes","Abouheif","sumDD"),
          a=1, normalize=c("row","col","none"), symmetric=TRUE)
 }
 \arguments{
@@ -48,7 +48,7 @@
   \item{method}{a character string (full or abbreviated without
     ambiguity) specifying the method used to compute proximities;
     possible values are:\cr
-    - \code{brlength}: (inversed sum of) branch length \cr
+    - \code{patristic}: (inversed sum of) branch length \cr
     - \code{nNodes}: (inversed) number of nodes on the path between the nodes \cr
     - \code{Abouheif}: Abouheif's proximity (see details) \cr
     - \code{sumDD}: (inversed) sum of direct descendants of all nodes on the path

Modified: pkg/man/tithonia.Rd
===================================================================
--- pkg/man/tithonia.Rd	2008-11-28 11:54:20 UTC (rev 59)
+++ pkg/man/tithonia.Rd	2008-11-28 12:07:16 UTC (rev 60)
@@ -50,7 +50,7 @@
 if(require(ade4)){
 
 ## use branch length to define proximities
-prox1 <- proxTips(tre, method="brlength")
+prox1 <- proxTips(tre, method="patristic")
 gearymoran(prox, traits)
 
 ## use Abouheif's proximity



More information about the Adephylo-commits mailing list