jebl.evolution.sequences
Class GeneticCode

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

public final class GeneticCode
extends java.lang.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
static GeneticCode ALT_YEAST
           
static GeneticCode ASCIDIAN_MT
           
static GeneticCode BACTERIAL
           
static GeneticCode BLEPHARISMA_NUC
           
static GeneticCode CILIATE
           
static GeneticCode ECHINODERM_MT
           
static GeneticCode EUPLOTID_NUC
           
static GeneticCode FLATWORM_MT
           
static GeneticCode[] GENETIC_CODES
          Deprecated. use getGeneticCodes() instead
static GeneticCode INVERTEBRATE_MT
           
static GeneticCode MOLD_PROTOZOAN_MT
           
static GeneticCode MYCOPLASMA
           
static GeneticCode UNIVERSAL
           
static GeneticCode VERTEBRATE_MT
           
static GeneticCode YEAST
           
 
Method Summary
 java.lang.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.
 java.util.Set<CodonState> getCodonsForAminoAcid(AminoAcidState aminoAcidState)
           
 java.lang.String getDescription()
          Returns the description of the genetic code
static java.lang.Iterable<GeneticCode> getGeneticCodes()
          Returns an iterable that allows you to iterate over all the standard genetic codes
static GeneticCode[] getGeneticCodesArray()
           
 java.lang.String getName()
          Returns the name of the genetic code
 int getNcbiTranslationTableNumber()
           
 java.util.Set<CodonState> getStartCodons()
           
 int getStopCodonCount()
          Returns the number of terminator amino acids.
 java.util.Set<CodonState> getStopCodons()
           
 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.
 AminoAcidState getTranslation(java.lang.String nucleotides)
          Returns the state associated with AminoAcid represented by the three nucleotides.
 boolean isStartCodon(CodonState codonState)
          Deprecated. 
 MaybeBoolean isStartCodonString(java.lang.String tripletString)
          Checks whether all possible disambiguations of a given nucleotide triplet string represents a start codon.
 boolean isStopCodon(CodonState codonState)
          Deprecated. 
 MaybeBoolean isStopCodonString(java.lang.String tripletString)
          Checks whether a given String represents a stop codon.
 java.lang.String toString()
          Same as getDescription() (so that GeneticCode objects can be used e.g.
static GeneticCode valueOf(int NCBITranslationTableNumber)
           
static GeneticCode valueOf(java.lang.String name)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

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 Detail

getGeneticCodes

public static java.lang.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(java.lang.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 java.lang.String getName()
Returns the name of the genetic code

Returns:
the name of this genetic code

getDescription

public java.lang.String getDescription()
Returns the description of the genetic code

Returns:
the description of this genetic code

getCodeTable

public java.lang.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(java.lang.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(java.lang.String tripletString)
                                throws java.lang.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:
java.lang.IllegalArgumentException - if tripletString doesn't consist of 3 nucleotide or ambiguity symbols
java.lang.NullPointerException - if tripletString is null

isStartCodon

@Deprecated
public boolean isStartCodon(CodonState codonState)
Deprecated. 

As of 2007-07-30, CodonStates 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, CodonStates 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(java.lang.String tripletString)
                               throws java.lang.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:
java.lang.IllegalArgumentException - if tripletString doesn't consist of 3 nucleotide or ambiguity symbols
java.lang.NullPointerException - if tripletString is null

getCodonsForAminoAcid

public java.util.Set<CodonState> getCodonsForAminoAcid(AminoAcidState aminoAcidState)
Returns:
all the possible codons for a given amino acid

getStartCodons

public java.util.Set<CodonState> getStartCodons()
Returns:
the codon states of starts

getStopCodons

public java.util.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 java.lang.String toString()
Same as getDescription() (so that GeneticCode objects can be used e.g. in a JComboBox).

Overrides:
toString in class java.lang.Object
Returns:
the description of this genetic code


http://code.google.com/p/jebl2/