OpenMS
DigestionEnzymeDB< DigestionEnzymeType, InstanceType > Class Template Reference

Digestion enzyme database (base class) More...

#include <OpenMS/CHEMISTRY/DigestionEnzymeDB.h>

Inheritance diagram for DigestionEnzymeDB< DigestionEnzymeType, InstanceType >:
[legend]
Collaboration diagram for DigestionEnzymeDB< DigestionEnzymeType, InstanceType >:
[legend]

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...
 

Typedefs

typedef std::set< const DigestionEnzymeType * >::const_iterator ConstEnzymeIterator
 
typedef std::set< const DigestionEnzymeType * >::iterator EnzymeIterator
 
static InstanceType * getInstance ()
 this member function serves as a replacement of the constructor More...
 

Assignment

std::map< String, const DigestionEnzymeType * > enzyme_names_
 index by names More...
 
std::map< String, const DigestionEnzymeType * > enzyme_regex_
 index by regex More...
 
std::set< const DigestionEnzymeType * > const_enzymes_
 set of enzymes More...
 
DigestionEnzymeDBoperator= (const DigestionEnzymeDB &enzymes_db)=delete
 assignment operator More...
 
void readEnzymesFromFile_ (const String &filename)
 reads enzymes from the given file More...
 
const DigestionEnzymeType * parseEnzyme_ (std::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...
 

Iterators

ConstEnzymeIterator beginEnzyme () const
 
ConstEnzymeIterator endEnzyme () const
 
 DigestionEnzymeDB (const String &db_file="")
 
 DigestionEnzymeDB (const DigestionEnzymeDB &enzymes_db)=delete
 copy constructor 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()

◆ DigestionEnzymeDB() [1/2]

◆ DigestionEnzymeDB() [2/2]

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

copy constructor

Member Function Documentation

◆ addEnzyme_()

◆ beginEnzyme()

◆ endEnzyme()

◆ getAllNames()

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

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

References DigestionEnzymeDB< DigestionEnzymeType, InstanceType >::const_enzymes_.

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::ElementNotFoundif enzyme is unknown
Note
enzymes are registered in regular and in toLowercase() style, if unsure use toLowercase

References DigestionEnzymeDB< DigestionEnzymeType, InstanceType >::enzyme_names_.

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::IllegalArgumentif enzyme regex is unregistered.

References DigestionEnzymeDB< DigestionEnzymeType, InstanceType >::enzyme_regex_, and DigestionEnzymeDB< DigestionEnzymeType, InstanceType >::hasRegEx().

◆ getInstance()

static InstanceType* getInstance ( )
inlinestatic

this member function serves as a replacement of the constructor

◆ hasEnzyme() [1/2]

bool hasEnzyme ( const DigestionEnzymeType *  enzyme) const
inline

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

References DigestionEnzymeDB< DigestionEnzymeType, InstanceType >::const_enzymes_.

◆ hasEnzyme() [2/2]

bool hasEnzyme ( const String name) const
inline

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

References DigestionEnzymeDB< DigestionEnzymeType, InstanceType >::enzyme_names_.

◆ hasRegEx()

bool hasRegEx ( const String cleavage_regex) const
inline

◆ operator=()

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

assignment operator

◆ parseEnzyme_()

const DigestionEnzymeType* parseEnzyme_ ( std::map< String, String > &  values) const
inlineprotected

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

References OPENMS_LOG_ERROR.

Referenced by DigestionEnzymeDB< DigestionEnzymeType, InstanceType >::readEnzymesFromFile_().

◆ readEnzymesFromFile_()

Member Data Documentation

◆ const_enzymes_

◆ enzyme_names_

◆ enzyme_regex_