javagene.seq
Class AminoAcid

java.lang.Object
  extended by javagene.seq.AminoAcid

public class AminoAcid
extends java.lang.Object

An amino acid object with codon/residue utility methods. Implements the classic 20, plus STOP.


Field Summary
static AminoAcid ALA
           
static AminoAcid ARG
           
static AminoAcid ASN
           
static AminoAcid ASP
           
static AminoAcid CYS
           
static AminoAcid GLN
           
static AminoAcid GLU
           
static AminoAcid GLY
           
static AminoAcid HIS
           
static AminoAcid ILE
           
static AminoAcid LEU
           
static AminoAcid LYS
           
static AminoAcid MET
           
static AminoAcid PHE
           
static AminoAcid PRO
           
static AminoAcid SER
           
static AminoAcid STOP
           
static AminoAcid THR
           
static AminoAcid TRP
           
static AminoAcid TYR
           
static AminoAcid UNDEFINED
           
static AminoAcid VAL
           
 
Method Summary
static int blosum62(AminoAcid a, AminoAcid b)
          Get BLOSUM62 distance between two AminoAcids.
 boolean isSynonym(java.lang.String str)
          Check if a three-letter Dna/Rna codon codes for this AminoAcid.
static AminoAcid lookup(java.lang.String str)
          Find the AminoAcid object corresponding to a three-letter Dna/Rna codon.
 java.lang.String toString()
          Get the IUPAC single letter representation of this AminoAcid.
static java.lang.String translate(java.lang.String str)
          Translate from IUPAC nucleotide string to IUPAC protein string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ALA

public static final AminoAcid ALA

ARG

public static final AminoAcid ARG

ASN

public static final AminoAcid ASN

ASP

public static final AminoAcid ASP

CYS

public static final AminoAcid CYS

GLN

public static final AminoAcid GLN

GLU

public static final AminoAcid GLU

GLY

public static final AminoAcid GLY

HIS

public static final AminoAcid HIS

ILE

public static final AminoAcid ILE

LEU

public static final AminoAcid LEU

LYS

public static final AminoAcid LYS

MET

public static final AminoAcid MET

PHE

public static final AminoAcid PHE

PRO

public static final AminoAcid PRO

SER

public static final AminoAcid SER

STOP

public static final AminoAcid STOP

THR

public static final AminoAcid THR

TRP

public static final AminoAcid TRP

TYR

public static final AminoAcid TYR

UNDEFINED

public static final AminoAcid UNDEFINED

VAL

public static final AminoAcid VAL
Method Detail

blosum62

public static int blosum62(AminoAcid a,
                           AminoAcid b)
Get BLOSUM62 distance between two AminoAcids. Distances between AminoAcid.STOP, AminoAcid.UNDEFINED and other AminoAcids are not defined.

Parameters:
a - An AminoAcid.
b - Another AminoAcid.
Returns:
An integer distance based on the Blosum62 table.
Throws:
java.lang.IllegalArgumentException - A parameter specified either a STOP or UNDEFINED AminoAcid.

isSynonym

public boolean isSynonym(java.lang.String str)
Check if a three-letter Dna/Rna codon codes for this AminoAcid.

Parameters:
str - A string of exactly three letters representing a codon. Letters can be upper or lower case. Both U and T are accepted and considered equivalent.
Returns:
True if str codes for this AminoAcid.

lookup

public static AminoAcid lookup(java.lang.String str)
Find the AminoAcid object corresponding to a three-letter Dna/Rna codon.

Parameters:
str - A string of exactly three letters to look up. Letters can be upper or lower case. Both U and T are accepted.
Returns:
An AminoAcid object. Unknown codons return AminoAcid.UNDEFINED. Stop codons (TGA, TAG, TAA ) return AminoAcid.STOP.
Throws:
java.lang.IllegalArgumentException - The str parameter was not of length 3.

toString

public java.lang.String toString()
Get the IUPAC single letter representation of this AminoAcid.

Overrides:
toString in class java.lang.Object
Returns:
The uppercase single letter representation. "X" is returned for both STOP and UNDEFINED.

translate

public static java.lang.String translate(java.lang.String str)
Translate from IUPAC nucleotide string to IUPAC protein string. The nucleotides are considered in groups of three, starting at the beginning of the string, and translated using the lookup() and toString() methods. If the string length is not divisible by three, the final one or two letters are ignored (no error indication).

Parameters:
str - A Dna/Rna string.
Returns:
A string of the IUPAC amino acid single letter abbreviations for the translated codons.