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
IterativeBase.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
///
10
/// @author Oliver Lange
11
12
13
#ifndef INCLUDED_protocols_abinitio_IterativeBase_hh
14
#define INCLUDED_protocols_abinitio_IterativeBase_hh
15
16
// Unit Headers
17
//#include <protocols/abinitio/IterativeAbrelax.fwd.hh>
18
19
// Package Headers
20
#include <
protocols/jd2/archive/NormalizedEvaluatedArchive.hh
>
21
#include <
protocols/jd2/archive/ArchiveManager.fwd.hh
>
22
#include <
protocols/abinitio/HedgeArchive.hh
>
23
24
// Project Headers
25
#include <
protocols/abinitio/PairingStatistics.fwd.hh
>
26
#include <
protocols/loops/Loops.hh
>
27
28
#include <
core/types.hh
>
29
#include <
core/pose/Pose.fwd.hh
>
30
// AUTO-REMOVED #include <core/io/silent/SilentStruct.fwd.hh>
31
// AUTO-REMOVED #include <core/io/silent/SilentFileData.hh>
32
#include <
core/fragment/FragSet.fwd.hh
>
33
34
35
#include <utility/options/OptionCollection.hh>
36
37
38
// Utility headers
39
//for dynamic patching
40
#include <utility/options/keys/FileVectorOptionKey.hh>
41
#include <utility/io/ozstream.fwd.hh>
42
43
// Third-party Headers
44
#include <boost/functional/hash.hpp>
45
46
47
//// C++ headers
48
#include <string>
49
50
#include <
protocols/noesy_assign/NoesyModule.fwd.hh
>
51
#include <utility/vector1.hh>
52
53
54
namespace
protocols {
55
namespace
abinitio {
56
57
class
IterativeBase
:
public
jd2::archive::NormalizedEvaluatedArchive
{
58
typedef
jd2::archive::NormalizedEvaluatedArchive
Parent
;
59
typedef
utility::vector1< core::io::silent::SilentStructOP >
SilentStructVector
;
60
public
:
61
enum
IterationStage
{
62
ENUMERATION
= 1,
63
TOPO_RESAMPLING
,
64
PURE_TOPO_RESAMPLING
,
65
STAGE2_RESAMPLING
,
66
NOESY_PHASEII_TOPO
,
67
NOESY_PHASEII_S2_RESAMPLING
,
68
CEN2FULLATOM
,
69
// CEN2FULLATOM_NON_POOL_DECOYS,
70
LAST_CENTROID_START
=
CEN2FULLATOM
,
71
// FLEX_CORE_RESAMPLING,
72
RIGID_CORE_RESAMPLING
,
73
FINISHED
//keep last
74
};
75
76
IterativeBase
(
std::string
name
);
77
~IterativeBase
();
78
79
///@brief archive is finished when at last stage
80
virtual
bool
finished
()
const
{
return
stage_
>=
finish_stage_
; };
81
82
///@brief do initializing work that requires fully setup object here
83
virtual
void
initialize
();
84
85
///@brief where to stop ?
86
void
set_finish_stage
(
IterationStage
setting ) {
87
finish_stage_
= setting;
88
}
89
90
///@brief calls increment_stage() if appropriate
91
void
test_for_stage_end
();
92
93
///@brief overloaded to make input decoys appear the same as decoys coming from batches
94
virtual
void
init_from_decoy_set
(
core::io::silent::SilentFileData
const
& sfd );
95
96
///@brief we are always ready to generate a new batch
97
virtual
bool
ready_for_batch
()
const
{
return
true
; };
98
99
///@brief we are not interested in batches that were generated in old stages
100
virtual
bool
still_interested
(
jd2::archive::Batch
const
& batch )
const
;
101
102
///@brief generate a new batch, use different recipe according to current stage
103
104
///@brief generate a new batch, use different recipe according to current stage
105
virtual
void
generate_batch
();
106
107
///@brief while waiting for jobs to finish
108
virtual
void
idle
();
109
virtual
void
rescore
();
110
virtual
void
save_status
( std::ostream& )
const
;
111
virtual
void
restore_status
( std::istream& );
112
113
///@brief overloaded to handel special convergence check 'pool_converged_rmsd'
114
virtual
bool
add_structure
(
core::io::silent::SilentStructOP
,
jd2::archive::Batch
const
& );
115
116
///@brief setup JumpNrEvaluator
117
void
setup_default_evaluators
();
118
119
///@brief overloaded so we can test for end of IterationStage after reading
120
virtual
void
read_structures
(
core::io::silent::SilentFileData
& returned_decoys,
jd2::archive::Batch
const
& batch );
121
122
///@brief generate flags and stuff for the out-sourced evaluation ---> such that score_final column is returned for each decoy
123
/// note needs to be public, since IterativeCentroid calls this from IterativeFullatom to prepare evaluation for soon to be full-atom decoys
124
// cen2fullatom-stage ( stage5 )
125
virtual
void
gen_evaluation_output
(
jd2::archive::Batch
& batch,
bool
fullatom =
false
);
126
127
// overload by IterativeCentroid for rerouting to fullatom archive
128
virtual
void
gen_diversity_pool
(
jd2::archive::Batch
&,
bool
fullatom =
false
);
129
130
// cen2fullatom-stage ( stage5 )
131
virtual
void
gen_dynamic_patches
(
jd2::archive::Batch
& batch );
132
133
virtual
void
update_noesy_filter_files
(
134
std::string
const
& current,
135
bool
fullatom
136
);
137
138
// ///@brief need to get these from the IterativeCentroid to IterativeFullatom at end of stage5 ;
139
// std::string const& first_noesy_fa_cst_file() const { return first_noesy_fa_cst_file_; }
140
protected
:
141
//void set_first_noesy_fa_cst_file( std::string setting ) { first_noesy_fa_cst_file_ = setting; }
142
143
// core::Real noesy_assign_float_cycle() const { return noesy_assign_float_cycle_; }
144
void
set_noesy_assign_float_cycle
(
core::Real
setting ) {
noesy_assign_float_cycle_
= setting; }
145
bool
never_switched_noe_filter_
;
146
loops::Loops
scored_core_
;
147
148
bool
super_quick_relax_of_centroids
()
const
{
return
super_quick_relax_of_centroids_
; }
149
/// ------------- helper functions to be used from generate_batch() --------------------
150
151
void
gen_resample_topologies
(
jd2::archive::Batch
& batch );
152
void
gen_start_structures
(
jd2::archive::Batch
& batch );
153
void
gen_enumerate_pairings
(
jd2::archive::Batch
& batch );
154
void
gen_resample_stage2
(
jd2::archive::Batch
& batch );
155
void
gen_resample_fragments
(
jd2::archive::Batch
& batch );
156
void
gen_cen2fullatom
(
jd2::archive::Batch
& batch );
157
void
gen_cen2fullatom_non_pool_decoys
(
jd2::archive::Batch
& batch );
158
void
collect_hedgeing_decoys_from_batches
(
159
jd2::archive::Batch
const
& batch,
160
core::io::silent::SilentStructOPs
& start_decoys,
161
core::Real
score_cut_per_batch
162
);
163
void
add_fullatom_flags
(
jd2::archive::Batch
& batch );
164
165
/// actually run the assignment machinery (only after batch is started to keep archive from hogging the queue... )
166
void
reassign_noesy_data
(
jd2::archive::Batch
& batch );
167
168
/// generate cst-input from current assigned noesy data
169
void
gen_noe_assignments
(
jd2::archive::Batch
& batch );
170
171
/// some helpers for the helpers
172
PairingStatisticsOP
compute_beta_topology
();
173
void
guess_pairings_from_secondary_structure
(
174
core::fragment::FragSet
const
& frags,
175
std::string
const
& out_pairings_file,
176
std::string
const
& out_frag_ss_file
177
)
const
;
178
void
compute_cores
();
179
180
///these are set by the cmd-line options iterative::fa_score and iterative::fa_score_patch
181
std::string
const
&
fa_score
()
const
{
182
return
fa_score_
;
183
}
184
std::string
const
&
fa_score_patch
()
const
{
185
return
fa_score_patch_
;
186
}
187
188
///these are set by the cmd-line options iterative::cen_score and iterative::cen_score_patch
189
std::string
const
&
cen_score
()
const
{
190
return
cen_score_
;
191
}
192
std::string
const
&
cen_score_patch
()
const
{
193
return
cen_score_patch_
;
194
}
195
196
///@brief this is set from score::atom_pair_constraint of the pool-scorefunction
197
core::Real
overall_cstfilter_weight
()
const
{
198
return
overall_cstfilter_weight_
;
199
}
200
201
///@brief this is set from score::atom_pair_constraint of the pool-scorefunction
202
void
set_overall_cstfilter_weight
(
core::Real
setting ) {
203
overall_cstfilter_weight_
= setting;
204
}
205
206
///OBSOLET cores are computed by compute_cores() in idle()
207
loops::Loops
const
&
core
(
core::Size
i ) {
208
if
( i == 1 ) {
return
core15_
; };
209
if
( i == 2 ) {
return
core2_
; };
210
if
( i == 3 ) {
return
core3_
; };
211
if
( i == 4 ) {
return
core4_
; };
212
runtime_assert(
false
);
213
return
core2_
;
//happy compiler
214
}
215
216
///@brief current stage?
217
IterationStage
stage
()
const
{
218
return
stage_
;
219
}
220
221
///@brief needed for writing of psi-pred fiels (guess_pairings_from_secondary_structure)
222
std::string
const
&
target_sequence
()
const
{
223
return
target_sequence_
;
224
}
225
226
void
set_stage
(
IterationStage
setting ) {
227
stage_
= setting;
228
}
229
230
231
///@brief cluster structures with min_diversity_list_[ stage_ ] as cluster:radius
232
void
cluster
();
233
234
std::string
const
&
chemshift_column
()
const
{
235
return
chemshift_column_
;
236
}
237
238
void
test_broker_settings
(
jd2::archive::Batch
const
& batch );
239
void
setup_filter_cst
(
core::Real
weight );
240
241
private
:
242
243
void
collect_hedge_structures
(
core::io::silent::SilentStructOP
evaluated_decoy,
jd2::archive::Batch
const
& batch );
244
///@brief score a pose with Pool-Scoring function (adds necessary data to pose (RDC, constraints, etc ) )
245
virtual
void
score
(
core::pose::Pose
& pose )
const
;
246
247
void
collect_alternative_decoys
(
SilentStructs
primary_decoys,
std::string
alternative_decoy_file,
SilentStructVector
& output_decoys );
248
249
///@brief what is the expected lowest acceptance ratio at the current stage ?
250
core::Real
target_accept_ratio
()
const
{
return
target_accept_ratio_
[
stage_
]; }
251
252
///@brief [OBSOLET] add score_coreX and rms_coreX evaluators (and columns) with 0.0 weight
253
void
add_core_evaluator
(
loops::Loops
const
&
core
,
std::string
const
& core_tag );
254
255
///@brief necessary steps to go to next stage... e.g., saving snapshot of archive
256
void
increment_stage
();
257
258
// void read_noisy_assign_data_from_last_batch();
259
260
void
replace_noesy_filter_constraints
();
261
void
rescore_nonlocal_archive
();
262
263
void
setup_autoNOE
();
264
void
do_dynamic_patching
(
265
jd2::archive::Batch
& batch,
266
utility::io::ozstream& flags,
267
std::string
score
,
268
utility::options::FileVectorOptionKey
const
& key
269
)
const
;
270
private
:
271
/// ----------------- -- private data members -- --------------------
272
273
/// ------------------------------ stage - control --------------------------
274
///@brief current stage
275
IterationStage
stage_
;
276
277
///@brief end-condition
278
IterationStage
finish_stage_
;
279
280
///@brief indices of prominent batches ( STATUS file )
281
core::Size
first_batch_this_stage_
;
282
core::Size
first_fullatom_batch_
;
283
284
/// --------------------------------- other ------------------------------------
285
///@brief toggle to keep track of the enumerate-pairings mode .. want to run this only every 2nd batch
286
bool
bEnumeratedLastTime_
;
287
288
///@brief [OBSOLET?] keep track when idle() has been run ...
289
core::Size
last_accepted_decoys_in_idle_
;
290
291
///core-regions --- used in IterativeFullatom for the "rigid-core" sampling step...
292
loops::Loops
core15_
;
293
loops::Loops
core2_
;
294
loops::Loops
core3_
;
295
loops::Loops
core4_
;
296
297
/// ----------- some cmd-line controlled settings -----------------
298
299
///@brief how many structures are maximally produced in stage X
300
utility::vector1< int >
max_nstruct_list_
;
//-1 --> skip stage, 0 infinite, N>0 make a maximum of N structures.
301
302
///@brief cluster:radius for minimum diversity in stage X
303
utility::vector1< core::Real >
min_diversity_list_
;
304
305
///@brief minimum acceptance ratio .. current_accept_ratio < target_accept_ratio[ stage_ ] --> increment_stage
306
utility::vector1< core::Real >
target_accept_ratio_
;
307
308
///@brief for RMSD ... e.g., in:file:native
309
core::pose::PoseCOP
reference_pose_
;
310
311
///@brief from cmd-line cen-score and patch names
312
std::string
cen_score_
;
313
std::string
cen_score_patch_
;
314
315
///@brief from cmd-line fa-score and patch names
316
std::string
fa_score_
;
317
std::string
fa_score_patch_
;
318
319
///@brief this is set from score::atom_pair_constraint of the pool-scorefunction
320
core::Real
overall_cstfilter_weight_
;
321
322
std::string
target_sequence_
;
//read from in:file:fasta in c'stor
323
324
protocols::noesy_assign::NoesyModuleOP
noesy_module_
;
325
core::Real
noesy_assign_float_cycle_
;
326
327
std::string
first_noesy_cst_file_
;
328
std::string
first_noesy_fa_cst_file_
;
329
330
std::string
current_noesy_sampling_file_
;
331
bool
bCombineNoesyCst_
;
332
333
334
//hash value to see if decoys for noesy assign have changed
335
size_t
noesy_assign_hash_
;
336
boost::hash<std::string>
hasher
;
337
338
///@brief even in centroid mode the end of abinitio will have a fast relax... enables cs-score and noe-assignment
339
bool
recover_centroid_structure_for_pool_
;
340
341
std::string
chemshift_column_
;
342
bool
bDoBetaJumping_
;
343
344
///@brief even in centroid mode the end of abinitio will have a fast relax... enables cs-score and noe-assignment
345
bool
super_quick_relax_of_centroids_
;
346
347
348
///@brief use the score_variations from EvaluatedArchive to determine new sampling weights
349
bool
use_dynamic_weights_for_sampling_
;
350
351
core::Size
delay_noesy_reassign_
;
352
353
HedgeArchiveOP
hedge_archive_
;
354
///@brief cache some of the experimental data so we don't reload from file for each evaluation
355
mutable
core::scoring::ResidualDipolarCouplingOP
rdc_data_
;
//need to cache this to avoid reading RDC file each time...
356
mutable
core::scoring::constraints::ConstraintSetOP
cst_data_
;
357
mutable
core::scoring::constraints::ConstraintSetOP
cst_fa_data_
;
358
/// ------------------ register cmdline options ---------------------------
359
360
utility::options::OptionCollection
const
vanilla_options_
;
//options before stage-dpd auto-noe-options were added
361
362
363
private
:
364
static
bool
options_registered_
;
365
public
:
366
static
void
register_options
();
367
368
};
369
370
371
}
372
}
373
374
#endif
Generated on Sat Jun 1 2013 11:41:24 for Rosetta 3.5 by
1.8.4