reverseSeq            package:Biostrings            R Documentation

Reverse Sequence

Description:

     WARNING: The functions described in this man page have been
     deprecated in favor of 'reverse,XString-method' and
     'reverseComplement'.

     Functions to obtain the reverse and reverse complement of a
     sequence

Usage:

     reverseSeq(seq)
     revcompDNA(seq)
     revcompRNA(seq)

Arguments:

     seq: Character vector.  For 'revcompRNA' and 'revcompDNA' the
          sequence should consist of appropriate letter codes:
          '[ACGUN]' and 'ACGTN', respectively.

Details:

     The function reverses the order of the constituent character
     strings of its argument.

Value:

     A character vector of the same length as 'seq'.

Author(s):

     R. Gentleman, W. Huber, S. Falcon

See Also:

     'alphabetFrequency', 'reverseComplement'

Examples:

      w <-  c("hey there", "you silly fool")
      if (interactive()) {
        reverseSeq(w)  # deprecated (inefficient on large vectors)
      }
      reverse(BStringSet(w))  # more efficient

      w <- "able was I ere I saw Elba"
      if (interactive()) {
        reverseSeq(w)  # deprecated (inefficient on large vectors)
      }
      reverse(BStringSet(w))  # more efficient

      rna1 <- "UGCA"
      if (interactive()) {
        revcompRNA(rna1)  # deprecated (inefficient on large vectors)
      }
      reverseComplement(RNAString(rna1))  # more efficient

      dna1 <- "TGCA"
      if (interactive()) {
        revcompDNA(dna1)  # deprecated (inefficient on large vectors)
      }
      reverseComplement(DNAString(dna1))  # more efficient

      ## Comparing efficiencies:
      if (interactive()) {
        library(hgu95av2probe)
        system.time(y1 <- reverseSeq(hgu95av2probe$sequence))
        x <- DNAStringSet(hgu95av2probe)
        system.time(y2 <- reverse(x))

        system.time(y3 <- revcompDNA(hgu95av2probe$sequence))
        system.time(y4 <- reverseComplement(x))
      }

