Package jebl.evolution.sequences

# Class GeneticCode

java.lang.Object
jebl.evolution.sequences.GeneticCode

public final class GeneticCode extends Object
A set of standard genetic codes.

Version:
  $Id: GeneticCode.java 1044 2009-12-09 03:33:54Z stevensh $
Author:
  Andrew Rambaut, Alexei Drummond

## Field Summary

Fields
Modifier and Type
Field
Description
`static final GeneticCode`
`ALT_YEAST`
`static final GeneticCode`
`ASCIDIAN_MT`
`static final GeneticCode`
`BACTERIAL`
`static final GeneticCode`
`BLEPHARISMA_NUC`
`static final GeneticCode`
`CILIATE`
`static final GeneticCode`
`ECHINODERM_MT`
`static final GeneticCode`
`EUPLOTID_NUC`
`static final GeneticCode`
`FLATWORM_MT`
`static final GeneticCode[]`
`GENETIC_CODES`
Deprecated.
use `getGeneticCodes()` instead
`static final GeneticCode`
`INVERTEBRATE_MT`
`static final GeneticCode`
`MOLD_PROTOZOAN_MT`
`static final GeneticCode`
`MYCOPLASMA`
`static final GeneticCode`
`UNIVERSAL`
`static final GeneticCode`
`VERTEBRATE_MT`
`static final GeneticCode`
`YEAST`

## Method Summary

Modifier and Type
Method
Description
`String`
`getCodeTable()`
Returns a length-64 string that for each nucleotide triplet contains the single-character amino acid code (see `AminoAcids` to which that triplet is translated in this genetic code.
`Set<CodonState>`
`getCodonsForAminoAcid(AminoAcidState aminoAcidState)`
`String`
`getDescription()`
Returns the description of the genetic code
`static Iterable<GeneticCode>`
`getGeneticCodes()`
Returns an iterable that allows you to iterate over all the standard genetic codes
`static GeneticCode[]`
`getGeneticCodesArray()`
`String`
`getName()`
Returns the name of the genetic code
`int`
`getNcbiTranslationTableNumber()`
`Set<CodonState>`
`getStartCodons()`
`int`
`getStopCodonCount()`
Returns the number of terminator amino acids.
`Set<CodonState>`
`getStopCodons()`
`AminoAcidState`
`getTranslation(String nucleotides)`
Returns the state associated with AminoAcid represented by the three nucleotides.
`AminoAcidState`
`getTranslation(CodonState codonState)`
Returns the state associated with AminoAcid represented by codonState.
`AminoAcidState`
`getTranslation(NucleotideState nucleotide1, NucleotideState nucleotide2, NucleotideState nucleotide3)`
Returns the state associated with AminoAcid represented by the three nucleotides.
`boolean`
`isStartCodon(CodonState codonState)`
Deprecated.
`MaybeBoolean`
`isStartCodonString(String tripletString)`
Checks whether all possible disambiguations of a given nucleotide triplet string represents a start codon.
`boolean`
`isStopCodon(CodonState codonState)`
Deprecated.
`MaybeBoolean`
`isStopCodonString(String tripletString)`
Checks whether a given String represents a stop codon.
`String`
`toString()`
Same as getDescription() (so that GeneticCode objects can be used e.g.
`static GeneticCode`
`valueOf(int NCBITranslationTableNumber)`
`static GeneticCode`
`valueOf(String name)`

### Methods inherited from class java.lang.Object

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

## Field Details

### UNIVERSAL

public static final GeneticCode UNIVERSAL

### VERTEBRATE_MT

public static final GeneticCode VERTEBRATE_MT

### YEAST

public static final GeneticCode YEAST

### MOLD_PROTOZOAN_MT

public static final GeneticCode MOLD_PROTOZOAN_MT

### MYCOPLASMA

public static final GeneticCode MYCOPLASMA

### INVERTEBRATE_MT

public static final GeneticCode INVERTEBRATE_MT

### CILIATE

public static final GeneticCode CILIATE

### ECHINODERM_MT

public static final GeneticCode ECHINODERM_MT

### EUPLOTID_NUC

public static final GeneticCode EUPLOTID_NUC

### BACTERIAL

public static final GeneticCode BACTERIAL

### ALT_YEAST

public static final GeneticCode ALT_YEAST

### ASCIDIAN_MT

public static final GeneticCode ASCIDIAN_MT

### FLATWORM_MT

public static final GeneticCode FLATWORM_MT

### BLEPHARISMA_NUC

public static final GeneticCode BLEPHARISMA_NUC

### GENETIC_CODES

@Deprecated public static final GeneticCode[] GENETIC_CODES
Deprecated.
use `getGeneticCodes()` instead
Use of this field is deprecated because being an array it is mutable, i.e. an attacker could potentially replace values in this array.

## Method Details

### getGeneticCodes

public static Iterable<GeneticCode> getGeneticCodes()
Returns an iterable that allows you to iterate over all the standard genetic codes

Returns:
  An iterable over the genetic codes

### getGeneticCodesArray

public static GeneticCode[] getGeneticCodesArray()

### valueOf

public static GeneticCode valueOf(String name)

Parameters:
  `name` - the name of the genetic code
Returns:
  the genetic code such that `getDescription()` equals name

### valueOf

public static GeneticCode valueOf(int NCBITranslationTableNumber)

Parameters:
  `NCBITranslationTableNumber` - the name of the genetic code
Returns:
  the genetic code such that `getNcbiTranslationTableNumber()` equals NCBITranslationTableNumber

### getName

public String getName()
Returns the name of the genetic code

Returns:
  the name of this genetic code

### getDescription

public String getDescription()
Returns the description of the genetic code

Returns:
  the description of this genetic code

### getCodeTable

public String getCodeTable()
Returns a length-64 string that for each nucleotide triplet contains the single-character amino acid code (see `AminoAcids` to which that triplet is translated in this genetic code.

Returns:
  the string passed to the constructor as the `codeTable` argument.

### getTranslation

public AminoAcidState getTranslation(CodonState codonState)
Returns the state associated with AminoAcid represented by codonState. Note that the state is the canonical state (generated combinatorially)

Returns:
  '?' if codon unknown
See Also:
  - `AminoAcids`
  - `Codons`

### getTranslation

public AminoAcidState getTranslation(NucleotideState nucleotide1, NucleotideState nucleotide2, NucleotideState nucleotide3)
Returns the state associated with AminoAcid represented by the three nucleotides. If one or more of the nucleotides are ambiguous, and all combinations translate to the same protein, then this method will return that protein

Returns:
  '?' if codon unknown
See Also:
  - `AminoAcids`
  - `Codons`

### getTranslation

public AminoAcidState getTranslation(String nucleotides)
Returns the state associated with AminoAcid represented by the three nucleotides. If one or more of the nucleotides are ambiguous, and all combinations translate to the same protein, then this method will return that protein

Parameters:
  `nucleotides` - a string consisting of exactly 3 residues in any case.
Returns:
  '?' if codon unknown
See Also:
  - `AminoAcids`
  - `Codons`

### isStartCodonString

public MaybeBoolean isStartCodonString(String tripletString) throws IllegalArgumentException
Checks whether all possible disambiguations of a given nucleotide triplet string represents a start codon.

Parameters:
  `tripletString` - A string of length 3, with each character representing one nucleotide or ambiguity symbol
Returns:
  Whether all possible disambiguations of tripletString represent a start codon.
Throws:
  `IllegalArgumentException` - if tripletString doesn't consist of 3 nucleotide or ambiguity symbols
  `NullPointerException` - if tripletString is null

### isStartCodon

@Deprecated public boolean isStartCodon(CodonState codonState)
Deprecated.
As of 2007-07-30, `CodonState`s exist only for nonambiguous nucleotide triplets. Therefore, this method cannot be used to check if an ambiguous triplet of nucleotides codes for a transcription, start and therefore this method is deprecated.

Parameters:
  `codonState` -
Returns:
  True if the specified codonState codes for a transcription start under this genetic code.

### isStopCodon

@Deprecated public boolean isStopCodon(CodonState codonState)
Deprecated.
As of 2007-07-30, `CodonState`s exist only for nonambiguous nucleotide triplets. Therefore, this method cannot be used to check if an ambiguous triplet of nucleotides codes for a stop, and therefore this method is deprecated.

Parameters:
  `codonState` -
Returns:
  True if the specified codonState codes for a stop under this genetic code.

### isStopCodonString

public MaybeBoolean isStopCodonString(String tripletString) throws IllegalArgumentException
Checks whether a given String represents a stop codon.

Parameters:
  `tripletString` - A string of length 3, with each character representing one nucleotide or ambiguity symbol
Returns:
  true if tripletString represents a stop codon.
Throws:
  `IllegalArgumentException` - if tripletString doesn't consist of 3 nucleotide or ambiguity symbols
  `NullPointerException` - if tripletString is null

### getCodonsForAminoAcid

public Set<CodonState> getCodonsForAminoAcid(AminoAcidState aminoAcidState)

Returns:
  all the possible codons for a given amino acid

### getStartCodons

public Set<CodonState> getStartCodons()

Returns:
  the codon states of starts

### getStopCodons

public Set<CodonState> getStopCodons()

Returns:
  the codon states of stops.

### getStopCodonCount

public int getStopCodonCount()
Returns the number of terminator amino acids.

### getNcbiTranslationTableNumber

public int getNcbiTranslationTableNumber()

Returns:
  the number used by NCBI to represent this genetic code or -1 if none. Eg. 1 = Standard...

### toString

public String toString()
Same as getDescription() (so that GeneticCode objects can be used e.g. in a JComboBox).

Overrides:
  `toString` in class `Object`
Returns:
  the description of this genetic code