com.compomics.util.preferences
Class ModificationProfile

java.lang.Object
  extended by com.compomics.util.preferences.ModificationProfile
All Implemented Interfaces:
java.io.Serializable

public class ModificationProfile
extends java.lang.Object
implements java.io.Serializable

This class stores the information about the modification preferences (colors, names) used for the selected project.

Author:
Marc Vaudel
See Also:
Serialized Form

Constructor Summary
ModificationProfile()
          Constructor.
 
Method Summary
 void addFixedModification(PTM modification)
          Adds a fixed modification.
 void addRefinementModification(PTM modification)
          Adds a refinement modification.
 void addVariableModification(PTM modification)
          Adds a variable modification.
 void compatibilityCheck()
          Checks the compatibility with older versions of the class and makes the necessary changes.
 boolean contains(java.lang.String modificationName)
          Indicates whether the modification is contained in the profile, looking into all modifications (fixed, variable and refinement)
 java.util.ArrayList<java.lang.String> getAllModifications()
          Returns a list of all searched modifications.
 java.util.ArrayList<java.lang.String> getAllNotFixedModifications()
          Returns a list of all searched modifications but the fixed ones.
 java.util.Set<java.lang.String> getBackedUpPtms()
          Returns the names of the backed-up PTMs.
 java.awt.Color getColor(java.lang.String modification)
          Returns the color used to code the given modification.
 java.util.ArrayList<java.lang.String> getFixedModifications()
          Returns the searched fixed modifications names.
 java.lang.String getModification(int omssaIndex)
          Returns the name of the modification indexed by the given OMSSA index.
 java.lang.Integer getOmssaIndex(java.lang.String modificationName)
          Returns the OMSSA index of a given modification, null if not found.
 PTM getPtm(java.lang.String modName)
          Returns the back-ed up PTM with the given name.
 java.util.ArrayList<java.lang.String> getRefinementModifications()
          Return the refinement modifications used for the second pass search.
 java.util.ArrayList<java.lang.String> getVariableModifications()
          Returns the expected variable modification names included in this profile.
 void removeFixedModification(java.lang.String modificationName)
          Removes a modification from the list of fixed modifications.
 void removeRefinementModification(java.lang.String modificationName)
          Removes a modification from the list of refinement modifications modifications.
 void removeVariableModification(java.lang.String modificationName)
          Removes a modification from the list of variable modifications.
 void setColor(java.lang.String expectedModification, java.awt.Color color)
          Sets a new color for the given expected modification.
 void setOmssaIndex(java.lang.String modificationName, int omssaIndex)
          Sets the OMSSA index for a given modification.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModificationProfile

public ModificationProfile()
Constructor.

Method Detail

getVariableModifications

public java.util.ArrayList<java.lang.String> getVariableModifications()
Returns the expected variable modification names included in this profile.

Returns:
the expected variable modification names included in this profile

getFixedModifications

public java.util.ArrayList<java.lang.String> getFixedModifications()
Returns the searched fixed modifications names.

Returns:
the searched fixed modifications names

getRefinementModifications

public java.util.ArrayList<java.lang.String> getRefinementModifications()
Return the refinement modifications used for the second pass search.

Returns:
the refinement modifications

getAllModifications

public java.util.ArrayList<java.lang.String> getAllModifications()
Returns a list of all searched modifications.

Returns:
a list of all searched modifications

getAllNotFixedModifications

public java.util.ArrayList<java.lang.String> getAllNotFixedModifications()
Returns a list of all searched modifications but the fixed ones.

Returns:
a list of all searched modifications but the fixed ones

addVariableModification

public void addVariableModification(PTM modification)
Adds a variable modification. The modification name is added in the variable modifications names list and the modification is saved in the back-up. In case a modification with the same name was already used it will be silently overwritten.

Parameters:
modification - The modification to add

addRefinementModification

public void addRefinementModification(PTM modification)
Adds a refinement modification. The modification name is added in the refinement modifications names list and the modification is saved in the back-up. In case a modification with the same name was already used it will be silently overwritten.

Parameters:
modification - The modification to add

addFixedModification

public void addFixedModification(PTM modification)
Adds a fixed modification. The modification name is added in the fixed modifications names list and the modification is saved in the back-up. In case a modification with the same name was already used it will be silently overwritten.

Parameters:
modification - The modification to add

setColor

public void setColor(java.lang.String expectedModification,
                     java.awt.Color color)
Sets a new color for the given expected modification.

Parameters:
expectedModification - the name of the expected modification
color - the new color

getColor

public java.awt.Color getColor(java.lang.String modification)
Returns the color used to code the given modification.

Parameters:
modification - the name of the given expected modification
Returns:
the corresponding color

compatibilityCheck

public void compatibilityCheck()
Checks the compatibility with older versions of the class and makes the necessary changes. By default all modifications are set as variable.


getBackedUpPtms

public java.util.Set<java.lang.String> getBackedUpPtms()
Returns the names of the backed-up PTMs.

Returns:
the names of the backed-up PTMs

getPtm

public PTM getPtm(java.lang.String modName)
Returns the back-ed up PTM with the given name.

Parameters:
modName - the name of the PTM of interest
Returns:
the corresponding PTM. Null if not found.

removeVariableModification

public void removeVariableModification(java.lang.String modificationName)
Removes a modification from the list of variable modifications.

Parameters:
modificationName - the name of the modification

removeFixedModification

public void removeFixedModification(java.lang.String modificationName)
Removes a modification from the list of fixed modifications.

Parameters:
modificationName - the name of the modification

removeRefinementModification

public void removeRefinementModification(java.lang.String modificationName)
Removes a modification from the list of refinement modifications modifications.

Parameters:
modificationName - the name of the modification

setOmssaIndex

public void setOmssaIndex(java.lang.String modificationName,
                          int omssaIndex)
Sets the OMSSA index for a given modification. If another modification was already given with the same index the previous setting will be silently overwritten.

Parameters:
modificationName - the name of the modification
omssaIndex - the OMSSA index of the modification

getModification

public java.lang.String getModification(int omssaIndex)
Returns the name of the modification indexed by the given OMSSA index. Null if not found.

Parameters:
omssaIndex - the OMSSA index of the modification to look for
Returns:
the name of the modification indexed by the given OMSSA index

getOmssaIndex

public java.lang.Integer getOmssaIndex(java.lang.String modificationName)
Returns the OMSSA index of a given modification, null if not found.

Parameters:
modificationName - the name of the modification
Returns:
the corresponding OMSSA index

contains

public boolean contains(java.lang.String modificationName)
Indicates whether the modification is contained in the profile, looking into all modifications (fixed, variable and refinement)

Parameters:
modificationName - the name of the modification
Returns:
a boolean indicating whether the modification is contained in the mapping


Copyright © 2013. All Rights Reserved.