OpenMS
DigestionEnzyme.h
Go to the documentation of this file.
1 // Copyright (c) 2002-2023, The OpenMS Team -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Xiao Liang $
6 // $Authors: Xiao Liang $
7 // --------------------------------------------------------------------------
8 //
9 
10 #pragma once
11 
14 
15 #include <iosfwd>
16 #include <set>
17 #include <vector>
18 
19 namespace OpenMS
20 {
26  class OPENMS_DLLAPI DigestionEnzyme
27  {
28  public:
29 
34  DigestionEnzyme(const DigestionEnzyme&) = default;
35 
38 
40  explicit DigestionEnzyme(const String& name,
41  const String& cleavage_regex,
42  const std::set<String>& synonyms = std::set<String>(),
43  String regex_description = "");
44 
46  explicit DigestionEnzyme(const String& name,
47  String cut_before,
48  const String& nocut_after = "",
49  String sense = "C",
50  const std::set<String>& synonyms = std::set<String>(),
51  String regex_description = "");
52 
54  virtual ~DigestionEnzyme();
56 
62 
66 
71  void setName(const String& name);
72 
74  const String& getName() const;
75 
77  void setSynonyms(const std::set<String>& synonyms);
78 
80  void addSynonym(const String& synonym);
81 
83  const std::set<String>& getSynonyms() const;
84 
86  void setRegEx(const String& cleavage_regex);
87 
89  const String& getRegEx() const;
90 
92  void setRegExDescription(const String& value);
93 
95  const String& getRegExDescription() const;
97 
102  bool operator==(const DigestionEnzyme& enzyme) const;
103 
105  bool operator!=(const DigestionEnzyme& enzyme) const;
106 
108  bool operator==(const String& cleavage_regex) const;
109 
111  bool operator!=(const String& cleavage_regex) const;
112 
114  bool operator<(const DigestionEnzyme& enzyme) const;
116 
122  virtual bool setValueFromFile(const String& key, const String& value);
123 
125  friend OPENMS_DLLAPI std::ostream& operator<<(std::ostream& os, const DigestionEnzyme& enzyme);
126 
127  protected:
128 
131 
132  // basic
134 
136 
137  std::set<String> synonyms_;
138 
140  };
141 
142  OPENMS_DLLAPI std::ostream& operator<<(std::ostream& os, const DigestionEnzyme& enzyme);
143 }
144 
Base class for digestion enzymes.
Definition: DigestionEnzyme.h:27
bool operator<(const DigestionEnzyme &enzyme) const
order operator
virtual ~DigestionEnzyme()
Destructor.
bool operator==(const String &cleavage_regex) const
equality operator for regex
bool operator!=(const DigestionEnzyme &enzyme) const
inequality operator
DigestionEnzyme & operator=(DigestionEnzyme &&) &=default
Move assignment operator.
bool operator==(const DigestionEnzyme &enzyme) const
equality operator
String regex_description_
Definition: DigestionEnzyme.h:139
String name_
Definition: DigestionEnzyme.h:133
DigestionEnzyme(const DigestionEnzyme &)=default
Copy constructor.
void setSynonyms(const std::set< String > &synonyms)
sets the synonyms
void setRegExDescription(const String &value)
sets the regex description
DigestionEnzyme(const String &name, String cut_before, const String &nocut_after="", String sense="C", const std::set< String > &synonyms=std::set< String >(), String regex_description="")
Detailed constructor 2.
const String & getRegEx() const
returns the cleavage regex
friend std::ostream & operator<<(std::ostream &os, const DigestionEnzyme &enzyme)
ostream iterator to write the enzyme to a stream
void setName(const String &name)
sets the name of the enzyme
const String & getRegExDescription() const
returns the regex description
const std::set< String > & getSynonyms() const
returns the synonyms
DigestionEnzyme(const String &name, const String &cleavage_regex, const std::set< String > &synonyms=std::set< String >(), String regex_description="")
Detailed constructor.
virtual bool setValueFromFile(const String &key, const String &value)
Set the value of a member variable based on an entry from an input file.
const String & getName() const
returns the name of the enzyme
DigestionEnzyme & operator=(const DigestionEnzyme &)=default
Assignment operator.
std::set< String > synonyms_
Definition: DigestionEnzyme.h:137
String cleavage_regex_
Definition: DigestionEnzyme.h:135
DigestionEnzyme()
default constructor
bool operator!=(const String &cleavage_regex) const
equality operator for regex
DigestionEnzyme(DigestionEnzyme &&)=default
Move constructor.
void addSynonym(const String &synonym)
adds a synonym
void setRegEx(const String &cleavage_regex)
sets the cleavage regex
A more convenient string class.
Definition: String.h:34
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22
std::ostream & operator<<(std::ostream &os, const AccurateMassSearchResult &amsr)