## org.biojava.bio.seq
Class RNATools

    java.lang.Object
      org.biojava.bio.seq.RNATools

public final class RNATools
extends java.lang.Object

Useful functionality for processing DNA and RNA sequences.

Author:
  Matthew Pocock, Keith James (docs), Thomas Down, Greg Cox, Mark Schreiber

Constructor Summary
`RNATools()`

Method Summary
`static AtomicSymbol` `a()`
`static AtomicSymbol` `c()`
`static Symbol` `complement(Symbol sym)` Complement the symbol.
`static SymbolList` `complement(SymbolList list)` Retrieve a complement view of list.
`static ReversibleTranslationTable` `complementTable()` Get a translation table for complementing DNA symbols.
`static SymbolList` `createRNA(java.lang.String rna)` Return a new RNA SymbolList for rna.
`static Sequence` `createRNASequence(java.lang.String rna, java.lang.String name)` Return a new RNA Sequence for rna.
`static Symbol` `forIndex(int index)` Return the symbol for an index - compatible with index.
`static Symbol` `forSymbol(char token)` Retrieve the symbol for a symbol.
`static AtomicSymbol` `g()`
`static FiniteAlphabet` `getCodonAlphabet()` Gets the (RNA x RNA x RNA) Alphabet
`static TranslationTable` `getGeneticCode(java.lang.String name)` Retrieve a TranslationTable by name.
`static java.util.Set` `getGeneticCodeNames()` Retrieve a Set containing the name of each genetic code.
`static FiniteAlphabet` `getRNA()` Return the RNA alphabet.
`static int` `index(Symbol sym)` Return an integer index for a symbol - compatible with forIndex.
`static Symbol` `n()`
`static SymbolList` `reverseComplement(SymbolList list)` Retrieve a reverse-complement view of list.
`static SymbolList` `transcribe(SymbolList list)` Transcribe DNA into RNA.
`static ReversibleTranslationTable` `transcriptionTable()` Get a translation table for converting DNA to RNA.
`static SymbolList` `translate(SymbolList syms)` Translate RNA into protein (with termination symbols).
`static AtomicSymbol` `u()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### RNATools

    public RNATools()

Method Detail

### a

    public static AtomicSymbol a()

### g

    public static AtomicSymbol g()

### c

    public static AtomicSymbol c()

### u

    public static AtomicSymbol u()

### n

    public static Symbol n()

### getRNA

    public static FiniteAlphabet getRNA()

  Return the RNA alphabet.

  Returns:
    a flyweight version of the RNA alphabet

### getCodonAlphabet

    public static FiniteAlphabet getCodonAlphabet()

  Gets the (RNA x RNA x RNA) Alphabet

  Returns:
    a flyweight version of the (RNA x RNA x RNA) alphabet

### createRNA

    public static SymbolList createRNA(java.lang.String rna)
                                throws IllegalSymbolException

  Return a new RNA SymbolList for rna.

  Parameters:
    `rna` - a String to parse into RNA
  Returns:
    a SymbolList created form rna
  Throws:
    `IllegalSymbolException` - if rna contains any non-RNA characters

### createRNASequence

    public static Sequence createRNASequence(java.lang.String rna,
                                             java.lang.String name)
                                      throws IllegalSymbolException

  Return a new RNA Sequence for rna.

  Parameters:
    `rna` - a String to parse into RNA
    `name` - a String to use as the name
  Returns:
    a Sequence created form dna
  Throws:
    `IllegalSymbolException` - if rna contains any non-DNA characters

### index

    public static int index(Symbol sym)
                     throws IllegalSymbolException

  Return an integer index for a symbol - compatible with forIndex.

  The index for a symbol is stable accross virtual machines & invocations.

  Parameters:
    `sym` - the Symbol to index
  Returns:
    the index for that symbol
  Throws:
    `IllegalSymbolException` - if sym is not a member of the DNA alphabet

### forIndex

    public static Symbol forIndex(int index)
                           throws java.lang.IndexOutOfBoundsException

  Return the symbol for an index - compatible with index.

  The index for a symbol is stable accross virtual machines & invocations.

  Parameters:
    `index` - the index to look up
  Returns:
    the symbol at that index
  Throws:
    `java.lang.IndexOutOfBoundsException` - if index is not between 0 and 3

### complement

    public static Symbol complement(Symbol sym)
                             throws IllegalSymbolException

  Complement the symbol.

  Parameters:
    `sym` - the symbol to complement
  Returns:
    a Symbol that is the complement of sym
  Throws:
    `IllegalSymbolException` - if sym is not a member of the DNA alphabet

### forSymbol

    public static Symbol forSymbol(char token)
                            throws IllegalSymbolException

  Retrieve the symbol for a symbol.

  Parameters:
    `token` - the char to look up
  Returns:
    the symbol for that char
  Throws:
    `IllegalSymbolException` - if the char is not a valid IUB code.

### complement

    public static SymbolList complement(SymbolList list)
                                 throws IllegalAlphabetException

  Retrieve a complement view of list.

  Parameters:
    `list` - the SymbolList to complement
  Returns:
    a SymbolList that is the complement
  Throws:
    `IllegalAlphabetException` - if list is not a complementable alphabet

### reverseComplement

    public static SymbolList reverseComplement(SymbolList list)
                                        throws IllegalAlphabetException

  Retrieve a reverse-complement view of list.

  Parameters:
    `list` - the SymbolList to complement
  Returns:
    a SymbolList that is the complement
  Throws:
    `IllegalAlphabetException` - if list is not a complementable alphabet

### transcribe

    public static SymbolList transcribe(SymbolList list)
                                 throws IllegalAlphabetException

  Transcribe DNA into RNA.

  Parameters:
    `list` - the SymbolList to transcribe
  Returns:
    a SymbolList that is the transcribed view
  Throws:
    `IllegalAlphabetException` - if the list is not DNA

### complementTable

    public static ReversibleTranslationTable complementTable()

  Get a translation table for complementing DNA symbols.

  Since:
    1.1

### transcriptionTable

    public static ReversibleTranslationTable transcriptionTable()

  Get a translation table for converting DNA to RNA.

  Since:
    1.1

### getGeneticCode

    public static TranslationTable getGeneticCode(java.lang.String name)

  Retrieve a TranslationTable by name. The valid names are:
  - "UNIVERSAL"
  - "BACTERIAL"
  - "YEAST_MITOCHONDRIAL"
  - "VERTEBRATE_MITOCHONDRIAL"
  - "MOLD_MITOCHONDRIAL"
  - "INVERTEBRATE_MITOCHONDRIAL"
  - "ECHINODERM_MITOCHONDRIAL"
  - "ASCIDIAN_MITOCHONDRIAL"
  - "FLATWORM_MITOCHONDRIAL"
  - "CILIATE_NUCLEAR"
  - "EUPLOTID_NUCLEAR"
  - "ALTERNATIVE_YEAST_NUCLEAR"
  - "BLEPHARISMA_MACRONUCLEAR"
  There are public static final fields in the TranslationTable interface which contain these values. One of these should be used as the argument for this method.

  Since:
    1.1

### getGeneticCodeNames

    public static java.util.Set getGeneticCodeNames()

  Retrieve a Set containing the name of each genetic code.

  Since:
    1.1

### translate

    public static SymbolList translate(SymbolList syms)
                                throws IllegalAlphabetException

  Translate RNA into protein (with termination symbols). For compatibility with BioJava 1.1, this will also handle sequences which are already expressed in the (RNA x RNA x RNA) (codon) alphabet.

  Throws:
    `IllegalAlphabetException`
  Since:
    1.1