+ CHANGES IN APE VERSION 2.2-1
+
+
+NEW FEATURES
+
+ o The new function del.gaps() removes insertion gaps ("-") in a
+ set of DNA sequences.
+
+
+
CHANGES IN APE VERSION 2.2
Package: ape
-Version: 2.2
-Date: 2008-05-07
+Version: 2.2-1
+Date: 2008-06-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,
-## DNA.R (2008-04-24)
+## DNA.R (2008-06-08)
## Manipulations and Comparisons of DNA Sequences
## This file is part of the R-package `ape'.
## See the file ../COPYING for licensing issues.
+del.gaps <- function(x)
+{
+ deleteGaps <- function(x) {
+ i <- which(x == 4)
+ x[-i]
+ }
+
+ if (class(x) != "DNAbin") x <- as.DNAbin(x)
+ if (is.matrix(x)) {
+ n <- dim(x)[1]
+ y <- vector("list", n)
+ for (i in 1:n) y[[i]] <- x[i, ]
+ x <- y
+ rm(y)
+ }
+ if (!is.list(x)) return(deleteGaps(x))
+ x <- lapply(x, deleteGaps)
+ class(x) <- "DNAbin"
+ x
+}
+
as.alignment <- function(x)
{
if (is.list(x)) n <- length(x)
\value{
an object of class \code{"corPagel"}, the coefficients from an object
of this class, or the correlation matrix of an initialized object of
- this class. In most situations, only \code{corPagel()} will be called
+ this class. In most situations, only \code{corPagel} will be called
by the user.
}
\author{Emmanuel Paradis}
--- /dev/null
+\name{del.gaps}
+\alias{del.gaps}
+\title{
+ Delete Alignment Gaps in DNA Sequences
+}
+\usage{
+del.gaps(x)
+}
+\arguments{
+ \item{x}{a matrix, a list, or a vector containing the DNA sequences.}
+}
+\description{
+ This function removes the insertion gaps (\code{"-"}) in a sample of
+ DNA sequences.
+}
+\details{
+ The sequences can be either in \code{"DNAbin"} or in character format,
+ but the returned object is always of class \code{"DNAbin"}. If
+ \code{x} is a vector, then a vector is returned; if it is a list or a
+ matrix, then a list is returned.
+}
+\value{
+ A vector (if there is only one input sequence) or a list of class
+ \code{"DNAbin"}.
+}
+\author{Emmanuel Paradis \email{Emmanuel.Paradis@ird.fr}}
+\seealso{
+ \code{\link{base.freq}}, \code{\link{GC.content}},
+ \code{\link{theta.s}}, \code{\link{nuc.div}}, \code{\link{seg.sites}}
+}
+\keyword{univar}