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
protocols
simple_moves
GreenPacker.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 protocols/simple_moves/GreenPacker.hh
11
/// @brief packing mover that makes extensive reuse of rotamer pair energies class declaration
12
/// @author Andrew Leaver-Fay (aleaverfay@gmail.com)
13
14
#ifndef INCLUDED_protocols_simple_moves_GreenPacker_hh
15
#define INCLUDED_protocols_simple_moves_GreenPacker_hh
16
17
/// Unit headers
18
#include <
protocols/simple_moves/GreenPacker.fwd.hh
>
19
20
/// Package headers
21
#include <
protocols/moves/Mover.hh
>
22
23
/// Project headers
24
#include <
core/chemical/AA.hh
>
25
#include <
core/chemical/ResidueType.fwd.hh
>
26
#include <
core/conformation/Residue.fwd.hh
>
27
#include <
core/graph/Graph.fwd.hh
>
28
#include <
core/pack/interaction_graph/PrecomputedPairEnergiesInteractionGraph.fwd.hh
>
29
#include <
core/pack/task/TaskFactory.fwd.hh
>
30
#include <
core/pack/task/PackerTask.fwd.hh
>
31
#include <
core/pack/rotamer_set/RotamerSets.fwd.hh
>
32
#include <
core/pose/Pose.fwd.hh
>
33
#include <
core/scoring/EnergyMap.fwd.hh
>
34
#include <
core/scoring/methods/LongRangeTwoBodyEnergy.fwd.hh
>
35
#include <
core/scoring/ScoreFunction.fwd.hh
>
36
#include <
core/scoring/ScoreType.hh
>
37
#include <
core/types.hh
>
38
#include <utility/vector1.hh>
39
40
/// Utility headers
41
#include <utility/pointer/ReferenceCount.hh>
42
43
namespace
protocols {
44
namespace
simple_moves {
45
46
class
MinimalRotamer
:
public
utility::pointer::ReferenceCount
47
{
48
public
:
49
///@brief Automatically generated virtual destructor for class deriving directly from ReferenceCount
50
virtual
~MinimalRotamer
();
51
typedef
core::chemical::AA
AA
;
52
typedef
core::chemical::ResidueType
ResidueType
;
53
typedef
core::conformation::Residue
Residue
;
54
typedef
core::Size
Size
;
55
typedef
core::Vector
Vector
;
56
typedef
core::Real
Real
;
57
58
public
:
59
MinimalRotamer
(
Residue
const
& );
60
61
bool
62
same
(
MinimalRotamer
const
& )
const
;
63
64
bool
65
same_residue_type
(
MinimalRotamer
const
& )
const
;
66
67
AA
68
aa
()
const
;
69
70
private
:
71
72
bool
73
has_ideal_geometry
(
74
core::conformation::Residue
const
& res
75
)
const
;
76
77
bool
78
atom_is_ideal
(
79
core::conformation::Residue
const
& res,
80
Size
const
atom_id
81
)
const
;
82
83
void
84
record_chi
(
core::conformation::Residue
const
& res );
85
86
void
87
record_internal_geometry
(
core::conformation::Residue
const
& res );
88
89
void
90
record_internal_geometry
(
91
core::conformation::Residue
const
& res,
92
Size
const
atom_id
93
);
94
95
bool
96
chi_matches_coords
(
core::conformation::Residue
const
& res,
Size
chi_index )
const
;
97
98
bool
99
same_chi
(
MinimalRotamer
const
& other )
const
;
100
101
bool
102
same_nonideal_geometry
(
MinimalRotamer
const
& other )
const
;
103
104
105
private
:
106
ResidueType
const
&
residue_type_
;
107
bool
ideal_geometry_
;
108
utility::vector1< Real >
chi_
;
109
110
// Record of internal geometry using the tree-geometry defined in the
111
// ResidueType.
112
// steal xyzVector to record internal geometry:
113
// x = 0 = d, y = 1 = theta, z = 2 = phi
114
utility::vector1< Vector >
internal_geometry_
;
115
116
static
Size
const
d
= 0;
117
static
Size
const
theta
= 1;
118
static
Size
const
phi
= 2;
119
120
/// No default constructor or assignment operator
121
/// copy c-tor is fine
122
MinimalRotamer
();
123
MinimalRotamer
const
&
operator =
(
MinimalRotamer
const
& );
124
};
125
126
/// @brief Interface class used to break a pose down into a set of component "groups"
127
/// where intra-group rotamer-pair energies are preserved between calls to the
128
/// GreenPacker. E.g. in rigid-body docking between two proteins, chains 1 and 2 define
129
/// groups 1 and 2. In rigid-body docking between two domains of the same chain, those
130
/// residues upstream of jump 1 define group 1, and those downstream of jump 1 define group 2.
131
/// In loop modelling, the static background is group 1, and the loop itself is group 0, since
132
/// loop residues will have their bb dofs change regularly between repackings.
133
class
GroupDiscriminator
:
public
utility::pointer::ReferenceCount
134
{
135
public
:
136
typedef
core::pose::Pose
Pose
;
137
typedef
core::Size
Size
;
138
139
public
:
140
virtual
~GroupDiscriminator
();
141
142
virtual
143
protocols::simple_moves::GroupDiscriminatorOP
clone
()
const
= 0;
144
145
virtual
146
Size
147
group_id
(
Pose
const
& pose,
Size
seqpos )
const
= 0;
148
149
};
150
151
class
UserDefinedGroupDiscriminator
:
public
GroupDiscriminator
152
{
153
public
:
154
typedef
core::pose::Pose
Pose
;
155
typedef
core::Size
Size
;
156
157
public
:
158
virtual
~UserDefinedGroupDiscriminator
();
159
160
virtual
161
protocols::simple_moves::GroupDiscriminatorOP
clone
()
const
;
162
163
virtual
164
Size
165
group_id
(
Pose
const
& pose,
Size
seqpos )
const
;
166
167
void
168
set_group_ids
(
utility::vector1<Size >
const
& group_ids_input );
169
170
private
:
171
172
utility::vector1< Size >
group_ids_
;
173
174
};
175
176
class
ChainGroupDiscriminator
:
public
GroupDiscriminator
177
{
178
179
public
:
180
virtual
~ChainGroupDiscriminator
();
181
182
virtual
183
protocols::simple_moves::GroupDiscriminatorOP
clone
()
const
;
184
185
virtual
186
Size
187
group_id
(
Pose
const
& pose,
Size
seqpos )
const
;
188
};
189
190
class
GreenPacker
:
public
protocols::moves::Mover
191
{
192
public
:
193
/// Types
194
typedef
core::graph::Graph
Graph
;
195
typedef
core::graph::GraphOP
GraphOP
;
196
typedef
core::pack::interaction_graph::PrecomputedPairEnergiesInteractionGraph
PrecomputedPairEnergiesInteractionGraph
;
197
typedef
core::pack::interaction_graph::PrecomputedPairEnergiesInteractionGraphOP
PrecomputedPairEnergiesInteractionGraphOP
;
198
typedef
core::pack::rotamer_set::RotamerSets
RotamerSets
;
199
typedef
core::pack::rotamer_set::RotamerSetsOP
RotamerSetsOP
;
200
typedef
core::pack::task::TaskFactory
TaskFactory
;
201
typedef
core::pack::task::TaskFactoryOP
TaskFactoryOP
;
202
typedef
core::pack::task::PackerTaskOP
PackerTaskOP
;
203
typedef
core::pose::Pose
Pose
;
204
typedef
core::scoring::EnergyMap
EnergyMap
;
205
typedef
core::scoring::ScoreFunction
ScoreFunction
;
206
typedef
core::scoring::ScoreFunctionOP
ScoreFunctionOP
;
207
typedef
core::scoring::ScoreTypes
ScoreTypes
;
208
typedef
core::scoring::methods::LongRangeTwoBodyEnergy
LongRangeTwoBodyEnergy
;
209
typedef
core::Size
Size
;
210
typedef
core::Real
Real
;
211
typedef
core::Vector
Vector
;
212
213
public
:
214
GreenPacker
();
215
virtual
~GreenPacker
();
216
217
virtual
218
void
219
apply
(
Pose
& );
220
virtual
std::string
get_name
()
const
;
221
222
// Undefined, commentin out to make PyRosetta compile
223
// void reset();
224
225
void
226
set_scorefunction
(
ScoreFunction
const
& );
227
228
void
229
set_group_discriminator
(
protocols::simple_moves::GroupDiscriminatorOP
);
230
231
void
232
set_task_factory
(
TaskFactoryOP
);
233
234
void
235
set_reference_round_task_factory
(
TaskFactoryOP
);
236
237
private
:
238
/// Private methods
239
void
240
set_weights_for_sfxn
(
241
ScoreFunction
& sfxn,
242
ScoreTypes
const
& scoretypes,
243
EnergyMap
const
& weights
244
)
const
;
245
246
247
void
setup_reference_data
(
Pose
& );
248
void
repack
(
Pose
& pose );
249
250
void
split_pose_into_groups
(
Pose
& pose );
251
void
create_reference_packer_task
(
Pose
& pose );
252
void
create_reference_packer_neighbor_graph
(
Pose
& pose );
253
void
create_reference_rotamers
(
Pose
& pose );
254
void
compute_reference_intragroup_rpes
(
Pose
& pose );
255
256
void
create_fresh_task
(
Pose
& pose );
257
void
create_fresh_packer_neighbor_graph
(
Pose
& pose );
258
void
create_fresh_rotamers
(
Pose
& pose );
259
void
find_reference_and_current_rotamer_correspondence
(
Pose
& pose );
260
void
initialize_internal_correspondence_data
(
Pose
& pose );
261
void
compute_energies
(
Pose
& pose );
262
void
run_sa
(
Pose
& pose );
263
void
cleanup
();
264
265
void
add_precomputed_energies
(
Pose
& pose,
PrecomputedPairEnergiesInteractionGraphOP
pig );
266
void
compute_absent_energies
(
Pose
& pose,
PrecomputedPairEnergiesInteractionGraphOP
pig );
267
268
void
269
compute_absent_srci_energies_for_residue_pair
(
270
Pose
& pose,
271
PrecomputedPairEnergiesInteractionGraphOP
pig,
272
Size
lower_res,
273
Size
upper_res
274
);
275
276
void
277
compute_absent_lrci_energies_for_residue_pair
(
278
Pose
& pose,
279
LongRangeTwoBodyEnergy
const
& lre,
280
PrecomputedPairEnergiesInteractionGraphOP
pig,
281
Size
lower_res,
282
Size
upper_res
283
);
284
285
void
drop_inter_group_edges
(
Pose
& pose,
GraphOP
packer_neighbor_graph )
const
;
286
void
drop_intra_group_edges
(
Pose
& pose,
GraphOP
packer_neighbor_graph )
const
;
287
288
void
store_reference_pose_geometry
(
Pose
& pose );
289
void
compare_input_pose_geometry_to_reference
(
Pose
& pose );
290
291
292
private
:
293
ScoreFunctionOP
full_sfxn_
;
294
ScoreFunctionOP
ci_sfxn_
;
295
ScoreFunctionOP
cd_sfxn_
;
296
297
//@brief true at construction, or after a call to reset, before a call to apply.
298
bool
create_reference_data_
;
299
300
protocols::simple_moves::GroupDiscriminatorOP
group_discriminator_
;
301
utility::vector1< Size >
group_ids_
;
302
std::vector< utility::vector1< Size > >
group_members_
;
// index by zero to represent group 0
303
304
TaskFactoryOP
reference_task_factory_
;
305
TaskFactoryOP
task_factory_
;
306
307
////////////////////////////////////////////
308
/// Data captured from the reference apply()
309
310
/// @brief task used in construction of the reference data
311
PackerTaskOP
reference_task_
;
312
GraphOP
reference_packer_neighbor_graph_
;
313
314
/// @brief rotamer sets created by the reference task
315
RotamerSetsOP
reference_rotamer_sets_
;
316
utility::vector1< Size >
reference_resid_2_moltenres_
;
317
utility::vector1< Size >
reference_moltenres_2_resid_
;
318
319
/// @brief the stored intra-group RPEs from the context independent components of the
320
/// score function
321
PrecomputedPairEnergiesInteractionGraphOP
ci_rpes_
;
322
323
/// @brief the internal geometry of the rotamers created in the first round
324
utility::vector1< utility::vector1< protocols::simple_moves::MinimalRotamerOP >
>
original_rotamers_
;
325
326
/// @brief the internal geometry of the backbone used in the first round
327
utility::vector1< utility::vector1< Real >
>
orig_bb_tors_
;
// compare input tors against
328
329
/// @brief for debugging; a set of coordinates of each residue for backbone atom #1 (N in proteins, Phos for NA's)
330
/// so that if the backbone DOFs do change, and the structure of the input pose cannot be superimposed
331
/// back onto the original coordinates, then a debug runtime_assert statementmet will get caught.
332
utility::vector1< Vector >
original_bb_rep_coords_
;
333
334
//////////////////////////////////////////////////////////////////////////////////////////////
335
/// Data for the "current" packing -- valid between the beginning and end of a call to "apply"
336
337
PackerTaskOP
current_task_
;
338
RotamerSetsOP
current_rotamer_sets_
;
339
PrecomputedPairEnergiesInteractionGraphOP
current_ig_
;
340
341
/// @brief the internal geometry of the rotamers created in the first round
342
utility::vector1< utility::vector1< protocols::simple_moves::MinimalRotamerOP >
>
current_rotamers_
;
343
344
GraphOP
current_packer_neighbor_graph_
;
345
GraphOP
current_inter_group_packer_neighbor_graph_
;
346
GraphOP
current_intra_group_packer_neighbor_graph_
;
347
348
/// correspondence between current rotamer set and original rotamer set.
349
utility::vector1< utility::vector1< Size >
>
orig_rot_2_curr_rot_
;
350
utility::vector1< utility::vector1< Size >
>
curr_rot_2_orig_rot_
;
351
utility::vector1< utility::vector1< Size >
>
curr_rotamers_with_correspondence_
;
352
utility::vector1< utility::vector1< Size >
>
curr_rotamers_without_correspondence_
;
353
354
355
};
356
357
}
// namespace moves
358
}
// namespace protocols
359
360
#endif // INCLUDED_protocols_simple_moves_GreenPacker_HH
Generated on Sat Jun 1 2013 12:15:58 for Rosetta 3.5 by
1.8.4