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-2013.
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 <iostream>
44 #include <set>
45 #include <vector>
46 
47 namespace OpenMS
48 {
49  // forward declarations
50  class ResidueModification;
51 
64  class OPENMS_DLLAPI Residue
65  {
66 public:
67 
71  // Internal
72  inline static const EmpiricalFormula & getInternalToFull()
73  {
74  static const EmpiricalFormula internal_to_full = EmpiricalFormula("H2O");
75  return internal_to_full;
76  }
77 
79  {
80  static const DoubleReal internal_to_full_average_weight = getInternalToFull().getAverageWeight();
81  return internal_to_full_average_weight;
82  }
83 
85  {
86  static const DoubleReal internal_to_full_mono_weight = getInternalToFull().getMonoWeight();
87  return internal_to_full_mono_weight;
88  }
89 
90  // N-terminal
91  inline static const EmpiricalFormula & getNTerminalToFull()
92  {
93  static const EmpiricalFormula Nterminal_to_full = EmpiricalFormula("HO");
94  return Nterminal_to_full;
95  }
96 
98  {
99  static const DoubleReal Nterminal_to_full_average_weight = getNTerminalToFull().getAverageWeight();
100  return Nterminal_to_full_average_weight;
101  }
102 
104  {
105  static const DoubleReal Nterminal_to_full_mono_weight = getNTerminalToFull().getMonoWeight();
106  return Nterminal_to_full_mono_weight;
107  }
108 
109  // C-terminal
110  inline static const EmpiricalFormula & getCTerminalToFull()
111  {
112  static const EmpiricalFormula Cterminal_to_full = EmpiricalFormula("H");
113  return Cterminal_to_full;
114  }
115 
117  {
118  static const DoubleReal Cterminal_to_full_average_weight = getCTerminalToFull().getAverageWeight();
119  return Cterminal_to_full_average_weight;
120  }
121 
123  {
124  static const DoubleReal Cterminal_to_full_mono_weight = getCTerminalToFull().getMonoWeight();
125  return Cterminal_to_full_mono_weight;
126  }
127 
128  // b ion
129  inline static const EmpiricalFormula & getBIonToFull()
130  {
131  static const EmpiricalFormula b_ion_to_full = EmpiricalFormula("HO");
132  return b_ion_to_full;
133  }
134 
136  {
137  static const DoubleReal b_ion_to_full_average_weight = getBIonToFull().getAverageWeight();
138  return b_ion_to_full_average_weight;
139  }
140 
142  {
143  static const DoubleReal b_ion_to_full_mono_weight = getBIonToFull().getMonoWeight();
144  return b_ion_to_full_mono_weight;
145  }
146 
147  // a ion
148  inline static const EmpiricalFormula & getAIonToFull()
149  {
150  static const EmpiricalFormula a_ion_to_full = EmpiricalFormula("HCO2");
151  return a_ion_to_full;
152  }
153 
155  {
156  static const DoubleReal a_ion_to_full_average_weight = getAIonToFull().getAverageWeight();
157  return a_ion_to_full_average_weight;
158  }
159 
161  {
162  static const DoubleReal a_ion_to_full_mono_weight = getAIonToFull().getMonoWeight();
163  return a_ion_to_full_mono_weight;
164  }
165 
166  // y ion
167  inline static const EmpiricalFormula & getYIonToFull()
168  {
169  static const EmpiricalFormula y_ion_to_full = EmpiricalFormula("");
170  return y_ion_to_full;
171  }
172 
174  {
175  static const DoubleReal y_ion_to_full_average_weight = getYIonToFull().getAverageWeight();
176  return y_ion_to_full_average_weight;
177  }
178 
180  {
181  static const DoubleReal y_ion_to_full_mono_weight = getYIonToFull().getMonoWeight();
182  return y_ion_to_full_mono_weight;
183  }
184 
185  // c ion
186  inline static const EmpiricalFormula & getCIonToFull()
187  {
188  static const EmpiricalFormula c_ion_to_full = EmpiricalFormula("H-1");
189  return c_ion_to_full;
190  }
191 
193  {
194  static const DoubleReal c_ion_to_full_average_weight = getCIonToFull().getAverageWeight();
195  return c_ion_to_full_average_weight;
196  }
197 
199  {
200  static const DoubleReal c_ion_to_full_mono_weight = getCIonToFull().getMonoWeight();
201  return c_ion_to_full_mono_weight;
202  }
203 
204  // c-1 ion
205  inline static const EmpiricalFormula & getCIonMinusOneToFull()
206  {
207  static const EmpiricalFormula c_ion_to_full = EmpiricalFormula("H-2");
208  return c_ion_to_full;
209  }
210 
212  {
213  static const DoubleReal c_ion_to_full_average_weight = getCIonMinusOneToFull().getAverageWeight();
214  return c_ion_to_full_average_weight;
215  }
216 
218  {
219  static const DoubleReal c_ion_to_full_mono_weight = getCIonMinusOneToFull().getMonoWeight();
220  return c_ion_to_full_mono_weight;
221  }
222 
223  // c+1 ion
224  inline static const EmpiricalFormula & getCIonPlusOneToFull()
225  {
226  static const EmpiricalFormula c_ion_to_full = EmpiricalFormula("");
227  return c_ion_to_full;
228  }
229 
231  {
232  static const DoubleReal c_ion_to_full_average_weight = getCIonPlusOneToFull().getAverageWeight();
233  return c_ion_to_full_average_weight;
234  }
235 
237  {
238  static const DoubleReal c_ion_to_full_mono_weight = getCIonPlusOneToFull().getMonoWeight();
239  return c_ion_to_full_mono_weight;
240  }
241 
242  // c+2 ion
243  inline static const EmpiricalFormula & getCIonPlusTwoToFull()
244  {
245  static const EmpiricalFormula c_ion_to_full = EmpiricalFormula("H2");
246  return c_ion_to_full;
247  }
248 
250  {
251  static const DoubleReal c_ion_to_full_average_weight = getCIonPlusTwoToFull().getAverageWeight();
252  return c_ion_to_full_average_weight;
253  }
254 
256  {
257  static const DoubleReal c_ion_to_full_mono_weight = getCIonPlusTwoToFull().getMonoWeight();
258  return c_ion_to_full_mono_weight;
259  }
260 
261  // x ion
262  inline static const EmpiricalFormula & getXIonToFull()
263  {
264  static const EmpiricalFormula x_ion_to_full = EmpiricalFormula("HCO");
265  return x_ion_to_full;
266  }
267 
269  {
270  static const DoubleReal x_ion_to_full_average_weight = getXIonToFull().getAverageWeight();
271  return x_ion_to_full_average_weight;
272  }
273 
275  {
276  static const DoubleReal x_ion_to_full_mono_weight = getXIonToFull().getMonoWeight();
277  return x_ion_to_full_mono_weight;
278  }
279 
280  // z ion
281  inline static const EmpiricalFormula & getZIonToFull()
282  {
283  static const EmpiricalFormula z_ion_to_full = EmpiricalFormula("NH2");
284  return z_ion_to_full;
285  }
286 
288  {
289  static const DoubleReal z_ion_to_full_average_weight = getZIonToFull().getAverageWeight();
290  return z_ion_to_full_average_weight;
291  }
292 
294  {
295  static const DoubleReal z_ion_to_full_mono_weight = getZIonToFull().getMonoWeight();
296  return z_ion_to_full_mono_weight;
297  }
298 
299  // z-1 ion
300  inline static const EmpiricalFormula & getZIonMinusOneToFull()
301  {
302  static const EmpiricalFormula z_ion_to_full = EmpiricalFormula("N2");
303  return z_ion_to_full;
304  }
305 
307  {
308  static const DoubleReal z_ion_to_full_average_weight = getZIonMinusOneToFull().getAverageWeight();
309  return z_ion_to_full_average_weight;
310  }
311 
313  {
314  static const DoubleReal z_ion_to_full_mono_weight = getZIonMinusOneToFull().getMonoWeight();
315  return z_ion_to_full_mono_weight;
316  }
317 
318  // z+1 ion
319  inline static const EmpiricalFormula & getZIonPlusOneToFull()
320  {
321  static const EmpiricalFormula z_ion_to_full = EmpiricalFormula("NH3");
322  return z_ion_to_full;
323  }
324 
326  {
327  static const DoubleReal z_ion_to_full_average_weight = getZIonPlusOneToFull().getAverageWeight();
328  return z_ion_to_full_average_weight;
329  }
330 
332  {
333  static const DoubleReal z_ion_to_full_mono_weight = getZIonPlusOneToFull().getMonoWeight();
334  return z_ion_to_full_mono_weight;
335  }
336 
337  // z+2 ion
338  inline static const EmpiricalFormula & getZIonPlusTwoToFull()
339  {
340  static const EmpiricalFormula z_ion_to_full = EmpiricalFormula("NH4");
341  return z_ion_to_full;
342  }
343 
345  {
346  static const DoubleReal z_ion_to_full_average_weight = getZIonPlusTwoToFull().getAverageWeight();
347  return z_ion_to_full_average_weight;
348  }
349 
351  {
352  static const DoubleReal z_ion_to_full_mono_weight = getZIonPlusTwoToFull().getMonoWeight();
353  return z_ion_to_full_mono_weight;
354  }
355 
357 
362  {
363  Full = 0, // with N-terminus and C-terminus
364  Internal, // internal, without any termini
365  NTerminal, // only N-terminus
366  CTerminal, // only C-terminus
367  AIon, // N-terminus up to the C-alpha/carbonyl carbon bond
368  BIon, // N-terminus up to the peptide bond
369  CIonMinusOne, // N-terminus up to the amide/C-alpha bond
370  CIon, // N-terminus up to the amide/C-alpha bond
371  CIonPlusOne, // N-terminus up to the amide/C-alpha bond
372  CIonPlusTwo, // N-terminus up to the amide/C-alpha bond
373  XIon, // amide/C-alpha bond up to the C-terminus
374  YIon, // peptide bond up to the C-terminus
375  ZIonMinusOne, // C-alpha/carbonyl carbon bond
376  ZIon, // C-alpha/carbonyl carbon bond
377  ZIonPlusOne, // C-alpha/carbonyl carbon bond
378  ZIonPlusTwo, // C-alpha/carbonyl carbon bond
379  SizeOfResidueType
380 
382  };
384 
386  static String getResidueTypeName(const ResidueType res_type);
387 
388 
392  Residue();
394 
396  Residue(const Residue & residue);
397 
399  Residue(const String & name,
400  const String & three_letter_code,
401  const String & one_letter_code,
402  const EmpiricalFormula & formula);
403 
405  virtual ~Residue();
407 
411  Residue & operator=(const Residue & residue);
414 
418  void setName(const String & name);
420 
422  const String & getName() const;
423 
425  void setShortName(const String & short_name);
426 
428  const String & getShortName() const;
429 
431  void setSynonyms(const std::set<String> & synonyms);
432 
434  void addSynonym(const String & synonym);
435 
437  const std::set<String> & getSynonyms() const;
438 
440  void setThreeLetterCode(const String & three_letter_code);
441 
443  const String & getThreeLetterCode() const;
444 
446  void setOneLetterCode(const String & one_letter_code);
447 
449  const String & getOneLetterCode() const;
450 
452  void addLossFormula(const EmpiricalFormula &);
453 
455  void setLossFormulas(const std::vector<EmpiricalFormula> &);
456 
458  void addNTermLossFormula(const EmpiricalFormula &);
459 
461  void setNTermLossFormulas(const std::vector<EmpiricalFormula> &);
462 
464  const std::vector<EmpiricalFormula> & getLossFormulas() const;
465 
467  const std::vector<EmpiricalFormula> & getNTermLossFormulas() const;
468 
470  void setLossNames(const std::vector<String> & name);
471 
473  void setNTermLossNames(const std::vector<String> & name);
474 
476  void addLossName(const String & name);
477 
479  void addNTermLossName(const String & name);
480 
482  const std::vector<String> & getLossNames() const;
483 
485  const std::vector<String> & getNTermLossNames() const;
486 
488  void setFormula(const EmpiricalFormula & formula);
489 
491  EmpiricalFormula getFormula(ResidueType res_type = Full) const;
492 
494  void setAverageWeight(DoubleReal weight);
495 
497  DoubleReal getAverageWeight(ResidueType res_type = Full) const;
498 
500  void setMonoWeight(DoubleReal weight);
501 
503  DoubleReal getMonoWeight(ResidueType res_type = Full) const;
504 
506  void setModification(const String & name);
507 
509  const String & getModification() const;
510 
512  void setLowMassIons(const std::vector<EmpiricalFormula> & low_mass_ions);
513 
515  const std::vector<EmpiricalFormula> & getLowMassIons() const;
516 
518  void setResidueSets(const std::set<String> & residues_sets);
519 
521  void addResidueSet(const String & residue_sets);
522 
524  const std::set<String> & getResidueSets() const;
526 
530  bool hasNeutralLoss() const;
532 
534  bool hasNTermNeutralLosses() const;
535 
537  bool operator==(const Residue & residue) const;
538 
540  bool operator!=(const Residue & residue) const;
541 
543  bool operator==(char one_letter_code) const;
544 
546  bool operator!=(char one_letter_code) const;
547 
549  DoubleReal getPka() const;
550 
552  DoubleReal getPkb() const;
553 
555  DoubleReal getPkc() const;
556 
558  DoubleReal getPiValue() const;
559 
561  void setPka(DoubleReal value);
562 
564  void setPkb(DoubleReal value);
565 
567  void setPkc(DoubleReal value);
568 
570  DoubleReal getSideChainBasicity() const;
571 
573  void setSideChainBasicity(DoubleReal gb_sc);
574 
576  DoubleReal getBackboneBasicityLeft() const;
577 
579  void setBackboneBasicityLeft(DoubleReal gb_bb_l);
580 
582  DoubleReal getBackboneBasicityRight() const;
583 
585  void setBackboneBasicityRight(DoubleReal gb_bb_r);
586 
588  bool isModified() const;
589 
591  bool isInResidueSet(const String & residue_set);
593 
595  friend OPENMS_DLLAPI std::ostream & operator<<(std::ostream & os, const Residue & residue);
596 
597 protected:
598 
599  // basic
601 
603 
604  std::set<String> synonyms_;
605 
607 
609 
611 
613 
615 
617 
618  // modification
620 
622 
624 
625  // loss
626  std::vector<String> loss_names_;
627 
628  std::vector<EmpiricalFormula> loss_formulas_;
629 
630  std::vector<String> NTerm_loss_names_;
631 
632  std::vector<EmpiricalFormula> NTerm_loss_formulas_;
633 
635 
637 
638  // low mass markers like immonium ions
639  std::vector<EmpiricalFormula> low_mass_ions_;
640 
641  // pka values
643 
644  // pkb values
646 
647  // pkc values
649 
651 
653 
655 
656  // residue sets this amino acid is contained in
657  std::set<String> residue_sets_;
658 
659  };
660 
661  OPENMS_DLLAPI std::ostream & operator<<(std::ostream & os, const Residue & residue);
662 
663 }
664 
665 #endif
Definition: Residue.h:367
static const EmpiricalFormula & getZIonPlusTwoToFull()
Definition: Residue.h:338
static const EmpiricalFormula & getBIonToFull()
Definition: Residue.h:129
static DoubleReal getCIonToFullAverageWeight()
Definition: Residue.h:192
Definition: Residue.h:374
DoubleReal pka_
Definition: Residue.h:642
std::vector< String > loss_names_
Definition: Residue.h:626
static DoubleReal getCIonMinusOneToFullMonoWeight()
Definition: Residue.h:217
A more convenient string class.
Definition: String.h:56
static DoubleReal getZIonToFullAverageWeight()
Definition: Residue.h:287
static DoubleReal getNTerminalToFullMonoWeight()
Definition: Residue.h:103
std::vector< String > NTerm_loss_names_
Definition: Residue.h:630
static DoubleReal getAIonToFullMonoWeight()
Definition: Residue.h:160
Definition: Residue.h:364
DoubleReal pkb_
Definition: Residue.h:645
Definition: Residue.h:365
DoubleReal loss_average_weight_
Definition: Residue.h:634
DoubleReal gb_bb_r_
Definition: Residue.h:654
static const EmpiricalFormula & getInternalToFull()
Definition: Residue.h:72
static const EmpiricalFormula & getYIonToFull()
Definition: Residue.h:167
DoubleReal average_weight_
Definition: Residue.h:614
static DoubleReal getZIonMinusOneToFullMonoWeight()
Definition: Residue.h:312
static DoubleReal getCIonPlusTwoToFullMonoWeight()
Definition: Residue.h:255
std::ostream & operator<<(std::ostream &os, const ItraqQuantifier::ItraqQuantifierStats &stats)
Definition: Residue.h:366
static const EmpiricalFormula & getCIonPlusOneToFull()
Definition: Residue.h:224
static const EmpiricalFormula & getCIonToFull()
Definition: Residue.h:186
static const EmpiricalFormula & getZIonMinusOneToFull()
Definition: Residue.h:300
Representation of a residue.
Definition: Residue.h:64
std::vector< EmpiricalFormula > loss_formulas_
Definition: Residue.h:628
static DoubleReal getZIonPlusOneToFullMonoWeight()
Definition: Residue.h:331
DoubleReal gb_sc_
Definition: Residue.h:650
static DoubleReal getCTerminalToFullAverageWeight()
Definition: Residue.h:116
std::vector< EmpiricalFormula > low_mass_ions_
Definition: Residue.h:639
Definition: Residue.h:378
Representation of an empirical formula.
Definition: EmpiricalFormula.h:78
DoubleReal pkc_
Definition: Residue.h:648
Definition: Residue.h:376
Definition: Residue.h:372
void setModification(int location, int max_size, String modification, OpenMS::AASequence &aas)
helper function that sets a modifiction on a AASequence object
static DoubleReal getCIonPlusTwoToFullAverageWeight()
Definition: Residue.h:249
static const EmpiricalFormula & getZIonToFull()
Definition: Residue.h:281
static DoubleReal getZIonPlusTwoToFullAverageWeight()
Definition: Residue.h:344
static const EmpiricalFormula & getZIonPlusOneToFull()
Definition: Residue.h:319
static const EmpiricalFormula & getAIonToFull()
Definition: Residue.h:148
static const EmpiricalFormula & getCIonMinusOneToFull()
Definition: Residue.h:205
DoubleReal loss_mono_weight_
Definition: Residue.h:636
static DoubleReal getYIonToFullAverageWeight()
Definition: Residue.h:173
static DoubleReal getAIonToFullAverageWeight()
Definition: Residue.h:154
static const EmpiricalFormula & getCIonPlusTwoToFull()
Definition: Residue.h:243
String short_name_
Definition: Residue.h:602
Definition: Residue.h:373
Definition: Residue.h:377
static DoubleReal getXIonToFullAverageWeight()
Definition: Residue.h:268
static const EmpiricalFormula & getCTerminalToFull()
Definition: Residue.h:110
EmpiricalFormula internal_formula_
Definition: Residue.h:612
static DoubleReal getZIonToFullMonoWeight()
Definition: Residue.h:293
static DoubleReal getCIonMinusOneToFullAverageWeight()
Definition: Residue.h:211
String name_
Definition: Residue.h:600
String three_letter_code_
Definition: Residue.h:606
static DoubleReal getZIonPlusTwoToFullMonoWeight()
Definition: Residue.h:350
static DoubleReal getInternalToFullMonoWeight()
Definition: Residue.h:84
ResidueType
Definition: Residue.h:361
bool is_modified_
Definition: Residue.h:619
static DoubleReal getInternalToFullAverageWeight()
Definition: Residue.h:78
Definition: Residue.h:368
Definition: Residue.h:369
static const EmpiricalFormula & getXIonToFull()
Definition: Residue.h:262
std::set< String > synonyms_
Definition: Residue.h:604
static DoubleReal getCIonPlusOneToFullMonoWeight()
Definition: Residue.h:236
static DoubleReal getCIonToFullMonoWeight()
Definition: Residue.h:198
String pre_mod_name_
Definition: Residue.h:621
static DoubleReal getCTerminalToFullMonoWeight()
Definition: Residue.h:122
EmpiricalFormula formula_
Definition: Residue.h:610
static DoubleReal getBIonToFullAverageWeight()
Definition: Residue.h:135
String modification_
Definition: Residue.h:623
static DoubleReal getXIonToFullMonoWeight()
Definition: Residue.h:274
static DoubleReal getBIonToFullMonoWeight()
Definition: Residue.h:141
static const EmpiricalFormula & getNTerminalToFull()
Definition: Residue.h:91
DoubleReal gb_bb_l_
Definition: Residue.h:652
static DoubleReal getZIonMinusOneToFullAverageWeight()
Definition: Residue.h:306
DoubleReal mono_weight_
Definition: Residue.h:616
Definition: Residue.h:375
std::set< String > residue_sets_
Definition: Residue.h:657
Definition: Residue.h:371
std::vector< EmpiricalFormula > NTerm_loss_formulas_
Definition: Residue.h:632
static DoubleReal getCIonPlusOneToFullAverageWeight()
Definition: Residue.h:230
String one_letter_code_
Definition: Residue.h:608
static DoubleReal getYIonToFullMonoWeight()
Definition: Residue.h:179
static DoubleReal getNTerminalToFullAverageWeight()
Definition: Residue.h:97
Definition: Residue.h:370
static DoubleReal getZIonPlusOneToFullAverageWeight()
Definition: Residue.h:325

OpenMS / TOPP release 1.11.1 Documentation generated on Thu Nov 14 2013 11:19:20 using doxygen 1.8.5