Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
ModificationsDB Class Reference

database which holds all residue modifications from UniMod More...

#include <OpenMS/CHEMISTRY/ModificationsDB.h>

Public Member Functions

Size getNumberOfModifications () const
 returns the number of modifications read from the unimod.xml file More...
 
const ResidueModificationgetModification (Size index) const
 returns the modification with the given index More...
 
void searchTerminalModifications (std::set< const ResidueModification * > &mods, const String &name, ResidueModification::Term_Specificity term_spec) const
 returns all modifications which have the given name as synonym More...
 
void searchModifications (std::set< const ResidueModification * > &mods, const String &orgin, const String &mod_name, ResidueModification::Term_Specificity term_spec) const
 returns all modification which have the given name as synonym and the given origin More...
 
void searchModifications (std::set< const ResidueModification * > &mods, const String &mod_name, ResidueModification::Term_Specificity term_spec) const
 returns all modification which have the given name as synonym More...
 
const ResidueModificationgetTerminalModification (const String &name, ResidueModification::Term_Specificity term_spec) const
 returns the modifications of the given name More...
 
const ResidueModificationgetModification (const String &residue_name, const String &mod_name, ResidueModification::Term_Specificity term_spec) const
 returns the modification with the given name and given residue More...
 
const ResidueModificationgetModification (const String &modification) const
 
Size findModificationIndex (const String &mod_name) const
 returns the index of the modification in the mods_ vector; a unique name must be given More...
 
void getTerminalModificationsByDiffMonoMass (std::vector< String > &mods, double mass, double error, ResidueModification::Term_Specificity term_spec)
 query the modifications DB to get the terminal modifications with mass More...
 
void getModificationsByDiffMonoMass (std::vector< String > &mods, double mass, double error=0.0)
 query the modifications DB to get the modifications with mass, without any specific origin More...
 
void getModificationsByDiffMonoMass (std::vector< String > &mods, const String &residue, double mass, double error=0.0)
 query the modifications DB to get modifications with the given delta mass at the given residue More...
 
const ResidueModificationgetBestModificationsByMonoMass (const String &residue, double mass, double max_error=0.0)
 returns the best matching modification for the given mass and residue More...
 
const ResidueModificationgetBestModificationsByDiffMonoMass (const String &residue, double mass, double max_error=0.0)
 returns the best matching modification for the given delta mass and residue More...
 
void readFromOBOFile (const String &filename)
 adds modifications from a given file in OBO format More...
 
void readFromUnimodXMLFile (const String &filename)
 adds modifications from a given file in Unimod XML format More...
 
void getAllSearchModifications (std::vector< String > &modifications)
 get all modifications that can be used for identification searches More...
 

Static Public Member Functions

static ModificationsDBgetInstance ()
 

Protected Attributes

std::vector< ResidueModification * > mods_
 stores the modifications More...
 
Map< String, std::set< const ResidueModification * > > modification_names_
 stores the mappings of (unique) names to the modifications More...
 

Private Member Functions

Constructors and Destructors
 ModificationsDB ()
 default constructor More...
 
 ModificationsDB (const ModificationsDB &residue_db)
 copy constructor More...
 
virtual ~ModificationsDB ()
 destructor More...
 
Assignment
ModificationsDBoperator= (const ModificationsDB &aa)
 assignment operator More...
 

Detailed Description

database which holds all residue modifications from UniMod

This singleton class serves as a storage of the available modifications represented by UniMod (www.unimod.org). The modifications are identified by there name and possibly other ids from UniMod or the PSI-MOD ontology. Modifications can have different specificities, e.g. they can occur only at the termini, anywhere or only at specific amino acids.

The modifications are defined in share/OpenMS/CHEMISTRY/unimod.xml and in share/OpenMS/CHEMISTRY/PSI-MOD.obo. The unimod file can be directly downloaded from unimod.org and replaced if the modifications change.

To add a new modification, not contained in UniMod, one should follow the way described at the unimod.org website and download the file then from unimod.org. The same can be done to add support for the modifications to search engines, e.g. Mascot.

Constructor & Destructor Documentation

ModificationsDB ( )
private

default constructor

ModificationsDB ( const ModificationsDB residue_db)
private

copy constructor

virtual ~ModificationsDB ( )
privatevirtual

destructor

Member Function Documentation

Size findModificationIndex ( const String mod_name) const

returns the index of the modification in the mods_ vector; a unique name must be given

void getAllSearchModifications ( std::vector< String > &  modifications)

get all modifications that can be used for identification searches

Referenced by SimpleSearchEngine::registerOptionsAndFlags_().

const ResidueModification* getBestModificationsByDiffMonoMass ( const String residue,
double  mass,
double  max_error = 0.0 
)

returns the best matching modification for the given delta mass and residue

Query the modifications DB to get the best matching modification with the given delta mass at the given residue (NULL pointer means no result, maybe the maximal error tolerance needs to be increased). Possible input for CAM modification would be a delta mass of 57 and a residue of "C".

Note
If there are multiple possible matches with equal masses, it will choose the _first_ match which defaults to the first matching UniMod entry.
Parameters
residueThe residue at which the modifications occurs
massThe monoisotopic mass of the residue including the mass of the modification
max_errorThe maximal mass error in the modification search
Returns
A pointer to the best matching modification (or NULL if none was found)
const ResidueModification* getBestModificationsByMonoMass ( const String residue,
double  mass,
double  max_error = 0.0 
)

returns the best matching modification for the given mass and residue

Query the modifications DB to get the best matching modification with the given mass at the given residue (NULL pointer means no result, maybe the maximal error tolerance needs to be increased). Possible input for CAM modification would be a mass of 160 and a residue of "C".

Note
If there are multiple possible matches with equal masses, it will choose the _first_ match which defaults to the first matching UniMod entry.
Parameters
residueThe residue at which the modifications occurs
massThe monoisotopic mass of the residue including the mass of the modification
max_errorThe maximal mass error in the modification search
Returns
A pointer to the best matching modification (or NULL if none was found)
static ModificationsDB* getInstance ( )
inlinestatic
const ResidueModification& getModification ( Size  index) const

returns the modification with the given index

const ResidueModification& getModification ( const String residue_name,
const String mod_name,
ResidueModification::Term_Specificity  term_spec 
) const

returns the modification with the given name and given residue

const ResidueModification& getModification ( const String modification) const
void getModificationsByDiffMonoMass ( std::vector< String > &  mods,
double  mass,
double  error = 0.0 
)

query the modifications DB to get the modifications with mass, without any specific origin

void getModificationsByDiffMonoMass ( std::vector< String > &  mods,
const String residue,
double  mass,
double  error = 0.0 
)

query the modifications DB to get modifications with the given delta mass at the given residue

Size getNumberOfModifications ( ) const

returns the number of modifications read from the unimod.xml file

const ResidueModification& getTerminalModification ( const String name,
ResidueModification::Term_Specificity  term_spec 
) const

returns the modifications of the given name

This can either be the PSI-MOD identifier or every other unique identifier which can be found in the PSI-MOD definitions file.

To search for more than one modification searchModifications() can be used!

Exceptions
ElementNotFoundis thrown if no or more than one element is found
void getTerminalModificationsByDiffMonoMass ( std::vector< String > &  mods,
double  mass,
double  error,
ResidueModification::Term_Specificity  term_spec 
)

query the modifications DB to get the terminal modifications with mass

ModificationsDB& operator= ( const ModificationsDB aa)
private

assignment operator

void readFromOBOFile ( const String filename)

adds modifications from a given file in OBO format

void readFromUnimodXMLFile ( const String filename)

adds modifications from a given file in Unimod XML format

void searchModifications ( std::set< const ResidueModification * > &  mods,
const String orgin,
const String mod_name,
ResidueModification::Term_Specificity  term_spec 
) const

returns all modification which have the given name as synonym and the given origin

void searchModifications ( std::set< const ResidueModification * > &  mods,
const String mod_name,
ResidueModification::Term_Specificity  term_spec 
) const

returns all modification which have the given name as synonym

void searchTerminalModifications ( std::set< const ResidueModification * > &  mods,
const String name,
ResidueModification::Term_Specificity  term_spec 
) const

returns all modifications which have the given name as synonym

Member Data Documentation

Map<String, std::set<const ResidueModification *> > modification_names_
protected

stores the mappings of (unique) names to the modifications

std::vector<ResidueModification *> mods_
protected

stores the modifications


OpenMS / TOPP release 2.0.0 Documentation generated on Fri May 29 2015 17:20:40 using doxygen 1.8.9.1