39 typedef typename std::set<const DigestionEnzymeType*>::iterator
EnzymeIterator;
46 static InstanceType* db_ =
nullptr;
49 db_ =
new InstanceType;
73 const DigestionEnzymeType*
getEnzyme(
const std::string& name)
const
91 std::string(
"Enzyme with regex " + cleavage_regex +
" was not registered in Enzyme DB, register first!").c_str());
102 all_names.push_back((*it)->getName());
117 bool hasRegEx(
const std::string& cleavage_regex)
const
154 std::string name = enzyme->getName();
160 const DigestionEnzymeType* old = existing->second;
163 std::string old_name = old->getName();
166 for (
const auto& syn : old->getSynonyms())
171 if (!old->getRegEx().empty())
183 for (std::set<std::string>::const_iterator it = enzyme->getSynonyms().begin(); it != enzyme->getSynonyms().end(); ++it)
188 if (enzyme->getRegEx() !=
"")
200 for (
auto& provider : providers)
202 auto enzymes = provider->loadEnzymes();
203 for (
auto& enzyme : enzymes)
Digestion enzyme database (base class)
Definition DigestionEnzymeDB.h:32
void getAllNames(std::vector< std::string > &all_names) const
returns all the enzyme names (does NOT include synonym names)
Definition DigestionEnzymeDB.h:97
bool hasEnzyme(const std::string &name) const
returns true if the db contains a enzyme with the given name (supports synonym names)
Definition DigestionEnzymeDB.h:111
DigestionEnzymeDB(const DigestionEnzymeDB &enzymes_db)=delete
copy constructor
bool hasRegEx(const std::string &cleavage_regex) const
returns true if the db contains a enzyme with the given regex
Definition DigestionEnzymeDB.h:117
DigestionEnzymeDB()=default
ConstEnzymeIterator endEnzyme() const
Definition DigestionEnzymeDB.h:133
virtual ~DigestionEnzymeDB()
destructor
Definition DigestionEnzymeDB.h:58
void loadFromProviders_(std::vector< std::unique_ptr< DigestionEnzymeDataProvider< DigestionEnzymeType > > > &providers)
Definition DigestionEnzymeDB.h:198
ConstEnzymeIterator beginEnzyme() const
Definition DigestionEnzymeDB.h:132
std::map< std::string, const DigestionEnzymeType * > enzyme_names_
index by names
Definition DigestionEnzymeDB.h:210
const DigestionEnzymeType * getEnzymeByRegEx(const std::string &cleavage_regex) const
Definition DigestionEnzymeDB.h:85
static const InstanceType * getInstance()
Definition DigestionEnzymeDB.h:44
std::map< std::string, const DigestionEnzymeType * > enzyme_regex_
index by regex
Definition DigestionEnzymeDB.h:212
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:123
const DigestionEnzymeType * getEnzyme(const std::string &name) const
Definition DigestionEnzymeDB.h:73
std::set< const DigestionEnzymeType * > const_enzymes_
set of enzymes
Definition DigestionEnzymeDB.h:214
void addEnzyme_(const DigestionEnzymeType *enzyme)
Definition DigestionEnzymeDB.h:152
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
std::string & toLower(std::string &s)
Definition StringUtils.h:584
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19