public class PTMFactory extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
boolean |
defaultModsSorted
Set to true if the default mods are sorted alphabetically.
|
static String |
SINGLE_AA_SUFFIX
Suffix for the modification clone targeting a single amino acid instead
of a pattern.
|
static PTM |
unknownPTM
Unknown modification to be returned when the modification is not found.
|
boolean |
usersModsSorted
Set to true if the users mods are sorted alphabetically.
|
Modifier and Type | Method and Description |
---|---|
void |
addUserPTM(PTM ptm)
Adds a new user modification.
|
void |
checkFixedModifications(PtmSettings modificationProfile,
Peptide peptide,
SequenceMatchingPreferences sequenceMatchingPreferences,
SequenceMatchingPreferences ptmSequenceMatchingPreferences)
Removes the fixed modifications of the peptide and remaps the one
searched for according to the ModificationProfile.
|
void |
checkFixedModifications(PtmSettings modificationProfile,
Tag tag,
SequenceMatchingPreferences sequenceMatchingPreferences)
Removes the fixed modifications of the given tag and remaps the one
searched for according to the ModificationProfile.
|
void |
clearFactory()
Clears the factory getInstance() needs to be called afterwards.
|
boolean |
containsPTM(String name)
Returns a boolean indicating whether the PTM is loaded in the factory.
|
String |
convertPridePtm(String pridePtmName,
PtmSettings modProfile,
ArrayList<String> unknownPtms,
boolean isFixed)
Tries to convert a PRIDE PTM to utilities PTM name, and add it to the
modification profile.
|
Color |
getColor(String modification)
Returns the color used to code the given modification.
|
static Color |
getDefaultColor(String modification)
Returns a default color based on the modification name.
|
ArrayList<String> |
getDefaultModifications()
Returns the names of the default modifications.
|
ArrayList<String> |
getDefaultModificationsOrdered()
Returns the alphabetically ordered names of the default modifications.
|
HashMap<Integer,ArrayList<String>> |
getExpectedPTMs(PtmSettings modificationProfile,
Peptide peptide,
double modificationMass,
double ptmMassTolerance,
SequenceMatchingPreferences sequenceMatchingPreferences,
SequenceMatchingPreferences ptmSequenceMatchingPreferences)
Returns the expected modifications based on the modification profile, the
peptide found and the modification details.
|
HashMap<Integer,ArrayList<String>> |
getExpectedPTMs(PtmSettings modificationProfile,
Peptide peptide,
String ptmName,
Double ptmMassTolerance,
SequenceMatchingPreferences sequenceMatchingPreferences,
SequenceMatchingPreferences ptmSequenceMatchingPreferences)
Returns the names of the possibly expected modification based on the name
of the expected modification in a map where the PTM names are indexed by
their potential site on the sequence.
|
static PTMFactory |
getInstance()
Static method to get the instance of the factory.
|
PTM |
getPTM(String name)
Returns the PTM indexed by its name.
|
ArrayList<String> |
getPTMs()
Returns the names of all imported PTMs.
|
static String |
getSerializationFolder()
Returns the folder where the factory is saved.
|
static PTM |
getSingleAAPTM(PTM modification)
Returns a clone of the given PTM targeting a single amino acid instead of
a pattern.
|
PTM |
getSingleAAPTM(String modificationName)
Returns a clone of the given PTM targeting a single amino acid instead of
a pattern.
|
ArrayList<String> |
getUserModifications()
Returns the names of the user defined modifications.
|
ArrayList<String> |
getUserModificationsOrdered()
Returns the alphabetically ordered names of the user defined
modifications.
|
boolean |
isUserDefined(String ptmName)
Convenience method returning a boolean indicating whether a PTM is user
defined or default.
|
ArrayList<String> |
loadBackedUpModifications(SearchParameters searchParameters,
boolean overwrite)
Verifies that the modifications backed-up in the search parameters are
loaded and alerts the user in case conflicts are found.
|
void |
reloadFactory()
Reloads the factory getInstance() needs to be called afterwards.
|
void |
removeUserPtm(String ptmName)
Removes a user PTM.
|
void |
saveFactory()
Saves the factory in the user folder.
|
void |
setColor(String expectedModification,
Color color)
Sets a new color for the given expected modification.
|
static void |
setSerializationFolder(String serializationFolder)
Sets the folder where the factory is saved.
|
public static final PTM unknownPTM
public static final String SINGLE_AA_SUFFIX
public boolean defaultModsSorted
public boolean usersModsSorted
public static PTMFactory getInstance()
public void clearFactory()
public void reloadFactory()
public void saveFactory() throws IOException
IOException
- exception thrown whenever an error occurred while
saving the ptmFactorypublic static PTM getSingleAAPTM(PTM modification)
modification
- the modification of interestpublic PTM getSingleAAPTM(String modificationName)
modificationName
- the name of the modification of interestpublic void addUserPTM(PTM ptm)
ptm
- the new modification to addpublic void removeUserPtm(String ptmName)
ptmName
- the name of the PTM to removepublic PTM getPTM(String name)
name
- the name of the desired PTMpublic boolean containsPTM(String name)
name
- the name of the PTMpublic ArrayList<String> getDefaultModifications()
public ArrayList<String> getDefaultModificationsOrdered()
public ArrayList<String> getUserModifications()
public ArrayList<String> getUserModificationsOrdered()
public ArrayList<String> getPTMs()
public boolean isUserDefined(String ptmName)
ptmName
- the name of the PTMpublic ArrayList<String> loadBackedUpModifications(SearchParameters searchParameters, boolean overwrite)
searchParameters
- the search parameters to loadoverwrite
- if true, overwrite the modificationpublic HashMap<Integer,ArrayList<String>> getExpectedPTMs(PtmSettings modificationProfile, Peptide peptide, double modificationMass, double ptmMassTolerance, SequenceMatchingPreferences sequenceMatchingPreferences, SequenceMatchingPreferences ptmSequenceMatchingPreferences) throws IOException, IllegalArgumentException, InterruptedException, FileNotFoundException, ClassNotFoundException, FileNotFoundException, SQLException
modificationProfile
- the modification profile used for the search
(available in the search parameters)peptide
- the peptide identified with the parent proteins (necessary
for protein termini modifications)modificationMass
- the modification mass as found in the search
resultsptmMassTolerance
- the mass tolerance to use to match the
modification masssequenceMatchingPreferences
- the sequence matching preferences for
peptide to protein mappingptmSequenceMatchingPreferences
- the sequence matching preferences
for PTM to peptide mappingIOException
- exception thrown whenever an error occurred while
reading a protein sequenceIllegalArgumentException
- exception thrown whenever an error
occurred while reading a protein sequenceInterruptedException
- exception thrown whenever an error occurred
while reading a protein sequenceFileNotFoundException
- if a FileNotFoundException occursClassNotFoundException
- if a ClassNotFoundException occursSQLException
- if an SQLException occurspublic HashMap<Integer,ArrayList<String>> getExpectedPTMs(PtmSettings modificationProfile, Peptide peptide, String ptmName, Double ptmMassTolerance, SequenceMatchingPreferences sequenceMatchingPreferences, SequenceMatchingPreferences ptmSequenceMatchingPreferences) throws IOException, IllegalArgumentException, InterruptedException, FileNotFoundException, ClassNotFoundException, SQLException
modificationProfile
- the modification profile used for the search
(available in the search parameters)peptide
- the peptideptmName
- the name of the searched PTMptmMassTolerance
- the PTM mass tolerancesequenceMatchingPreferences
- the sequence matching preferences for
peptide to protein mappingptmSequenceMatchingPreferences
- the sequence matching preferences
for PTM to peptide mappingIOException
- exception thrown whenever an error occurred while
reading a protein sequenceIllegalArgumentException
- exception thrown whenever an error
occurred while reading a protein sequenceInterruptedException
- exception thrown whenever an error occurred
while reading a protein sequenceFileNotFoundException
- if a FileNotFoundException occursClassNotFoundException
- if a ClassNotFoundException occursSQLException
- if an SQLException occurspublic void checkFixedModifications(PtmSettings modificationProfile, Peptide peptide, SequenceMatchingPreferences sequenceMatchingPreferences, SequenceMatchingPreferences ptmSequenceMatchingPreferences) throws IOException, IllegalArgumentException, InterruptedException, FileNotFoundException, ClassNotFoundException, SQLException
modificationProfile
- the modification profilepeptide
- the peptidesequenceMatchingPreferences
- the sequence matching preferences for
peptide to protein mappingptmSequenceMatchingPreferences
- the sequence matching preferences
for PTM to peptide mappingIOException
- exception thrown whenever an error occurred while
reading a protein sequenceIllegalArgumentException
- exception thrown whenever an error
occurred while reading a protein sequenceInterruptedException
- exception thrown whenever an error occurred
while reading a protein sequenceFileNotFoundException
- if a FileNotFoundException occursClassNotFoundException
- if a ClassNotFoundException occursSQLException
- if an SQLException occurspublic void checkFixedModifications(PtmSettings modificationProfile, Tag tag, SequenceMatchingPreferences sequenceMatchingPreferences) throws IOException, IllegalArgumentException, InterruptedException, FileNotFoundException, ClassNotFoundException, SQLException
modificationProfile
- the modification profiletag
- the tagsequenceMatchingPreferences
- the sequence matching preferences for
PTM to amino acid mappingIOException
- exception thrown whenever an error occurred while
reading a protein sequenceIllegalArgumentException
- exception thrown whenever an error
occurred while reading a protein sequenceInterruptedException
- exception thrown whenever an error occurred
while reading a protein sequenceFileNotFoundException
- if a FileNotFoundException occursClassNotFoundException
- if a ClassNotFoundException occursSQLException
- if an SQLException occurspublic Color getColor(String modification)
modification
- the name of the given expected modificationpublic void setColor(String expectedModification, Color color)
expectedModification
- the name of the expected modificationcolor
- the new colorpublic static Color getDefaultColor(String modification)
modification
- the name of the modificationpublic String convertPridePtm(String pridePtmName, PtmSettings modProfile, ArrayList<String> unknownPtms, boolean isFixed)
pridePtmName
- the PRIDE PTM namemodProfile
- the modification profile to add the PTMs tounknownPtms
- the list of unknown PTMS, updated during this methodisFixed
- if true, the PTM will be added as a fixed modificationpublic static String getSerializationFolder()
public static void setSerializationFolder(String serializationFolder)
serializationFolder
- the folder where the factory is savedCopyright © 2016. All rights reserved.