Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Residue.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-2016.
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: Andreas Bertsch $
32 // $Authors: Andreas Bertsch $
33 // --------------------------------------------------------------------------
34 //
35 
36 #ifndef OPENMS_CHEMISTRY_RESIDUE_H
37 #define OPENMS_CHEMISTRY_RESIDUE_H
38 
40 #include <OpenMS/CONCEPT/Types.h>
42 
43 #include <iosfwd>
44 #include <set>
45 #include <vector>
46 
47 namespace OpenMS
48 {
49 
62  class OPENMS_DLLAPI Residue
63  {
64 public:
65 
69 
70  // Formulae that need to be added to the internal residues to get to fragment type
71  // Formulae from http://www.matrixscience.com/help/fragmentation_help.html
72  inline static const EmpiricalFormula& getInternalToFull()
73  {
74  static const EmpiricalFormula to_full = EmpiricalFormula("H2O");
75  return to_full;
76  }
77 
78  inline static const EmpiricalFormula& getInternalToNTerm()
79  {
80  static const EmpiricalFormula to_full = EmpiricalFormula("H");
81  return to_full;
82  }
83 
84  inline static const EmpiricalFormula& getInternalToCTerm()
85  {
86  static const EmpiricalFormula to_full = EmpiricalFormula("OH");
87  return to_full;
88  }
89 
90  inline static const EmpiricalFormula& getInternalToAIon()
91  {
92  // Mind the "-"
93  static const EmpiricalFormula to_full =
94  getInternalToNTerm() - EmpiricalFormula("CHO");
95  return to_full;
96  }
97 
98  inline static const EmpiricalFormula& getInternalToBIon()
99  {
100  // Mind the "-"
101  static const EmpiricalFormula to_full =
102  getInternalToNTerm() - EmpiricalFormula("H");
103  return to_full;
104  }
105 
106  inline static const EmpiricalFormula& getInternalToCIon()
107  {
108  static const EmpiricalFormula to_full =
109  getInternalToNTerm() + EmpiricalFormula("NH2");
110  return to_full;
111  }
112 
113  inline static const EmpiricalFormula& getInternalToXIon()
114  {
115  // Mind the "-"
116  static const EmpiricalFormula to_full =
117  getInternalToCTerm() + EmpiricalFormula("CO") - EmpiricalFormula("H");
118  return to_full;
119  }
120 
121  inline static const EmpiricalFormula& getInternalToYIon()
122  {
123  static const EmpiricalFormula to_full =
124  getInternalToCTerm() + EmpiricalFormula("H");
125  return to_full;
126  }
127 
128  inline static const EmpiricalFormula& getInternalToZIon()
129  {
130  // Mind the "-"
131  static const EmpiricalFormula to_full =
132  getInternalToCTerm() - EmpiricalFormula("NH2");
133  return to_full;
134  }
135 
136 
138 
143  {
144  Full = 0, // with N-terminus and C-terminus
145  Internal, // internal, without any termini
146  NTerminal, // only N-terminus
147  CTerminal, // only C-terminus
148  AIon, // N-terminus up to the C-alpha/carbonyl carbon bond
149  BIon, // N-terminus up to the peptide bond
150  CIon, // N-terminus up to the amide/C-alpha bond
151  XIon, // amide/C-alpha bond up to the C-terminus
152  YIon, // peptide bond up to the C-terminus
153  ZIon, // C-alpha/carbonyl carbon bond
154  SizeOfResidueType
155  };
157 
159  static String getResidueTypeName(const ResidueType res_type);
160 
161 
165  Residue();
167 
169  Residue(const Residue & residue);
170 
172  Residue(const String & name,
173  const String & three_letter_code,
174  const String & one_letter_code,
175  const EmpiricalFormula & formula);
176 
178  virtual ~Residue();
180 
184  Residue & operator=(const Residue & residue);
187 
191  void setName(const String & name);
193 
195  const String & getName() const;
196 
198  void setShortName(const String & short_name);
199 
201  const String & getShortName() const;
202 
204  void setSynonyms(const std::set<String> & synonyms);
205 
207  void addSynonym(const String & synonym);
208 
210  const std::set<String> & getSynonyms() const;
211 
213  void setThreeLetterCode(const String & three_letter_code);
214 
216  const String & getThreeLetterCode() const;
217 
219  void setOneLetterCode(const String & one_letter_code);
220 
222  const String & getOneLetterCode() const;
223 
225  void addLossFormula(const EmpiricalFormula &);
226 
228  void setLossFormulas(const std::vector<EmpiricalFormula> &);
229 
231  void addNTermLossFormula(const EmpiricalFormula &);
232 
234  void setNTermLossFormulas(const std::vector<EmpiricalFormula> &);
235 
237  const std::vector<EmpiricalFormula> & getLossFormulas() const;
238 
240  const std::vector<EmpiricalFormula> & getNTermLossFormulas() const;
241 
243  void setLossNames(const std::vector<String> & name);
244 
246  void setNTermLossNames(const std::vector<String> & name);
247 
249  void addLossName(const String & name);
250 
252  void addNTermLossName(const String & name);
253 
255  const std::vector<String> & getLossNames() const;
256 
258  const std::vector<String> & getNTermLossNames() const;
259 
261  void setFormula(const EmpiricalFormula & formula);
262 
264  EmpiricalFormula getFormula(ResidueType res_type = Full) const;
265 
267  void setAverageWeight(double weight);
268 
270  double getAverageWeight(ResidueType res_type = Full) const;
271 
273  void setMonoWeight(double weight);
274 
276  double getMonoWeight(ResidueType res_type = Full) const;
277 
279  void setModification(const String & name);
280 
282  const String & getModification() const;
283 
285  void setLowMassIons(const std::vector<EmpiricalFormula> & low_mass_ions);
286 
288  const std::vector<EmpiricalFormula> & getLowMassIons() const;
289 
291  void setResidueSets(const std::set<String> & residues_sets);
292 
294  void addResidueSet(const String & residue_sets);
295 
297  const std::set<String> & getResidueSets() const;
299 
303  bool hasNeutralLoss() const;
305 
307  bool hasNTermNeutralLosses() const;
308 
310  bool operator==(const Residue & residue) const;
311 
313  bool operator!=(const Residue & residue) const;
314 
316  bool operator==(char one_letter_code) const;
317 
319  bool operator!=(char one_letter_code) const;
320 
322  double getPka() const;
323 
325  double getPkb() const;
326 
328  double getPkc() const;
329 
331  double getPiValue() const;
332 
334  void setPka(double value);
335 
337  void setPkb(double value);
338 
340  void setPkc(double value);
341 
343  double getSideChainBasicity() const;
344 
346  void setSideChainBasicity(double gb_sc);
347 
349  double getBackboneBasicityLeft() const;
350 
352  void setBackboneBasicityLeft(double gb_bb_l);
353 
355  double getBackboneBasicityRight() const;
356 
358  void setBackboneBasicityRight(double gb_bb_r);
359 
361  bool isModified() const;
362 
364  bool isInResidueSet(const String & residue_set);
366 
368  friend OPENMS_DLLAPI std::ostream & operator<<(std::ostream & os, const Residue & residue);
369 
370 protected:
371 
372  // basic
374 
376 
377  std::set<String> synonyms_;
378 
380 
382 
384 
386 
388 
389  double mono_weight_;
390 
391  // modification
393 
395 
397 
398  // loss
399  std::vector<String> loss_names_;
400 
401  std::vector<EmpiricalFormula> loss_formulas_;
402 
403  std::vector<String> NTerm_loss_names_;
404 
405  std::vector<EmpiricalFormula> NTerm_loss_formulas_;
406 
408 
410 
411  // low mass markers like immonium ions
412  std::vector<EmpiricalFormula> low_mass_ions_;
413 
414  // pka values
415  double pka_;
416 
417  // pkb values
418  double pkb_;
419 
420  // pkc values
421  double pkc_;
422 
423  double gb_sc_;
424 
425  double gb_bb_l_;
426 
427  double gb_bb_r_;
428 
429  // residue sets this amino acid is contained in
430  std::set<String> residue_sets_;
431 
432  };
433 
434  OPENMS_DLLAPI std::ostream & operator<<(std::ostream & os, const Residue & residue);
435 
436 }
437 
438 #endif
Definition: Residue.h:152
std::vector< String > loss_names_
Definition: Residue.h:399
A more convenient string class.
Definition: String.h:57
std::vector< String > NTerm_loss_names_
Definition: Residue.h:403
double pkc_
Definition: Residue.h:421
static const EmpiricalFormula & getInternalToNTerm()
Definition: Residue.h:78
double gb_bb_r_
Definition: Residue.h:427
static const EmpiricalFormula & getInternalToFull()
Definition: Residue.h:72
Definition: Residue.h:146
Definition: Residue.h:145
static const EmpiricalFormula & getInternalToAIon()
Definition: Residue.h:90
static const EmpiricalFormula & getInternalToBIon()
Definition: Residue.h:98
double pka_
Definition: Residue.h:415
static const EmpiricalFormula & getInternalToXIon()
Definition: Residue.h:113
double gb_sc_
Definition: Residue.h:423
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
Representation of a residue.
Definition: Residue.h:62
std::vector< EmpiricalFormula > loss_formulas_
Definition: Residue.h:401
double gb_bb_l_
Definition: Residue.h:425
double loss_mono_weight_
Definition: Residue.h:409
std::vector< EmpiricalFormula > low_mass_ions_
Definition: Residue.h:412
static const EmpiricalFormula & getInternalToCTerm()
Definition: Residue.h:84
Representation of an empirical formula.
Definition: EmpiricalFormula.h:79
static const EmpiricalFormula & getInternalToYIon()
Definition: Residue.h:121
void setModification(int location, int max_size, String modification, OpenMS::AASequence &aas)
helper function that sets a modification on a AASequence object
Definition: Residue.h:147
static const EmpiricalFormula & getInternalToZIon()
Definition: Residue.h:128
std::ostream & operator<<(std::ostream &os, const AccurateMassSearchResult &amsr)
double average_weight_
Definition: Residue.h:387
String short_name_
Definition: Residue.h:375
Definition: Residue.h:153
EmpiricalFormula internal_formula_
Definition: Residue.h:385
double mono_weight_
Definition: Residue.h:389
ResidueType
Definition: Residue.h:142
Definition: Residue.h:148
String name_
Definition: Residue.h:373
String three_letter_code_
Definition: Residue.h:379
double pkb_
Definition: Residue.h:418
bool is_modified_
Definition: Residue.h:392
std::set< String > synonyms_
Definition: Residue.h:377
Definition: Residue.h:149
String pre_mod_name_
Definition: Residue.h:394
EmpiricalFormula formula_
Definition: Residue.h:383
double loss_average_weight_
Definition: Residue.h:407
String modification_
Definition: Residue.h:396
Definition: Residue.h:150
Definition: Residue.h:151
std::set< String > residue_sets_
Definition: Residue.h:430
std::vector< EmpiricalFormula > NTerm_loss_formulas_
Definition: Residue.h:405
String one_letter_code_
Definition: Residue.h:381
static const EmpiricalFormula & getInternalToCIon()
Definition: Residue.h:106

OpenMS / TOPP release 2.0.0 Documentation generated on Tue Jan 31 2017 06:39:52 using doxygen 1.8.8