https://github.com/cran/ape
Raw File
Tip revision: cf0f890d3a3691a2894b863f00b4ed3628be5ad7 authored by Emmanuel Paradis on 19 January 2013, 00:00:00 UTC
version 3.0-7
Tip revision: cf0f890
where.Rd
\name{where}
\alias{where}
\title{Find Patterns in DNA Sequences}
\description{
  This function finds patterns in a single or a set of DNA sequences.
}
\usage{
where(x, pattern)
}
\arguments{
  \item{x}{an object of class \code{"DNAbin"}.}
  \item{pattern}{a character string to be searched in \code{x}.}
}
\details{
  If \code{x} is a vector, the function returns a single vector giving
  the position(s) where the pattern was found. If \code{x} is a matrix
  or a list, it returns a list with the positions of the pattern for
  each sequence.

  Patterns may be overlapping. For instance, if \code{pattern = "tata"}
  and the sequence starts with `tatata', then the vector returned will
  be c(1, 3).
}
\value{
  a vector of integers or a list of such vectors.
}
\author{Emmanuel Paradis}
\seealso{
  \code{\link{DNAbin}}, \code{\link{image.DNAbin}}
}
\examples{
data(woodmouse)
where(woodmouse, "tata")
}
\keyword{manip}
back to top