Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
HBondDatabase.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 part of the Rosetta software suite and is made available under license.
5 // The Rosetta software is developed by the contributing members of the Rosetta Commons consortium.
6 // (C) 199x-2009 Rosetta Commons participating institutions and developers.
7 // For more information, see http://www.rosettacommons.org/.
8 
9 /// @file core/scoring/geometric_solvation/HBondDatabase.cc
10 /// @brief Database containing params for HBondEnergy
11 /// @author John Karanicolas
12 /// @author Matthew O'Meara
13 
14 #ifndef INCLUDED_core_scoring_hbonds_HBondDatabase_hh
15 #define INCLUDED_core_scoring_hbonds_HBondDatabase_hh
16 
17 // Unit Headers
19 
20 // Project Headers
21 // AUTO-REMOVED #include <core/scoring/hbonds/HBondOptions.hh>
24 
25 // Utility Headers
26 #include <utility/pointer/ReferenceCount.hh>
27 #include <utility/sql_database/DatabaseSessionManager.fwd.hh>
28 #include <utility/vector1.hh>
29 
30 // C++
31 #include <map>
32 
34 
35 #ifdef WIN32
38 #endif
39 
40 namespace core {
41 namespace scoring {
42 namespace hbonds {
43 
44 
46 
47 private:
48 
49  HBondDatabase();
51  //HBondOptionsCOP hbondoptions
52  std::string const & hbond_params_database_tag
53  );
54 
56  const HBondDatabase& src
57  );
58 
59 public:
60 
61  ///@brief only public way to create an HBondDatabase
62  static
64  get_database();
65 
66 
67  ///@brief only public way to create an HBondDatabase
68  static
70  get_database( std::string const & );
71 
72  virtual ~HBondDatabase();
73 
74  void
75  initialize();
76 
77  bool
78  initialized() const;
79 
80  /// @brief read one dimensional polynomial definitions file
81  void
83 
84  /// @brief read table of evaluation types
85  void
87 
88  /// @brief read table of donor bonding strengths
89  void
91 
92  /// @brief read table of acceptor bonding strengths
93  void
95 
96  /// @brief read table of fade intervals
97  void
99 
100  ///@brief find polynomial function given name
102  HBFadeInterval_from_name( std::string const name ) const;
103 
104  ///@brief find fading function for hbgd_AHdist sort
107 
108  ///@brief find fading function for hbgd_AHdist long
110  AHdist_long_fade_lookup( Size const hb_eval_type ) const;
111 
112  ///@brief find fading function for hbgd_cosBAH
114  cosBAH_fade_lookup( Size const hb_eval_type ) const;
115 
116  ///@brief find fading function for hbgd_cosAHD
118  cosAHD_fade_lookup( Size const hb_eval_type ) const;
119 
120  ///@brief find polynomial function given name
122  HBPoly1D_from_name( std::string const name ) const;
123 
124  ///@brief find polynomial to hbgd_AHdist dimension
126  AHdist_poly_lookup( Size const hb_eval_type ) const;
127 
128  ///@brief find polynomial to hbgd_cosBAH dimension when hbgd_AHdist is short
130  cosBAH_short_poly_lookup( Size const hb_eval_type ) const;
131 
132  ///@brief find polynomial to hbgd_cosBAH dimension when hbgd_AHdist is long
134  cosBAH_long_poly_lookup( Size const hb_eval_type ) const;
135 
136  ///@brief find polynomial to hbgd_cosAHD dimension when hbgd_AHdist is short
138  cosAHD_short_poly_lookup( Size const hb_eval_type ) const;
139 
140  ///@brief find polynomial to hbgd_cosAHD dimension when hbgd_AHdist is long
142  cosAHD_long_poly_lookup( Size const hb_eval_type ) const;
143 
144  ///@brief find polynomial to hbgd_chi dimension
146  chi_poly_lookup( Size const hb_eval_type ) const;
147 
148  ///@brief get the bonding strength of a donor group
149  Real
150  don_strength( HBDonChemType const don_chem_type ) const;
151 
152  ///@brief get the bonding strength of an acceptor group
153  Real
154  acc_strength( HBAccChemType const ac_chem_type ) const;
155 
156  ///@brief find weight type for evaluation type
158  weight_type_lookup( Size const hb_eval_type ) const;
159 
160  ///@details Signal to use deprecated derivitive calculation in
161  ///core::scoring::hbonds::hb_energy_deriv_u2(). Once old code has
162  ///been modified to support the new behavior, remove this
163  ///option. Since the options are not passe directly to to
164  ///hb_energy_deriv_u2, access it through the HBondDatabase, rather
165  ///then messing with the interfaces for the hb_energy_deriv functions.
166  inline
167  bool
169  return false; // APL TEMP return hb_options_->use_incorrect_deriv();
170  }
171 
172  void
174  utility::sql_database::sessionOP db_session) const;
175 
176 private:
177  void
179  utility::sql_database::sessionOP db_session) const;
180 
181  void
183  utility::sql_database::sessionOP db_session) const;
184 
185  void
187  utility::sql_database::sessionOP db_session) const;
188 
189 public:
190  core::Size
192  utility::sql_database::sessionOP db_session ) const;
193 
194 private:
196  //HBondOptionsCOP hb_options_;
197  std::string params_database_tag_; // the tag for the set of files that describe this database
198 
199  std::map< const std::string, FadeIntervalCOP > HBFadeInterval_lookup_by_name_;
205 
206  std::map< const std::string, Polynomial_1dCOP > HBPoly1D_lookup_by_name_;
217 
218  static std::map< const std::string, HBondDatabaseCOP > initialized_databases_;
219 };
220 
221 } // hbonds
222 } // scoring
223 } // core
224 
225 #endif