reverseComplement {spgs} | R Documentation |
Reverse Complement of a DNA/RNA Sequence
Description
Compute the reverse complement of a DNA or RNA sequence.
Usage
## Default S3 method:
reverseComplement(x, content=c("dna", "rna"), case=c("lower", "upper", "as is"), ...)
## S3 method for class 'SeqFastadna'
reverseComplement(x, ...)
## S3 method for class 'list'
reverseComplement(x, ...)
Arguments
x |
A character vector, an object that can be coersed to a character vector or a
list of objects that canbe be converted to character vectors. this argument
can also be a |
content |
The content type of sequence(s). At present, supported types include
“ |
case |
Determines how symbols in |
... |
Arguments to be passed from or to other functions. |
Details
If x
is a SeqFastadna object or a character vector in which each element
is a single nucleobase, then it represents a single sequence and its reverse-
complementary sequence will be returned in the same form.
On the other hand, if x
is a vector of character strings, each of which
represents a nucleic sequence, then the result will bea a character vector in
which each element contains the reverse complement of the corresponding element
in x
as a character string.
Value
According to the input x
, a character vector, SeqFastadna object or list
containing the reverse complement(s) of the sequence(s) in x
.
Author(s)
Andrew Hart and Servet MartÃnez
See Also
Examples
reverseComplement("actg")
reverseComplement(c("t", "g", "a"))
#List of sequences
some.dna <- list("atgcgtcgttaa", c("g", "t", "g", "a", "a", "a"))
reverseComplement(some.dna)
#RNA sequence example
reverseComplement(c("a", "u", "g"), content="rna")
#Examples of lowercase, uppercase and as-is conversion
mixed.case <- c("t", "G", "g", "C", "a")
reverseComplement(mixed.case)
reverseComplement(mixed.case, case="upper")
reverseComplement(mixed.case, case="as is")