All Packages Class Hierarchy This Package Previous Next Index
Class diana.sequence.AminoAcidSequence
java.lang.Object
|
+----diana.sequence.AminoAcidSequence
- public class AminoAcidSequence
- extends Object
Objects of this class represent a string of amino acids.
- Version:
- $Id: AminoAcidSequence.java,v 1.24 2003/11/18 14:38:16 kmr Exp $
-
amino_acid_symbol_count
- The number of amino acid symbols, not including stop codons: 20.
-
codon_translation_array
- This table is used for fast lookup of codon translations by
getCodonTranslation ().
-
HYDROPHOBIC_AA
- Used by getAminoAcidType ().
-
ILLEGAL_AA
- Used by getAminoAcidType ().
-
NEGATIVELY_CHARGED_AA
- Used by getAminoAcidType ().
-
POLAR_UNCHARGED_AA
- Used by getAminoAcidType ().
-
POSITIVELY_CHARGED_AA
- Used by getAminoAcidType ().
-
SPECIAL_AA
- Used by getAminoAcidType ().
-
STOP_AA
- Used by getAminoAcidType ().
-
symbol_count
- The number of amino acid symbols, including stop codons and a symbol for
unknown (---): 23.
-
UNKNOWN_AA
- Used by getAminoAcidType ().
-
AminoAcidSequence(String)
- Create a new AminoAcidSequence object from a string containing single
character amino acids symbols.
-
checkForMatch(AminoAcidSequence)
- Search the subject_sequence for this AminoAcidSequence as a substring.
-
containsStopCodon()
- Return true if and only if this sequence contains a stop codon.
-
elementAt(int)
- Return the one letter codon code of the codon at the given index
(counting from zero).
-
findMatch(Bases, Marker, boolean)
- Find the next occurrence of this seqeuence on either Strand of the given
Bases object.
-
getAminoAcidType(char)
- Returns one of POLAR_UNCHARGED_AA, POSITIVELY_CHARGED_AA,
NEGATIVELY_CHARGED_AA, HYDROPHOBIC_AA, SPECIAL_AA or STOP_AA depending
on the aa_char argument.
-
getCodonTranslation(char, char, char)
- Translate a single codon into the corresponding single letter amino acid
code.
-
getCodonTranslation(String)
- Translate a single codon into the corresponding single letter amino acid
code.
-
getMolecularWeight()
- Return the total molecular weight of the amino acids in this
AminoAcidSequence..
-
getOneLetterCode(String)
- Return the one letter abbreviation for the given three letter amino acid
name.
-
getSymbolFromIndex(int)
- Given an index return a one letter codon symbol.
-
getSymbolIndex(char)
- Return an integer from 0 to 22 representing the index of a codon
symbol.
-
getThreeLetterAbbreviation(char)
- Return the three letter abbreviation for the given one letter amino acid
code.
-
getThreeLetterAbbreviation(int)
- Return the three letter abbreviation for the given index code.
-
getTranslation(String, boolean)
- Translate a sequence of bases into the corresponding single letter amino
acid codes.
-
isLegalCodon(char)
- Return true if and only if the given one letter code symbol is the a
legal amino acid or stop symbol.
-
isStopCodon(char)
- Return true if and only if the given amino acid symbol is the
translation of a stop codon.
-
length()
- Return the number of units in this amino acid sequence.
-
reverseComplementSearchBackwardFor(String, int)
- Search backward for this AminoAcidSequence in the reverse complement of
the given String of bases.
-
reverseComplementSearchFor(String, int, boolean)
- Search for this AminoAcidSequence in the reverse complement of the given
String of bases.
-
reverseComplementSearchForwardFor(String, int)
- Search forward for this AminoAcidSequence in the reverse complement of
the given String of bases.
-
searchBackwardFor(String, int)
- Search backward for this AminoAcidSequence in the given String of bases.
-
searchFor(String, int, boolean)
- Search for this AminoAcidSequence in the given String of bases.
-
searchForwardFor(String, int)
- Search forward for this AminoAcidSequence in the given String of bases.
-
toString()
- Return a string representation of this object.
codon_translation_array
public static final char codon_translation_array[]
- This table is used for fast lookup of codon translations by
getCodonTranslation (). There is one entry for each codon and the
entries are in this order: TTT, TTC, TTA, TTG, TCT, TCC, ...
POLAR_UNCHARGED_AA
public static final int POLAR_UNCHARGED_AA
- Used by getAminoAcidType ().
POSITIVELY_CHARGED_AA
public static final int POSITIVELY_CHARGED_AA
- Used by getAminoAcidType ().
NEGATIVELY_CHARGED_AA
public static final int NEGATIVELY_CHARGED_AA
- Used by getAminoAcidType ().
HYDROPHOBIC_AA
public static final int HYDROPHOBIC_AA
- Used by getAminoAcidType ().
SPECIAL_AA
public static final int SPECIAL_AA
- Used by getAminoAcidType ().
STOP_AA
public static final int STOP_AA
- Used by getAminoAcidType ().
UNKNOWN_AA
public static final int UNKNOWN_AA
- Used by getAminoAcidType ().
ILLEGAL_AA
public static final int ILLEGAL_AA
- Used by getAminoAcidType ().
symbol_count
public static final int symbol_count
- The number of amino acid symbols, including stop codons and a symbol for
unknown (---): 23.
amino_acid_symbol_count
public static final int amino_acid_symbol_count
- The number of amino acid symbols, not including stop codons: 20.
AminoAcidSequence
public AminoAcidSequence(String amino_acid_string)
- Create a new AminoAcidSequence object from a string containing single
character amino acids symbols.
getTranslation
public static AminoAcidSequence getTranslation(String bases,
boolean unknown_is_x)
- Translate a sequence of bases into the corresponding single letter amino
acid codes.
- Parameters:
- bases - The bases to translated. If the string length is not a
multiple of three the last codon is incomplete and will not be
translated.
- unknown_is_x - If this parameter is true codons that contain
ambiguous bases will be translated as 'x', if false they will be
translated as '.'
- Returns:
- The translated sequence in one letter abbreviated form.
getCodonTranslation
public static char getCodonTranslation(String codon_string)
- Translate a single codon into the corresponding single letter amino acid
code.
- Parameters:
- codon_string - A three character lowercase String containing the
bases to translate.
- Returns:
- The translated sequence in one letter abbreviated form. The
return value will be '.' if the codon_string isn't a codon (eg. it
contains more or less than three letters or the letters aren't from
"CTAG")
getCodonTranslation
public static char getCodonTranslation(char first_letter,
char second_letter,
char third_letter)
- Translate a single codon into the corresponding single letter amino acid
code.
- Parameters:
- first_letter - The first base of the codon.
- second_letter - The second base of the codon.
- third_letter - The third base of the codon.
- Returns:
- The translated sequence in one letter abbreviated form. The
return value will be '.' if the letters do not form a codon.
length
public int length()
- Return the number of units in this amino acid sequence.
elementAt
public char elementAt(int index)
- Return the one letter codon code of the codon at the given index
(counting from zero).
getMolecularWeight
public float getMolecularWeight()
- Return the total molecular weight of the amino acids in this
AminoAcidSequence..
toString
public String toString()
- Return a string representation of this object. This string will contain
the one character amino acid codes for each acid in sequence.
- Overrides:
- toString in class Object
checkForMatch
public boolean checkForMatch(AminoAcidSequence subject_sequence)
- Search the subject_sequence for this AminoAcidSequence as a substring.
'X' AAs are treated as wildcards in both sequences.
findMatch
public MarkerRange findMatch(Bases bases,
Marker search_start_marker,
boolean search_backwards)
- Find the next occurrence of this seqeuence on either Strand of the given
Bases object. This method searches both strands simultaneously by
searching the underlying Bases object directly.
- Parameters:
- bases - This holds the Strand objects to search.
- search_start_marker - The match that will be returned will be
after this base Marker position. Position 1 on the reverse strand is
considered to be after position 1 on the forward strand, forward
position 2 is after reverse position 1, reverse position 2 is after
forward position 2, etc. This scheme allows the caller to iterate
through all matches.
- search_end_position - The search will not extend past this
position.
- search_backwards - If true the search will move from last base to
first base, otherwise first to last.
- Returns:
- A MarkerRange covering the matching bases or null if there is no
match in the given range.
searchFor
public int searchFor(String bases_string,
int start_index,
boolean search_backwards)
- Search for this AminoAcidSequence in the given String of bases. The
String is treated as a sequence of bases and this AminoAcidSequence is
searched for in each of the three reading frames.
- Parameters:
- bases_string - Search this String for the amino acid sequence.
- start_index - This is the index in bases_string where the search
should start.
- search_backwards - If true the search will move from last base to
first base, otherwise first to last.
- Returns:
- The index of the match or -1 if there is no match.
searchForwardFor
public int searchForwardFor(String bases_string,
int start_index)
- Search forward for this AminoAcidSequence in the given String of bases.
The String is treated as a sequence of bases and this AminoAcidSequence
is searched for in each of the three reading frames.
- Parameters:
- bases_string - Search this String for the amino acid sequence.
- start_index - This is the index in bases_string where the search
should start.
- Returns:
- The index of the match or -1 if there is no match.
searchBackwardFor
public int searchBackwardFor(String bases_string,
int start_index)
- Search backward for this AminoAcidSequence in the given String of bases.
The String is treated as a sequence of bases and this AminoAcidSequence
is searched for in each of the three reading frames.
- Parameters:
- bases_string - Search this String for the amino acid sequence.
- start_index - This is the index in bases_string where the search
should start.
- Returns:
- The index of the match or -1 if there is no match.
reverseComplementSearchFor
public int reverseComplementSearchFor(String bases_string,
int start_index,
boolean search_backwards)
- Search for this AminoAcidSequence in the reverse complement of the given
String of bases. The String is treated as a sequence of bases and this
AminoAcidSequence is searched for in each of the three reading frames.
- Parameters:
- bases_string - Search this String for the amino acid sequence.
- start_index - This is the index in bases_string where the search
should start.
- search_backwards - If true the search will move from last base to
first base, otherwise first to last.
- Returns:
- The index of the match or -1 if there is no match.
reverseComplementSearchForwardFor
public int reverseComplementSearchForwardFor(String bases_string,
int start_index)
- Search forward for this AminoAcidSequence in the reverse complement of
the given String of bases. The String is treated as a sequence of bases
and this AminoAcidSequence is searched for in each of the three reading
frames.
- Parameters:
- bases_string - Search this String for the amino acid sequence.
- start_index - This is the index in bases_string where the search
should start.
- Returns:
- The index of the match or -1 if there is no match.
reverseComplementSearchBackwardFor
public int reverseComplementSearchBackwardFor(String bases_string,
int start_index)
- Search backward for this AminoAcidSequence in the reverse complement of
the given String of bases. The String is treated as a sequence of bases
and this AminoAcidSequence is searched for in each of the three reading
frames.
- Parameters:
- bases_string - Search this String for the amino acid sequence.
- start_index - This is the index in bases_string where the search
should start.
- Returns:
- The index of the match or -1 if there is no match.
containsStopCodon
public boolean containsStopCodon()
- Return true if and only if this sequence contains a stop codon.
isStopCodon
public static boolean isStopCodon(char amino_acid_char)
- Return true if and only if the given amino acid symbol is the
translation of a stop codon. ie #, * or +.
isLegalCodon
public static boolean isLegalCodon(char one_letter_code)
- Return true if and only if the given one letter code symbol is the a
legal amino acid or stop symbol.
getAminoAcidType
public static int getAminoAcidType(char aa_char)
- Returns one of POLAR_UNCHARGED_AA, POSITIVELY_CHARGED_AA,
NEGATIVELY_CHARGED_AA, HYDROPHOBIC_AA, SPECIAL_AA or STOP_AA depending
on the aa_char argument.
getOneLetterCode
public static char getOneLetterCode(String three_letter_code)
- Return the one letter abbreviation for the given three letter amino acid
name.
- Returns:
- A one letter code or -1 if three_letter_code can't be understood.
getThreeLetterAbbreviation
public static String getThreeLetterAbbreviation(char one_letter_code)
- Return the three letter abbreviation for the given one letter amino acid
code.
getThreeLetterAbbreviation
public static String getThreeLetterAbbreviation(int index)
- Return the three letter abbreviation for the given index code.
getSymbolIndex
public static int getSymbolIndex(char one_letter_code)
- Return an integer from 0 to 22 representing the index of a codon
symbol.
getSymbolFromIndex
public static char getSymbolFromIndex(int index)
- Given an index return a one letter codon symbol. This method is the
inverse of getSymbolIndex ().
All Packages Class Hierarchy This Package Previous Next Index