Rosetta 3.5
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
core
scoring
methods
EnergyMethod.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/method/EnergyMethod.hh
11
/// @brief Base class for energy classes
12
/// @author Phil Bradley
13
14
15
#ifndef INCLUDED_core_scoring_methods_EnergyMethod_hh
16
#define INCLUDED_core_scoring_methods_EnergyMethod_hh
17
18
// Unit headers
19
#include <
core/scoring/methods/EnergyMethod.fwd.hh
>
20
21
// Package headers
22
#include <
core/types.hh
>
23
// AUTO-REMOVED #include <core/scoring/DerivVectorPair.fwd.hh>
24
#include <
core/scoring/methods/EnergyMethodCreator.fwd.hh
>
25
#include <
core/scoring/EnergyMap.fwd.hh
>
26
#include <
core/scoring/ScoreType.hh
>
27
#include <
core/scoring/ScoreFunction.fwd.hh
>
28
29
// Project headers
30
#include <
core/conformation/RotamerSetBase.fwd.hh
>
31
#include <
core/kinematics/DomainMap.fwd.hh
>
32
33
#include <
core/pose/Pose.fwd.hh
>
34
// AUTO-REMOVED #include <core/scoring/Energies.fwd.hh>
35
36
#include <
core/kinematics/MinimizerMapBase.fwd.hh
>
37
38
#include <
core/id/AtomID.fwd.hh
>
39
// AUTO-REMOVED #include <core/id/DOF_ID.fwd.hh>
40
// AUTO-REMOVED #include <core/id/TorsionID.fwd.hh>
41
42
// Utility headers
43
#include <utility/vector1.hh>
44
#include <utility/pointer/ReferenceCount.hh>
45
46
// Numeric headers
47
48
49
namespace
core {
50
namespace
scoring {
51
namespace
methods {
52
53
/// @brief base class for the energy method hierarchy
54
class
EnergyMethod
:
public
utility::pointer::ReferenceCount
{
55
public
:
56
typedef
utility::pointer::ReferenceCount
parent
;
57
58
public
:
59
/// @brief Constructor with EnergyMethodCreator, which lists the score
60
/// types that this energy method is responsible for.
61
EnergyMethod
(
EnergyMethodCreatorOP
creator );
62
63
/// @brief Copy constructor copies over the score types of the source
64
EnergyMethod
(
EnergyMethod
const
& src );
65
66
virtual
67
~EnergyMethod
();
68
69
virtual
70
EnergyMethodOP
71
clone
()
const
= 0;
72
73
// @brief if an energy method needs to cache data in the Energies object,
74
// before packing begins, then it does so during this function. The packer
75
// must ensure this function is called. The default behavior is to do nothing.
76
virtual
77
void
78
setup_for_packing
(
pose::Pose
&,
utility::vector1< bool >
const
&,
utility::vector1< bool >
const
& )
const
;
79
80
// @brief If an energy method needs to cache data in a packing::RotamerSet object before
81
// rotamer energies are calculated, it does so during this function. The packer
82
// must ensure this function is called. The default behavior is to do nothing.
83
virtual
84
void
85
prepare_rotamers_for_packing
(
86
pose::Pose
const
&,
87
conformation::RotamerSetBase
&
88
)
const
;
89
90
91
// @brief If the pose changes in the middle of a packing (as happens in rotamer trials) and if
92
// an energy method needs to cache data in the pose that corresponds to its current state,
93
// then the method must update that data when this function is called. The packer must
94
/// ensure this function gets called. The default behavior is to do nothing.
95
virtual
96
void
97
update_residue_for_packing
(
98
pose::Pose
&,
99
Size
resid
100
)
const
;
101
102
// @brief if an energy method needs to cache something in the pose (e.g. in pose.energies()),
103
// before scoring begins, it must do so in this method. All long range energy
104
// functions must initialize their LREnergyContainers before scoring begins.
105
// The default is to do nothing.
106
virtual
107
void
108
setup_for_scoring
(
pose::Pose
&,
ScoreFunction
const
& )
const
;
109
110
/// @brief Called at the beginning of atom tree minimization, this method
111
/// allows the derived class the opportunity to initialize pertinent data
112
/// that will be used during minimization. During minimzation, the chemical
113
/// structure of the pose is constant, so assumptions on the number of atoms
114
/// per residue and their identities are safe so long as the pose's Energies
115
/// object's "use_nblist()" method returns true.
116
virtual
117
void
118
setup_for_minimizing
(
119
pose::Pose
& ,
120
ScoreFunction
const
& ,
121
kinematics::MinimizerMapBase
const
&
122
)
const
;
123
124
/// @brief Called immediately before atom- and DOF-derivatives are calculated
125
/// allowing the derived class a chance to prepare for future calls.
126
virtual
127
void
128
setup_for_derivatives
(
pose::Pose
& pose,
ScoreFunction
const
& sfxn )
const
;
129
130
/// @brief called at the end of derivatives evaluation
131
virtual
132
void
133
finalize_after_derivatives
(
pose::Pose
&,
ScoreFunction
const
& )
const
;
134
135
/// @brief Should this EnergyMethod have score and derivative evaluation
136
/// evaluated only in the context of the whole Pose, or can it be included
137
/// in a decomposed manner for a residue or a set of residue-pairs that are
138
/// not part of the Pose that's serving as their context? The default
139
/// method implemented in the base class returns true in order to grandfather
140
/// in EnergyMethods that have not had their derivatives changed to take
141
/// advantage of the new derivative-evaluation machinery. Methods that return
142
/// "true" will not have their residue-energy(-ext) / residue-pair-energy(-ext)
143
/// methods invoked by the ScoreFunction during its traversal of the
144
/// MinimizationGraph, and instead will be asked to perform all their work
145
/// during finalize_total_energies(). Similarly, they will be expected to
146
/// perform all their work during eval_atom_deriv() instead of during the
147
/// ScoreFunction's traversal of the MinimizationGraph for derivative evaluation.
148
/// IMPORTANT: Methods that return "true" cannot be included in RTMin.
149
virtual
150
bool
151
minimize_in_whole_structure_context
(
pose::Pose
const
& )
const
;
152
153
/// @brief Should this EnergyMethod have score and derivative evaluation
154
/// evaluated both in the context of the whole Pose and in the context
155
/// of residue or residue-pairs? This covers scoring terms like env-smooth
156
/// wherein the CBeta's get derivatives for increasing the neighbor counts
157
/// for surrounding residues, and terms like constraints, which are definable
158
/// on arbitrary number of residues (e.g. more than 2); both of these terms
159
/// could be used in RTMin, and both should use the residue and residue-pair
160
/// evaluation scheme with the MinimizationGraph for the majority of the
161
/// work they do. (Now, high-order constraints (3-body or above) will not
162
/// be properly evaluated within RTMin.). The default implementation
163
/// returns "false".
164
virtual
165
bool
166
defines_high_order_terms
(
pose::Pose
const
& )
const
;
167
168
/// @brief Evaluate the XYZ derivative for an atom in the pose.
169
/// Called during the atomtree derivative calculation, atom_tree_minimize.cc,
170
/// through the ScoreFunction::eval_atom_derivative intermediary.
171
/// F1 and F2 should not zeroed, rather, this class should accumulate its contribution
172
/// from this atom's XYZ derivative
173
///
174
/// @details The derivative scheme is based on that of Abe, Braun, Noguti and Go (1984)
175
/// "Rapid Calculation of First and Second Derivatives of Conformational Energy with
176
/// Respect to Dihedral Angles for Proteins. General Recurrent Equations"
177
/// Computers & Chemistry 8(4) pp. 239-247. F1 and F2 correspond roughly to Fa and Ga,
178
/// respectively, of equations 7a & 7b in that paper.
179
virtual
180
void
181
eval_atom_derivative
(
182
id::AtomID
const
&
id
,
183
pose::Pose
const
& pose,
184
kinematics::DomainMap
const
& domain_map,
185
ScoreFunction
const
& sfxn,
186
EnergyMap
const
& emap,
187
Vector
& F1,
188
Vector
& F2
189
)
const
;
190
191
192
/* /// @brief Evaluate the derivative for a DOF in the atom tree.
193
virtual
194
Real
195
eval_dof_derivative(
196
id::DOF_ID const &,
197
id::TorsionID const &,
198
pose::Pose const &,
199
ScoreFunction const &,
200
EnergyMap const &
201
) const;*/
202
203
/// @brief called by the ScoreFunction at the end of energy evaluation.
204
/// The derived class has the opportunity to accumulate a score
205
/// into the pose's total_energy EnergyMap. WholeStructure energies
206
/// operate within this method; any method using a NeighborList during
207
/// minimization would also operate within this function call.
208
virtual
209
void
210
finalize_total_energy
(
211
pose::Pose
& pose,
212
ScoreFunction
const
& sfxn,
213
EnergyMap
& total_energy
214
)
const
;
215
216
/// @brief Returns the score types that this energy method computes.
217
ScoreTypes
const
&
218
score_types
()
const
219
{
220
return
score_types_
;
221
}
222
223
/// @brief Return one of the 7 kinds of energy methods that exist:
224
/// e.g. context-dependent-one-body vs whole-structure.
225
virtual
226
EnergyMethodType
227
method_type
()
const
= 0;
228
229
/// @brief Indicate in the context-graphs-required list which
230
/// context-graphs this energy method requires that the Pose
231
/// maintain when doing neighbor evaluation. Context graphs are
232
/// allowed
233
virtual
234
void
indicate_required_context_graphs
(
235
utility::vector1< bool >
& context_graphs_required
236
)
const
= 0;
237
238
///@brief Return the version of the energy method
239
virtual
240
core::Size
version
()
const
= 0;
241
protected
:
242
243
void
244
set_score_types
(
EnergyMethodCreatorOP
creator );
245
246
private
:
247
ScoreTypes
score_types_
;
248
249
250
};
251
252
}
// methods
253
}
// scoring
254
}
// core
255
256
#endif // INCLUDED_core_scoring_ScoreFunction_HH
Generated on Sat Jun 1 2013 11:37:52 for Rosetta 3.5 by
1.8.4