]> git.donarmstrong.com Git - ape.git/commitdiff
fix bug in seg.sites + improved Damien's man pages
authorparadis <paradis@6e262413-ae40-0410-9e79-b911bd7a66b7>
Thu, 24 Apr 2008 19:25:35 +0000 (19:25 +0000)
committerparadis <paradis@6e262413-ae40-0410-9e79-b911bd7a66b7>
Thu, 24 Apr 2008 19:25:35 +0000 (19:25 +0000)
git-svn-id: https://svn.mpl.ird.fr/ape/dev/ape@28 6e262413-ae40-0410-9e79-b911bd7a66b7

12 files changed:
Changes
DESCRIPTION
R/DNA.R
R/PGLS.R
R/dist.topo.R
R/plot.cophylo.R
R/plot.phylo.coor.R
R/summary.phylo.R
man/compar.cheverud.Rd
man/plot.cophylo.Rd
man/subtreeplot.Rd
man/subtrees.Rd

diff --git a/Changes b/Changes
index c3b05a4d59dc0e509bce577a046b954c2417b080..da98ec10377afbcdcce8cb4c9743e5ba871cb177 100644 (file)
--- a/Changes
+++ b/Changes
@@ -28,6 +28,8 @@ BUG FIXES
 
     o drop.tip() failed with some trees  (fixed by Yan Wong).
 
+    o seg.sites() failed with a list.
+
 
 OTHER CHANGES
 
index 3817b831973d2d0e5a5028dddd5bd6ae3dee558f..5ded9a58c3ebc937c910d1f5be588481cd8ea3df 100644 (file)
@@ -1,6 +1,6 @@
 Package: ape
 Version: 2.2
-Date: 2008-04-18
+Date: 2008-04-24
 Title: Analyses of Phylogenetics and Evolution
 Author: Emmanuel Paradis, Ben Bolker, Julien Claude, Hoa Sien Cuong,
   Richard Desper, Benoit Durand, Julien Dutheil, Olivier Gascuel,
diff --git a/R/DNA.R b/R/DNA.R
index e8e2260486503f666486be1791a084a5961f3e3e..2482511079bbb47748730709306285784997abbc 100644 (file)
--- a/R/DNA.R
+++ b/R/DNA.R
@@ -1,4 +1,4 @@
-## DNA.R (2008-03-10)
+## DNA.R (2008-04-24)
 
 ##   Manipulations and Comparisons of DNA Sequences
 
@@ -215,14 +215,11 @@ base.freq <- function(x)
     BF
 }
 
-GC.content <- function(x)
-{
-    BF <- base.freq(x)
-    sum(BF[2:3])
-}
+GC.content <- function(x) sum(base.freq(x)[2:3])
 
 seg.sites <- function(x)
 {
+    if (is.list(x)) x <- as.matrix(x)
     n <- dim(x)
     s <- n[2]
     n <- n[1]
index 1b918e9a9574097322794c5ff5b17fd9b5277638..8c5ab74032e3ad75e5b44d008270834c7e5023d6 100644 (file)
--- a/R/PGLS.R
+++ b/R/PGLS.R
@@ -197,7 +197,7 @@ compute.brlen <- function(phy, method = "Grafen", power = 1, ...)
     }
 }
 
-### by EP:
+## by EP:
 
 corPagel <- function(value, phy, form = ~1, fixed = FALSE)
 {
index 04313b43a0a8ae0ad9f37e1e3bc6e8a85ad977d9..703f92d124509a3898d59e894f02e7bfe8aa8f48 100644 (file)
@@ -128,7 +128,7 @@ plot.prop.part <- function(x, barcol = "blue", leftmar = 4, ...)
     layout(matrix(1:2, 2, 1), heights = c(1, 3))
     par(mar = c(0.1, leftmar, 0.1, 0.1))
     plot(1:L, attr(x, "number"), type = "h", col = barcol, xlim = c(1, L),
-         xlab = "", ylab = "Number", xaxt = "n", bty = "n")
+         xlab = "", ylab = "Frequency", xaxt = "n", bty = "n")
     plot(0, type = "n", xlim = c(1, L), ylim = c(1, n),
          xlab = "", ylab = "", xaxt = "n", yaxt = "n")
     for (i in 1:L) points(rep(i, length(x[[i]])), x[[i]], ...)
index 7589f6aee36ccd42114b3692901faaba89ac5263..6625473d8a762acef4af3ceaf3b6d2823596cfa0 100644 (file)
@@ -12,7 +12,7 @@ plot.cophylo <-
     function (x, y, assoc = NULL, use.edge.length = FALSE, space = 0,
               length.line = 1, gap = 2, type = "phylogram",
               rotate = FALSE, col = "red", show.tip.label = TRUE,
-              font = 3)
+              font = 3, ...)
 {
     if (is.null(assoc)) {
         assoc <- matrix(ncol = 2)
@@ -51,7 +51,7 @@ plot.cophylo2 <-
     function (x, y, assoc = assoc, use.edge.length = use.edge.length,
               space = space, length.line = length.line, gap = gap,
               type = type, return = return, col = col,
-              show.tip.label = show.tip.label, font = font)
+              show.tip.label = show.tip.label, font = font, ...)
 {
     res <- list()
 
index b69fb959aaa9d6cfd3f533852f6deaaf4ceded53..5794af44c73f8bdd5915de4e41ba888f7e08cab0 100644 (file)
@@ -9,7 +9,7 @@
 
 plot.phylo.coor <-
     function (x, type = "phylogram", use.edge.length = TRUE, node.pos = NULL,
-              direction = "rightwards")
+              direction = "rightwards", ...)
 {
     Ntip <- length(x$tip.label)
     if (Ntip == 1)
index 365f615117962de5677c73542ef19d772c1d59d5..54c2eaa51e3f30f317adadc7a135c4f8fd9b1f34 100644 (file)
@@ -1,4 +1,4 @@
-## summary.phylo.R (2008-02-28)
+## summary.phylo.R (2008-04-22)
 
 ##   Print Summary of a Phylogeny
 
@@ -142,5 +142,6 @@ print.multiPhylo <- function(x, details = FALSE, ...)
 str.multiPhylo <- function(object, ...)
 {
     class(object) <- NULL
+    cat('Class "multiPhylo"\n')
     str(object, ...)
 }
index 6c7a8d777c227f2416bfe3103e7a028e66026711..4a6f86da959b018e808d8b8f19e0e2f6d08fc9fb 100644 (file)
@@ -52,10 +52,11 @@ compar.cheverud(y, W, tolerance = 1e-06, gold.tol = 1e-04)
 \seealso{\code{\link{compar.lynch}}}
 \examples{
 ### Example from Harvey and Pagel's book:
+\dontrun{
 y<-c(10,8,3,4)
 W <- matrix(c(1,1/6,1/6,1/6,1/6,1,1/2,1/2,1/6,1/2,1,1,1/6,1/2,1,1), 4)
 compar.cheverud(y,W)
-
+}
 ### Example from Rohlf's 2001 article:
 W<- matrix(c(
   0,1,1,2,0,0,0,0,
index 38ce54a870dc8aa17a6876b8f0e4393fc6e87d4a..64e140d77c6a3d7692d74395835e68061c6732bc 100644 (file)
@@ -5,11 +5,13 @@
   This function plots two trees face to face with the links if specified. It is possible to rotate the branches of each tree around the nodes by clicking.
 }
 \usage{
-plot.cophylo(phy1, phy2, assoc=NULL, use.edge.length=FALSE,space=0, length.line=1, gap=2, type="phylogram", rotate=FALSE, col="red", show.tip.label=TRUE, font=3)
+plot.cophylo(x, y, assoc=NULL, use.edge.length=FALSE,space=0,
+length.line=1, gap=2, type="phylogram", rotate=FALSE, col="red",
+show.tip.label=TRUE, font=3, \dots)
 }
 
 \arguments{
-  \item{phy1, phy2}{two objects of class \code{"phylo"}.}
+  \item{x, y}{two objects of class \code{"phylo"}.}
   \item{assoc}{a matrix with 2 columns specifying the associations between the tips. If NULL, no links will be drawn.}
   \item{use.edge.length}{a logical indicating whether the branch lengths should be used to plot the trees; default is FALSE.}
   \item{space}{a positive value that specifies the distance between the two trees.}
@@ -19,7 +21,10 @@ plot.cophylo(phy1, phy2, assoc=NULL, use.edge.length=FALSE,space=0, length.line=
   \item{rotate}{a logical indicating whether the nodes of the phylogeny can be rotated by clicking. Default is FALSE.}
   \item{col}{a character string indicating the color to be used for the links. Default is red.}
   \item{show.tip.label}{a logical indicating whether to show the tip labels on the phylogeny (defaults to 'TRUE', i.e. the labels are shown).}
-  \item{font}{an integer specifying the type of font for the labels: 1 (plain text), 2 (bold), 3 (italic, the default), or 4 (bold italic).}
+  \item{font}{an integer specifying the type of font for the labels: 1
+    (plain text), 2 (bold), 3 (italic, the default), or 4 (bold
+    italic).}
+  \item{\dots}{(unused)}
 }
 \details{
 The aim of this function is to plot simultaneously two phylogenetic trees with associated taxa. The two trees do not necessarily have the same number of tips and more than one tip in one phylogeny can be associated with a tip in the other.
index c9f80cee949ee3ded03824a218ef4561410da23d..62c621b2ad9755dae4f2d74e450e709267336a2e 100644 (file)
@@ -6,7 +6,7 @@
   (supposedly large) and a portion of it determined by clicking on the nodes of the phylogeny. On exit, returns the last subtree visualized.
 }
 \usage{
-subtreeplot(phy, wait=FALSE, ...)
+subtreeplot(x, wait=FALSE, ...)
 }
 
 \arguments{
index b59d70987844c2c4e284de9bf5d47333b5e6d7b4..edca731657556782935a3e947237231d7a7eff62 100644 (file)
@@ -2,21 +2,22 @@
 \alias{subtrees}
 \title{All subtrees of a Phylogenetic Tree}
 \usage{
-subtrees(x, wait=FALSE)
+subtrees(tree, wait=FALSE)
 }
 \arguments{
-  \item{x}{an object of class \code{"phylo"}.}
+  \item{tree}{an object of class \code{"phylo"}.}
   \item{wait}{a logical indicating whether the node beeing processed should be printed (useful for big phylogenies).}
 }
 \description{
   This function returns a list of all the subtrees of a phylogenetic tree.
 }
 \author{Damien de Vienne \email{damien.de-vienne@u-psud.fr}}
-\see also{
+\seealso{
   \code{\link{zoom}}, \code{\link{subtreeplot}} for functions extracting particular subtrees.
 }
 \value{
-  \code{subtrees} returns a list of trees of class \code{"phylo"} and returns invisibly for each subtree a list with the following
+  \code{subtrees} returns a list of trees of class \code{"phylo"} and
+  returns invisibly for each subtree a list with the following
   components:
 
   \item{tip.label}
@@ -37,3 +38,4 @@ l<-subtrees(phy)
 for (i in 1:11) plot(l[[i]], sub=paste("Node", l[[i]]$node.label[1]))
 par(mfrow=c(1,1))
 }
+\keyword{manip}