OpenMS  2.5.0
List of all members
DigestionEnzymeDB< DigestionEnzymeType, InstanceType > Class Template Reference

Digestion enzyme database (base class) More...

#include <OpenMS/CHEMISTRY/DigestionEnzymeDB.h>

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

Iterators

ConstEnzymeIterator beginEnzyme () const
 
ConstEnzymeIterator endEnzyme () const
 
 DigestionEnzymeDB (const String &db_file="")
 
 DigestionEnzymeDB (const DigestionEnzymeDB &enzymes_db)=delete
 copy constructor More...
 

Assignment

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...
 
DigestionEnzymeDBoperator= (const DigestionEnzymeDB &enzymes_db)=delete
 assignment operator 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...
 

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 ( )
inlinevirtual

destructor

◆ DigestionEnzymeDB() [1/2]

DigestionEnzymeDB ( const String db_file = "")
inlineprotected

◆ DigestionEnzymeDB() [2/2]

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

copy constructor

Member Function Documentation

◆ addEnzyme_()

void addEnzyme_ ( const DigestionEnzymeType *  enzyme)
inlineprotected

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

◆ 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

◆ 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)

◆ 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)
protecteddelete

assignment operator

◆ parseEnzyme_()

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

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

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

◆ readEnzymesFromFile_()

void readEnzymesFromFile_ ( const String filename)
inlineprotected

reads enzymes from the given file

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

Member Data Documentation

◆ const_enzymes_

std::set<const DigestionEnzymeType*> const_enzymes_
protected

◆ enzyme_names_

Map<String, const DigestionEnzymeType*> enzyme_names_
protected

◆ enzyme_regex_

Map<String, const DigestionEnzymeType*> enzyme_regex_
protected