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

public class Modification
extends ExperimentObject
This class models a peptide or protein modification.
Author:
Marc Vaudel, Harald Barsnes
See Also:
Serialized Form
  • Constructor Details

    • Modification

      public Modification()
      Constructor for the modification.
    • Modification

      public Modification​(ModificationType modificationType, String name, String shortName, AtomChain atomChainAdded, AtomChain atomChainRemoved, AminoAcidPattern aminoAcidPattern, ModificationCategory category)
      Constructor for a reference modification.
      Parameters:
      modificationType - type of modification
      name - name of the modification
      shortName - short name of the modification
      atomChainAdded - atomic composition of the molecule added
      atomChainRemoved - atomic composition of the molecule removed
      aminoAcidPattern - residue pattern affected by this modification
      category - the modification category
    • Modification

      public Modification​(ModificationType modificationType, String name, String shortName, AtomChain atomChainAdded, AtomChain atomChainRemoved, AminoAcidPattern aminoAcidPattern, CvTerm unimodCvTerm, CvTerm psiModCvTerm, ModificationCategory category)
      Constructor for a reference modification.
      Parameters:
      modificationType - type of modification
      name - name of the modification
      shortName - short name of the modification
      atomChainAdded - atomic composition of the molecule added
      atomChainRemoved - atomic composition of the molecule removed
      aminoAcidPattern - residue pattern affected by this modification
      unimodCvTerm - the Unimod CV term associated with this modification, null if not set
      psiModCvTerm - the PSI-MOD CV term associated with this modification, null if not set
      category - the modification category
    • Modification

      public Modification​(ModificationType modificationType, String name, Double mass, ArrayList<String> residues, ModificationCategory category)
      Simple constructor for a modification. This constructor does not set the atomic composition or the cv terms.
      Parameters:
      modificationType - type of modification
      name - name of the modification
      mass - the mass of the modification
      residues - list of residues possibly targeted by this modification
      category - the modification category
  • Method Details

    • getModificationType

      public ModificationType getModificationType()
      Returns the modification type.
      Returns:
      the modification type
    • getName

      public String getName()
      Getter for the modification name.
      Returns:
      the modification name
    • setName

      public void setName​(String name)
      Sets the modification name.
      Parameters:
      name - the modification name
    • getShortName

      public String getShortName()
      Getter for the short modification name.
      Returns:
      the short modification name
    • setShortName

      public void setShortName​(String shortName)
      Sets the short modification name.
      Parameters:
      shortName - the modification name
    • getMass

      public double getMass()
      Getter for the mass difference induced by this modification.
      Returns:
      the mass difference induced by the modification
    • getAmbiguityKey

      public String getAmbiguityKey()
      Returns the ambiguity key.
      Returns:
      the ambiguity key
    • getRoundedMass

      public double getRoundedMass​(int numberOfDecimals)
      Getter for the rounded mass difference induced by this modification.
      Parameters:
      numberOfDecimals - the number of decimals to round to
      Returns:
      the rounded mass difference induced by the modification
    • getRoundedMass

      public double getRoundedMass()
      Getter for the rounded mass difference induced by this modification. Rounded to the number of decimals set in NUMBER_OF_ROUNDED_DECIMALS.
      Returns:
      the rounded mass difference induced by the modification
    • getAtomChainAdded

      public AtomChain getAtomChainAdded()
      Returns the atom chain added.
      Returns:
      the atom chain added
    • setAtomChainAdded

      public void setAtomChainAdded​(AtomChain atomChainAdded)
      Sets the atom chain added.
      Parameters:
      atomChainAdded - the atom chain added
    • getAtomChainRemoved

      public AtomChain getAtomChainRemoved()
      Returns the atom chain removed.
      Returns:
      the atom chain removed
    • setAtomChainRemoved

      public void setAtomChainRemoved​(AtomChain atomChainRemoved)
      Sets the atom chain removed.
      Parameters:
      atomChainRemoved - the atom chain removed
    • isSameAtomicComposition

      public boolean isSameAtomicComposition​(Modification anotherModification)
      Returns true if the atomic composition of the modification is the same as another one.
      Parameters:
      anotherModification - the modification to compare to
      Returns:
      true if the atomic composition of the modification is the same as the other one
    • isSamePattern

      public boolean isSamePattern​(Modification anotherModification)
      Returns true if the targeted pattern of the modification is the same as another one. An empty pattern is considered to be the same as a null pattern.
      Parameters:
      anotherModification - the modification to compare to
      Returns:
      true if the targeted pattern of the modification is the same as the other one
    • isSameAs

      public boolean isSameAs​(Modification anotherModification)
      Returns true if the modification is the same as another one.
      Parameters:
      anotherModification - another modification
      Returns:
      true if the modification is the same as the other one
    • getNeutralLosses

      public ArrayList<NeutralLoss> getNeutralLosses()
      Returns the neutral losses possibly encountered with this modification.
      Returns:
      the neutral losses possibly encountered with this modification
    • setNeutralLosses

      public void setNeutralLosses​(ArrayList<NeutralLoss> neutralLosses)
      Sets the neutral losses possibly encountered with this modification.
      Parameters:
      neutralLosses - the neutral losses possibly encountered with this modification
    • addNeutralLoss

      public void addNeutralLoss​(NeutralLoss neutralLoss)
      Adds a neutral loss.
      Parameters:
      neutralLoss - the new neutral loss
    • getReporterIons

      public ArrayList<ReporterIon> getReporterIons()
      Returns the reporter ions possibly encountered with this modification.
      Returns:
      the reporter ions possibly encountered with this modification
    • setReporterIons

      public void setReporterIons​(ArrayList<ReporterIon> reporterIons)
      Sets the reporter ions possibly encountered with this modification.
      Parameters:
      reporterIons - the reporter ions possibly encountered with this modification
    • addReporterIon

      public void addReporterIon​(ReporterIon reporterIon)
      Adds a reporter ion.
      Parameters:
      reporterIon - the reporter ion to add
    • getPattern

      public AminoAcidPattern getPattern()
      Returns the amino acid pattern targeted by this modification.
      Returns:
      the amino acid pattern targeted by this modification
    • setPattern

      public void setPattern​(AminoAcidPattern pattern)
      Sets the amino acid pattern targeted by this modification.
      Parameters:
      pattern - the amino acid pattern targeted by this modification
    • isStandardSearch

      public boolean isStandardSearch()
      Indicates whether a modification can be searched with standard search engines, i.e., true if it targets a single amino acid position, false if it targets a complex pattern.
      Returns:
      a boolean indicating whether a modification can be searched with standard search engines
    • getHtmlTooltip

      public String getHtmlTooltip()
      Returns information about the modification as an HTML tooltip.
      Returns:
      information about the modification as an HTML tooltip
    • getUnimodCvTerm

      public CvTerm getUnimodCvTerm()
      Returns the Unimod CV term associated with this modification.
      Returns:
      the Unimod cvTerm
    • setUnimodCvTerm

      public void setUnimodCvTerm​(CvTerm cvTerm)
      Set the Unimod CV term associated with this modification.
      Parameters:
      cvTerm - the cvTerm to set
    • getPsiModCvTerm

      public CvTerm getPsiModCvTerm()
      Returns the PSI-MOD CV term associated with this modification.
      Returns:
      the PSI-MOD cvTerm
    • setPsiModCvTerm

      public void setPsiModCvTerm​(CvTerm cvTerm)
      Set the PSI-MOD CV term associated with this modification.
      Parameters:
      cvTerm - the cvTerm to set
    • getCategory

      public ModificationCategory getCategory()
      Returns the modification category. Null if not set.
      Returns:
      the modification category
    • setCategory

      public void setCategory​(ModificationCategory category)
      Set the modification category.
      Parameters:
      category - the modification category
    • toString

      public String toString()
      Overrides:
      toString in class Object