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  {
70  ENZYME_TRYPSIN, //< Trypsin with [KR] | [^P]
71  ENZYME_TRYPSIN_P, //< relaxed Trypsin, allowing any AA after cleavage [KR] | .
72  SIZE_OF_ENZYMES
73  };
75  static const std::string NamesOfEnzymes[SIZE_OF_ENZYMES];
76 
79  {
80  SPEC_FULL, //< fully enzyme specific, e.g., tryptic (ends with KR, AA-before is KR), or peptide is at protein terminal ends
81  SPEC_SEMI, //< semi specific, i.e., one of the two cleavage sites must fulfill requirements
82  SPEC_NONE, //< no requirements on start / end
83  SIZE_OF_SPECIFICITY
84  };
86  static const std::string NamesOfSpecificity[SIZE_OF_SPECIFICITY];
87 
88 
91 
94 
96  EnzymaticDigestion& operator=(const EnzymaticDigestion& rhs);
97 
98 
100  SignedSize getMissedCleavages() const;
101 
103  void setMissedCleavages(SignedSize missed_cleavages);
104 
106  Enzyme getEnzyme() const;
107 
109  void setEnzyme(Enzyme enzyme);
110 
113  static Enzyme getEnzymeByName(const String & name);
114 
116  Specificity getSpecificity() const;
117 
119  void setSpecificity(Specificity spec);
120 
123  static Specificity getSpecificityByName(const String & name);
124 
126  void digest(const AASequence & protein, std::vector<AASequence> & output) const;
127 
129  Size peptideCount(const AASequence & protein);
130 
132  bool isLogModelEnabled() const;
133 
135  void setLogModelEnabled(bool enabled);
136 
138  double getLogThreshold() const;
139 
142  void setLogThreshold(double threshold);
143 
145  bool isValidProduct(const AASequence& protein, Size pep_pos, Size pep_length);
146 
147 protected:
148  // define a binding site by position and AA
149  struct BindingSite
150  {
153 
155  position(), AAname() {}
156 
157  BindingSite(const Size & p, const String & name) :
158  position(p), AAname(name) {}
159 
160  bool operator<(const BindingSite & rhs) const
161  {
162  return (position < rhs.position) || ((position == rhs.position) && (AAname < rhs.AAname));
163  }
164 
165  bool operator==(const BindingSite & rhs) const
166  {
167  return position == rhs.position && AAname == rhs.AAname;
168  }
169 
170  };
171 
172  // define the log likelihood for missed and cleavage model
174  {
175  double p_cleave;
176  double p_miss;
177 
179  p_cleave(0), p_miss(0) {}
180  CleavageModel(const double & p_c, const double & p_m) :
181  p_cleave(p_c), p_miss(p_m) {}
182  };
183 
185  void nextCleavageSite_(const AASequence & sequence, AASequence::ConstIterator & p) const;
186 
188  bool isCleavageSite_(const AASequence & sequence, const AASequence::ConstIterator & p) const;
189 
196 
203  };
204 
205 } // namespace OpenMS
206 
207 #endif // OPENMS_CHEMISTRY_ENZYMATICDIGESTION_H
Definition: EnzymaticDigestion.h:81
A more convenient string class.
Definition: String.h:57
bool use_log_model_
Use the log model (only supported for 'Trypsin' with zero missed cleavages) or naive digestion (with ...
Definition: EnzymaticDigestion.h:198
BindingSite(const Size &p, const String &name)
Definition: EnzymaticDigestion.h:157
Map< BindingSite, CleavageModel > model_data_
Holds the cleavage model.
Definition: EnzymaticDigestion.h:202
Definition: EnzymaticDigestion.h:80
CleavageModel()
Definition: EnzymaticDigestion.h:178
Definition: EnzymaticDigestion.h:149
Definition: EnzymaticDigestion.h:70
Definition: EnzymaticDigestion.h:173
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:160
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
BindingSite()
Definition: EnzymaticDigestion.h:154
bool operator==(const BindingSite &rhs) const
Definition: EnzymaticDigestion.h:165
double p_cleave
Definition: EnzymaticDigestion.h:175
Definition: EnzymaticDigestion.h:82
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:193
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:78
CleavageModel(const double &p_c, const double &p_m)
Definition: EnzymaticDigestion.h:180
Specificity specificity_
specificity of enzyme
Definition: EnzymaticDigestion.h:195
String AAname
Definition: EnzymaticDigestion.h:152
Definition: EnzymaticDigestion.h:71
double p_miss
Definition: EnzymaticDigestion.h:176
Size position
Definition: EnzymaticDigestion.h:151
double log_model_threshold_
Threshold to decide if position is cleaved or missed (only for the model)
Definition: EnzymaticDigestion.h:200
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:191

OpenMS / TOPP release 2.0.0 Documentation generated on Thu Aug 20 2015 01:44:22 using doxygen 1.8.9.1