| OpenMS 2.5.0

Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ResidueDB Class Reference
Chemistry

residue data base which holds residues More...

`#include <OpenMS/CHEMISTRY/ResidueDB.h>`

## Public Types

Typedefs
typedef std::set< Residue * >::iterator | ResidueIterator
typedef std::set< const Residue * >::const_iterator | ResidueConstIterator

## Public Member Functions

Constructors and Destructors
virtual | ~ResidueDB ()
| destructor More...
Accessors
Size | getNumberOfResidues () const
| returns the number of residues stored More...
Size | getNumberOfModifiedResidues () const
| returns the number of modified residues stored More...
const Residue * | getResidue (const String &name) const
| returns a pointer to the residue with name, 3 letter code or 1 letter code name More...
const Residue * | getResidue (const unsigned char &one_letter_code) const
| returns a pointer to the residue with 1 letter code name More...
const Residue * | getModifiedResidue (const String &name)
| Returns a pointer to a modified residue given a modification name. More...
const Residue * | getModifiedResidue (const Residue *residue, const String &name)
| Returns a pointer to a modified residue given a residue and a modification name. More...
const std::set< const Residue * > | getResidues (const String &residue_set="All") const
| returns a set of all residues stored in this residue db More...
const std::set< String > | getResidueSets () const
| returns all residue sets that are registered which this instance More...
Predicates
bool | hasResidue (const String &name) const
| returns true if the db contains a residue with the given name More...
bool | hasResidue (const Residue *residue) const
| returns true if the db contains the residue of the given pointer More...
Iterators
ResidueIterator | beginResidue ()
ResidueIterator | endResidue ()
ResidueConstIterator | beginResidue () const
ResidueConstIterator | endResidue () const

## Static Public Member Functions

static ResidueDB * | getInstance ()
| this member function serves as a replacement of the constructor More...

## Protected Member Functions

void | setResidues_ (const String &filename)
| sets the residues from given file More...
void | readResiduesFromFile_ (const String &filename)
| reads residues from the given file More...
Residue * | parseResidue_ (Map< String, String > &values)
| parses a residue, given the key/value pairs from i.e. an XML file More...
void | clear_ ()
| deletes all sub-instances of the stored data like modifications and residues More...
void | clearResidues_ ()
| clears the residues and all lookup structures More...
void | clearResidueModifications_ ()
| clears the residue modifications and all lookup structures More...
void | buildResidueNames_ ()
| builds an index of residue names for fast access, synonyms are also considered More...
void | addResidue_ (Residue *residue)
Private Constructors
| ResidueDB ()
| default constructor More...
| ResidueDB (const ResidueDB &residue_db)
| copy constructor More...
Assignment
ResidueDB & | operator= (const ResidueDB &aa)
| assignment operator More...

## Protected Attributes

boost::unordered_map< String, Residue * > | residue_names_
Residue * | residue_by_one_letter_code_ [256]
Map< String, Map< String, Residue * > > | residue_mod_names_
std::set< Residue * > | residues_
std::set< const Residue * > | const_residues_
std::set< Residue * > | modified_residues_
std::set< const Residue * > | const_modified_residues_
Map< String, std::set< const Residue * > > | residues_by_set_
std::set< String > | residue_sets_

## Detailed Description

residue data base which holds residues

The residues stored in this DB are defined in a XML file under data/CHEMISTRY/residues.xml

By default no modified residues are stored in an instance. However, if one queries the instance with getModifiedResidue, a new modified residue is added.

## Member Typedef Documentation

## ◆ ResidueConstIterator

typedef std::set<const Residue*>::const_iterator ResidueConstIterator

## ◆ ResidueIterator

typedef std::set<Residue*>::iterator ResidueIterator

## Constructor & Destructor Documentation

## ◆ ~ResidueDB()

virtual ~ResidueDB | ( |  | ) |

virtual

destructor

## ◆ ResidueDB() [1/2]

ResidueDB | ( |  | ) |

protected

default constructor

## ◆ ResidueDB() [2/2]

ResidueDB | ( | const ResidueDB & | residue_db | ) |

protected

copy constructor

## Member Function Documentation

## ◆ addResidue_()

void addResidue_ | ( | Residue * | residue | ) |

protected

## ◆ beginResidue() [1/2]

ResidueIterator beginResidue | ( |  | ) |

inline

## ◆ beginResidue() [2/2]

ResidueConstIterator beginResidue | ( |  | ) | const

inline

## ◆ buildResidueNames_()

void buildResidueNames_ | ( |  | ) |

protected

builds an index of residue names for fast access, synonyms are also considered

## ◆ clear_()

void clear_ | ( |  | ) |

protected

deletes all sub-instances of the stored data like modifications and residues

## ◆ clearResidueModifications_()

void clearResidueModifications_ | ( |  | ) |

protected

clears the residue modifications and all lookup structures

## ◆ clearResidues_()

void clearResidues_ | ( |  | ) |

protected

clears the residues and all lookup structures

## ◆ endResidue() [1/2]

ResidueIterator endResidue | ( |  | ) |

inline

## ◆ endResidue() [2/2]

ResidueConstIterator endResidue | ( |  | ) | const

inline

## ◆ getInstance()

static ResidueDB* getInstance | ( |  | ) |

static

this member function serves as a replacement of the constructor

## ◆ getModifiedResidue() [1/2]

const Residue* getModifiedResidue | ( | const String & | name | ) |

Returns a pointer to a modified residue given a modification name.

The "base" residue is looked up in ModificationsDB using the modification name. The modified residue is added to the database if it doesn't exist yet.

## ◆ getModifiedResidue() [2/2]

const Residue* getModifiedResidue | ( | const Residue * | residue,
|  | const String & | name
| ) |  |

Returns a pointer to a modified residue given a residue and a modification name.

The modified residue is added to the database if it doesn't exist yet.

Exceptions

  Exception::IllegalArgument | if the residue was not found
  Exception::InvalidValue | if no matching modification was found (via ModificationsDB::getModification)

## ◆ getNumberOfModifiedResidues()

Size getNumberOfModifiedResidues | ( |  | ) | const

returns the number of modified residues stored

## ◆ getNumberOfResidues()

Size getNumberOfResidues | ( |  | ) | const

returns the number of residues stored

## ◆ getResidue() [1/2]

const Residue* getResidue | ( | const String & | name | ) | const

returns a pointer to the residue with name, 3 letter code or 1 letter code name

## ◆ getResidue() [2/2]

const Residue* getResidue | ( | const unsigned char & | one_letter_code | ) | const

returns a pointer to the residue with 1 letter code name

## ◆ getResidues()

const std::set<const Residue*> getResidues | ( | const String & | residue_set = `"All"` | ) | const

returns a set of all residues stored in this residue db

The possible residues are defined in share/OpenMS/CHEMISTRY/Residues.xml. At the moment the following sets are available: All - all residues stored in the file Natural20 - default 20 naturally occurring residues Natural19WithoutI - default natural amino acids, excluding isoleucine (isobaric to leucine) Natural19WithoutL - default natural amino acids, excluding leucine (isobaric to isoleucine) Natural19J - default natural amino acids, (isobaric leucine/isoleucine are marked by 'J') AmbiguousWithoutX - all amino acids, including ambiguous ones: B (asparagine or aspartate), Z (glutamine or glutamate), J (isoleucine or leucine) Ambiguous - all amino acids including all ambiguous ones (X can be every other amino acid) AllNatural - naturally occurring residues, including selenocysteine (U)

returns an empty set if the specified residue set is not defined

## ◆ getResidueSets()

const std::set<String> getResidueSets | ( |  | ) | const

returns all residue sets that are registered which this instance

## ◆ hasResidue() [1/2]

bool hasResidue | ( | const String & | name | ) | const

returns true if the db contains a residue with the given name

## ◆ hasResidue() [2/2]

bool hasResidue | ( | const Residue * | residue | ) | const

returns true if the db contains the residue of the given pointer

## ◆ operator=()

ResidueDB& operator= | ( | const ResidueDB & | aa | ) |

protected

assignment operator

## ◆ parseResidue_()

Residue* parseResidue_ | ( | Map< String, String > & | values | ) |

protected

parses a residue, given the key/value pairs from i.e. an XML file

## ◆ readResiduesFromFile_()

void readResiduesFromFile_ | ( | const String & | filename | ) |

protected

reads residues from the given file

Exceptions

  Exception::ParseError | if the file cannot be parsed

## ◆ setResidues_()

void setResidues_ | ( | const String & | filename | ) |

protected

sets the residues from given file

## Member Data Documentation

## ◆ const_modified_residues_

std::set<const Residue*> const_modified_residues_

protected

## ◆ const_residues_

std::set<const Residue*> const_residues_

protected

## ◆ modified_residues_

std::set<Residue*> modified_residues_

protected

## ◆ residue_by_one_letter_code_

Residue* residue_by_one_letter_code_[256]

protected

## ◆ residue_mod_names_

Map<String, Map<String, Residue*> > residue_mod_names_

protected

## ◆ residue_names_

boost::unordered_map<String, Residue*> residue_names_

protected

## ◆ residue_sets_

std::set<String> residue_sets_

protected

## ◆ residues_

std::set<Residue*> residues_

protected

## ◆ residues_by_set_

Map<String, std::set<const Residue*> > residues_by_set_

protected