Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages

Residue.h (Maintainer: Andreas Bertsch)

Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 //
00004 // --------------------------------------------------------------------------
00005 //                   OpenMS Mass Spectrometry Framework
00006 // --------------------------------------------------------------------------
00007 //  Copyright (C) 2003-2008 -- Oliver Kohlbacher, Knut Reinert
00008 //
00009 //  This library is free software; you can redistribute it and/or
00010 //  modify it under the terms of the GNU Lesser General Public
00011 //  License as published by the Free Software Foundation; either
00012 //  version 2.1 of the License, or (at your option) any later version.
00013 //
00014 //  This library is distributed in the hope that it will be useful,
00015 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017 //  Lesser General Public License for more details.
00018 //
00019 //  You should have received a copy of the GNU Lesser General Public
00020 //  License along with this library; if not, write to the Free Software
00021 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022 //
00023 // --------------------------------------------------------------------------
00024 // $Maintainer: Andreas Bertsch $
00025 // --------------------------------------------------------------------------
00026 //
00027 
00028 #ifndef OPENMS_CHEMISTRY_RESIDUE_H
00029 #define OPENMS_CHEMISTRY_RESIDUE_H
00030 
00031 #include <OpenMS/CHEMISTRY/EmpiricalFormula.h>
00032 #include <OpenMS/CONCEPT/Types.h>
00033 #include <OpenMS/DATASTRUCTURES/String.h>
00034 
00035 #include <iostream>
00036 #include <set>
00037 #include <vector>
00038 
00039 namespace OpenMS
00040 {
00041   // forward declarations
00042   class ResidueModification;
00043 
00049   class Residue
00050   {
00051     public:
00052     
00056       typedef std::vector<EmpiricalFormula>::const_iterator LowMassConstIterator;
00057       typedef std::vector<EmpiricalFormula>::iterator LowMassIterator;
00058 
00059       
00060       inline static const EmpiricalFormula& getInternalToFull()
00061       {
00062         static const EmpiricalFormula internal_to_full = EmpiricalFormula("H2O");
00063         return internal_to_full;
00064       }
00065 
00066       
00067       inline static DoubleReal getInternalToFullAverageWeight()
00068       {
00069         static const DoubleReal internal_to_full_average_weight = getInternalToFull().getAverageWeight();
00070         return internal_to_full_average_weight;
00071       }
00072 
00073       inline static DoubleReal getInternalToFullMonoWeight()
00074       {
00075         static const DoubleReal internal_to_full_mono_weight = getInternalToFull().getMonoWeight();
00076         return internal_to_full_mono_weight;
00077       }
00078 
00079       inline static const EmpiricalFormula& getNTerminalToFull()
00080       {
00081         static const EmpiricalFormula Nterminal_to_full = EmpiricalFormula("HO");
00082         return Nterminal_to_full;
00083       }
00084 
00085       inline static DoubleReal getNTerminalToFullAverageWeight()
00086       {
00087         static const DoubleReal Nterminal_to_full_average_weight = getNTerminalToFull().getAverageWeight();
00088         return Nterminal_to_full_average_weight;
00089       }
00090 
00091       inline static DoubleReal getNTerminalToFullMonoWeight()
00092       {
00093         static const DoubleReal Nterminal_to_full_mono_weight = getNTerminalToFull().getMonoWeight();
00094         return Nterminal_to_full_mono_weight;
00095       }
00096       
00097       inline static const EmpiricalFormula& getCTerminalToFull()
00098       {
00099         static const EmpiricalFormula Cterminal_to_full = EmpiricalFormula("H");
00100         return Cterminal_to_full;
00101       }
00102 
00103       inline static DoubleReal getCTerminalToFullAverageWeight()
00104       {
00105         static const DoubleReal Cterminal_to_full_average_weight = getCTerminalToFull().getAverageWeight();
00106         return Cterminal_to_full_average_weight;
00107       }
00108     
00109       inline static DoubleReal getCTerminalToFullMonoWeight()
00110       {
00111         static const DoubleReal Cterminal_to_full_mono_weight = getCTerminalToFull().getMonoWeight();
00112         return Cterminal_to_full_mono_weight;
00113       }
00114     
00115       inline static const EmpiricalFormula& getBIonToFull()
00116       {
00117         static const EmpiricalFormula b_ion_to_full = EmpiricalFormula("HO");
00118         return b_ion_to_full;
00119       }
00120 
00121       inline static DoubleReal getBIonToFullAverageWeight()
00122       {
00123         static const DoubleReal b_ion_to_full_average_weight = getBIonToFull().getAverageWeight();
00124         return b_ion_to_full_average_weight;
00125       }
00126       
00127       inline static DoubleReal getBIonToFullMonoWeight()
00128       {
00129         static const DoubleReal b_ion_to_full_mono_weight = getBIonToFull().getMonoWeight();
00130         return b_ion_to_full_mono_weight;
00131       }
00132       
00133       inline static const EmpiricalFormula& getAIonToFull()
00134       {
00135         static const EmpiricalFormula a_ion_to_full = EmpiricalFormula("HCO2");
00136         return a_ion_to_full;
00137       }
00138   
00139       inline static DoubleReal getAIonToFullAverageWeight()
00140       {
00141         static const DoubleReal a_ion_to_full_average_weight = getAIonToFull().getAverageWeight();
00142         return a_ion_to_full_average_weight;
00143       }
00144 
00145       inline static DoubleReal getAIonToFullMonoWeight()
00146       {
00147         static const DoubleReal a_ion_to_full_mono_weight = getAIonToFull().getMonoWeight();
00148         return a_ion_to_full_mono_weight;
00149       }
00150 
00151       inline static const EmpiricalFormula& getYIonToFull()
00152       {
00153         static const EmpiricalFormula y_ion_to_full = EmpiricalFormula("");
00154         return y_ion_to_full;
00155       }
00156 
00157       inline static DoubleReal getYIonToFullAverageWeight()
00158       {
00159         static const DoubleReal y_ion_to_full_average_weight = getYIonToFull().getAverageWeight();
00160         return y_ion_to_full_average_weight;
00161       }
00162 
00163       inline static DoubleReal getYIonToFullMonoWeight()
00164       {
00165         static const DoubleReal y_ion_to_full_mono_weight = getYIonToFull().getMonoWeight();
00166         return y_ion_to_full_mono_weight;
00167       }
00168 
00169       inline static const EmpiricalFormula& getCIonToFull()
00170       {
00171         static const EmpiricalFormula c_ion_to_full = EmpiricalFormula("");
00172         return c_ion_to_full;
00173       }
00174 
00175       inline static DoubleReal getCIonToFullAverageWeight()
00176       {
00177         static const DoubleReal c_ion_to_full_average_weight = getCIonToFull().getAverageWeight();
00178         return c_ion_to_full_average_weight;
00179       }
00180 
00181       inline static DoubleReal getCIonToFullMonoWeight()
00182       {
00183         static const DoubleReal c_ion_to_full_mono_weight = getCIonToFull().getMonoWeight();
00184         return c_ion_to_full_mono_weight;
00185       }
00186       
00187       inline static const EmpiricalFormula& getXIonToFull()
00188       {
00189         static const EmpiricalFormula x_ion_to_full = EmpiricalFormula("HCO");
00190         return x_ion_to_full;
00191       }
00192 
00193       inline static DoubleReal getXIonToFullAverageWeight()
00194       {
00195         static const DoubleReal x_ion_to_full_average_weight = getXIonToFull().getAverageWeight();
00196         return x_ion_to_full_average_weight;
00197       }
00198 
00199       inline static DoubleReal getXIonToFullMonoWeight()
00200       {
00201         static const DoubleReal x_ion_to_full_mono_weight = getXIonToFull().getMonoWeight();
00202         return x_ion_to_full_mono_weight;
00203       }
00204 
00205       inline static const EmpiricalFormula& getZIonToFull()
00206       {
00207         static const EmpiricalFormula z_ion_to_full = EmpiricalFormula("NH2");
00208         return z_ion_to_full;
00209       }
00210 
00211       inline static DoubleReal getZIonToFullAverageWeight()
00212       {
00213         static const DoubleReal z_ion_to_full_average_weight = getZIonToFull().getAverageWeight();
00214         return z_ion_to_full_average_weight;
00215       }
00216 
00217       inline static DoubleReal getZIonToFullMonoWeight()
00218       {
00219         static const DoubleReal z_ion_to_full_mono_weight = getZIonToFull().getMonoWeight();
00220         return z_ion_to_full_mono_weight;
00221       }
00223       
00227       enum ResidueType
00228       {
00229         Full = 0,
00230         Internal,
00231         NTerminal,
00232         CTerminal,
00233         AIon,
00234         BIon,
00235         CIon,
00236         XIon,
00237         YIon,
00238         ZIon
00239       };
00241       
00245 
00246       Residue();
00247   
00249       Residue(const Residue& residue);
00250   
00252       Residue(const String& name,
00253               const String& three_letter_code,
00254               const String& one_letter_code,
00255               const EmpiricalFormula& formula,
00256               const EmpiricalFormula& neutral_loss);
00257   
00259       virtual ~Residue();
00261       
00265 
00266       Residue& operator = (const Residue& residue);
00268   
00272 
00273       void setName(const String& name);
00274       
00276       const String& getName() const;
00277 
00279       void setShortName(const String& short_name);
00280 
00282       const String& getShortName() const;
00283   
00285       void setSynonyms(const std::set<String>& synonyms);
00286 
00288       void addSynonym(const String& synonym);
00289       
00291       const std::set<String>& getSynonyms() const;
00292       
00294       void setThreeLetterCode(const String& three_letter_code);
00295   
00297       const String& getThreeLetterCode() const;
00298   
00300       void setOneLetterCode(const String& one_letter_code);
00301   
00303       const String& getOneLetterCode() const;
00304   
00306       void setLossFormula(const EmpiricalFormula&);
00307   
00309       const EmpiricalFormula& getLossFormula() const;
00310   
00312       void setLossAverageWeight(DoubleReal weight);
00313   
00315       DoubleReal getLossAverageWeight() const;
00316   
00318       void setLossMonoWeight(DoubleReal weight);
00319   
00321       DoubleReal getLossMonoWeight() const;
00322   
00324       void setLossName(const String& name);
00325       
00327       const String& getLossName() const;
00328       
00330       void setFormula(const EmpiricalFormula& formula, ResidueType res_type = Full);
00331     
00333       EmpiricalFormula getFormula(ResidueType res_type = Full) const;
00334   
00336       void setAverageWeight(DoubleReal weight, ResidueType res_type = Full);
00337   
00339       DoubleReal getAverageWeight(ResidueType res_type = Full) const;
00340   
00342       void setMonoWeight(DoubleReal weight, ResidueType res_type = Full);
00343   
00345       DoubleReal getMonoWeight(ResidueType res_type = Full) const;
00346 
00348       void setModification(ResidueModification* modification);
00349       
00351       const ResidueModification * getModification() const;
00352       
00354       void setUnmodifiedName(const String& name);
00355 
00357       const String& getUnmodifiedName() const;
00358 
00360       void setLowMassIons(const std::vector<EmpiricalFormula>& low_mass_ions);
00361 
00363       const std::vector<EmpiricalFormula>& getLowMassIons() const;
00365       
00369 
00370       bool hasNeutralLoss() const;
00371       
00373       bool operator == (const Residue& residue) const;
00374 
00376       bool operator != (const Residue& residue) const;
00377 
00379       bool operator == (char one_letter_code) const;
00380 
00382       bool operator != (char one_letter_code) const;
00383 
00385       DoubleReal getPka() const;
00386     
00388       DoubleReal getPkb() const;
00389     
00391       DoubleReal getPkc() const;
00392     
00394       DoubleReal getPiValue() const;
00395 
00397       void setPka(DoubleReal value);
00398     
00400       void setPkb(DoubleReal value);    
00401     
00403       void setPkc(DoubleReal value);    
00404     
00406       DoubleReal getSideChainBasicity() const;
00407 
00409       void setSideChainBasicity(DoubleReal gb_sc);
00410 
00412       DoubleReal getBackboneBasicityLeft() const;
00413 
00415       void setBackboneBasicityLeft(DoubleReal gb_bb_l);
00416 
00418       DoubleReal getBackboneBasicityRight() const;
00419 
00421       void setBackboneBasicityRight(DoubleReal gb_bb_r);
00422 
00424       bool isModified() const;
00426     
00428       friend std::ostream& operator << (std::ostream& os, const Residue& residue);
00429 
00430     protected:
00431 
00432       // basic 
00433       String name_;
00434 
00435       String short_name_;
00436       
00437       std::set<String> synonyms_;
00438       
00439       String three_letter_code_;
00440 
00441       String one_letter_code_;
00442 
00443       EmpiricalFormula formula_;
00444 
00445       EmpiricalFormula internal_formula_;
00446 
00447       DoubleReal average_weight_;
00448 
00449       DoubleReal mono_weight_;
00450 
00451       // modification
00452       bool is_modified_;
00453 
00454       String pre_mod_name_;
00455 
00456       ResidueModification* modification_;
00457       
00458       // loss
00459       String loss_name_;
00460 
00461       EmpiricalFormula loss_formula_;
00462 
00463       DoubleReal loss_average_weight_;
00464 
00465       DoubleReal loss_mono_weight_;
00466 
00467       // low mass markers like immonium ions
00468       std::vector<EmpiricalFormula> low_mass_ions_;
00469         
00470       // pka values
00471       DoubleReal pka_;
00472 
00473       // pkb values
00474       DoubleReal pkb_;
00475       
00476       // pkc values
00477       DoubleReal pkc_;
00478     
00479       DoubleReal gb_sc_;
00480 
00481       DoubleReal gb_bb_l_;
00482 
00483       DoubleReal gb_bb_r_;
00484   
00485   };
00486   
00487   std::ostream& operator << (std::ostream& os, const Residue& residue);
00488 
00490   String getResidueTypeName(Residue::ResidueType res_type);
00491 }
00492 
00493 #endif

Generated Tue Apr 1 15:36:37 2008 -- using doxygen 1.5.4 OpenMS / TOPP 1.1