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
abinitio
MembraneAbinitio.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 src/protocols/abinitio/MembraneAbinitio.hh
11
/// @brief header file for MembraneAbinitio protocol
12
/// @detailed
13
/// Contains currently: Classic Abinitio
14
///
15
///
16
/// @author Oliver Lange
17
18
19
#ifndef INCLUDED_protocols_abinitio_MembraneAbinitio_hh
20
#define INCLUDED_protocols_abinitio_MembraneAbinitio_hh
21
22
// Unit Headers
23
24
// Package Headers
25
#include <
protocols/simple_moves/FragmentMover.fwd.hh
>
26
27
// Project Headers
28
#include <
core/pose/Pose.fwd.hh
>
29
#include <
core/kinematics/MoveMap.fwd.hh
>
30
#include <
core/types.hh
>
31
#include <
core/scoring/ScoreFunction.fwd.hh
>
32
#include <
core/scoring/ScoreType.hh
>
33
#include <
core/scoring/MembraneTopology.fwd.hh
>
34
#include <
core/scoring/MembranePotential.fwd.hh
>
35
// AUTO-REMOVED #include <core/pack/task/PackerTask.fwd.hh>
36
37
#include <
protocols/abinitio/Protocol.hh
>
38
#include <
protocols/moves/TrialMover.hh
>
39
40
#include <
protocols/checkpoint/CheckPointer.hh
>
41
42
//// C++ headers
43
#include <string>
44
45
#include <
core/fragment/FragSet.fwd.hh
>
46
#include <
protocols/moves/MonteCarlo.hh
>
47
#include <utility/vector1.hh>
48
49
50
namespace
protocols {
51
namespace
abinitio {
52
53
/// Move these forward declarations to MembraneAbinitio.fwd.hh
54
class
MembraneAbinitio;
55
typedef
utility::pointer::owning_ptr< MembraneAbinitio >
MembraneAbinitioOP
;
56
57
//@ brief The Classic Abinitio protocol from rosetta++
58
/*!
59
@ detail
60
general usage:
61
MembraneAbinitio abinitio;
62
abinitio.init( pose );
63
...
64
while(nstruct) {
65
abinitio.apply( pose );
66
}
67
68
call MembraneAbinitio::register_options() before core::init to add relevant options to the applications help
69
70
, with the following
71
stages, all of which uses a different ScoreFunction based on the cen_std.wts in minirosetta_database:
72
73
- Stage 1: large (usually 9mer) randomly selected fragment insertions, only VDW term turned on.
74
Uses score0.wts_patch and runs for either a maximum of 2000 cycles or until all moveable phi/psi values
75
have been changed.
76
77
- Stage 2: large randomly selected fragment insertions, more score terms turned on. Uses score1.wts_patch
78
and runs for 2000 cycles.
79
80
- Stage 3: uses large randomly selected fragment insertions, although the size of the fragment insertions
81
is tunable via the set_apply_large_frags( bool ) method. Alternates between score2.wts_patch and score5.wts_patch,
82
running tunable numbers of 2000-cycle iterations between the two scoring functions.
83
84
- Stage 4: uses small (usually 3mer) fragment insertions with the fragment selection based on the Gunn cost for
85
finding local fragment moves. Runs for 4000-cycles and uses score3.wts_patch.
86
87
The class implements the basic abinito approach as known from rosetta++. We tried to set this up, such that
88
behaviour of the protocol can be changed in many different ways ( see, e.g., FoldConstraints ). To be able to change the
89
behaviour of the protocol easily the class-apply function and methods called therein (e.g., prepare_XXX() / do_XXX_cycles() ) should
90
not directly change moves or trials. A reference to the currently used score-function should be obtained by
91
mc().score_function() ...
92
93
Behaviour can be changed in the following ways:
94
95
use non-classic FragmentMover --> eg. not uniformly sampled fragments, but using some weighting
96
--> large and small moves doesn't have to be 3mers and 9mers... use other movers...
97
---> or other fragets for the "convenience constructor"
98
use custom trial classes --> overload update_moves()
99
100
change sampling behaviour:
101
overload prepare_XXX() methods: these are called before the cycling for a certain stage begins
102
overload do_stageX_cycles() : the actual loops over trial-moves ...
103
104
change scoring functions:
105
overload set_default_scores()
106
weight-changes effective for all stages: set_score_weight()
107
108
*/
109
110
111
class
MembraneAbinitio
:
public
Protocol
{
112
typedef
Protocol
Parent
;
113
public
:
114
enum
StageID
{
115
ALL_STAGES
= 0,
116
STAGE_1
,
117
STAGE_2
,
118
STAGE_3a
,
119
STAGE_3b
,
120
STAGE_4
121
};
122
///@brief This constructor does not work -- Fix it before using it.
123
// constructor: supply mover classes for Fragment Moves
124
MembraneAbinitio
(
125
simple_moves::FragmentMoverOP
brute_move_small
,
126
simple_moves::FragmentMoverOP
brute_move_small_top25
,
127
simple_moves::FragmentMoverOP
brute_move_large
,
128
simple_moves::FragmentMoverOP
smooth_move_small
,
129
int
/*dummy otherwise the two constructors are ambiguous */
130
);
131
132
///@brief constructor: supply fragsets for large and small fragment moves
133
MembraneAbinitio
(
134
core::fragment::FragSetCOP
fragset_small,
135
core::fragment::FragSetCOP
fragset_small_top25,
136
core::fragment::FragSetCOP
fragset_large,
137
core::kinematics::MoveMapCOP
movemap
138
);
139
140
//@brief setup moves, mc-object, scores
141
//@details can't call this from constructor; virtual functions don't operate
142
//until construction has completed.
143
virtual
144
void
init
(
core::pose::Pose
const
& pose );
145
146
//@brief MembraneAbinitio has virtual functions... use this to obtain a new instance
147
virtual
148
moves::MoverOP
clone
()
const
;
149
// MembraneAbinitioOP clone() const;
150
151
//@brief run protocol on pose
152
virtual
void
apply
(
core::pose::Pose
& pose );
153
154
virtual
std::string
get_name
()
const
;
155
156
//@brief return FramgentMover for smooth_small fragment insertions (i.e., stage4 moves)
157
simple_moves::FragmentMoverOP
smooth_move_small
();
158
simple_moves::FragmentMoverOP
brute_move_small_top25
();
159
160
//@brief return FragmentMover for small fragment insertions ( i.e., stage3/4 moves )
161
simple_moves::FragmentMoverOP
brute_move_small
();
162
163
//@brief return FragmentMover for large fragment insertions (i.e., stage1/2 moves )
164
simple_moves::FragmentMoverOP
brute_move_large
();
165
166
//@brief change the movemap ( is propagated to mover-objects )
167
//@detail overload if your extension stores additional moves as member variables
168
virtual
void
set_movemap
(
core::kinematics::MoveMapCOP
mm );
169
170
//@brief returns current movemap
171
core::kinematics::MoveMapCOP
movemap
();
172
173
174
//@brief add a new transmembrane region to be inserted
175
void
add_spanning_region
(
core::pose::Pose
& pose);
176
void
move_all_inserted
(
core::pose::Pose
& pose);
177
void
print_debug
(
core::pose::Pose
& pose);
178
179
//@brief set new instances of FragmentMovers
180
void
set_moves
(
181
simple_moves::FragmentMoverOP
brute_move_small
,
182
simple_moves::FragmentMoverOP
brute_move_large
,
183
simple_moves::FragmentMoverOP
smooth_move_small
184
);
185
186
//@brief set new monte-carlo object
187
void
set_mc
(
moves::MonteCarloOP
);
188
189
//@brief obtain currently used monte-carlo object --> use to obtain current score-func: mc().score_function()
190
moves::MonteCarlo
&
mc
() {
191
return
*
mc_
;
192
}
193
194
//@brief obtain currently used monte-carlo object --> use to obtain current score-func: mc().score_function()
195
moves::MonteCarlo
const
&
mc
()
const
{
196
return
*
mc_
;
197
}
198
199
//@brief override cycle setting ( init() -> sets it according to cmd-line options )
200
virtual
void
set_cycles
(
core::Real
increase_cycles = 1.0 );
201
202
//@brief
203
Size
total_trials
()
const
{
204
return
total_trials_
;
205
}
206
207
//@brief override cycle setting for specific stage ( valid nr: 1,2,3,4)
208
// void set_cycles( Size stage, Size cycles );
209
210
// eventually replace with a polymorphic checkpointer class
211
// these functions are almost identical to the ones used for ClassicRelax
212
virtual
void
clear_checkpoints
(
void
);
213
virtual
bool
recover_checkpoint
(
core::pose::Pose
&pose,
std::string
const
&
id
);
214
virtual
void
checkpoint
(
core::pose::Pose
&pose,
std::string
const
&
id
);
215
216
/* obsoleted by set_current_tag in Mover class
217
/// @brief set tag for debugging output
218
void set_output_tag( std::string tag ) {
219
output_tag_ = tag;
220
}
221
222
std::string get_output_tag() {
223
return output_tag_;
224
}
225
*/
226
227
/// @brief for debugging, one wants to have access to the native pose.
228
// void set_native_pose( core::pose::Pose const & pose );
229
230
//@brief set weight - effective for all scoring functions stage == -1 --> set weight for all stages
231
// mod -1 (ignored) , in stage3 mod = 1 --> 3a , mod = 2 --> 3b
232
virtual
void
set_score_weight
(
core::scoring::ScoreType
,
core::Real
setting,
StageID
stage =
ALL_STAGES
);
233
234
protected
:
235
//@brief called to notify about changes regarding movers... new movemap / new instances of FragmentMover
236
virtual
void
update_moves
();
237
238
//@brief called by init() --- calls all set_default_XXX methods
239
virtual
void
set_defaults
(
core::pose::Pose
const
& pose );
240
241
//@brief read out cmd-line options
242
virtual
void
set_default_options
();
243
244
//@brief register cmd-line options in option system ( call before core::init )
245
public
:
246
static
void
register_options
();
247
protected
:
248
//@brief construct default monto-carlo object
249
virtual
void
set_default_mc
(
250
core::pose::Pose
const
& pose,
251
core::scoring::ScoreFunction
const
& scorefxn
252
);
253
254
//@brief assigns default score-functions to the 4 stages--> score0 / score1 / (score2/score5) / score3
255
virtual
void
set_default_scores
();
256
257
//@brief currently used score function ( depends on stage )
258
core::scoring::ScoreFunction
const
&
current_scorefxn
()
const
;
259
260
//@brief set current scorefunction
261
void
current_scorefxn
(
core::scoring::ScoreFunction
const
& scorefxn );
262
263
//@brief set individual weight of current scorefunction
264
//@details NOTE: does not change the predefined weights, this information is lost each time the score is set
265
// weight will be overwritten with default ->at beginning of stages, each iteration of loop in stage3
266
// we could change this behaviour by having a pointer to the current score and making sure that nobody can
267
// change the score inside the mc-object (only const accessor )
268
void
set_current_weight
(
core::scoring::ScoreType
type
,
core::Real
setting );
269
270
//@brief run cycles for different scoring_stages, return number of steps used
271
virtual
int
do_stage1_cycles
(
core::pose::Pose
&pose );
272
virtual
int
do_stage2_cycles
(
core::pose::Pose
&pose );
273
virtual
int
do_stage3_cycles
(
core::pose::Pose
&pose );
274
virtual
int
do_stage3b_cycles
(
core::pose::Pose
&pose );
275
virtual
int
do_stage4_cycles
(
core::pose::Pose
&pose );
276
277
//@brief returns true if pose is < 3.0 A rms to last pose sent to this function
278
// bool convergence_check( core::pose::Pose const & pose );
279
280
//@brief returns the Mover that is applied inside the stage3 double loop
281
virtual
moves::TrialMoverOP
282
stage2_mover
(
core::pose::Pose
&pose,
moves::TrialMoverOP
trials_in );
283
284
//@brief returns the Mover that is applied inside the stage3 double loop
285
virtual
moves::TrialMoverOP
286
stage3_mover
(
core::pose::Pose
& pose,
int
lct1,
int
lct2,
moves::TrialMoverOP
trials_in );
287
288
//@brief returns the Mover that is applied inside the stage4 loop
289
virtual
moves::TrialMoverOP
290
stage4_mover
(
core::pose::Pose
&pose,
int
kk,
moves::TrialMoverOP
trials_in );
291
292
293
//@brief called by update_moves() creates the instances of TrialMover with the FragmentMoves
294
virtual
void
set_trials
();
295
296
//@brief accessor for instances of TrialMover
297
moves::TrialMoverOP
trial_large
() {
298
return
(
apply_large_frags_
?
trial_large_
:
trial_small_
);
299
}
300
301
//@brief accessor for instances of TrialMover
302
moves::TrialMoverOP
trial_small
() {
303
return
trial_small_
;
304
}
305
306
//@brief accessor for instances of TrialMover
307
moves::TrialMoverOP
trial_small_top25
() {
308
return
trial_small_top25_
;
309
}
310
311
//@brief accessor for instances of TrialMover
312
moves::TrialMoverOP
trial_smooth
() {
313
return
smooth_trial_small_
;
314
}
315
316
// anything you want to have done before the stages ?
317
//@brief prepare_stageX is called before do_stageX_cycles... overload to change status/scoring/conformation....
318
virtual
void
prepare_stage1
(
core::pose::Pose
&pose );
319
virtual
void
prepare_stage2
(
core::pose::Pose
&pose );
320
virtual
void
prepare_stage3
(
core::pose::Pose
&pose );
321
virtual
void
prepare_stage4
(
core::pose::Pose
&pose );
322
323
//@brief called in each iteration of inner loop in stage3 before stage3_cycles_ of trials commence
324
virtual
void
prepare_loop_in_stage3
(
325
core::pose::Pose
&,
326
Size
,
/* loop_iteration*/
327
Size
/* total_iterations */
328
);
329
330
//@brief called in each iteration of the loop in stage4 before the stage4_cycles_ of trials commence
331
virtual
void
prepare_loop_in_stage4
(
332
core::pose::Pose
&,
333
Size
,
/* loop_iteration*/
334
Size
/* total_iterations */
335
);
336
337
public
:
338
//@brief accessor for boolean flag: just_smooth_cycles
339
inline
340
bool
just_smooth_cycles
()
const
{
341
return
just_smooth_cycles_
;
342
}
343
344
//@brief Accessor for number of stage1 cycles
345
inline
346
Size
stage1_cycles
()
const
{
347
return
stage1_cycles_
;
348
}
349
350
//@brief Accessor for number of stage2
351
inline
352
Size
stage2_cycles
()
const
{
353
return
stage2_cycles_
;
354
}
355
356
//@brief Accessor for number of stage3 cycles
357
inline
358
Size
stage3_cycles
()
const
{
359
return
stage3_cycles_
;
360
}
361
362
//@brief Setter for number of stage4 cycles
363
inline
364
void
set_stage4_cycles
(
Size
stage4_cycles_new) {
365
stage4_cycles_
= stage4_cycles_new;
366
}
367
368
369
//@brief Accessor for number of stage4 cycles
370
inline
371
Size
stage4_cycles
()
const
{
372
return
stage4_cycles_
;
373
}
374
375
//@brief query this flag if you have time-intensive stuff and cut it short
376
bool
bQuickTest
()
const
{
377
return
bQuickTest_
;
378
}
379
380
protected
:
381
void
output_debug_structure
(
core::pose::Pose
& pose,
std::string
prefix );
382
383
//@brief obtain currently used monte-carlo object --> use to obtain current score-func: mc().score_function()
384
moves::MonteCarloOP
mc_ptr
() {
385
return
mc_
;
386
}
387
388
389
protected
:
390
//@brief cycles_numbers -- modified by set_cycles(), set_default_options()
391
Size
stage1_cycles_
;
//score0
392
Size
stage2_cycles_
;
//score1
393
Size
stage3_cycles_
;
//score25
394
Size
stage4_cycles_
;
//score3
395
396
public
:
397
398
void
set_only_stage4
(
bool
value ){
only_stage4_
= value; }
//just_smooth_cycles_=value; }
399
400
401
private
:
402
Size
get_tmh_inserted
(
core::pose::Pose
const
& pose)
const
;
403
core::scoring::MembraneEmbed
const
&
MembraneEmbed_from_pose
(
core::pose::Pose
const
& )
const
;
404
core::scoring::MembraneEmbed
&
nonconst_MembraneEmbed_from_pose
(
core::pose::Pose
& )
const
;
405
core::scoring::MembraneTopology
const
&
MembraneTopology_from_pose
(
core::pose::Pose
const
& )
const
;
406
core::scoring::MembraneTopology
&
nonconst_MembraneTopology_from_pose
(
core::pose::Pose
& )
const
;
407
408
//@brief scoring functions -- modified by set_default_scores() / set_score_weight()
409
core::scoring::ScoreFunctionOP
score_stage1_
;
//score0
410
core::scoring::ScoreFunctionOP
score_stage2_
;
//score1
411
core::scoring::ScoreFunctionOP
score_stage3a_
;
//score2
412
core::scoring::ScoreFunctionOP
score_stage3b_
;
//score5
413
core::scoring::ScoreFunctionOP
score_stage4_
;
//score3
414
415
//@brief flags
416
bool
apply_large_frags_
;
//above contig_cut2
417
bool
short_insert_region_
;
//below contig_cut3
418
bool
just_smooth_cycles_
;
419
bool
only_stage4_
;
420
bool
bQuickTest_
;
// this flag might land in base-class
421
422
423
//@brief a temperature
424
core::Real
temperature_
;
425
426
//@brief movemap --> which dofs can be moved during abinitio
427
core::kinematics::MoveMapCOP
movemap_
;
428
429
//@brief a MonteCarlo object -- set_default_mc() , access: mc()
430
moves::MonteCarloOP
mc_
;
431
432
// Large and small Fragments
433
simple_moves::FragmentMoverOP
brute_move_small_
;
434
simple_moves::FragmentMoverOP
brute_move_small_top25_
;
435
simple_moves::FragmentMoverOP
brute_move_large_
;
436
simple_moves::FragmentMoverOP
smooth_move_small_
;
437
438
// TrialMovers
439
moves::TrialMoverOP
trial_large_
;
440
moves::TrialMoverOP
trial_small_
;
441
moves::TrialMoverOP
trial_small_top25_
;
442
moves::TrialMoverOP
smooth_trial_small_
;
443
444
std::vector< std::string >
checkpoint_ids_
;
445
446
Size
total_trials_
;
447
448
checkpoint::CheckPointer
checkpoint_
;
449
};
450
451
}
// abinitio
452
}
// protocols
453
454
#endif
Generated on Sat Jun 1 2013 11:41:39 for Rosetta 3.5 by
1.8.4