Class AaSubstitutionMatrix

java.lang.Object
com.compomics.util.experiment.personalization.ExperimentObject
com.compomics.util.experiment.biology.variants.AaSubstitutionMatrix
All Implemented Interfaces:
Serializable

public class AaSubstitutionMatrix extends ExperimentObject
Matrix of amino acid substitutions. This class contains pre-implemented matrices.
Author:
Marc Vaudel
See Also:
  • Field Details

    • noSubstitution

      public static final AaSubstitutionMatrix noSubstitution
      Empty substitution matrix.
    • singleBaseSubstitution

      public static final AaSubstitutionMatrix singleBaseSubstitution
      Substitution matrix allowing for a single base substitution.
    • transitionsSingleBaseSubstitution

      public static final AaSubstitutionMatrix transitionsSingleBaseSubstitution
      Substitution matrix allowing for a single base transition variant.
    • transversalSingleBaseSubstitution

      public static final AaSubstitutionMatrix transversalSingleBaseSubstitution
      Substitution matrix allowing for a single base transversion variant.
    • allSubstitutions

      public static final AaSubstitutionMatrix allSubstitutions
      Substitution matrix allowing all substitutions.
    • synonymousVariant

      public static final AaSubstitutionMatrix synonymousVariant
      Substitution matrix grouping synonymous amino acids. Amino acids are grouped according to their side chain properties: - Non-polar aliphatic groups: {'G', 'A', 'V', 'L', 'M', 'I'} - Aromatic groups: {'F', 'Y', 'W'} - Polar neutral groups: {'S', 'T', 'C', 'P', 'N', 'Q'} - Basic groups: {'K', 'R', 'H'} - Acidic groups: {'D', 'E'}.
    • defaultMutationMatrices

      public static final AaSubstitutionMatrix[] defaultMutationMatrices
      Returns the implemented default substitution matrices.
  • Constructor Details

    • AaSubstitutionMatrix

      public AaSubstitutionMatrix()
      Empty default constructor
    • AaSubstitutionMatrix

      public AaSubstitutionMatrix(String name, String description)
      Constructor.
      Parameters:
      name - the name of this substitution matrix
      description - the description of the substitution matrix
  • Method Details

    • addSubstitution

      public void addSubstitution(Character originalAa, Character substitutionAa)
      Adds a possible substitution.
      Parameters:
      originalAa - the original amino acid represented by its single letter code
      substitutionAa - the substituted amino acid represented by its single letter code
    • getSubstitutionAminoAcids

      public HashSet<Character> getSubstitutionAminoAcids(Character originalAminoAcid)
      Returns the possible substituted amino acids for the given amino acid as a list of their single letter code. Null if none found.
      Parameters:
      originalAminoAcid - the amino acid of interest
      Returns:
      the possible substituted amino acids
    • getOriginalAminoAcids

      public HashSet<Character> getOriginalAminoAcids(Character substitutedAminoAcid)
      Returns the possible original amino acids for the given substituted amino acid as a list of their single letter code. Null if none found.
      Parameters:
      substitutedAminoAcid - the substitution amino acid of interest
      Returns:
      the possible original amino acids for the given substituted amino acid
    • getOriginalAminoAcids

      public HashSet<Character> getOriginalAminoAcids()
      Returns the amino acids where a substitution has been registered.
      Returns:
      the amino acids where a substitution has been registered
    • getSubstitutionAminoAcids

      public HashSet<Character> getSubstitutionAminoAcids()
      Returns the possible substituted amino acids.
      Returns:
      the possible substituted amino acids
    • add

      public void add(AaSubstitutionMatrix otherMatrix)
      Adds the content of a substitution matrix in this matrix.
      Parameters:
      otherMatrix - the other matrix to add
    • getName

      public String getName()
      Returns the name of this substitution matrix.
      Returns:
      the name of this substitution matrix
    • setName

      public void setName(String name)
      Sets the name of this substitution matrix.
      Parameters:
      name - the name of this substitution matrix
    • getDescription

      public String getDescription()
      Returns the description of this substitution matrix.
      Returns:
      the description of this substitution matrix
    • setDescription

      public void setDescription(String description)
      Sets the description of this substitution matrix.
      Parameters:
      description - the description of this substitution matrix
    • isSameAs

      public boolean isSameAs(AaSubstitutionMatrix aaSubstitutionMatrix)
      Indicates whether the given AaSubstitutionMatrix is the same as this one.
      Parameters:
      aaSubstitutionMatrix - the substitution matrix
      Returns:
      a boolean indicating whether the given AaSubstitutionMatrix is the same as this one
    • toString

      public String toString()
      Overrides:
      toString in class Object