From bab1a9f9a25774bb2c11430540b02f1b91f458bc Mon Sep 17 00:00:00 2001 From: paradis Date: Thu, 24 Apr 2008 19:25:35 +0000 Subject: [PATCH] fix bug in seg.sites + improved Damien's man pages git-svn-id: https://svn.mpl.ird.fr/ape/dev/ape@28 6e262413-ae40-0410-9e79-b911bd7a66b7 --- Changes | 2 ++ DESCRIPTION | 2 +- R/DNA.R | 9 +++------ R/PGLS.R | 2 +- R/dist.topo.R | 2 +- R/plot.cophylo.R | 4 ++-- R/plot.phylo.coor.R | 2 +- R/summary.phylo.R | 3 ++- man/compar.cheverud.Rd | 3 ++- man/plot.cophylo.Rd | 11 ++++++++--- man/subtreeplot.Rd | 2 +- man/subtrees.Rd | 10 ++++++---- 12 files changed, 30 insertions(+), 22 deletions(-) diff --git a/Changes b/Changes index c3b05a4..da98ec1 100644 --- 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 diff --git a/DESCRIPTION b/DESCRIPTION index 3817b83..5ded9a5 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -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 e8e2260..2482511 100644 --- 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] diff --git a/R/PGLS.R b/R/PGLS.R index 1b918e9..8c5ab74 100644 --- 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) { diff --git a/R/dist.topo.R b/R/dist.topo.R index 04313b4..703f92d 100644 --- a/R/dist.topo.R +++ b/R/dist.topo.R @@ -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]], ...) diff --git a/R/plot.cophylo.R b/R/plot.cophylo.R index 7589f6a..6625473 100644 --- a/R/plot.cophylo.R +++ b/R/plot.cophylo.R @@ -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() diff --git a/R/plot.phylo.coor.R b/R/plot.phylo.coor.R index b69fb95..5794af4 100644 --- a/R/plot.phylo.coor.R +++ b/R/plot.phylo.coor.R @@ -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) diff --git a/R/summary.phylo.R b/R/summary.phylo.R index 365f615..54c2eaa 100644 --- a/R/summary.phylo.R +++ b/R/summary.phylo.R @@ -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, ...) } diff --git a/man/compar.cheverud.Rd b/man/compar.cheverud.Rd index 6c7a8d7..4a6f86d 100644 --- a/man/compar.cheverud.Rd +++ b/man/compar.cheverud.Rd @@ -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, diff --git a/man/plot.cophylo.Rd b/man/plot.cophylo.Rd index 38ce54a..64e140d 100644 --- a/man/plot.cophylo.Rd +++ b/man/plot.cophylo.Rd @@ -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. diff --git a/man/subtreeplot.Rd b/man/subtreeplot.Rd index c9f80ce..62c621b 100644 --- a/man/subtreeplot.Rd +++ b/man/subtreeplot.Rd @@ -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{ diff --git a/man/subtrees.Rd b/man/subtrees.Rd index b59d709..edca731 100644 --- a/man/subtrees.Rd +++ b/man/subtrees.Rd @@ -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} -- 2.39.2