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:
Serialized Form
  • Field Details

  • 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