com.compomics.util.experiment.biology
Class PTMFactory

java.lang.Object
  extended by com.compomics.util.experiment.biology.PTMFactory

public class PTMFactory
extends Object

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


Method Summary
static PTMFactory getInstance()
          Static method to get the instance of the factory
 PTM getPTM(double mass, String location, String sequence)
          getter for a ptm according to its measured characteristics /!
 PTM getPTM(int index)
          get a PTM according to its index
 PTM getPTM(String name)
          Returns the PTM indexed by its name
 Integer getPTMIndex(String modificationName)
          Returns the index of the desired modification
 Iterator<PTM> getPtmIterator()
          returns an iterator on the imported PTM
 HashMap<Integer,PTM> getPtmMap()
          getter for the index to PTM map
 void importModifications(File modificationsFile)
          Import modifications from a modification file
 void writeOmssaModificationsFiles(File aFolder, File utilitiesModFile, File utilitiesUserModFile)
          Write the OMSSA modification files to the given folder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static PTMFactory getInstance()
Static method to get the instance of the factory

Returns:
the instance of the factory

getPTM

public PTM getPTM(int index)
get a PTM according to its index

Parameters:
index - the PTM index
Returns:
the selected PTM

getPTM

public PTM getPTM(String name)
Returns the PTM indexed by its name

Parameters:
name - the name of the desired PTM
Returns:
The desired PTM

getPTMIndex

public Integer getPTMIndex(String modificationName)
Returns the index of the desired modification

Parameters:
modificationName - the desired modification name to lower case
Returns:
the corresponding index

getPtmMap

public HashMap<Integer,PTM> getPtmMap()
getter for the index to PTM map

Returns:
the index to ptem map

getPTM

public PTM getPTM(double mass,
                  String location,
                  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.

Parameters:
mass - the measured mass induced by the modification
location - the modification location
sequence - the peptide sequence
Returns:
the candidate modification, null if none is found

getPtmIterator

public Iterator<PTM> getPtmIterator()
returns an iterator on the imported PTM

Returns:
an iterator on imported PTM

importModifications

public void importModifications(File modificationsFile)
                         throws org.xmlpull.v1.XmlPullParserException,
                                IOException
Import modifications from a modification file

Parameters:
modificationsFile - A file containing modifications
Throws:
org.xmlpull.v1.XmlPullParserException - exception thrown whenever an error is encountered while parsing
IOException - exception thrown whenever an error is encountered reading the file

writeOmssaModificationsFiles

public void writeOmssaModificationsFiles(File aFolder,
                                         File utilitiesModFile,
                                         File utilitiesUserModFile)
                                  throws IOException
Write the OMSSA modification files to the given folder.

Parameters:
aFolder - the folder to write the modification files to
utilitiesModFile - the utilities corresponding mod file
utilitiesUserModFile - the utilities corresponding usermod file
Throws:
IOException - an IOException is thrown in case an issue is encountered while reading or writing a file.


Copyright © 2011. All Rights Reserved.