39 typedef typename std::set<const DigestionEnzymeType*>::iterator
EnzymeIterator;
45 static InstanceType* db_ =
nullptr;
48 db_ =
new InstanceType;
90 String(
"Enzyme with regex " + cleavage_regex +
" was not registered in Enzyme DB, register first!").c_str());
101 all_names.push_back((*it)->getName());
153 String name = enzyme->getName();
159 const DigestionEnzymeType* old = existing->second;
162 String old_name = old->getName();
165 for (
const auto& syn : old->getSynonyms())
170 if (!old->getRegEx().empty())
182 for (std::set<String>::const_iterator it = enzyme->getSynonyms().begin(); it != enzyme->getSynonyms().end(); ++it)
187 if (enzyme->getRegEx() !=
"")
199 for (
auto& provider : providers)
201 auto enzymes = provider->loadEnzymes();
202 for (
auto& enzyme : enzymes)
Digestion enzyme database (base class)
Definition DigestionEnzymeDB.h:32
static InstanceType * getInstance()
this member function serves as a replacement of the constructor
Definition DigestionEnzymeDB.h:43
DigestionEnzymeDB(const DigestionEnzymeDB &enzymes_db)=delete
copy constructor
std::map< String, const DigestionEnzymeType * > enzyme_regex_
index by regex
Definition DigestionEnzymeDB.h:211
DigestionEnzymeDB()=default
ConstEnzymeIterator endEnzyme() const
Definition DigestionEnzymeDB.h:132
virtual ~DigestionEnzymeDB()
destructor
Definition DigestionEnzymeDB.h:57
void loadFromProviders_(std::vector< std::unique_ptr< DigestionEnzymeDataProvider< DigestionEnzymeType > > > &providers)
Definition DigestionEnzymeDB.h:197
ConstEnzymeIterator beginEnzyme() const
Definition DigestionEnzymeDB.h:131
const DigestionEnzymeType * getEnzyme(const String &name) const
Definition DigestionEnzymeDB.h:72
void getAllNames(std::vector< String > &all_names) const
returns all the enzyme names (does NOT include synonym names)
Definition DigestionEnzymeDB.h:96
DigestionEnzymeDB & operator=(const DigestionEnzymeDB &enzymes_db)=delete
assignment operator
std::set< constDigestionEnzymeType * >::const_iterator ConstEnzymeIterator
Definition DigestionEnzymeDB.h:38
std::set< constDigestionEnzymeType * >::iterator EnzymeIterator
Definition DigestionEnzymeDB.h:39
bool hasEnzyme(const DigestionEnzymeType *enzyme) const
returns true if the db contains the enzyme of the given pointer
Definition DigestionEnzymeDB.h:122
bool hasEnzyme(const String &name) const
returns true if the db contains a enzyme with the given name (supports synonym names)
Definition DigestionEnzymeDB.h:110
std::set< const DigestionEnzymeType * > const_enzymes_
set of enzymes
Definition DigestionEnzymeDB.h:213
std::map< String, const DigestionEnzymeType * > enzyme_names_
index by names
Definition DigestionEnzymeDB.h:209
const DigestionEnzymeType * getEnzymeByRegEx(const String &cleavage_regex) const
Definition DigestionEnzymeDB.h:84
bool hasRegEx(const String &cleavage_regex) const
returns true if the db contains a enzyme with the given regex
Definition DigestionEnzymeDB.h:116
void addEnzyme_(const DigestionEnzymeType *enzyme)
Definition DigestionEnzymeDB.h:151
Abstract interface for providing digestion enzyme data.
Definition DigestionEnzymeDataProvider.h:30
Element could not be found exception.
Definition Exception.h:654
A method or algorithm argument contains illegal values.
Definition Exception.h:630
A more convenient string class.
Definition String.h:34
String & toLower()
Converts the string to lowercase.
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19