Class Modification
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
-
Field Summary
-
Constructor Summary
Constructors Constructor Description Modification()
Constructor for the modification.Modification(ModificationType modificationType, String name, Double mass, ArrayList<String> residues, ModificationCategory category)
Simple constructor for a modification.Modification(ModificationType modificationType, String name, String shortName, AtomChain atomChainAdded, AtomChain atomChainRemoved, AminoAcidPattern aminoAcidPattern, ModificationCategory category)
Constructor for a reference modification.Modification(ModificationType modificationType, String name, String shortName, AtomChain atomChainAdded, AtomChain atomChainRemoved, AminoAcidPattern aminoAcidPattern, CvTerm unimodCvTerm, CvTerm psiModCvTerm, ModificationCategory category)
Constructor for a reference modification. -
Method Summary
Modifier and Type Method Description void
addNeutralLoss(NeutralLoss neutralLoss)
Adds a neutral loss.void
addReporterIon(ReporterIon reporterIon)
Adds a reporter ion.String
getAmbiguityKey()
Returns the ambiguity key.AtomChain
getAtomChainAdded()
Returns the atom chain added.AtomChain
getAtomChainRemoved()
Returns the atom chain removed.ModificationCategory
getCategory()
Returns the modification category.String
getHtmlTooltip()
Returns information about the modification as an HTML tooltip.double
getMass()
Getter for the mass difference induced by this modification.ModificationType
getModificationType()
Returns the modification type.String
getName()
Getter for the modification name.ArrayList<NeutralLoss>
getNeutralLosses()
Returns the neutral losses possibly encountered with this modification.AminoAcidPattern
getPattern()
Returns the amino acid pattern targeted by this modification.CvTerm
getPsiModCvTerm()
Returns the PSI-MOD CV term associated with this modification.ArrayList<ReporterIon>
getReporterIons()
Returns the reporter ions possibly encountered with this modification.double
getRoundedMass()
Getter for the rounded mass difference induced by this modification.double
getRoundedMass(int numberOfDecimals)
Getter for the rounded mass difference induced by this modification.String
getShortName()
Getter for the short modification name.CvTerm
getUnimodCvTerm()
Returns the Unimod CV term associated with this modification.boolean
isSameAs(Modification anotherModification)
Returns true if the modification is the same as another one.boolean
isSameAtomicComposition(Modification anotherModification)
Returns true if the atomic composition of the modification is the same as another one.boolean
isSamePattern(Modification anotherModification)
Returns true if the targeted pattern of the modification is the same as another one.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.void
setAtomChainAdded(AtomChain atomChainAdded)
Sets the atom chain added.void
setAtomChainRemoved(AtomChain atomChainRemoved)
Sets the atom chain removed.void
setCategory(ModificationCategory category)
Set the modification category.void
setName(String name)
Sets the modification name.void
setNeutralLosses(ArrayList<NeutralLoss> neutralLosses)
Sets the neutral losses possibly encountered with this modification.void
setPattern(AminoAcidPattern pattern)
Sets the amino acid pattern targeted by this modification.void
setPsiModCvTerm(CvTerm cvTerm)
Set the PSI-MOD CV term associated with this modification.void
setReporterIons(ArrayList<ReporterIon> reporterIons)
Sets the reporter ions possibly encountered with this modification.void
setShortName(String shortName)
Sets the short modification name.void
setUnimodCvTerm(CvTerm cvTerm)
Set the Unimod CV term associated with this modification.String
toString()
Methods inherited from class com.compomics.util.experiment.personalization.ExperimentObject
addUrParam, asLong, clearParametersMap, getId, getUrParam, getUrParams, removeUrParam, setId, setUrParams
-
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 modificationname
- name of the modificationshortName
- short name of the modificationatomChainAdded
- atomic composition of the molecule addedatomChainRemoved
- atomic composition of the molecule removedaminoAcidPattern
- residue pattern affected by this modificationcategory
- 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 modificationname
- name of the modificationshortName
- short name of the modificationatomChainAdded
- atomic composition of the molecule addedatomChainRemoved
- atomic composition of the molecule removedaminoAcidPattern
- residue pattern affected by this modificationunimodCvTerm
- the Unimod CV term associated with this modification, null if not setpsiModCvTerm
- the PSI-MOD CV term associated with this modification, null if not setcategory
- 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 modificationname
- name of the modificationmass
- the mass of the modificationresidues
- list of residues possibly targeted by this modificationcategory
- the modification category
-
-
Method Details
-
getModificationType
Returns the modification type.- Returns:
- the modification type
-
getName
Getter for the modification name.- Returns:
- the modification name
-
setName
Sets the modification name.- Parameters:
name
- the modification name
-
getShortName
Getter for the short modification name.- Returns:
- the short modification name
-
setShortName
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
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
Returns the atom chain added.- Returns:
- the atom chain added
-
setAtomChainAdded
Sets the atom chain added.- Parameters:
atomChainAdded
- the atom chain added
-
getAtomChainRemoved
Returns the atom chain removed.- Returns:
- the atom chain removed
-
setAtomChainRemoved
Sets the atom chain removed.- Parameters:
atomChainRemoved
- the atom chain removed
-
isSameAtomicComposition
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
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
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
Returns the neutral losses possibly encountered with this modification.- Returns:
- the neutral losses possibly encountered with this modification
-
setNeutralLosses
Sets the neutral losses possibly encountered with this modification.- Parameters:
neutralLosses
- the neutral losses possibly encountered with this modification
-
addNeutralLoss
Adds a neutral loss.- Parameters:
neutralLoss
- the new neutral loss
-
getReporterIons
Returns the reporter ions possibly encountered with this modification.- Returns:
- the reporter ions possibly encountered with this modification
-
setReporterIons
Sets the reporter ions possibly encountered with this modification.- Parameters:
reporterIons
- the reporter ions possibly encountered with this modification
-
addReporterIon
Adds a reporter ion.- Parameters:
reporterIon
- the reporter ion to add
-
getPattern
Returns the amino acid pattern targeted by this modification.- Returns:
- the amino acid pattern targeted by this modification
-
setPattern
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
Returns information about the modification as an HTML tooltip.- Returns:
- information about the modification as an HTML tooltip
-
getUnimodCvTerm
Returns the Unimod CV term associated with this modification.- Returns:
- the Unimod cvTerm
-
setUnimodCvTerm
Set the Unimod CV term associated with this modification.- Parameters:
cvTerm
- the cvTerm to set
-
getPsiModCvTerm
Returns the PSI-MOD CV term associated with this modification.- Returns:
- the PSI-MOD cvTerm
-
setPsiModCvTerm
Set the PSI-MOD CV term associated with this modification.- Parameters:
cvTerm
- the cvTerm to set
-
getCategory
Returns the modification category. Null if not set.- Returns:
- the modification category
-
setCategory
Set the modification category.- Parameters:
category
- the modification category
-
toString
-