38 #include <basic/options/option.hh>
63 #include <basic/Tracer.hh>
67 #include <numeric/random/random.hh>
77 #include <basic/options/keys/loops.OptionKeys.gen.hh>
78 #include <basic/options/keys/constraints.OptionKeys.gen.hh>
81 #include <utility/vector1.hh>
92 namespace loop_mover {
97 static basic::Tracer
TR(
"protocols.loops.loop_mover.perturb.LoopMover_Perturb_QuickCCD_Moves");
100 static numeric::random::RandomGenerator
RG(42862);
126 return "LoopMover_Perturb_QuickCCD_Moves";
133 using namespace kinematics;
134 using namespace scoring;
135 using namespace optimization;
136 using namespace protocols::simple_moves;
137 using namespace basic::options;
138 using namespace basic::options::OptionKeys;
141 tr() <<
"***** DOING CCD MOVES *****" << std::endl;
157 int const loop_size( loop.
stop() - loop.
start() + 1 );
159 core::Size cycles3 = std::max( 30,
int( 10*loop_size));
160 tr().Info <<
"Number of cycles: cycles2 and cycles3 " << cycles2 <<
" " << cycles3 << std::endl;
164 bool chainbreak_present = ( loop.
start() != 1 && loop.
stop() != nres &&
166 !pose.
residue( loop.
stop() ).is_upper_terminus() );
169 if( chainbreak_present ){
186 frag_mover_movemap->set_bb_true_range( loop.
start(), loop.
stop() );
191 it != it_end; it++ ) {
193 cfm->set_check_ss(
false );
194 cfm->enable_end_bias_check(
false );
195 fragmover.push_back( cfm );
204 for ( std::vector< FragmentMoverOP >::const_iterator
205 it = fragmover.begin(),it_end = fragmover.end(); it != it_end; it++ ) {
206 (*it)->apply( pose );
213 float const dummy_tol( 0.001 );
214 bool const use_nblist(
true ), deriv_check(
false );
215 MinimizerOptions options(
"linmin", dummy_tol, use_nblist, deriv_check);
228 mc_->set_temperature( temperature );
233 float final_chain_break_weight = 5.0;
236 dynamic_cast<core::conformation::symmetry::SymmetricConformation const & > ( pose.
conformation()) );
238 final_chain_break_weight = 5.0*symm_info->subunits();
243 float const delta_weight( final_chain_break_weight/cycles2 );
248 float final_constraint_weight = option[ basic::options::OptionKeys::constraints::cst_weight ]();
249 for (
core::Size c2 = 1; c2 <= cycles2; ++c2 ) {
250 mc_->recover_low( pose );
253 if( has_constraints ) {
254 if( c2 != cycles2 ) {
260 if ( chainbreak_present ) {
270 for (
core::Size c3 = 1; c3 <= cycles3; ++c3 ) {
271 if(( !chainbreak_present || uniform()*cycles2 > c2 ))
274 for ( std::vector< FragmentMoverOP >::const_iterator
275 it = fragmover.begin(),it_end = fragmover.end(); it != it_end; it++ ) {
278 if( ((*it)->fragments()->max_frag_length() == 1 ) && (uniform() < option[OptionKeys::loops::skip_1mers ]() ) )
continue;
279 if( ((*it)->fragments()->max_frag_length() == 3 ) && (uniform() < option[OptionKeys::loops::skip_3mers ]() ) )
continue;
280 if( ((*it)->fragments()->max_frag_length() == 9 ) && (uniform() < option[OptionKeys::loops::skip_9mers ]() ) )
continue;
282 (*it)->apply( pose );
287 if( ! option[OptionKeys::loops::skip_ccd_moves ]() ){
291 mc_->boltzmann( pose,
"QuickCCD_Moves" );
293 mzr->run( pose, *mm_one_loop_symm, *
scorefxn(), options );
300 if( ( chain_break_score > 0.1 ) && chainbreak_present )
302 mc_->recover_low( pose );
303 tr() <<
"--" << std::endl;
315 pose = mc_->lowest_score_pose();
317 tr().Info <<
"-------------------------" << std::endl;
318 mc_->show_counters();
321 if( chainbreak_present ){
326 core::Real chain_break_tol = option[ basic::options::OptionKeys::loops::chain_break_tol ]();
327 tr().Info <<
"Chainbreak: " << chain_break_score <<
" Max: " << chain_break_tol << std::endl;
328 if( chain_break_score > chain_break_tol )
return Failure;
350 return "LoopMover_Perturb_QuickCCD_Moves";