where | R Documentation |
This function finds patterns in a single or a set of DNA or AA sequences.
where(x, pattern)
x |
an object inheriting the class either |
pattern |
a character string to be searched in |
If x
is a vector, the function returns a single vector giving
the position(s) where the pattern was found. If 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 pattern = "tata"
and the sequence starts with ‘tatata’, then the output will be c(1, 3).
a vector of integers or a list of such vectors.
Emmanuel Paradis
DNAbin
, image.DNAbin
, AAbin
data(woodmouse)
where(woodmouse, "tata")
## with AA sequences:
x <- trans(woodmouse, 2)
where(x, "irk")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.