Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
LK_BallEnergy.hh
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/LK_BallEnergy.hh
14 /// @brief LK Solvation using hemisphere culling class declaration
15 /// @author David Baker
16 /// @author Andrew Leaver-Fay
17 
18 
19 #ifndef INCLUDED_core_scoring_methods_LK_BALLENERGY_HH
20 #define INCLUDED_core_scoring_methods_LK_BALLENERGY_HH
21 
22 // Unit Headers
25 
28 
29 // Package headers
37 
38 // Project headers
39 #include <core/pose/Pose.fwd.hh>
40 //#include <core/pack/task/PackerTask.fwd.hh>
41 
42 // Utility headers
43 #include <ObjexxFCL/FArray3D.hh>
44 #include <utility/vector1.hh>
45 
46 namespace core {
47 namespace scoring {
48 namespace methods {
49 
50 
51 
52 ///
54 public:
56 public:
57  /// convenience typedefs
61 
62 
63 public:
64 
65  LK_BallEnergy( EnergyMethodOptions const & options );
66 
67 
68  /// clone
69  virtual
71  clone() const;
72 
73  LK_BallEnergy( LK_BallEnergy const & src );
74 
75  ///
76  virtual
77  void
79 
80  ///
81  virtual
82  void
83  setup_for_scoring( pose::Pose & pose, ScoreFunction const & ) const;
84 
85  virtual
86  void
88  pose::Pose const & pose,
89  conformation::RotamerSetBase & rotamer_set
90  ) const;
91 
92  virtual
93  void
95  pose::Pose &,
96  Size resid ) const;
97 
98  virtual
99  void
101  pose::Pose & pose,
102  ScoreFunction const & scfxn
103  ) const;
104 
105  /// helper function for outside use
106  Real
108  Size const atom1,
109  conformation::Residue const & rsd1,
110  conformation::Residue const & rsd2
111  );
112  Real
114  Size const atom1,
115  conformation::Residue const & rsd1,
116  conformation::Residue const & rsd2
117  );
118  void
120  Size const atom1,
121  conformation::Residue const & rsd1,
122  Vectors const & atom1_waters,
123  Size const atom2,
124  conformation::Residue const & rsd2,
125  Real & lk_desolvation_of_atom1_by_atom2,
126  Real & lk_ball_desolvation_of_atom1_by_atom2 // includes lk-fraction
127  ) const;
128 
129  // helper
130  Real
132  Vector const & atom2_xyz,
133  Size const atom2_type,
134  Vector const & atom1_water
135  ) const;
136 
137  void
139  Real const d2,
140  Size const atom1,
141  conformation::Residue const & rsd1,
142  Size const atom2,
143  conformation::Residue const & rsd2,
144  Real & atom1_lk_desolvation_by_atom2_deriv,
145  Real & atom2_lk_desolvation_by_atom1_deriv
146  );
147 
148 // /// called during gradient-based minimization inside dfunc
149 // /**
150 // F1 and F2 are not zeroed -- contributions from this atom are
151 // just summed in
152 // **/
153 // virtual
154 // void
155 // eval_atom_derivative(
156 // id::AtomID const & id,
157 // pose::Pose const & pose,
158 // kinematics::DomainMap const & domain_map,
159 // ScoreFunction const & sfxn,
160 // EnergyMap const & weights,
161 // Vector & F1,
162 // Vector & F2
163 // ) const;
164 
165  virtual
166  void
168  conformation::Residue const & rsd1,
169  conformation::Residue const & rsd2,
172  ResPairMinimizationData const & min_data,
173  pose::Pose const & pose, // provides context
174  EnergyMap const & weights,
175  utility::vector1< DerivVectorPair > & r1_atom_derivs,
176  utility::vector1< DerivVectorPair > & r2_atom_derivs
177  ) const;
178 
179 
180 
181  virtual
182  void
184  conformation::Residue const & rsd1,
185  conformation::Residue const & rsd2,
186  pose::Pose const & pose,
187  ScoreFunction const &,
188  EnergyMap & emap
189  ) const;
190 
191 
192  void
194  conformation::Residue const & rsd1,
195  LKB_ResidueInfo const & rsd1_info,
196  conformation::Residue const & rsd2,
197  LKB_ResidueInfo const & rsd2_info,
198  EnergyMap & emap
199  ) const;
200 
201 
202  void
204  Size const atom1,
205  Size const atom1_type_index,
206  Vectors const & atom1_waters,
207  conformation::Residue const & rsd1,
208  Size const atom2_type_index,
209  Vector const & atom2_xyz,
210  Real const lk_desolvation_of_atom1_by_atom2,
211  EnergyMap & emap
212  ) const;
213 
214  /* Undefined, commenting out to fix PyRosetta build void
215  get_scorefxn_weights_for_derivatives(
216  Size const atom1,
217  conformation::Residue const & rsd1,
218  bool const atom1_has_waters,
219  Size const atom2,
220  conformation::Residue const & rsd2,
221  EnergyMap const & weights,
222  Real & unoriented_weight,
223  Real & oriented_weight
224  ) const;
225  */
226 
227  virtual
228  bool
229  defines_intrares_energy( EnergyMap const & /*weights*/ ) const { return false; }
230 
231  virtual
232  void
234  conformation::Residue const &,
235  pose::Pose const &,
236  ScoreFunction const &,
237  EnergyMap &
238  ) const {}
239 
240  virtual
241  Distance
243 
244 
245  void indicate_required_context_graphs( utility::vector1< bool > & context_graphs_required ) const;
246 
247 
248 
249 /////////////////////////////////////////////////////////////////////////////
250 // private methods
251 //private:
252 /////////////////////////////////////////////////////////////////////////////
253 
254  Real
255  eval_lk_fraction( Real const d2_delta ) const;
256 
257 
258  Real
259  eval_d_lk_fraction_dr_over_r( Real const d2_delta ) const;
260 
261 
262  Real
264  Vector const & atom2_xyz,
265  Size const atom2_type_index,
266  Vectors const & atom1_waters,
267  Size & closest_water,
268  Real & closest_water_dis2
269  ) const;
270  Real
272  Vector const & atom2_xyz,
273  Size const atom2_type_index,
274  Vectors const & atom1_waters
275  ) const;
276  /// for external use
277  Real
279  Vector const & atom2_xyz,
280  Size const atom2_type_index,
281  Vectors const & atom1_waters,
282  bool const evaluate_deriv,
283  Vector & f1,
284  Vector & f2
285  ) const;
286 
287 
288  /* Undefined, commenting out to fix PyRosetta build void
289  residue_pair_energy(
290  conformation::Residue const & rsd1,
291  utility::vector1< Vectors > const & rsd1_waters,
292  conformation::Residue const & rsd2,
293  utility::vector1< Vectors > const & rsd2_waters,
294  pose::Pose const & pose,
295  ScoreFunction const &,
296  EnergyMap & emap
297  ) const; */
298 
299  virtual
300  void
302  conformation::RotamerSetBase const & set1,
303  conformation::RotamerSetBase const & set2,
304  pose::Pose const & pose,
305  ScoreFunction const & sfxn,
306  EnergyMap const & weights,
307  ObjexxFCL::FArray2D< core::PackerEnergy > & energy_table
308  ) const;
309 
310 
311  virtual
312  void
314  conformation::RotamerSetBase const & set,
315  conformation::Residue const & residue,
316  pose::Pose const & pose,
317  ScoreFunction const & sfxn,
318  EnergyMap const & weights,
320  ) const;
321 
322 
323 
324  void
326  Size const atom1,
327  conformation::Residue const & rsd1,
328  Vectors const & atom1_waters,
329  Size const atom2,
330  conformation::Residue const & rsd2,
331  scoring::EnergyMap const & weights,
332  Real const weight_factor,
333  Real const d2,
334  Vector & F1,
335  Vector & F2
336  ) const;
337 
338  void
340  Size const atom1,
341  conformation::Residue const & rsd1,
342  LKB_ResidueInfo const & rsd1_info,
343  Size const atom2,
344  conformation::Residue const & rsd2,
345  LKB_ResidueInfo const & rsd2_info,
346  pose::Pose const & pose,
347  scoring::EnergyMap const & weights,
348  Real const cp_weight,
349  Vector & F1,
350  Vector & F2
351  ) const;
352 
353 
354  void
355  setup_d2_bounds();
356 
357 // void
358 // add_my_score_types();
359 
360 // /// HACK
361 // void
362 // setup_hack();
363 
364 // bool
365 // include_residue( conformation::Residue const & rsd ) const;
366 
367 
368 
369 
370 /////////////////////////////////////////////////////////////////////////////
371 // data
372 private:
373 /////////////////////////////////////////////////////////////////////////////
374 
375  etable::Etable const & etable_; // shouldn't this be a pointer? Reference count information is (dangerously) lost when
376  //a reference is taken, instead of a smart pointer. There's the potential for a dangling reference with this.
377 
378 
379  /// these guys are taken from the etable
380  ObjexxFCL::FArray3D< Real > const & solv1_;
381  ObjexxFCL::FArray3D< Real > const & solv2_;
382 
383  ObjexxFCL::FArray3D< Real > const & dsolv1_;
384 
387 
389 
390  static Real const ramp_width_A2_;
393 
395  /// HACK
396  //utility::vector1< Size > positions_;
397  //bool include_all_dna_;
398 
399  virtual
400  core::Size version() const;
401 
402 };
403 
404 /// this is a helper function for hbonds
405 void
407  Size const hatm,
408  conformation::Residue const & don_rsd,
409  Size const aatm,
410  conformation::Residue const & acc_rsd,
411  Vector const & hatm_xyz,
412  Vector const & datm_xyz,
413  Real & unweighted_energy,
414  bool const evaluate_derivative,
415  hbonds::HBondDerivs & hbderivs,
416  Real & don_lk_fraction,
417  Real & acc_lk_fraction
418  );
419 
420 }
421 }
422 }
423 
424 #endif // INCLUDED_core_scoring_methods_LK_BallEnergy_HH