com.compomics.util.preferences
Class ModificationProfile

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

public class ModificationProfile
extends Object
implements 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.
 ArrayList<String> getAllModifications()
          Returns a list of all searched modifications
 ArrayList<String> getAllNotFixedModifications()
          Returns a list of all searched modifications but the fixed ones
 Set<String> getBackedUpPtms()
          Returns the names of the backed-up PTMs
 Color getColor(String modification)
          Returns the color used to code the given modification.
 ArrayList<String> getFixedModifications()
          Returns the searched fixed modifications names
 PTM getPtm(String modName)
          Returns the back-ed up PTM with the given name
 HashMap<String,Color> getPtmColors()
          Returns a mapping of the expected modifications names to the colors used.
 ArrayList<String> getRefinementModifications()
          Return the refinement modifications used for the second pass search
 ArrayList<String> getVariableModifications()
          Returns the expected variable modification names included in this profile.
 void removeFixedModification(String modificationName)
          Removes a modification from the list of fixed modifications
 void removeRefinementModification(String modificationName)
          Removes a modification from the list of refinement modifications modifications
 void removeVariableModification(String modificationName)
          Removes a modification from the list of variable modifications
 void setColor(String expectedModification, Color color)
          Sets a new color for the given expected 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 ArrayList<String> getVariableModifications()
Returns the expected variable modification names included in this profile.

Returns:
the expected variable modification names included in this profile

getFixedModifications

public ArrayList<String> getFixedModifications()
Returns the searched fixed modifications names

Returns:
the searched fixed modifications names

getRefinementModifications

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

Returns:
the refinement modifications

getAllModifications

public ArrayList<String> getAllModifications()
Returns a list of all searched modifications

Returns:
a list of all searched modifications

getAllNotFixedModifications

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

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

getColor

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

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

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(String expectedModification,
                     Color color)
Sets a new color for the given expected modification.

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

getPtmColors

public HashMap<String,Color> getPtmColors()
Returns a mapping of the expected modifications names to the colors used.

Returns:
a mapping of the expected modifications names to the colors used

compatibilityCheck

public void compatibilityCheck()
Checks the compatibility with older versions of the class and makes the necessary changes.


getBackedUpPtms

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

Returns:
the names of the backed-up PTMs

getPtm

public PTM getPtm(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(String modificationName)
Removes a modification from the list of variable modifications

Parameters:
modificationName - the name of the modification

removeFixedModification

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

Parameters:
modificationName - the name of the modification

removeRefinementModification

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

Parameters:
modificationName - the name of the modification


Copyright © 2012. All Rights Reserved.