|
||||||||||
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. Created by IntelliJ IDEA. User: Marc Date: Jun 22, 2010 Time: 8:26:09 PM
Field Summary | |
---|---|
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(java.lang.String name)
Returns a boolean indicating whether the PTM is loaded in the factory |
java.util.ArrayList<java.lang.String> |
getDefaultModifications()
returns the names of the default modifications |
static PTMFactory |
getInstance()
Static method to get the instance of the factory |
java.util.ArrayList<java.lang.Integer> |
getOMSSAIndexes(java.lang.String modificationName)
Returns the index of the desired modification |
java.lang.String |
getOmssaUserModBloc(java.lang.String ptmName,
int cpt)
Returns an MSModSpec bloc as present in the OMSSA user modification files for a given PTM |
PTM |
getPTM(double mass,
java.lang.String location,
java.lang.String sequence)
getter for a ptm according to its measured characteristics /!\ 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(java.lang.String name)
Returns the PTM indexed by its name |
java.util.ArrayList<java.lang.String> |
getPTMs()
Returns the names of all imported PTMs |
java.util.ArrayList<java.lang.String> |
getUserModifications()
Returns the names of the user defined modifications |
void |
importModifications(java.io.File modificationsFile,
boolean userMod)
Import modifications from a modification file |
boolean |
isUserDefined(java.lang.String ptmName)
Convenience method returning a boolean indicating whether a ptm is user defined or default |
void |
reloadFactory()
Reloads the factory getInstance() needs to be called afterwards |
void |
removeUserPtm(java.lang.String ptmName)
Removes a user ptm |
void |
replacePTM(java.lang.String oldName,
PTM newPTM)
replaces an old ptm by a new |
void |
saveFactory()
Saves the factory in the user folder |
void |
writeOmssaModificationsFiles(java.io.File aFolder,
java.io.File utilitiesModFile,
java.io.File utilitiesUserModFile)
Write the OMSSA modification files to the given folder. |
void |
writeOmssaUserModificationFile(java.io.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
Method Detail |
---|
public static PTMFactory getInstance()
public void clearFactory()
public void reloadFactory()
public void saveFactory() throws java.io.IOException
java.io.IOException
- exception thrown whenever an error occurred while
saving the ptmFactorypublic PTM getPTM(int index)
index
- the PTM index
public void replacePTM(java.lang.String oldName, PTM newPTM)
oldName
- the name of the old ptmnewPTM
- the new ptmpublic void addUserPTM(PTM ptm)
ptm
- the new modification to addpublic void removeUserPtm(java.lang.String ptmName)
ptmName
- the name of the ptm to removepublic PTM getPTM(java.lang.String name)
name
- the name of the desired PTM
public boolean containsPTM(java.lang.String name)
name
- the name of the PTM
public java.util.ArrayList<java.lang.Integer> getOMSSAIndexes(java.lang.String modificationName)
modificationName
- the desired modification name to lower case
public PTM getPTM(double mass, java.lang.String location, java.lang.String sequence)
mass
- the measured mass induced by the modificationlocation
- the modification locationsequence
- the peptide sequence
public void importModifications(java.io.File modificationsFile, boolean userMod) throws org.xmlpull.v1.XmlPullParserException, java.io.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
java.io.IOException
- exception thrown whenever an error is encountered
reading the filepublic void writeOmssaModificationsFiles(java.io.File aFolder, java.io.File utilitiesModFile, java.io.File utilitiesUserModFile) throws java.io.IOException
aFolder
- the folder to write the modification files toutilitiesModFile
- the utilities corresponding mod fileutilitiesUserModFile
- the utilities corresponding usermod file
java.io.IOException
- an IOException is thrown in case an issue is
encountered while reading or writing a file.public void writeOmssaUserModificationFile(java.io.File file) throws java.io.IOException
file
- the file
java.io.IOException
- exception thrown whenever an error occurred while
writing the filepublic java.lang.String getOmssaUserModBloc(java.lang.String ptmName, int cpt)
ptmName
- the name of the PTMcpt
- the index of this PTM
public java.util.ArrayList<java.lang.String> getDefaultModifications()
public java.util.ArrayList<java.lang.String> getUserModifications()
public java.util.ArrayList<java.lang.String> getPTMs()
public boolean isUserDefined(java.lang.String ptmName)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |