33 #include <basic/options/option.hh>
48 #include <basic/Tracer.hh>
52 #include <numeric/random/random.hh>
58 #if defined(WIN32) || defined(__CYGWIN__)
64 #include <basic/options/keys/loops.OptionKeys.gen.hh>
65 #include <basic/options/keys/constraints.OptionKeys.gen.hh>
68 #include <utility/vector1.hh>
75 namespace loop_mover {
78 static basic::Tracer
TR(
"protocols.loops.loop_mover.perturb.LoopMover_Perturb_QuickCCD");
83 static numeric::random::RandomGenerator
RG(42863);
145 return "LoopMover_Perturb_QuickCCD";
157 using namespace kinematics;
158 using namespace scoring;
159 using namespace optimization;
160 using namespace protocols::simple_moves;
161 using namespace basic::options;
162 using namespace basic::options::OptionKeys;
165 tr().Info <<
"***** CCD CLOSURE *****" << std::endl;
182 int const loop_size( loop.
stop() - loop.
start() + 1 );
186 int base_cycles( std::max( 15, static_cast<int>( 5*std::min(loop_size,15) )));
187 int cycles3 = base_cycles;
188 tr().Info <<
"Number of cycles: cycles2 and cycles3 "
189 << cycles2 <<
" " << cycles3
195 bool chainbreak_present = ( loop.
start() != 1 && loop.
stop() != nres &&
197 !pose.
residue( loop.
stop() ).is_upper_terminus() );
200 if ( chainbreak_present ) {
219 frag_mover_movemap->set_bb_true_range( loop.
start(), loop.
stop() );
226 it != it_end; it++ ) {
228 cfm->set_check_ss(
false );
229 cfm->enable_end_bias_check(
false );
230 fragmover.push_back( cfm );
241 it = fragmover.begin(),it_end = fragmover.end(); it != it_end; it++
243 (*it)->apply( pose );
250 float const dummy_tol( 0.001 );
251 bool const use_nblist(
true ), deriv_check(
false );
252 MinimizerOptions options(
"linmin", dummy_tol, use_nblist, deriv_check);
264 mc_->set_temperature( temperature );
266 int starttime = time(NULL);
269 tr().Info << std::endl;
273 (final_temp/init_temp), (1.0/(cycles2*cycles3))
277 float final_constraint_weight = option[ basic::options::OptionKeys::constraints::cst_weight ]();
284 dynamic_cast<core::conformation::symmetry::SymmetricConformation const & > ( pose.
conformation()) );
289 for(
int c2 = 1; c2 <= cycles2; ++c2 ) {
290 mc_->recover_low( pose );
293 if ( has_constraints ) {
294 if( c2 != cycles2 ) {
302 if (
tr().visible() ) {
scorefxn()->show_line(
tr().Info , pose ); }
303 tr().Info << std::endl;
306 for (
int c3 = 1; c3 <= cycles3; ++c3 ) {
307 temperature *= gamma;
308 mc_->set_temperature( temperature );
310 it = fragmover.begin(),it_end = fragmover.end();
313 (*it)->apply( pose );
314 if ( chainbreak_present ) {
318 mzr->run( pose, *mm_one_loop_symm, *
scorefxn(), options );
319 mc_->boltzmann( pose,
"QuickCCD" );
326 tr().Info << std::endl;
331 int looptime = time(NULL) - starttime;
332 tr() <<
"FragCount: " << frag_count << std::endl;
333 tr() <<
"Looptime " << looptime << std::endl;
335 pose = mc_->lowest_score_pose();
337 tr().Info <<
"-------------------------" << std::endl;
338 mc_->show_counters();
346 if ( chainbreak_present ) {
347 using namespace core::scoring;
355 = option[ basic::options::OptionKeys::loops::chain_break_tol ]();
356 tr().Info <<
"Chainbreak: " << chain_break_score <<
" Max: "
357 << chain_break_tol << std::endl;
363 if ( chain_break_score > (chain_break_tol*10) )
return ExtendFailure;
364 if ( chain_break_score > chain_break_tol )
return Failure;
385 return "LoopMover_Perturb_QuickCCD";
400 int const ccd_cycles = { 100 };
401 Real const ccd_tol = { 0.01 };
402 bool const rama_check = {
false };
403 Real const max_rama_score_increase = { 2.0 };
404 Real const max_total_delta_helix = { 10.0 };
405 Real const max_total_delta_strand = { 50.0 };
406 Real const max_total_delta_loop = { 75.0 };
408 Real forward_deviation, backward_deviation;
409 Real torsion_delta, rama_delta;
411 pose, mm, loop.
start() , loop.
stop(), loop.
cut(), ccd_cycles,
412 ccd_tol, rama_check, max_rama_score_increase, max_total_delta_helix,
413 max_total_delta_strand, max_total_delta_loop, forward_deviation,
414 backward_deviation, torsion_delta, rama_delta
420 if ( ss_i !=
'L' && ss_i !=
'H' && ss_i !=
'E')