| OpenMS 2.5.0

Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
DigestionEnzymeDB< DigestionEnzymeType, InstanceType > Class Template Reference
Chemistry

Digestion enzyme database (base class) More...

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

## Public Types

Typedefs
typedef std::set< const DigestionEnzymeType * >::const_iterator | ConstEnzymeIterator
typedef std::set< const DigestionEnzymeType * >::iterator | EnzymeIterator

## Public Member Functions

Constructors and Destructors
virtual | ~DigestionEnzymeDB ()
| destructor More...
Accessors
const DigestionEnzymeType * | getEnzyme (const String &name) const
const DigestionEnzymeType * | getEnzymeByRegEx (const String &cleavage_regex) const
void | getAllNames (std::vector< String > &all_names) const
| returns all the enzyme names (does NOT include synonym names) More...
Predicates
bool | hasEnzyme (const String &name) const
| returns true if the db contains a enzyme with the given name (supports synonym names) More...
bool | hasRegEx (const String &cleavage_regex) const
| returns true if the db contains a enzyme with the given regex More...
bool | hasEnzyme (const DigestionEnzymeType *enzyme) const
| returns true if the db contains the enzyme of the given pointer More...
Iterators
ConstEnzymeIterator | beginEnzyme () const
ConstEnzymeIterator | endEnzyme () const

## Static Public Member Functions

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

## Protected Member Functions

| DigestionEnzymeDB (const String &db_file="")
| DigestionEnzymeDB (const DigestionEnzymeDB &enzymes_db)=delete
| copy constructor More...
void | readEnzymesFromFile_ (const String &filename)
| reads enzymes from the given file More...
const DigestionEnzymeType * | parseEnzyme_ (Map< String, String > &values) const
| parses an enzyme, given the key/value pairs from an XML file More...
void | addEnzyme_ (const DigestionEnzymeType *enzyme)
| add to internal data; also update indices for search by name and regex More...
Assignment
DigestionEnzymeDB & | operator= (const DigestionEnzymeDB &enzymes_db)=delete
| assignment operator More...

## Protected Attributes

Map< String, const DigestionEnzymeType * > | enzyme_names_
| index by names More...
Map< String, const DigestionEnzymeType * > | enzyme_regex_
| index by regex More...
std::set< const DigestionEnzymeType * > | const_enzymes_
| set of enzymes More...

## Detailed Description

### template<typename DigestionEnzymeType, typename InstanceType>
class OpenMS::DigestionEnzymeDB< DigestionEnzymeType, InstanceType >

Digestion enzyme database (base class)

Template parameters: `DigestionEnzymeType` should be a subclass of DigestionEnzyme. `InstanceType` should be a subclass of DigestionEnzymeDB ("Curiously Recurring Template Pattern", see https://stackoverflow.com/a/34519373).

## Member Typedef Documentation

## ◆ ConstEnzymeIterator

typedef std::set<const DigestionEnzymeType*>::const_iterator ConstEnzymeIterator

## ◆ EnzymeIterator

typedef std::set<const DigestionEnzymeType*>::iterator EnzymeIterator

## Constructor & Destructor Documentation

## ◆ ~DigestionEnzymeDB()

virtual ~DigestionEnzymeDB | ( |  | ) |

inline virtual

destructor

## ◆ DigestionEnzymeDB() [1/2]

DigestionEnzymeDB | ( | const String & | db_file = `""` | ) |

inline protected

## ◆ DigestionEnzymeDB() [2/2]

DigestionEnzymeDB | ( | const DigestionEnzymeDB< DigestionEnzymeType, InstanceType > & | enzymes_db | ) |

protected delete

copy constructor

## Member Function Documentation

## ◆ addEnzyme_()

void addEnzyme_ | ( | const DigestionEnzymeType * | enzyme | ) |

inline protected

add to internal data; also update indices for search by name and regex

Referenced by DigestionEnzymeDB< DigestionEnzymeRNA, RNaseDB >::readEnzymesFromFile_().

## ◆ beginEnzyme()

ConstEnzymeIterator beginEnzyme | ( |  | ) | const

inline

## ◆ endEnzyme()

ConstEnzymeIterator endEnzyme | ( |  | ) | const

inline

## ◆ getAllNames()

void getAllNames | ( | std::vector< String > & | all_names | ) | const

inline

returns all the enzyme names (does NOT include synonym names)

Referenced by NucleicAcidSearchEngine::registerOptionsAndFlags_().

## ◆ getEnzyme()

const DigestionEnzymeType* getEnzyme | ( | const String & | name | ) | const

inline

returns a pointer to the enzyme with name (supports synonym names)

Exceptions

  Exception::ElementNotFound | if enzyme is unknown

Note
  enzymes are registered in regular and in toLowercase() style, if unsure use toLowercase

Referenced by NucleicAcidSearchEngine::main_().

## ◆ getEnzymeByRegEx()

const DigestionEnzymeType* getEnzymeByRegEx | ( | const String & | cleavage_regex | ) | const

inline

returns a pointer to the enzyme with cleavage regex

Exceptions

  Exception::IllegalArgument | if enzyme regex is unregistered.

## ◆ getInstance()

static InstanceType* getInstance | ( |  | ) |

inline static

this member function serves as a replacement of the constructor

## ◆ hasEnzyme() [1/2]

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

inline

returns true if the db contains a enzyme with the given name (supports synonym names)

## ◆ hasEnzyme() [2/2]

bool hasEnzyme | ( | const DigestionEnzymeType * | enzyme | ) | const

inline

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

## ◆ hasRegEx()

bool hasRegEx | ( | const String & | cleavage_regex | ) | const

inline

returns true if the db contains a enzyme with the given regex

## ◆ operator=()

DigestionEnzymeDB& operator= | ( | const DigestionEnzymeDB< DigestionEnzymeType, InstanceType > & | enzymes_db | ) |

protected delete

assignment operator

## ◆ parseEnzyme_()

const DigestionEnzymeType* parseEnzyme_ | ( | Map< String, String > & | values | ) | const

inline protected

parses an enzyme, given the key/value pairs from an XML file

Referenced by DigestionEnzymeDB< DigestionEnzymeRNA, RNaseDB >::readEnzymesFromFile_().

## ◆ readEnzymesFromFile_()

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

inline protected

reads enzymes from the given file

Referenced by DigestionEnzymeDB< DigestionEnzymeRNA, RNaseDB >::DigestionEnzymeDB().

## Member Data Documentation

## ◆ const_enzymes_

std::set<const DigestionEnzymeType*> const_enzymes_

protected

set of enzymes

Referenced by DigestionEnzymeDB< DigestionEnzymeRNA, RNaseDB >::addEnzyme_(), DigestionEnzymeDB< DigestionEnzymeRNA, RNaseDB >::beginEnzyme(), DigestionEnzymeDB< DigestionEnzymeRNA, RNaseDB >::endEnzyme(), DigestionEnzymeDB< DigestionEnzymeRNA, RNaseDB >::getAllNames(), and DigestionEnzymeDB< DigestionEnzymeRNA, RNaseDB >::hasEnzyme().

## ◆ enzyme_names_

Map<String, const DigestionEnzymeType*> enzyme_names_

protected

index by names

Referenced by DigestionEnzymeDB< DigestionEnzymeRNA, RNaseDB >::addEnzyme_().

## ◆ enzyme_regex_

Map<String, const DigestionEnzymeType*> enzyme_regex_

protected

index by regex

Referenced by DigestionEnzymeDB< DigestionEnzymeRNA, RNaseDB >::addEnzyme_(), DigestionEnzymeDB< DigestionEnzymeRNA, RNaseDB >::getEnzymeByRegEx(), and DigestionEnzymeDB< DigestionEnzymeRNA, RNaseDB >::hasRegEx().