Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PoissonBoltzmannPotential.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 // (c) Copyright Rosetta Commons Member Institutions.
5 // (c) This file is part of the Rosetta software suite and is made available under license.
6 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
7 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
8 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
9 
10 /// @file core/scoring/PoissonBoltzmannPotential.hh
11 /// @brief Poisson Boltzmann potential class delcaration
12 /// @author Yifan Song (yfsong@uw.edu)
13 
14 #ifndef INCLUDED_core_scoring_PoissonBoltzmannPotential_HH
15 #define INCLUDED_core_scoring_PoissonBoltzmannPotential_HH
16 
17 // Unit Headers
19 #include <utility/pointer/ReferenceCount.hh>
20 
21 #include <ObjexxFCL/FArray3D.hh>
22 #include <numeric/xyzMatrix.hh>
23 #include <numeric/xyzVector.hh>
24 
25 #include <core/types.hh>
27 #include <core/pose/Pose.fwd.hh>
28 #include <utility/vector1.hh>
29 #include <utility/file/PathName.hh>
30 
31 #include <map>
32 #include <vector>
33 
34 namespace core {
35 namespace scoring {
36 
38 {
39 public:
41  static const std::string APBS_PQR_EXT;
42  static const std::string APBS_DX_EXT;
44 
45 
47 
48  virtual ~PoissonBoltzmannPotential(); // auto-removing definition from header{}
49 
50  core::Real get_potential(ObjexxFCL::FArray3D< core::Real > const & potential,
51  numeric::xyzVector<core::Real> const & cartX) const;
52  void
54  core::conformation::Residue const & rsd,
55  Real & PB_energy_residue,
56  Real & PB_energy_backbone,
57  Real & PB_energy_sidechain,
58  Real const & PB_burial_weight
59  ) const;
60 
61  //////////////////////////////////
62  //////////////////////////////////
63  // functions to convert between indices and cartesian coords
64  inline void cart2idx( numeric::xyzVector<core::Real> const & cartX, numeric::xyzVector<core::Real> & idxX ) const {
65  idxX = c2i_*(cartX-lower_bound_) + numeric::xyzVector<core::Real> (1,1,1);
66  }
67 
68  template<class Q>
69  inline void idx2cart( numeric::xyzVector<Q> const & idxX , numeric::xyzVector<core::Real> &cartX ) const {
71  }
73  return lower_bound_;
74  }
76  return upper_bound_;
77  }
78 
80  for (core::Size i=0;i<3;++i) {
81  if (cartX[i] < lower_bound()[i]) return true;
82  if (cartX[i] > upper_bound()[i]) return true;
83  }
84  return false;
85  }
86 
87  /// Execute ABPS to freshly compute the electrotatic field.
88  /// @param pose The pose
89  /// @param state_tag Arbitrary string for generating APBS files. e.g. The current energy state.
90  /// @param is_residue_charged_by_name Which residues are charged? The key is the residue name.
91  void solve_pb( core::pose::Pose const & pose,
92  std::string const & state_tag,
93  std::map<std::string, bool> const & is_residue_charged_by_name );
94 private:
100  ObjexxFCL::FArray3D< core::Real > potential_;
101 
105  std::string apbs_path_; // full path name to the APBS executable: e.g. /usr/bin/apbs.exe
107 
108  /// Prepare ABPS - generate .in and .pqr
109  void write_config (
110  core::pose::Pose const & pose) const;
111 
112  /// Read & load the APBS results
113 #ifdef LINK_APBS_LIB
114  void load_potential( const double grid_meta[],
115  const double pot[] );
116 #else
117  void load_APBS_potential();
118 #endif
119 
120  /// Write out .pqr
121  void write_pqr( core::pose::Pose const & pose,
122  std::map<std::string, bool> const & is_residue_charged_by_name) const;
123 
124 };
125 
126 }
127 }
128 
129 #endif