reverseComplement {Biostrings} | R Documentation |
These functions can reverse a BString, DNAString or RNAString object and complement each base of a DNAString object.
reverse(x) complement(x) reverseComplement(x)
x |
A BString, DNAString, RNAString
or BStringViews object for reverse .
A DNAString object (or a BStringViews object
with a DNAString subject) for complement
and reverseComplement .
|
Given an object x
of class BString, DNAString
or RNAString, reverse(x)
returns an object of the same class
where letters in x
are reordered in the reverse ordered.
If x
is a DNAString object, complement(x)
returns
an object where each base in x
is "complemented" i.e.
A, C, G, T are replaced by T, G, C, A respectively.
Letters belonging to the "IUPAC extended genetic alphabet"
are also replaced by their complement (M <-> K, R <-> Y, S <-> S, V <-> B,
W <-> W, H <-> D, N <-> N) and the gap symbol (-) is unchanged.
reverseComplement(x)
is equivalent to reverse(complement(x))
but is faster and more memory efficient.
An object of the same class and length as the original object.
H. Pages
reverseComplement(DNAString("ACGT-YN-"))