Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FullatomCustomPairDistanceEnergy.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/methods/FullatomCustomPairDistanceEnergy.hh
11 /// @brief Custom atom pair distance energy
12 /// @author David E Kim
13 
14 
15 #ifndef INCLUDED_core_scoring_custom_pair_distance_FullatomCustomPairDistanceEnergy_hh
16 #define INCLUDED_core_scoring_custom_pair_distance_FullatomCustomPairDistanceEnergy_hh
17 
18 // Unit Headers
20 
21 // Package headers
22 
23 // Project headers
24 #include <core/pose/Pose.fwd.hh>
28 
30 
32 // AUTO-REMOVED #include <basic/datacache/CacheableData.hh>
33 
34 // Utility headers
35 // AUTO-REMOVED #include <utility/OrderedTuple.hh>
36 // AUTO-REMOVED #include <utility/fixedsizearray1.hh>
37 #include <numeric/interpolation/Histogram.hh>
38 
39 // C++ headers
40 #include <map>
41 #include <list>
42 
43 #include <utility/OrderedTuple.fwd.hh>
44 #include <utility/fixedsizearray1.fwd.hh>
45 #include <utility/vector1.hh>
46 
47 
48 namespace core {
49 namespace scoring {
50 namespace custom_pair_distance {
51 
53 {
57 };
58 
60 {
64 };
65 
67 {
68 public:
70  virtual ~AtomPairFuncList();
71 
72  std::list< atoms_and_func_struct > const & ats_n_func_list() const {
74  }
75 
76  void
77  add_interaction( atoms_and_func_struct const & interacting_pair );
78 
79 private:
80  std::list< atoms_and_func_struct > interacting_atompair_list_;
81 };
82 
85 
86 ///
88 public:
90 
91 public:
92  typedef utility::fixedsizearray1< Size, 2 > ResAtomIndex;
93  typedef utility::OrderedTuple< ResAtomIndex > ResAtomIndexTuple;
94  typedef std::map< ResAtomIndexTuple, std::list< resatom_and_func_struct > > ResAtomIndexFuncMap;
95 
96  typedef utility::fixedsizearray1< chemical::ResidueTypeCOP, 2 > ResTypePair;
97  typedef utility::OrderedTuple< ResTypePair > ResTypePairTuple;
98 
99  typedef std::map< ResTypePairTuple, AtomPairFuncListOP > PairFuncMap;
100 
101  ///
103 
105 
106  /// clone
107  virtual
109  clone() const;
110 
111 
112  /////////////////////////////////////////////////////////////////////////////
113  // scoring
114  /////////////////////////////////////////////////////////////////////////////
115 
116  // necessary pure virtual functions
117  virtual
118  void indicate_required_context_graphs( utility::vector1< bool > & /*context_graphs_required*/ ) const {}
119 
120  virtual
121  bool
122  defines_intrares_energy( EnergyMap const & /*weights*/ ) const { return false; }
123 
124  virtual
125  void
127  conformation::Residue const &,
128  pose::Pose const &,
129  ScoreFunction const &,
130  EnergyMap &
131  ) const {}
132 
133  virtual
134  void
136  conformation::Residue const & rsd1,
137  conformation::Residue const & rsd2,
138  pose::Pose const & pose,
139  ScoreFunction const &,
140  EnergyMap & emap
141  ) const;
142 
143  virtual
144  Distance
146 
147  /*virtual
148  void
149  setup_for_minimizing(
150  pose::Pose & pose,
151  ScoreFunction const & sfxn,
152  kinematics::MinimizerMapBase const & min_map
153  ) const;*/
154 
155  /*virtual
156  void
157  eval_atom_derivative(
158  id::AtomID const & id,
159  pose::Pose const & pose,
160  kinematics::DomainMap const & domain_map,
161  ScoreFunction const & sfxn,
162  EnergyMap const & emap,
163  Vector & F1,
164  Vector & F2
165  ) const;*/
166 
167  /// @brief Returns true if there are atoms on residue 1 & 2 that have interactions defined between them,
168  /// and false otherwise. This avoids unnecessary calls to residue_pair_energy_ext during minimization
169  /// between pairs of atoms that have no interactons
170  virtual
171  bool
173  conformation::Residue const & res1,
174  conformation::Residue const & res2,
175  bool res_moving_wrt_eachother
176  ) const;
177 
178  virtual
179  bool
181 
182  /// @brief Returns true. This class takes advantage of the opportunity to store sequence-specific data
183  /// in a ResiduePairMinimiazationObject listing the atom-pair interactions for a particular residue pair
184  /// and to extract that data from cache for easy use inside residue_pair_energy_ext.
185  virtual
186  bool
188 
189  /// @brief Extract the cached std::list< atoms_and_func_struct > object from the ResPairMinimizationData
190  /// object that was stored for this particular residue pair in setup_for_minimizing_for_residue_pair, and
191  /// use this cached list to evaluate the atom-pair interactions.
192  virtual
193  void
195  conformation::Residue const & rsd1,
196  conformation::Residue const & rsd2,
197  ResPairMinimizationData const & min_data,
198  pose::Pose const & pose,
199  ScoreFunction const & sfxn,
200  EnergyMap & emap
201  ) const;
202 
203  /// @brief Find the list of atom-pair interactions from the pair_and_func_map_ for the given
204  /// residue-type pair and cache that list in the input ResPairMinimizationData object.
205  virtual
206  void
208  conformation::Residue const & rsd1,
209  conformation::Residue const & rsd2,
210  pose::Pose const & pose,
211  ScoreFunction const & sfxn,
212  kinematics::MinimizerMapBase const & minmap,
213  ResSingleMinimizationData const & res1_data_cache,
214  ResSingleMinimizationData const & res2_data_cache,
215  ResPairMinimizationData & data_cache
216  ) const;
217 
218 
219  /// @brief Evaluate all f1/f2 derivative vector pairs for all interacting atoms
220  /// on the input residue pair.
221  virtual
222  void
224  conformation::Residue const & rsd1,
225  conformation::Residue const & rsd2,
228  ResPairMinimizationData const & min_data,
229  pose::Pose const & pose, // provides context
230  EnergyMap const & weights,
231  utility::vector1< DerivVectorPair > & r1_atom_derivs,
232  utility::vector1< DerivVectorPair > & r2_atom_derivs
233  ) const;
234 
235 private:
236 
237  PairFuncMap::const_iterator
238  find(
239  conformation::Residue const & rsd1,
240  conformation::Residue const & rsd2
241  ) const;
242 
243  bool
245  conformation::Residue const & rsd1,
246  conformation::Residue const & rsd2 ) const;
247 
248  void
250 
251 // DATA
252 
253 private:
254 
257  virtual
258  core::Size version() const;
259 };
260 
261 
262 
263 // stolen from Spencer's centroid disulfide stuff
265 {
266 public:
267  DistanceFunc( std::string const name );
268  virtual ~DistanceFunc();
269  constraints::FuncOP clone() const { return new DistanceFunc( *this ); }
270  virtual Real func( Real const ) const;
271  virtual Real dfunc( Real const ) const;
272  virtual Real max_dis() const;
273  virtual Real min_dis() const;
274 private:
275  numeric::interpolation::HistogramCOP<Real,Real>::Type scores_hist_;
276 };
277 
278 
279 
280 /*class CacheableAtomPairFuncMap : public basic::datacache::CacheableData
281 {
282 public:
283  typedef utility::fixedsizearray1< Size, 2 > ResAtomIndex;
284  typedef utility::OrderedTuple< ResAtomIndex > ResAtomIndexTuple;
285  typedef std::map< ResAtomIndexTuple, std::list< resatom_and_func_struct > > ResAtomIndexFuncMap;
286 
287  CacheableAtomPairFuncMap(){};
288  virtual ~CacheableAtomPairFuncMap(){};
289  virtual basic::datacache::CacheableDataOP clone() const { return new CacheableAtomPairFuncMap( *this ); }
290  ResAtomIndexFuncMap & map() { return map_; }
291  ResAtomIndexFuncMap const & map() const { return map_; }
292 private:
293  ResAtomIndexFuncMap map_;
294 virtual
295 core::Size version() const;
296 };*/
297 
298 
299 }
300 }
301 }
302 
303 
304 #endif