|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.compomics.util.experiment.biology.PTMFactory
public class PTMFactory
This factory will load PTM from an XML file and provide them on demand as standard class.
Field Summary | |
---|---|
static String |
SEARCH_SUFFIX
Suffix for the modifications searched but not in the factory |
static PTM |
unknownPTM
Unknown modification to be returned when the modification is not found. |
Method Summary | |
---|---|
void |
addUserPTM(PTM ptm)
Adds a new user modification. |
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. |
ArrayList<String> |
getDefaultModifications()
Returns the names of the default modifications. |
static PTMFactory |
getInstance()
Static method to get the instance of the factory. |
Integer |
getOMSSAIndex(String modificationName)
Returns the index of the desired modification. |
String |
getOmssaUserModBloc(String ptmName,
int cpt)
Returns an MSModSpec bloc as present in the OMSSA user modification files for a given PTM. |
PTM |
getPTM(double mass,
String location,
String sequence)
Deprecated. This method can generate inconsistent results in case a measurement matches to various PTMs. |
PTM |
getPTM(int index)
Get a PTM according to its omssa index. |
PTM |
getPTM(String name)
Returns the PTM indexed by its name. |
ArrayList<String> |
getPTMs()
Returns the names of all imported PTMs. |
PTM |
getSearchedPTM(PTM modification)
Returns the standard search compatible PTM corresponding to this pattern. |
PTM |
getSearchedPTM(String modificationName)
Returns the standard search compatible PTM corresponding to this pattern. |
ArrayList<String> |
getUserModifications()
Returns the names of the user defined modifications. |
void |
importModifications(File modificationsFile,
boolean userMod)
Import modifications from a modification file. |
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 |
setDefaultNeutralLosses()
Sets the default neutral losses of PTMs when not implemented. |
void |
setDefaultReporterIons()
Sets the default reporter ions of PTMs when not implemented. |
void |
writeOmssaModificationsFiles(File aFolder,
File utilitiesModFile,
File utilitiesUserModFile)
Write the OMSSA modification files to the given folder. |
void |
writeOmssaUserModificationFile(File file)
Writes the omssa modification file corresponding to the PTMs loaded in the factory in the given file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final PTM unknownPTM
public static final String SEARCH_SUFFIX
Method Detail |
---|
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 PTM getPTM(int index)
index
- the PTM index
public PTM getSearchedPTM(PTM modification)
modification
- the modification of interest
public PTM getSearchedPTM(String modificationName)
modificationName
- the name of the modification of interest
public 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 PTM
public boolean containsPTM(String name)
name
- the name of the PTM
public Integer getOMSSAIndex(String modificationName)
modificationName
- the desired modification name to lower case
public PTM getPTM(double mass, String location, String sequence)
mass
- the measured mass induced by the modificationlocation
- the modification locationsequence
- the peptide sequence
public void importModifications(File modificationsFile, boolean userMod) throws org.xmlpull.v1.XmlPullParserException, IOException
modificationsFile
- A file containing modificationsuserMod
- A boolean indicating whether the file comprises user
designed modification
org.xmlpull.v1.XmlPullParserException
- exception thrown whenever an error is
encountered while parsing
IOException
- exception thrown whenever an error is encountered
reading the filepublic void writeOmssaModificationsFiles(File aFolder, File utilitiesModFile, File utilitiesUserModFile) throws IOException
aFolder
- the folder to write the modification files toutilitiesModFile
- the utilities corresponding mod fileutilitiesUserModFile
- the utilities corresponding usermod file
IOException
- an IOException is thrown in case an issue is
encountered while reading or writing a file.public void writeOmssaUserModificationFile(File file) throws IOException
file
- the file
IOException
- exception thrown whenever an error occurred while
writing the filepublic String getOmssaUserModBloc(String ptmName, int cpt)
ptmName
- the name of the PTMcpt
- the index of this PTM
public ArrayList<String> getDefaultModifications()
public ArrayList<String> getUserModifications()
public ArrayList<String> getPTMs()
public boolean isUserDefined(String ptmName)
ptmName
-
public ArrayList<String> loadBackedUpModifications(SearchParameters searchParameters, boolean overwrite)
searchParameters
- the search parameters to loadoverwrite
- if true, overwrite the modification
public void setDefaultNeutralLosses()
public void setDefaultReporterIons()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |