reverseComplement {Biostrings}R Documentation

Sequence reversing and complementing

Description

These functions can reverse a BString, DNAString or RNAString object and complement each base of a DNAString object.

Usage

  reverse(x)
  complement(x)
  reverseComplement(x)

Arguments

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.

Details

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.

Value

An object of the same class and length as the original object.

Author(s)

H. Pages

See Also

Examples

  reverseComplement(DNAString("ACGT-YN-"))

[Package Biostrings version 2.0.3 Index]