Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
EnzymaticDigestion.h
Go to the documentation of this file.
1 // --------------------------------------------------------------------------
2 // OpenMS -- Open-Source Mass Spectrometry
3 // --------------------------------------------------------------------------
4 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
5 // ETH Zurich, and Freie Universitaet Berlin 2002-2015.
6 //
7 // This software is released under a three-clause BSD license:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of any author or any participating institution
14 // may be used to endorse or promote products derived from this software
15 // without specific prior written permission.
16 // For a full list of authors, refer to the file AUTHORS.
17 // --------------------------------------------------------------------------
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
22 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // --------------------------------------------------------------------------
31 // $Maintainer: Chris Bielow $
32 // $Authors: Marc Sturm, Chris Bielow $
33 // --------------------------------------------------------------------------
34 
35 #ifndef OPENMS_CHEMISTRY_ENZYMATICDIGESTION_H
36 #define OPENMS_CHEMISTRY_ENZYMATICDIGESTION_H
37 
38 #include <OpenMS/CONCEPT/Types.h>
40 
41 #include <string>
42 #include <vector>
43 
44 namespace OpenMS
45 {
64  class OPENMS_DLLAPI EnzymaticDigestion
65  {
66 public:
68  enum Enzyme
69  {
71  SIZE_OF_ENZYMES
72  };
74  static const std::string NamesOfEnzymes[SIZE_OF_ENZYMES];
75 
78  {
79  SPEC_FULL, //< fully enzyme specific, e.g., tryptic (ends with KR, AA-before is KR), or peptide is at protein terminal ends
80  SPEC_SEMI, //< semi specific, i.e., one of the two cleavage sites must fulfill requirements
81  SPEC_NONE, //< no requirements on start / end
82  SIZE_OF_SPECIFICITY
83  };
85  static const std::string NamesOfSpecificity[SIZE_OF_SPECIFICITY];
86 
87 
90 
93 
95  EnzymaticDigestion& operator=(const EnzymaticDigestion& rhs);
96 
97 
99  SignedSize getMissedCleavages() const;
100 
102  void setMissedCleavages(SignedSize missed_cleavages);
103 
105  Enzyme getEnzyme() const;
106 
108  void setEnzyme(Enzyme enzyme);
109 
112  static Enzyme getEnzymeByName(const String & name);
113 
115  Specificity getSpecificity() const;
116 
118  void setSpecificity(Specificity spec);
119 
122  static Specificity getSpecificityByName(const String & name);
123 
125  void digest(const AASequence & protein, std::vector<AASequence> & output) const;
126 
128  Size peptideCount(const AASequence & protein);
129 
131  bool isLogModelEnabled() const;
132 
134  void setLogModelEnabled(bool enabled);
135 
137  double getLogThreshold() const;
138 
141  void setLogThreshold(double threshold);
142 
144  bool isValidProduct(const AASequence& protein, Size pep_pos, Size pep_length);
145 
146 protected:
147  // define a binding site by position and AA
148  struct BindingSite
149  {
152 
154  position(), AAname() {}
155 
156  BindingSite(const Size & p, const String & name) :
157  position(p), AAname(name) {}
158 
159  bool operator<(const BindingSite & rhs) const
160  {
161  return (position < rhs.position) || ((position == rhs.position) && (AAname < rhs.AAname));
162  }
163 
164  bool operator==(const BindingSite & rhs) const
165  {
166  return position == rhs.position && AAname == rhs.AAname;
167  }
168 
169  };
170 
171  // define the log likelihood for missed and cleavage model
173  {
174  double p_cleave;
175  double p_miss;
176 
178  p_cleave(0), p_miss(0) {}
179  CleavageModel(const double & p_c, const double & p_m) :
180  p_cleave(p_c), p_miss(p_m) {}
181  };
182 
184  void nextCleavageSite_(const AASequence & sequence, AASequence::ConstIterator & p) const;
185 
187  bool isCleavageSite_(const AASequence & sequence, const AASequence::ConstIterator & p) const;
188 
195 
202  };
203 
204 } // namespace OpenMS
205 
206 #endif // OPENMS_CHEMISTRY_ENZYMATICDIGESTION_H
Definition: EnzymaticDigestion.h:80
A more convenient string class.
Definition: String.h:57
bool use_log_model_
use the log model or naive digestion (with missed cleavages)
Definition: EnzymaticDigestion.h:197
BindingSite(const Size &p, const String &name)
Definition: EnzymaticDigestion.h:156
Map< BindingSite, CleavageModel > model_data_
Holds the cleavage model.
Definition: EnzymaticDigestion.h:201
Definition: EnzymaticDigestion.h:79
CleavageModel()
Definition: EnzymaticDigestion.h:177
Definition: EnzymaticDigestion.h:148
Definition: EnzymaticDigestion.h:70
Definition: EnzymaticDigestion.h:172
ptrdiff_t SignedSize
Signed Size type e.g. used as pointer difference.
Definition: Types.h:128
Class for the enzymatic digestion of proteins.
Definition: EnzymaticDigestion.h:64
Representation of a peptide/protein sequence.
Definition: AASequence.h:70
bool operator<(const BindingSite &rhs) const
Definition: EnzymaticDigestion.h:159
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
BindingSite()
Definition: EnzymaticDigestion.h:153
bool operator==(const BindingSite &rhs) const
Definition: EnzymaticDigestion.h:164
double p_cleave
Definition: EnzymaticDigestion.h:174
Definition: EnzymaticDigestion.h:81
Enzyme
Possible enzymes for the digestion (adapt NamesOfEnzymes & nextCleavageSite_() if you add more enzyme...
Definition: EnzymaticDigestion.h:68
Enzyme enzyme_
Used enzyme.
Definition: EnzymaticDigestion.h:192
ConstIterator for AASequence.
Definition: AASequence.h:80
Specificity
when querying for valid digestion products, this determines if the specificity of the two peptide end...
Definition: EnzymaticDigestion.h:77
CleavageModel(const double &p_c, const double &p_m)
Definition: EnzymaticDigestion.h:179
Specificity specificity_
specificity of enzyme
Definition: EnzymaticDigestion.h:194
String AAname
Definition: EnzymaticDigestion.h:151
double p_miss
Definition: EnzymaticDigestion.h:175
Size position
Definition: EnzymaticDigestion.h:150
double log_model_threshold_
Threshold to decide if position is cleaved or missed (only for the model)
Definition: EnzymaticDigestion.h:199
Map class based on the STL map (containing several convenience functions)
Definition: Map.h:51
SignedSize missed_cleavages_
Number of missed cleavages.
Definition: EnzymaticDigestion.h:190

OpenMS / TOPP release 2.0.0 Documentation generated on Fri May 29 2015 17:20:23 using doxygen 1.8.9.1