Chemical Data Processing Library C++ API - Version 1.4.0
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
CDPL::Biomol::ResidueDictionary Class Reference

Global dictionary for the lookup of meta-data associated with the residues in biological macromolecules. More...

#include <ResidueDictionary.hpp>

Classes

class  Entry
 A single residue dictionary entry. More...
 

Public Types

typedef std::shared_ptr< ResidueDictionarySharedPointer
 A reference-counted smart pointer [SHPTR] for dynamically allocated ResidueDictionary instances. More...
 
typedef boost::transform_iterator< std::function< const Entry &(const EntryLookupTable::value_type &)>, EntryLookupTable::const_iterator > ConstEntryIterator
 A constant iterator over the entries of the dictionary. More...
 

Public Member Functions

void addEntry (const Entry &entry)
 Adds (or overwrites) the dictionary entry entry. More...
 
void addEntry (Entry &&entry)
 Adds (or overwrites) the dictionary entry entry by moving its data. More...
 
bool containsEntry (const std::string &code) const
 Tells whether the dictionary contains an entry for the residue with three-letter code code. More...
 
void removeEntry (const std::string &code)
 Removes the dictionary entry for the residue with three-letter code code. More...
 
const EntrygetEntry (const std::string &code) const
 Returns the dictionary entry for the residue with three-letter code code. More...
 
void clear ()
 Removes all entries from the dictionary. More...
 
std::size_t getNumEntries () const
 Returns the number of entries in the dictionary. More...
 
ConstEntryIterator getEntriesBegin () const
 Returns a constant iterator pointing to the beginning of the entry list. More...
 
ConstEntryIterator getEntriesEnd () const
 Returns a constant iterator pointing one past the last entry. More...
 
ConstEntryIterator begin () const
 Returns a constant iterator pointing to the beginning of the entry list (alias of getEntriesBegin()). More...
 
ConstEntryIterator end () const
 Returns a constant iterator pointing one past the last entry (alias of getEntriesEnd()). More...
 
const std::string & getReplacedCode (const std::string &code) const
 Returns the TLC of the residue replaced by the residue with three-letter code code. More...
 
const std::string & getReplacedByCode (const std::string &code) const
 Returns the TLC of the residue that replaces the residue with three-letter code code. More...
 
const std::string & getParentCode (const std::string &code) const
 Returns the TLC of the parent residue of the residue with three-letter code code. More...
 
const std::string & getOneLetterCode (const std::string &code) const
 Returns the one-letter code of the residue with three-letter code code. More...
 
bool isObsolete (const std::string &code) const
 Tells whether the residue type with three-letter code code is obsolete. More...
 
const std::string & getName (const std::string &code) const
 Returns the full name of the residue with three-letter code code. More...
 
unsigned int getType (const std::string &code) const
 Returns the residue type (see Biomol::ResidueType) of the residue with three-letter code code. More...
 
Chem::MolecularGraph::SharedPointer getStructure (const std::string &code) const
 Retrieves the structure of the residue with three-letter code code. More...
 
void loadDefaults ()
 Loads the built-in default residue dictionary entries. More...
 

Static Public Member Functions

static bool isStdResidue (const std::string &code)
 Tells whether the residue with three-letter code code is a standard biopolymer residue (amino acid or nucleotide). More...
 
static void set (const SharedPointer &dict)
 Replaces the process-wide default dictionary by dict. More...
 
static const SharedPointerget ()
 Returns the process-wide default dictionary (lazily initialized on first call). More...
 

Detailed Description

Global dictionary for the lookup of meta-data associated with the residues in biological macromolecules.

Member Typedef Documentation

◆ SharedPointer

A reference-counted smart pointer [SHPTR] for dynamically allocated ResidueDictionary instances.

◆ ConstEntryIterator

typedef boost::transform_iterator<std::function<const Entry&(const EntryLookupTable::value_type&)>, EntryLookupTable::const_iterator> CDPL::Biomol::ResidueDictionary::ConstEntryIterator

A constant iterator over the entries of the dictionary.

Member Function Documentation

◆ isStdResidue()

static bool CDPL::Biomol::ResidueDictionary::isStdResidue ( const std::string &  code)
static

Tells whether the residue with three-letter code code is a standard biopolymer residue (amino acid or nucleotide).

Parameters
codeThe residue three-letter code.
Returns
true if the residue is a standard biopolymer residue, and false otherwise.

◆ addEntry() [1/2]

void CDPL::Biomol::ResidueDictionary::addEntry ( const Entry entry)

Adds (or overwrites) the dictionary entry entry.

Parameters
entryThe entry to add.

◆ addEntry() [2/2]

void CDPL::Biomol::ResidueDictionary::addEntry ( Entry &&  entry)

Adds (or overwrites) the dictionary entry entry by moving its data.

Parameters
entryThe entry to add.
Since
1.2

◆ containsEntry()

bool CDPL::Biomol::ResidueDictionary::containsEntry ( const std::string &  code) const

Tells whether the dictionary contains an entry for the residue with three-letter code code.

Parameters
codeThe residue three-letter code.
Returns
true if a matching entry exists, and false otherwise.

◆ removeEntry()

void CDPL::Biomol::ResidueDictionary::removeEntry ( const std::string &  code)

Removes the dictionary entry for the residue with three-letter code code.

Parameters
codeThe residue three-letter code.

◆ getEntry()

const Entry& CDPL::Biomol::ResidueDictionary::getEntry ( const std::string &  code) const

Returns the dictionary entry for the residue with three-letter code code.

Parameters
codeThe residue three-letter code.
Returns
A const reference to the matching entry (or to an empty default-constructed entry if no matching entry exists).

◆ clear()

void CDPL::Biomol::ResidueDictionary::clear ( )

Removes all entries from the dictionary.

◆ getNumEntries()

std::size_t CDPL::Biomol::ResidueDictionary::getNumEntries ( ) const

Returns the number of entries in the dictionary.

Returns
The entry count.

◆ getEntriesBegin()

ConstEntryIterator CDPL::Biomol::ResidueDictionary::getEntriesBegin ( ) const

Returns a constant iterator pointing to the beginning of the entry list.

Returns
A constant iterator to the first entry.

◆ getEntriesEnd()

ConstEntryIterator CDPL::Biomol::ResidueDictionary::getEntriesEnd ( ) const

Returns a constant iterator pointing one past the last entry.

Returns
A constant iterator to the end of the entry list.

◆ begin()

ConstEntryIterator CDPL::Biomol::ResidueDictionary::begin ( ) const

Returns a constant iterator pointing to the beginning of the entry list (alias of getEntriesBegin()).

Returns
A constant iterator to the first entry.

◆ end()

ConstEntryIterator CDPL::Biomol::ResidueDictionary::end ( ) const

Returns a constant iterator pointing one past the last entry (alias of getEntriesEnd()).

Returns
A constant iterator to the end of the entry list.

◆ getReplacedCode()

const std::string& CDPL::Biomol::ResidueDictionary::getReplacedCode ( const std::string &  code) const

Returns the TLC of the residue replaced by the residue with three-letter code code.

Parameters
codeThe residue three-letter code.
Returns
A const reference to the replaced-residue code (or an empty string if no matching entry exists or the entry does not replace any other residue).

◆ getReplacedByCode()

const std::string& CDPL::Biomol::ResidueDictionary::getReplacedByCode ( const std::string &  code) const

Returns the TLC of the residue that replaces the residue with three-letter code code.

Parameters
codeThe residue three-letter code.
Returns
A const reference to the replacing-residue code (or an empty string if no matching entry exists or the entry has not been replaced).

◆ getParentCode()

const std::string& CDPL::Biomol::ResidueDictionary::getParentCode ( const std::string &  code) const

Returns the TLC of the parent residue of the residue with three-letter code code.

Parameters
codeThe residue three-letter code.
Returns
A const reference to the parent-residue code (or an empty string if no matching entry exists or the residue has no parent).
Since
1.2

◆ getOneLetterCode()

const std::string& CDPL::Biomol::ResidueDictionary::getOneLetterCode ( const std::string &  code) const

Returns the one-letter code of the residue with three-letter code code.

Parameters
codeThe residue three-letter code.
Returns
A const reference to the one-letter residue code (or an empty string if not defined or no matching entry exists).
Since
1.2

◆ isObsolete()

bool CDPL::Biomol::ResidueDictionary::isObsolete ( const std::string &  code) const

Tells whether the residue type with three-letter code code is obsolete.

Parameters
codeThe residue three-letter code.
Returns
true if the residue type is obsolete, and false otherwise (also if no matching entry exists).

◆ getName()

const std::string& CDPL::Biomol::ResidueDictionary::getName ( const std::string &  code) const

Returns the full name of the residue with three-letter code code.

Parameters
codeThe residue three-letter code.
Returns
A const reference to the residue name (or an empty string if no matching entry exists).

◆ getType()

unsigned int CDPL::Biomol::ResidueDictionary::getType ( const std::string &  code) const

Returns the residue type (see Biomol::ResidueType) of the residue with three-letter code code.

Parameters
codeThe residue three-letter code.
Returns
The residue type identifier (or Biomol::ResidueType::UNKNOWN if no matching entry exists).

◆ getStructure()

Chem::MolecularGraph::SharedPointer CDPL::Biomol::ResidueDictionary::getStructure ( const std::string &  code) const

Retrieves the structure of the residue with three-letter code code.

Parameters
codeThe residue three-letter code.
Returns
A shared pointer to the residue structure (or an empty pointer if the structure could not be retrieved).

◆ loadDefaults()

void CDPL::Biomol::ResidueDictionary::loadDefaults ( )

Loads the built-in default residue dictionary entries.

◆ set()

static void CDPL::Biomol::ResidueDictionary::set ( const SharedPointer dict)
static

Replaces the process-wide default dictionary by dict.

Parameters
dictThe new default dictionary (a nullptr resets to the built-in default).

◆ get()

static const SharedPointer& CDPL::Biomol::ResidueDictionary::get ( )
static

Returns the process-wide default dictionary (lazily initialized on first call).

Returns
A const reference to the default-dictionary shared pointer.

The documentation for this class was generated from the following file: