# Class CodonTable

java.lang.Object
org.snpeff.codons.CodonTable

public class CodonTable extends Object
A codon translation table

Author:
  pcingola

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`DEFAULT_START_CODON`
All start codons are translated as "M".
`static final String`
`TERMINATION_CODON`
`static final String`
`TERMINATION_CODON_1`

## Constructor Summary

Constructors
Constructor
Description
`CodonTable(String name, String table)`

## Method Summary

Modifier and Type
Method
Description
`String`
`aa(String codons)`
Translate codons to an amino acid sequence
`String`
`aa(String codons, boolean fullProteinSequence)`
`String`
`aaThreeLetterCode(char aa)`
`String`
`aaThreeLetterCode(String aa)`
Convert 1-letter code to 3-letter code (amino acids) Reference: http://www.hgvs.org/mutnomen/standards.html#aalist
`List<String>`
`codon(String aa)`
Translate an amino acid into a codon
`int`
`degenerate(String codon, int pos)`
Degree of "degenerate site" What is a "degenerate site"? Here is an explanation form Stephen Wright (Univ.
`String`
`getName()`
`boolean`
`isStart(String codon)`
Is 'codon' a start codon in this table?
`boolean`
`isStartFirst(String codon)`
Is the first codon a 'start' codon?
`boolean`
`isStop(String codon)`
Is 'codon' a stop codon in this table?
`boolean`
`isStopAa(String aas)`
Is there a stop codon in this amino acid sequence
`boolean`
`isStopAaSymbol(char aaSymbol)`
`String`
`toString()`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Field Details

### TERMINATION_CODON

public static final String TERMINATION_CODON

See Also:
  - Constant Field Values

### TERMINATION_CODON_1

public static final String TERMINATION_CODON_1

See Also:
  - Constant Field Values

### DEFAULT_START_CODON

public static final String DEFAULT_START_CODON
All start codons are translated as "M". Reference: https://en.wikipedia.org/wiki/Start_codon Alternative start codons are different from the standard AUG codon and are found in both prokaryotes (bacteria) and eukaryotes. Alternate start codons are still translated as Met when they are at the start of a protein (even if the codon encodes a different amino acid otherwise). This is because a separate transfer RNA (tRNA) is used for initiation.

See Also:
  - Constant Field Values

## Constructor Details

### CodonTable

public CodonTable(String name, String table)

## Method Details

### aa

public String aa(String codons)
Translate codons to an amino acid sequence

### aa

public String aa(String codons, boolean fullProteinSequence)

### aaThreeLetterCode

public String aaThreeLetterCode(char aa)

### aaThreeLetterCode

public String aaThreeLetterCode(String aa)
Convert 1-letter code to 3-letter code (amino acids) Reference: http://www.hgvs.org/mutnomen/standards.html#aalist

Parameters:
  `Amino` - acid in three letter code

### codon

public List<String> codon(String aa)
Translate an amino acid into a codon

### degenerate

public int degenerate(String codon, int pos)
Degree of "degenerate site" What is a "degenerate site"? Here is an explanation form Stephen Wright (Univ. Toronto), who requested to add this feature "...a fourfold degenerate site would be a site where any change is synonymous. So the third codon position for the arginine CGN, is a fourfold degenerate site, as is the third codon position for valine, alanine, etc. Similarly, all second positions of a codon are zerofold degenerate, since any change is nonsynonymous. Many first codon positions are also zerofold degenerate, however, for example, the first codon position of AGG is NOT zerofold, because a shift to CGG is a synonymous change."

Parameters:
  `codon` -
  `pos` -
Returns:
  Degenracy level, or '-1' if not available

### getName

public String getName()

### isStart

public boolean isStart(String codon)
Is 'codon' a start codon in this table?

### isStartFirst

public boolean isStartFirst(String codon)
Is the first codon a 'start' codon?

### isStopAaSymbol

public boolean isStopAaSymbol(char aaSymbol)

### isStop

public boolean isStop(String codon)
Is 'codon' a stop codon in this table?

### isStopAa

public boolean isStopAa(String aas)
Is there a stop codon in this amino acid sequence

### toString

public String toString()

Overrides:
  `toString` in class `Object`