reverse {tidysq} | R Documentation |
Reverse sequence
Description
Reverse given list of sequences.
Usage
reverse(x, ...)
## S3 method for class 'sq'
reverse(x, ..., NA_letter = getOption("tidysq_NA_letter"))
Arguments
x |
[ |
... |
further arguments to be passed from or to other methods. |
NA_letter |
[ |
Details
reverse()
function reverses each sequence in supplied sq
object
(e.q. transforms "MIAANYTWIL"
to "LIWTYNAAIM"
). This operation
does not alter the type of the input object nor its alphabet.
Value
An sq
object of the same type as input
object but each sequence is reversed.
See Also
Functions that affect order of elements:
bite()
,
collapse()
,
paste()
Examples
# Creating objects to work on:
sq_ami <- sq(c("MIAANYTWIL","TIAALGNIIYRAIE", "NYERTGHLI", "MAYXXXIALN"),
alphabet = "ami_ext")
sq_dna <- sq(c("ATGCAGGA", "GACCGAACGAN", ""), alphabet = "dna_ext")
sq_unt <- sq(c("ATGCAGGA?", "TGACGAGCTTA", "", "TIAALGNIIYRAIE"))
# Reversing sequences:
reverse(sq_ami)
reverse(sq_dna)
reverse(sq_unt)
[Package tidysq version 1.1.3 Index]