32 #include <basic/datacache/BasicDataCache.hh>
33 #include <basic/Tracer.hh>
55 #include <basic/options/keys/symmetry.OptionKeys.gen.hh>
60 #include <basic/options/option.hh>
61 #include <basic/options/keys/relax.OptionKeys.gen.hh>
62 #include <basic/options/keys/in.OptionKeys.gen.hh>
63 #include <basic/options/keys/run.OptionKeys.gen.hh>
64 #include <basic/datacache/DiagnosticData.hh>
70 #include <ObjexxFCL/string.functions.hh>
72 #include <utility/vector0.hh>
73 #include <utility/vector1.hh>
87 static basic::Tracer
TR(
"protocols.relax.ClassicRelax");
97 ClassicRelaxCreator::keyname()
const
99 return ClassicRelaxCreator::mover_name();
103 ClassicRelaxCreator::create_mover()
const {
108 ClassicRelaxCreator::mover_name()
110 return "ClassicRelax";
114 ClassicRelax::ClassicRelax(
117 parent(
"ClassicRelax", scorefxn_in ),
118 checkpoints_(
"ClassicRelax")
131 parent(
"ClassicRelax",scorefxn_in ),
132 checkpoints_(
"ClassicRelax")
144 checkpoints_(
"ClassicRelax")
156 min_mover_( other.min_mover_ ),
157 checkpoints_( other.checkpoints_ ),
159 use_default_mc_( other.use_default_mc_ ),
160 pack_full_repack_( other.pack_full_repack_ ),
161 use_default_pack_full_repack_( other.use_default_pack_full_repack_ ),
162 pack_rottrial_( other.pack_rottrial_ ),
163 use_default_pack_rottrial_( other.use_default_pack_rottrial_ ),
164 m_Temperature( other.m_Temperature ),
165 nmoves_( other.nmoves_ ),
166 energycut( other.energycut ),
167 min_type( other.min_type ),
168 nb_list( other.nb_list ),
169 min_tolerance( other.min_tolerance ),
170 moveset_phase1_( other.moveset_phase1_ ),
171 moveset_phase2_( other.moveset_phase2_ ),
172 moveset_phase3_( other.moveset_phase3_ ),
173 lj_ramp_cycles( other.lj_ramp_cycles ),
174 lj_ramp_inner_cycles( other.lj_ramp_inner_cycles ),
175 start_rep_weight( other.start_rep_weight ),
176 end_rep_weight( other.end_rep_weight ),
177 st_rep_( other.st_rep_ ),
178 st_atr_( other.st_atr_ ),
179 st_sol_( other.st_sol_ ),
180 stage2_repack_period( other.stage2_repack_period ),
181 stage2_cycles( other.stage2_cycles ),
182 stage3_cycles( other.stage3_cycles ),
183 score_stage2_beginning( other.score_stage2_beginning ),
184 score_stage2_quarter( other.score_stage2_quarter ),
185 score_stage2_half( other.score_stage2_half ),
186 score_stage2_end( other.score_stage2_end ),
187 filter_stage2_beginning( other.filter_stage2_beginning ),
188 filter_stage2_quarter( other.filter_stage2_quarter ),
189 filter_stage2_half( other.filter_stage2_half ),
190 filter_stage2_end( other.filter_stage2_end )
207 using namespace basic::options;
208 using namespace basic::options::OptionKeys;
212 option.add_relevant( OptionKeys::relax::wobblemoves );
213 option.add_relevant( OptionKeys::relax::constrain_relax_to_native_coords );
214 option.add_relevant( OptionKeys::relax::constrain_relax_to_start_coords );
215 option.add_relevant( OptionKeys::relax::constrain_relax_segments );
216 option.add_relevant( OptionKeys::relax::ramp_constraints );
217 option.add_relevant( OptionKeys::relax::energycut );
218 option.add_relevant( OptionKeys::relax::stage1_ramp_cycles );
219 option.add_relevant( OptionKeys::relax::stage1_ramp_inner_cycles );
220 option.add_relevant( OptionKeys::relax::stage2_repack_period );
221 option.add_relevant( OptionKeys::relax::stage2_cycles );
222 option.add_relevant( OptionKeys::relax::min_tolerance );
223 option.add_relevant( OptionKeys::relax::stage3_cycles );
224 option.add_relevant( OptionKeys::relax::cycle_ratio );
225 option.add_relevant( OptionKeys::relax::filter_stage2_beginning );
226 option.add_relevant( OptionKeys::relax::filter_stage2_quarter );
227 option.add_relevant( OptionKeys::relax::filter_stage2_half );
228 option.add_relevant( OptionKeys::relax::filter_stage2_end );
242 TR <<
"Setting up default relax setting" << std::endl;
256 energycut = basic::options::option[ basic::options::OptionKeys::relax::energycut ];
258 lj_ramp_cycles = basic::options::option[ basic::options::OptionKeys::relax::stage1_ramp_cycles];
259 lj_ramp_inner_cycles = basic::options::option[ basic::options::OptionKeys::relax::stage1_ramp_inner_cycles];
264 stage2_repack_period = basic::options::option[ basic::options::OptionKeys::relax::stage2_repack_period];
265 stage2_cycles = basic::options::option[ basic::options::OptionKeys::relax::stage2_cycles ];
266 min_tolerance = basic::options::option[ basic::options::OptionKeys::relax::min_tolerance ];
268 if ( basic::options::option[ basic::options::OptionKeys::run::test_cycles ] ) {
276 stage3_cycles = basic::options::option[ basic::options::OptionKeys::relax::stage3_cycles ];
278 filter_stage2_beginning = basic::options::option[ basic::options::OptionKeys::relax::filter_stage2_beginning ];
279 filter_stage2_quarter = basic::options::option[ basic::options::OptionKeys::relax::filter_stage2_quarter ];
280 filter_stage2_half = basic::options::option[ basic::options::OptionKeys::relax::filter_stage2_half ];
281 filter_stage2_end = basic::options::option[ basic::options::OptionKeys::relax::filter_stage2_end ];
290 if ( use_default_movemap ) {
301 TR.Info <<
"Setting min tolerance: " << new_tolerance << std::endl;
310 if ( basic::options::option[ basic::options::OptionKeys::symmetry::symmetry_definition ].user() ) {
322 small_mover->angle_max(
'H', 2.0 );
323 small_mover->angle_max(
'E', 2.0 );
324 small_mover->angle_max(
'L', 3.0 );
328 shear_mover->angle_max(
'H', 2.0 );
329 shear_mover->angle_max(
'E', 2.0 );
330 shear_mover->angle_max(
'L', 3.0 );
346 small_mover->angle_max(
'H', 2.0 );
347 small_mover->angle_max(
'E', 2.0 );
348 small_mover->angle_max(
'L', 3.0 );
352 shear_mover->angle_max(
'H', 2.0 );
353 shear_mover->angle_max(
'E', 2.0 );
354 shear_mover->angle_max(
'L', 3.0 );
358 moveset_phase2_temp ->add_mover( small_mover );
359 moveset_phase2_temp ->add_mover( shear_mover );
362 if( basic::options::option[ basic::options::OptionKeys::relax::wobblemoves ].user() &&
363 basic::options::option[ basic::options::OptionKeys::in::file::frag3 ].user() ){
364 std::string frag3_file = basic::options::option[ basic::options::OptionKeys::in::file::frag3 ]();
366 fragset3mer->read_fragment_file( frag3_file );
369 moveset_phase2_temp ->add_mover( wobble_mover );
370 moveset_phase2_temp ->add_mover( wobble_mover );
383 small_mover->angle_max(
'H', 2.0 );
384 small_mover->angle_max(
'E', 2.0 );
385 small_mover->angle_max(
'L', 3.0 );
389 shear_mover->angle_max(
'H', 2.0 );
390 shear_mover->angle_max(
'E', 2.0 );
391 shear_mover->angle_max(
'L', 3.0 );
395 moveset_phase3_temp ->add_mover( small_mover );
396 moveset_phase3_temp ->add_mover( shear_mover );
426 task_ = pack::task::TaskFactory::create_packer_task( pose );
432 allow_repack[i] = movemap.
get_chi(i);
436 if (basic::options::option[ basic::options::OptionKeys::relax::chi_move].user() ){
437 bool const repack = basic::options::option[ basic::options::OptionKeys::relax::chi_move]();
441 task_->initialize_from_command_line().restrict_to_repacking().restrict_to_residues(allow_repack);
442 task_->or_include_current(
true );
443 if ( basic::options::option[ basic::options::OptionKeys::symmetry::symmetry_definition ].user() ) {
465 task_ = pack::task::TaskFactory::create_packer_task( pose );
473 allow_repack[i] = movemap.
get_chi(i);
478 if (basic::options::option[ basic::options::OptionKeys::relax::chi_move].user() ){
479 bool const repack = basic::options::option[ basic::options::OptionKeys::relax::chi_move]();
484 task_->initialize_from_command_line().restrict_to_repacking().restrict_to_residues(allow_repack);
485 task_->or_include_current(
true );
488 if ( basic::options::option[ basic::options::OptionKeys::symmetry::symmetry_definition ].user() ) {
513 using namespace moves;
514 using namespace scoring;
515 using namespace basic::options;
516 using namespace basic::options::OptionKeys;
517 using namespace core::pose::datacache;
542 if ( basic::options::option[ basic::options::OptionKeys::symmetry::symmetry_definition ].user() ) {
555 TR.Info << std::endl << std::endl <<
"===================================================================" << std::endl;
556 TR.Info <<
" Stage 1 " << std::endl;
557 TR.Info <<
" Ramping repulsives with " <<
lj_ramp_cycles <<
" outer cycles and "
568 phase1_cycle->add_mover( repack_cycle );
579 starting_weights = final_weights =
get_scorefxn()->weights();
588 starting_weights, final_weights,
600 full_cycle_phase1_->apply( pose );
612 dynamic_cast<core::conformation::symmetry::SymmetricConformation &> ( pose.
conformation()) );
615 for (
Size ii = prerefine_pose.total_residue(); ii>=1; --ii ) {
616 if ( symm_info->fa_is_independent(ii) )
617 prerefine_pose.replace_residue( ii, pose.
residue( ii ),
false);
620 for (
Size ii = 1; ii <= prerefine_pose.total_residue(); ++ii ) {
621 prerefine_pose.replace_residue( ii, pose.
residue( ii ),
false);
624 pose = prerefine_pose;
658 TR.Info << std::endl <<
"===================================================================" << std::endl;
659 TR.Info <<
" Stage 2 " << std::endl;
660 TR.Info <<
" Mainmintrial for " <<
stage2_cycles <<
" with a full repack every "
672 phase2_cycle->add_mover( repack_cycle );
681 full_cycle_phase2_->apply( pose );
686 if ( filter_stage2_quarter < mc_->lowest_score() ) {
688 mc_->recover_low( pose );
693 full_cycle_phase2_->apply( pose );
697 if ( filter_stage2_half < mc_->lowest_score() ) {
699 mc_->recover_low( pose );
704 full_cycle_phase2_->apply( pose );
705 full_cycle_phase2_->apply( pose );
708 if ( filter_stage2_end< mc_->lowest_score() ) {
710 mc_->recover_low( pose );
718 mc_->recover_low( pose );
733 TR.Info << std::endl <<
"===================================================================" << std::endl;
734 TR.Info <<
" Stage 3 " << std::endl;
747 full_cycle_phase3_->apply( pose );
754 mc_->recover_low( pose );
757 std::map < std::string, core::Real > score_map;
768 pose.
data().set(CacheableDataType::SCORE_MAP,
new basic::datacache::DiagnosticData(score_map));
776 return "ClassicRelax";