Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
pHEnergy.cc
Go to the documentation of this file.
1 // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
2 // vi: set ts=2 noet:
3 //
4 // This file is made available under the Rosetta Commons license.
5 // See http://www.rosettacommons.org/license
6 // (C) 199x-2007 University of Washington
7 // (C) 199x-2007 University of California Santa Cruz
8 // (C) 199x-2007 University of California San Francisco
9 // (C) 199x-2007 Johns Hopkins University
10 // (C) 199x-2007 University of North Carolina, Chapel Hill
11 // (C) 199x-2007 Vanderbilt University
12 
13 /// @file core/scoring/methods/pHEnergy.cc
14 /// @brief Energy due to ionization state of the residue at a particular pH (see pHEnergy.hh for a detailed description)
15 /// @author krishna
16 
17 // Standard libraries
18 #include <cmath>
19 
20 // Unit headers
21 // AUTO-REMOVED #include <core/scoring/methods/util.hh>
24 
25 // Package headers
27 // AUTO-REMOVED #include <core/scoring/ScoringManager.hh>
30 
31 #include <basic/options/option.hh>
32 // AUTO-REMOVED #include <basic/options/util.hh>
33 
34 // Project headers
35 // AUTO-REMOVED #include <core/pose/Pose.hh>
38 
39 
40 // Option Key includes
41 #include <basic/options/keys/pH.OptionKeys.gen.hh>
42 
43 #include <utility/vector1.hh>
44 
45 
46 // C++
47 
48 namespace core {
49 namespace scoring {
50 namespace methods {
51 
52 core::Real pHEnergy::pH_; //Reference to static variable pH_
53 
54 /// @details This must return a fresh instance of the pHEnergy class,
55 /// never an instance already in use
59 ) const {
60  return new pHEnergy;
61 }
62 
65  ScoreTypes sts;
66  sts.push_back( e_pH );
67  return sts;
68 }
69 
70 //ctor
72  parent( new pHEnergyCreator )
73 {
74  using namespace basic::options;
75  pH_ = option[ OptionKeys::pH::value_pH ]();
76 }
77 
78 
79 void
81 {
82  pH_ = new_pH_;
83 }
84 
85 /// clone
88 {
89  return new pHEnergy;
90 }
91 
92 
93 /////////////////////////////////////////////////////////////////////////////
94 // methods for ContextIndependentOneBodyEnergies
95 ////////////////////////////////////////////////////////////////////////////
96 
97 // pH score
98 void
100  conformation::Residue const & rsd,
101  pose::Pose const &,
102  EnergyMap & emap
103 ) const
104 {
105  core::Real ipKa_, pH_score_, fprot_, score1_, score2_;
106 
107  switch ( rsd.type().aa() ) {
108 
109  case chemical::aa_asp:
110  ipKa_ = 4.0;
111  fprot_ = 1.0/((pow (10.0,(pH_ - ipKa_))) + 1.0); //protonation probability
112  score1_ = -0.59 * log (fprot_); //if residue is protonated
113  score2_ = -0.59 * log (1.0 - fprot_); //if residue is not protonated
114  pH_score_ = (rsd.type().has_variant_type( chemical::PROTONATED )) ? score1_ : score2_;
115  break;
116 
117  case chemical::aa_glu:
118  ipKa_ = 4.4;
119  fprot_ = 1.0/((pow (10.0,(pH_ - ipKa_))) + 1.0);
120  score1_ = -0.59 * log (fprot_);
121  score2_ = -0.59 * log (1.0 - fprot_);
122  pH_score_ = (rsd.type().has_variant_type( chemical::PROTONATED )) ? score1_ : score2_;
123  break;
124 
125  case chemical::aa_his:
126  ipKa_ = 6.3;
127  fprot_ = 1.0/((pow (10.0,(pH_ - ipKa_))) + 1.0);
128  score1_ = -0.59 * log (fprot_);
129  score2_ = -0.59 * log (1.0 - fprot_);
130  pH_score_ = (rsd.type().has_variant_type( chemical::PROTONATED )) ? score1_ : score2_;
131  break;
132 
133  case chemical::aa_lys:
134  ipKa_ = 10.4;
135  fprot_ = 1.0/((pow (10.0,(pH_ - ipKa_))) + 1.0);
136  score1_ = -0.59 * log (fprot_);
137  score2_ = -0.59 * log (1.0 - fprot_);
138  pH_score_ = (rsd.type().has_variant_type( chemical::DEPROTONATED )) ? score2_ : score1_;
139  break;
140 
141  case chemical::aa_tyr:
142  ipKa_ = 10.0;
143  fprot_ = 1.0/((pow (10.0,(pH_ - ipKa_))) + 1.0);
144  score1_ = -0.59 * log (fprot_);
145  score2_ = -0.59 * log (1.0 - fprot_);
146  pH_score_ = (rsd.type().has_variant_type( chemical::DEPROTONATED )) ? score2_ : score1_;
147  break;
148 
149  default:
150  pH_score_ = 0.0;
151  break;
152 
153  }//end switch
154 
155  emap[ e_pH ] += pH_score_; //add pHEnergy to the EmapVector
156 
157 } // residue_energy
158 
159 
160 Real
162  id::DOF_ID const & ,// dof_id,
163  id::TorsionID const & , //tor_id
164  pose::Pose const & , // pose
165  ScoreFunction const &, //sfxn,
166  EnergyMap const & // weights
167 ) const
168 {
169  return 0.0;
170 }
171 
172 
173 /// @pHEnergy is context independent
174 void
178 {
179  return 1; // Initial versioning
180 }
181 
182 
183 }
184 }
185 }
186