java.lang.Object
com.compomics.util.experiment.personalization.ExperimentObject
com.compomics.util.experiment.biology.aminoacids.AminoAcid
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
Alanine, Arginine, Asparagine, AsparticAcid, B, Cysteine, GlutamicAcid, Glutamine, Glycine, Histidine, Isoleucine, J, Leucine, Lysine, Methionine, Phenylalanine, Proline, Pyrrolysine, Selenocysteine, Serine, Threonine, Tryptophan, Tyrosine, Valine, X, Z

public abstract class AminoAcid
extends ExperimentObject
Class representing amino acids.
Author:
Marc Vaudel, Harald Barsnes
See Also:
Serialized Form
  • Field Details

  • Constructor Details

    • AminoAcid

      public AminoAcid()
      Empty default constructor.
  • Method Details

    • getAminoAcids

      public static char[] getAminoAcids()
      Convenience method returning an array of all implemented amino acids represented by their singe letter code.
      Returns:
      an array of all implemented amino acids
    • getSingleLetterCodeAsChar

      public char getSingleLetterCodeAsChar()
      Returns the single letter code as character.
      Returns:
      the single letter code as character
    • getAminoAcidsList

      public static List<String> getAminoAcidsList()
      Convenience method returning an arrayList of all implemented amino acids.
      Returns:
      an arrayList of all implemented amino acids represented by their character
    • getUniqueAminoAcids

      public static char[] getUniqueAminoAcids()
      Returns a char array of the one letter code of amino acids without combinations of amino acids.
      Returns:
      a char array of the one letter code of amino acids without combinations of amino acids
    • getAminoAcid

      public static AminoAcid getAminoAcid​(String aa) throws IllegalArgumentException
      Returns the amino acid corresponding to the letter given. Throws an exception if not implemented. If more than one letter is given only the first one will be accounted for.
      Parameters:
      aa - the amino acid single letter code as a String
      Returns:
      the corresponding amino acid
      Throws:
      IllegalArgumentException - if the amino acid is not implemented
    • getAminoAcid

      public static AminoAcid getAminoAcid​(char aa) throws IllegalArgumentException
      Returns the amino acid corresponding to the single letter code given. Throws an exception if not implemented.
      Parameters:
      aa - the single letter code of the amino acid
      Returns:
      the corresponding amino acid
      Throws:
      IllegalArgumentException - if the amino acid is not implemented
    • iscombination

      public abstract boolean iscombination()
      Indicates whether the amino acid object refers to a combination of amino acids like B, J, Z or X.
      Returns:
      an boolean indicating whether the amino acid object refers to a combination of amino acids like B, J, Z or X
    • getSubAminoAcids

      public char[] getSubAminoAcids()
      In case of a combination of amino acids, returns the comprised amino acids or amino acid groups represented by their single letter code including sub combinations. Example: Z > {G, Q}.
      Returns:
      the actual amino acids
    • getSubAminoAcids

      public char[] getSubAminoAcids​(boolean includeCombinations)
      In case of a combination of amino acids, returns the comprised amino acids or amino acid groups represented by their single letter code. Example: Z > {G, Q}.
      Parameters:
      includeCombinations - if true, sub-amino acids which are amino acids combinations like Z will also be included
      Returns:
      the actual amino acids
    • getCombinations

      public char[] getCombinations()
      Returns the amino acids combinations which might represent this amino acid. Example: g > {Z, X}.
      Returns:
      the amino acids combinations which might represent this amino acid
    • getMatchingAminoAcid

      public static char getMatchingAminoAcid​(char aa, SequenceMatchingParameters sequenceMatchingPreferences)
      Returns a matching amino acid using the given preferences. The amino acid is unique when different possibilities are found, then for instance I is returned for both I and L. The first of the amino acid string array is returned.
      Parameters:
      aa - the single letter code of the amino acid of interest
      sequenceMatchingPreferences - the sequence matching preferences
      Returns:
      a matching amino acid using the given matching type and massTolerance
    • getMatchingSequence

      public static String getMatchingSequence​(String sequence, SequenceMatchingParameters sequenceMatchingPreferences)
      Returns the matching sequence of a given sequence. For example both PEPTLDE and PEPTIDE will return PEPTIDE when I and L are considered as indistinguishable. See getMatchingAminoAcid for more details.
      Parameters:
      sequence - the sequence of interest
      sequenceMatchingPreferences - the sequence matching preferences
      Returns:
      the matching sequence
    • getStandardGeneticCode

      public String[] getStandardGeneticCode()
      Returns the standard genetic triplets associated to this amino acid.
      Returns:
      the standard genetic triplets associated to this amino acid
    • getAminoAcidFromGeneticCode

      public static AminoAcid getAminoAcidFromGeneticCode​(String geneticCode)
      Returns the amino acid from the standard genetic code. Null if not coding for an amino acid.
      Parameters:
      geneticCode - the three letter genetic code of the desired amino acid
      Returns:
      the amino acid from the standard genetic code
    • getStandardGeneticCodeForCombination

      protected String[] getStandardGeneticCodeForCombination()
      Returns the genetic code as combination of the sub amino acid genetic codes.
      Returns:
      the genetic code as combination of the sub amino acid genetic codes
    • getMonoisotopicAtomChain

      public AtomChain getMonoisotopicAtomChain()
      Returns the monoisotopic atom chain representing this amino acid.
      Returns:
      the monoisotopic atom chain representing this amino acid
    • getMonoisotopicMass

      public double getMonoisotopicMass()
      Returns the mass of the amino acid.
      Returns:
      the mass of the amino acid
    • getHydrophobicity

      public abstract double getHydrophobicity()
      Returns the hydrophobicity according to PMID 14730315.
      Returns:
      the hydrophobicity
    • getHelicity

      public abstract double getHelicity()
      Returns the helicity according to PMID 14730315.
      Returns:
      the helicity
    • getBasicity

      public abstract double getBasicity()
      Returns the basicity according to PMID 14730315.
      Returns:
      the basicity
    • getPI

      public abstract double getPI()
      Returns the pI.
      Returns:
      the pI
    • getPK1

      public abstract double getPK1()
      Returns the pK1.
      Returns:
      the pK1
    • getPK2

      public abstract double getPK2()
      Returns the pK2.
      Returns:
      the pK2
    • getPKa

      public abstract double getPKa()
      Returns the pKa. 0.0 if none.
      Returns:
      the pKa
    • getVanDerWaalsVolume

      public abstract int getVanDerWaalsVolume()
      Returns the van der Waals volume in Å3.
      Returns:
      the van der Waals volume
    • getProperty

      public double getProperty​(AminoAcid.Property property)
      Returns a property of the amino acid.
      Parameters:
      property - the property of interest
      Returns:
      the property of the amino acid
    • getNUnique

      public static int getNUnique()
      Returns the number of amino acids excluding combinations.
      Returns:
      the number of amino acids excluding combinations
    • getUniqueIndex

      public static int getUniqueIndex​(char aa)
      Returns an index for the amino acid excluding combinations. The amino acid must be provided as upper case single letter code. No sanity check is done.
      Parameters:
      aa - the upper case single letter code of the amino acid.
      Returns:
      an index for the amino acid
    • getIndex

      public static int getIndex​(char aa)
      Returns an index for the amino acid excluding combinations. The amino acid must be provided as upper case single letter code. No sanity check is done.
      Parameters:
      aa - the upper case single letter code of the amino acid.
      Returns:
      an index for the amino acid
    • isAa

      public static boolean isAa​(char aa)
      Returns a boolean indicating whether the given character is a supported amino acid.
      Parameters:
      aa - the amino acid as single character code
      Returns:
      a boolean indicating whether the given character is a supported amino acid
    • isAa

      public static boolean isAa​(int aa)
      Returns a boolean indicating whether the given character is a supported amino acid.
      Parameters:
      aa - the amino acid as single character code
      Returns:
      a boolean indicating whether the given character is a supported amino acid
    • isUniqueAa

      public static boolean isUniqueAa​(char aa)
      Returns a boolean indicating whether the given character is a supported amino acid excluding combinations.
      Parameters:
      aa - the amino acid as single character code
      Returns:
      a boolean indicating whether the given character is a supported amino acid excluding combinations
    • equals

      public boolean equals​(Object obj)
      Overrides:
      equals in class Object