77 #include <ObjexxFCL/format.hh>
78 #include <numeric/xyz.functions.hh>
79 #include <numeric/random/random.hh>
80 #include <numeric/random/random_permutation.hh>
81 #include <numeric/model_quality/rms.hh>
82 #include <numeric/model_quality/maxsub.hh>
84 #include <basic/options/option.hh>
85 #include <basic/options/keys/OptionKeys.hh>
86 #include <basic/options/keys/in.OptionKeys.gen.hh>
87 #include <basic/options/keys/cm.OptionKeys.gen.hh>
88 #include <basic/options/keys/constraints.OptionKeys.gen.hh>
89 #include <basic/options/keys/rigid.OptionKeys.gen.hh>
90 #include <basic/options/keys/jumps.OptionKeys.gen.hh>
91 #include <basic/options/keys/evaluation.OptionKeys.gen.hh>
92 #include <basic/options/keys/abinitio.OptionKeys.gen.hh>
93 #include <basic/Tracer.hh>
95 #include <numeric/random/DistributionSampler.hh>
96 #include <numeric/util.hh>
111 static numeric::random::RandomGenerator
RG(42136);
112 static basic::Tracer
TR(
"protocols.hybridization.FoldTreeHybridize" );
114 namespace protocols {
115 namespace hybridization {
117 using namespace core;
118 using namespace chemical;
119 using namespace core::kinematics;
120 using namespace ObjexxFCL;
121 using namespace protocols::moves;
122 using namespace protocols::simple_moves;
123 using namespace protocols::loops;
124 using namespace numeric::model_quality;
126 using namespace basic::options;
127 using namespace basic::options::OptionKeys;
168 using namespace basic::options;
169 using namespace basic::options::OptionKeys;
202 if ( option[ in::file::native ].user() ) {
205 }
else if ( option[ evaluation::align_rmsd_target ].user() ) {
227 for (
Size ires=loops[iloop].
start(); ires<=loops[iloop].stop(); ++ires) {
231 restype_set.name_map(
"VBB"), pose.
residue(ires),
248 for (
Size ires=loops[iloop].
start(); ires<=loops[iloop].stop(); ++ires) {
251 mutate_mover.
apply(pose);
252 for (
Size i_var = 1; i_var <=variant_types.size(); ++i_var) {
275 return gap_torr_0;
break;
277 return gap_torr_1;
break;
279 return gap_torr_2;
break;
281 return gap_torr_3;
break;
283 return gap_torr_4;
break;
285 return gap_torr_5;
break;
287 return gap_torr_6;
break;
289 return gap_torr_7;
break;
291 return gap_torr_8;
break;
299 using namespace ObjexxFCL::fmt;
301 int gap_start = chunks[i].stop() + gap_edge_shift;
302 int gap_stop = chunks[i+1].start() - gap_edge_shift;
303 int gap_size = gap_stop - gap_start - 1;
304 if (gap_size < 0)
continue;
305 if (gap_size > 8)
continue;
311 TR <<
"Add constraint to residue " << I(4,gap_start) <<
" and residue " << I(4,gap_stop) << std::endl;
330 if ( option[ OptionKeys::in::file::psipred_ss2 ].user() )
334 for (
core::Size i = 1; i<= num_residues_nonvirt; ++i ) {
337 TR.Info <<
"Secondary structure from fragments: " << pose.
secstruct() << std::endl;
339 TR.Info <<
"Secondary structure from psipred_ss2: " << pose.
secstruct() << std::endl;
351 dynamic_cast<core::conformation::symmetry::SymmetricConformation &> ( pose.
conformation()) );
353 nres = symm_info->num_independent_residues();
362 my_chunks[i].set_start( seqpos_start_target );
365 my_chunks[i].set_stop( seqpos_stop_target );
366 for (
Size j=seqpos_start_target; j<=seqpos_stop_target; ++j) template_mask[j] =
true;
376 std::set<core::Size> strand_pair_library_positions;
381 std::set<core::Size>::iterator pairings_iter;
385 strand_pairs_.push_back( std::pair< core::Size, core::Size >( seqpos_pairing_i, seqpos_pairing_j ) );
386 if (!template_mask[seqpos_pairing_i]) {
388 new_loop_i.
set_start( seqpos_pairing_i );
389 new_loop_i.
set_stop( seqpos_pairing_i );
391 strand_pair_library_positions.insert(seqpos_pairing_i);
392 template_mask[seqpos_pairing_i] =
true;
394 if (!template_mask[seqpos_pairing_j]) {
396 new_loop_j.
set_start( seqpos_pairing_j );
397 new_loop_j.
set_stop( seqpos_pairing_j );
399 strand_pair_library_positions.insert(seqpos_pairing_j);
400 template_mask[seqpos_pairing_j] =
true;
405 TR.Debug <<
"Chunks of initial template: " << initial_template_index_ << std::endl;
407 TR.Debug <<
"Chunks from initial template: " << std::endl;
408 TR.Debug << my_chunks << std::endl;
414 if (itempl == initial_template_index_)
continue;
420 bool uncovered =
true;
421 for (
Size j=seqpos_start_target; j<=seqpos_stop_target && uncovered ; ++j)
422 uncovered &= !template_mask[j];
426 new_loop.
set_start( seqpos_start_target );
427 new_loop.
set_stop( seqpos_stop_target );
428 wted_insertions_to_consider.push_back( std::pair< core::Real, protocols::loops::Loop >(
template_wts_[itempl] , new_loop ) );
434 TR.Debug <<
"Chunks from all template: " << std::endl;
435 TR.Debug << my_chunks << std::endl;
436 std::random_shuffle ( wted_insertions_to_consider.begin(), wted_insertions_to_consider.end() );
437 for (
Size i=1; i<=wted_insertions_to_consider.size(); ++i) {
439 bool uncovered =
true;
440 for (
Size j=wted_insertions_to_consider[i].second.start(); j<=wted_insertions_to_consider[i].second.stop() && uncovered ; ++j)
441 uncovered &= !template_mask[j];
443 if (!uncovered)
continue;
445 core::Real selector = numeric::random::uniform();
447 TR <<
"Consider " << wted_insertions_to_consider[i].second.start() <<
"," << wted_insertions_to_consider[i].second.stop() << std::endl;
448 if (selector <= wted_insertions_to_consider[i].first) {
449 TR <<
" ====> taken!" << std::endl;
450 my_chunks.
add_loop( wted_insertions_to_consider[i].second );
451 for (
Size j=wted_insertions_to_consider[i].second.start(); j<=wted_insertions_to_consider[i].second.stop(); ++j) {
452 template_mask[j] =
true;
459 TR <<
"Chunks used for foldtree setup: " << std::endl;
460 TR << my_chunks << std::endl;
471 for (
int i=1; i<= nres; ++i ) {
475 for (
Size j=1; j<= rsd.nheavyatoms(); ++j ) {
477 massSum += atom.
xyz();
492 using namespace ObjexxFCL::fmt;
493 TR.Debug << F(8,3,translation.x()) << F(8,3,translation.y()) << F(8,3,translation.z()) << std::endl;
501 positions.push_back(atom_xyz + translation);
508 using namespace ObjexxFCL::fmt;
512 TR.Debug <<
"Fragment insertion positions and weights:" << std::endl;
513 for (
Size ires=1; ires<= num_residues_nonvirt; ++ires ) {
515 bool residue_in_template =
false;
519 if (renumbered_template_chunks.
has(ires)) {
520 residue_in_template =
true;
524 if (! residue_in_template ) {
525 residue_weights[ires] = 1.0;
536 if (! renumbered_template_chunks.
has(ires) ) {
537 residue_weights[ires] = 1.0;
543 TR.Debug <<
" " << ires <<
": " << F(7,5,residue_weights[ires]) << std::endl;
548 int coverage_start =
template_poses_[i_template]->pdb_info()->number(1);
551 if (
template_poses_[i_template]->pdb_info()->number(ires) < coverage_start) {
552 coverage_start =
template_poses_[i_template]->pdb_info()->number(ires);
554 if (
template_poses_[i_template]->pdb_info()->number(ires) > coverage_end) {
559 for (
int shift = -5; shift<=5; ++shift) {
560 int ires = coverage_start + shift;
561 if (ires >= 1 && ires <= (
int)num_residues_nonvirt) {
562 residue_weights[ires] = 1.;
563 TR.Debug <<
" " << ires <<
": " << F(7,5,residue_weights[ires]) << std::endl;
566 ires = coverage_end + shift;
567 if (ires >= 1 && ires <= (
int)num_residues_nonvirt) {
568 residue_weights[ires] = 1.;
569 TR.Debug <<
" " << ires <<
": " << F(7,5,residue_weights[ires]) << std::endl;
574 return residue_weights;
578 std::set<core::Size>::iterator iter;
580 std::set< core::Size > unique;
581 for (
core::Size i = 1; i<=jump_anchors.size();++i) unique.insert(jump_anchors[i]);
582 jump_anchors.clear();
585 for (iter = unique.begin(); iter != unique.end(); ++iter) {
586 if (strand_pair_residues.count(*iter))
continue;
587 jump_anchors.push_back(*iter);
593 using namespace ObjexxFCL::fmt;
599 TR.Debug <<
"1mer fragment insertion positions and weights:" << std::endl;
605 for (
core::Size i = 1; i<=jump_anchors.size(); ++i) {
606 core::Size anchor_gap = jump_anchors[i]-last_anchor-1;
607 if (anchor_gap && anchor_gap < min_small_frag_len) {
608 for (
core::Size ipos = last_anchor+1;ipos<jump_anchors[i];++ipos) {
609 residue_weights_new[ipos] = residue_weights[ipos];
610 TR.Debug <<
" " << ipos <<
": " << F(7,5,residue_weights[ipos]) << std::endl;
613 last_anchor = jump_anchors[i];
615 core::Size anchor_gap = num_residues_nonvirt-last_anchor;
616 if (anchor_gap && anchor_gap < min_small_frag_len) {
617 for (
core::Size ipos = last_anchor+1;ipos<=num_residues_nonvirt;++ipos) {
618 residue_weights_new[ipos] = residue_weights[ipos];
619 TR.Debug <<
" " << ipos <<
": " << F(7,5,residue_weights[ipos]) << std::endl;
622 return residue_weights_new;
626 using namespace ObjexxFCL::fmt;
632 TR.Debug <<
"Small fragment insertion positions and weights:" << std::endl;
638 for (
core::Size i = 1; i<=jump_anchors.size(); ++i) {
639 core::Size anchor_gap = jump_anchors[i]-last_anchor-1;
640 if (anchor_gap && anchor_gap < min_big_frag_len) {
641 for (
core::Size ipos = last_anchor+1;ipos<jump_anchors[i];++ipos) {
642 residue_weights_new[ipos] = residue_weights[ipos];
643 TR.Debug <<
" " << ipos <<
": " << F(7,5,residue_weights[ipos]) << std::endl;
646 last_anchor = jump_anchors[i];
648 core::Size anchor_gap = num_residues_nonvirt-last_anchor;
649 if (anchor_gap && anchor_gap < min_big_frag_len) {
650 for (
core::Size ipos = last_anchor+1;ipos<=num_residues_nonvirt;++ipos) {
651 residue_weights_new[ipos] = residue_weights[ipos];
652 TR.Debug <<
" " << ipos <<
": " << F(7,5,residue_weights[ipos]) << std::endl;
655 return residue_weights_new;
696 score1->set_energy_method_options(score1_options);
717 score2->set_energy_method_options(score2_options);
737 score5->set_energy_method_options(score5_options);
774 utility_exit_with_message(
"not able to get jump sample in HybridizeProtocol::add_strand_pairings()" );
780 movemap->set_bb(
true );
781 movemap->set_jump(
true );
788 core::Size jumpres1 = jumps(1,i), jumpres2 = jumps(2,i);
790 if (!pairing.
Pos1() || !pairing.
Pos2())
791 utility_exit_with_message(
"not able to get pairing " + ObjexxFCL::string_of(jumpres1) +
" " +
792 ObjexxFCL::string_of(jumpres2) +
" from jump sample in HybridizeProtocol::add_strand_pairings()" );
793 pairings_to_add.push_back( pairing );
798 if (renumbered_template_chunks.
has(jumpres1) && renumbered_template_chunks.
has(jumpres2)) {
801 TR <<
"WARNING! template " << itempl <<
" is missing pairing: " << pairing << std::endl;
804 TR <<
"template " << itempl <<
" has pairing: " << pairing << std::endl;
816 for (
core::Size i = 1; i <= pairings_to_add.size(); ++i )
832 m.
apply(*pairing_pose);
834 jump_mover->apply_at_all_positions( *pairing_pose );
835 ObjexxFCL::FArray2D_int jumps( 2, 1 );
838 ObjexxFCL::FArray1D_int cuts(1);
842 TR <<
"WARNING! tree_from_jumps_and_cuts failed for pairing " << pairing <<
" so skipping it." << std::endl;
846 pairing_positions.push_back(pairing.
Pos1());
847 pairing_positions.push_back(pairing.
Pos2());
852 pdb_numbering.push_back(pairing.
Pos1());
853 pdb_numbering.push_back(pairing.
Pos2());
855 pdb_info->set_numbering( pdb_numbering );
856 pdb_info->set_chains(
' ' );
857 pdb_info->obsolete(
false );
858 trimmed_pairing_pose->set_secstruct( 1,
'E' );
859 trimmed_pairing_pose->set_secstruct( 2,
'E' );
862 trimmed_pairing_pose->pdb_info( pdb_info );
874 TR <<
"Templates have been filtered so added first residue of pairing " << pairing <<
" as initial template " <<
template_poses_.size() << std::endl;
881 TR <<
"Added pairing " << pairing <<
" as template " <<
template_poses_.size() << std::endl;
886 using namespace core::kinematics;
890 atom_names.push_back(
"CA");
891 atom_names.push_back(
"N");
892 atom_names.push_back(
"C");
893 atom_names.push_back(
"O");
894 std::set<core::Size>::iterator pairings_iter;
898 if (!it->is_jump() || it->start() == fold_tree.root())
continue;
911 if (template_resi && template_resj) {
913 for (
core::Size i = 1; i<=atom_names.size();++i) {
916 atom_map[ id1i ] = id2i;
919 atom_map[ id1j ] = id2j;
921 TR <<
"Superimpose strand pair " << *pairings_iter <<
" (" << resi_pdb <<
" " << resj_pdb <<
") at " << resi_pdb <<
" and " << resj_pdb <<
" to initial template " << initial_template_index_ << std::endl;
922 }
else if (template_resi) {
924 for (
core::Size i = 1; i<=atom_names.size();++i) {
927 atom_map[ id1i ] = id2i;
929 TR <<
"Superimpose strand pair " << *pairings_iter <<
" at " << resi_pdb <<
" to initial template " << initial_template_index_ << std::endl;
930 }
else if (template_resj) {
932 for (
core::Size i = 1; i<=atom_names.size();++i) {
935 atom_map[ id1j ] = id2j;
937 TR <<
"Superimpose strand pair " << *pairings_iter <<
" at " << resj_pdb <<
" to initial template " << initial_template_index_ << std::endl;
939 if (template_resi || template_resj) {
941 TR <<
"rms: " << ObjexxFCL::fmt::F(8,3,rms) << std::endl;
946 bool do_continue =
false;
948 if (*it == *iti || !iti->is_jump() || iti->start() == fold_tree.root() || iti->stop() != it->start())
continue;
949 std::set<core::Size>::iterator pairings_iteri;
959 for (
core::Size j = 1; j<=atom_names.size();++j) {
962 atom_map[ id1i ] = id2i;
964 TR <<
"Superimpose strand pair " << *pairings_iter <<
" at " << it->start() <<
" to pair " << *pairings_iteri << std::endl;
966 TR <<
"rms: " << ObjexxFCL::fmt::F(8,3,rms) << std::endl;
972 if (do_continue)
continue;
978 candidate_templates.push_back(i);
980 if (candidate_templates.size()) {
982 std::random_shuffle ( candidate_templates.begin(), candidate_templates.end() );
983 for (it=candidate_templates.begin(); it!=candidate_templates.end(); ++it) {
986 if (template_resi && template_resj) {
988 for (
core::Size i = 1; i<=atom_names.size();++i) {
991 atom_map[ id1i ] = id2i;
994 atom_map[ id1j ] = id2j;
996 }
else if (template_resi) {
998 for (
core::Size i = 1; i<=atom_names.size();++i) {
1001 atom_map[ id1i ] = id2i;
1003 }
else if (template_resj) {
1005 for (
core::Size i = 1; i<=atom_names.size();++i) {
1008 atom_map[ id1j ] = id2j;
1011 if (template_resi || template_resj) {
1012 TR <<
"Superimpose strand pair " << *pairings_iter <<
" to random template " << *it << std::endl;
1014 TR <<
"rms: " << ObjexxFCL::fmt::F(8,3,rms) << std::endl;
1020 if (do_continue)
continue;
1021 TR <<
"Cannot superimpose strand pairing " << *pairings_iter <<
" to a template so treating it as a floating pair" << std::endl;
1040 if (templates_to_remove.size() == 0)
return;
1047 if (templates_to_remove.count(i)) {
1050 TR <<
"filter_templates: removing initial template: " << i << std::endl;
1052 TR <<
"filter_templates: removing template: " << i << std::endl;
1061 if (!template_poses_filtered.size())
1062 TR <<
"Warning! all templates were removed." << std::endl;
1073 movemap->set_bb(
true );
1074 movemap->set_jump(
true );
1076 jump_mover->type(
"JumpMoves" );
1077 jump_mover->set_check_ss(
false );
1078 jump_mover->enable_end_bias_check(
false );
1083 std::set<core::Size> strand_pair_residues;
1088 return strand_pair_residues;
1108 void reset() { ct_ = 0; bInit_ =
false; residue_selection_big_frags_.clear(); residue_selection_small_frags_.clear(); }
1115 residue_selection_big_frags_ = residue_selection;
1118 residue_selection_small_frags_ = residue_selection;
1135 TR.Trace <<
"hConvergenceCheck residue_selection_small_frags size: " << residue_selection_small_frags_.size() << std::endl;
1136 TR.Trace <<
"hConvergenceCheck residue_selection_big_frags size: " << residue_selection_big_frags_.size() << std::endl;
1137 very_old_pose_ = pose;
1140 runtime_assert( trials_ );
1141 TR.Trace <<
"TrialCounter in hConvergenceCheck: " << trials_->num_accepts() << std::endl;
1142 if ( numeric::mod(trials_->num_accepts(),200) != 0 )
return true;
1143 if ( (
Size) trials_->num_accepts() <= last_move_ )
return true;
1144 last_move_ = trials_->num_accepts();
1145 core::Real converge_rms_small = (residue_selection_small_frags_.size()) ?
1147 core::Real converge_rms_big = (residue_selection_big_frags_.size()) ?
1149 very_old_pose_ = pose;
1150 if ( converge_rms_big >= 3.0 || converge_rms_small >= 1.5 || (!converge_rms_small && !converge_rms_big)) {
1151 TR.Trace <<
"hConvergenceCheck continue, converge_rms_big: " << converge_rms_big <<
" converge_rms_small: " << converge_rms_small << std::endl;
1155 TR.Info <<
"stop cycles due to convergence, converge_rms_big: " << converge_rms_big <<
" converge_rms_small: " << converge_rms_small << std::endl;
1185 bool use_random_template =
false;
1188 initialize_chunk_mover.
apply(pose);
1190 if (has_strand_pairings) {
1193 jump_mover->apply_at_all_positions( pose );
1198 initialize_chunk_mover.
apply(pose);
1204 use_random_template =
true;
1248 if ( total_frag_insertion_weight < 1. ) {
1249 random_chunk_and_frag_mover->add_mover(random_sample_chunk_mover, 1.-total_frag_insertion_weight);
1250 random_chunk_and_small_frag_mover->add_mover(random_sample_chunk_mover, 1.-total_frag_insertion_weight);
1251 random_chunk_and_small_frag_smooth_mover->add_mover(random_sample_chunk_mover, 1.-total_frag_insertion_weight);
1253 bool do_frag_inserts =
false;
1254 if ( total_frag_insertion_weight > 0. ) {
1256 for (
Size ires=1; ires<= residue_weights.size(); ++ires ) sum_weight += residue_weights[ires];
1257 if (sum_weight > 1e-6) do_frag_inserts =
true;
1259 if (do_frag_inserts) {
1264 if (frag_1mer_insertion_weight_ > 0.) {
1265 if (has_strand_pairings) {
1266 core::Real jump_insertion_weight = frag_1mer_insertion_weight_*jump_move_fraction;
1267 random_chunk_and_frag_mover->add_mover(frag_1mer_mover, frag_1mer_insertion_weight_-jump_insertion_weight);
1270 random_chunk_and_frag_mover->add_mover(jump_mover, jump_insertion_weight);
1272 random_chunk_and_frag_mover->add_mover(frag_1mer_mover, frag_1mer_insertion_weight_);
1278 if (has_strand_pairings) {
1283 random_chunk_and_frag_mover->add_mover(jump_mover, jump_insertion_weight);
1291 if (has_strand_pairings) {
1296 random_chunk_and_frag_mover->add_mover(jump_mover, jump_insertion_weight);
1304 if (has_strand_pairings) {
1310 random_chunk_and_small_frag_mover->add_mover(jump_mover, jump_insertion_weight);
1311 random_chunk_and_small_frag_smooth_mover->add_mover(jump_mover, jump_insertion_weight);
1319 if (frag_1mer_insertion_weight_ > 0.) {
1320 if (has_strand_pairings) {
1321 core::Real jump_insertion_weight = frag_1mer_insertion_weight_*jump_move_fraction;
1322 random_chunk_and_small_frag_mover->add_mover(frag_1mer_mover, frag_1mer_insertion_weight_-jump_insertion_weight);
1323 random_chunk_and_small_frag_smooth_mover->add_mover(frag_1mer_mover, frag_1mer_insertion_weight_-jump_insertion_weight);
1326 random_chunk_and_small_frag_mover->add_mover(jump_mover, jump_insertion_weight);
1327 random_chunk_and_small_frag_smooth_mover->add_mover(jump_mover, jump_insertion_weight);
1329 random_chunk_and_small_frag_mover->add_mover(frag_1mer_mover, frag_1mer_insertion_weight_);
1330 random_chunk_and_small_frag_smooth_mover->add_mover(frag_1mer_mover, frag_1mer_insertion_weight_);
1348 if (do_frag_inserts) {
1349 TR.Info <<
"\n===================================================================\n";
1350 TR.Info <<
" Stage 1 \n";
1351 TR.Info <<
" Folding with score0 for max of " << stage1_max_cycles << std::endl;
1352 using namespace ObjexxFCL::fmt;
1355 mc1->set_autotemp(
false, temp );
1357 bool all_res_changed =
false;
1358 for (
core::Size i=1; i<=stage1_max_cycles; ++i) {
1359 random_chunk_and_frag_mover->apply(pose);
1361 mc1->boltzmann(pose,
"RandomMover");
1363 TR.Info <<
"Stage 1: Replaced extended chains after " << i <<
" cycles." << std::endl;
1364 all_res_changed =
true;
1368 if (!all_res_changed) {
1369 TR.Warning <<
"Stage 1: Warning: extended chain may still remain after " << stage1_max_cycles <<
" cycles!" << std::endl;
1373 mc1->show_counters();
1374 mc1->recover_low(pose);
1384 TR <<
"GDTMM_after_stage1_1" << ObjexxFCL::fmt::F(8,3,gdtmm) << std::endl;
1392 TR.Info <<
"\n===================================================================\n";
1393 TR.Info <<
" Stage 2 \n";
1394 TR.Info <<
" Folding with score1 for " << stage2_max_cycles << std::endl;
1397 Real const setting( 0.25 / 3 * option[ jumps::increase_chainbreak ] );
1402 mc2->set_autotemp(
true, temp );
1403 mc2->set_temperature( temp );
1411 mc2->show_counters();
1412 mc2->recover_low(pose);
1421 TR <<
"GDTMM_after_stage1_2" << ObjexxFCL::fmt::F(8,3,gdtmm) << std::endl;
1430 TR.Info <<
"\n===================================================================\n";
1431 TR.Info <<
" Stage 3 \n";
1432 TR.Info <<
" Folding with score2 and score5 for " << stage3_max_cycles <<std::endl;
1433 hConvergenceCheckOP convergence_checker ( NULL );
1434 if ( !option[ abinitio::skip_convergence_check ] ) {
1436 std::list< core::Size > residue_selection_big_frags;
1437 std::list< core::Size > residue_selection_small_frags;
1438 for (
core::Size i = 1; i<=residue_weights.size(); ++i) {
1439 if ( residue_weights[i] > 0.0 &&
1441 pose.
residue(i).
has(
"CA") ) residue_selection_big_frags.push_back(i);
1443 for (
core::Size i = 1; i<=residue_weights_small_frags.size(); ++i) {
1444 if ( residue_weights_small_frags[i] > 0.0 &&
1446 pose.
residue(i).
has(
"CA") ) residue_selection_small_frags.push_back(i);
1448 convergence_checker->set_residue_selection_big_frags(residue_selection_big_frags);
1449 convergence_checker->set_residue_selection_small_frags(residue_selection_small_frags);
1452 for (
int nmacro=1; nmacro<=10; ++nmacro) {
1455 Real chbrk_weight_stage_3a = 0;
1456 Real chbrk_weight_stage_3b = 0;
1457 Real progress( 1.0* nmacro/10 );
1458 Real const fact( progress * 1.0/3 * option[ jumps::increase_chainbreak ]);
1459 chbrk_weight_stage_3a = 2.5 * fact;
1460 chbrk_weight_stage_3b = 0.5 * fact;
1470 if ( numeric::mod( nmacro, 2 ) != 0 || nmacro > 6 ) {
1471 TR.Info <<
"Stage 3 select score2..." << std::endl;
1472 mc3->recover_low(pose);
1473 mc3->score_function( *score2 );
1474 mc3->set_autotemp(
true, temp );
1475 mc3->set_temperature( temp );
1479 TR.Info <<
"Stage 3 select score5..." << std::endl;
1480 mc3->recover_low(pose);
1481 mc3->score_function( *score5 );
1482 mc3->set_autotemp(
true, temp );
1483 mc3->set_temperature( temp );
1488 TR.Info <<
"Stage 3 loop iteration " << nmacro << std::endl;
1489 if ( convergence_checker ) {
1490 convergence_checker->set_trials( stage3_trials );
1495 TR.Debug <<
"finished" << std::endl;
1497 mc3->show_counters();
1498 mc3->recover_low(pose);
1507 TR <<
"GDTMM_after_stage1_3" << ObjexxFCL::fmt::F(8,3,gdtmm) << std::endl;
1514 TR.Info <<
"\n===================================================================\n";
1515 TR.Info <<
" Stage 4 \n";
1516 TR.Info <<
" Folding with score3 for " << stage4_max_cycles <<std::endl;
1517 for (
int nmacro=1; nmacro<=3; ++nmacro) {
1520 Real progress( 1.0* nmacro/3 );
1521 Real const setting( ( 1.5*progress+2.5 ) * ( 1.0/3) * option[ jumps::increase_chainbreak ]);
1530 mc4->set_autotemp(
true, temp );
1531 mc4->set_temperature( temp );
1535 if ( nmacro == 1 ) {
1536 TR.Info <<
"Stage 4 loop iteration " << nmacro <<
": small fragments trials" << std::endl;
1537 stage4_trials =
new moves::TrialMover( random_chunk_and_small_frag_mover, mc4 );
1539 TR.Info <<
"Stage 4 loop iteration " << nmacro <<
": small fragments smooth trials" << std::endl;
1540 stage4_trials =
new moves::TrialMover(random_chunk_and_small_frag_smooth_mover, mc4);
1543 TR.Debug <<
"finished" << std::endl;
1545 mc4->show_counters();
1546 mc4->recover_low(pose);
1555 TR <<
"GDTMM_after_stage1_4" << ObjexxFCL::fmt::F(8,3,gdtmm) << std::endl;
1562 using namespace ObjexxFCL::fmt;
1563 TR.Debug <<
"Chunk trial counter:" << I(4,ires) << I(8, random_sample_chunk_mover->trial_counter(ires)) << std::endl;
1572 using namespace ObjexxFCL::fmt;
1574 core::Size frag_1mer_n_frags = frag_1mer_trial_mover->get_nr_frags();
1576 core::Size small_n_frags = small_frag_trial_mover->get_nr_frags();
1578 core::Size big_n_frags = big_frag_trial_mover->get_nr_frags();
1585 core::Size frag_1mer_pos_coverage = frag_1mer_trial_mover->get_total_frames()*frag_1mer_n_frags;
1586 core::Size small_frag_pos_coverage = small_frag_trial_mover->get_total_frames()*small_n_frags;
1587 core::Size big_frag_pos_coverage = big_frag_trial_mover->get_total_frames()*big_n_frags;
1588 core::Real sum = (
core::Real)(frag_1mer_pos_coverage+small_frag_pos_coverage+big_frag_pos_coverage+template_pos_coverage);
1592 TR.Info <<
"auto_frag_insertion_weight for 1mer fragments: " << F(7,5,
frag_1mer_insertion_weight_) <<
" " << frag_1mer_pos_coverage << std::endl;
1593 TR.Info <<
"auto_frag_insertion_weight for small fragments: " << F(7,5,
small_frag_insertion_weight_) <<
" " << small_frag_pos_coverage << std::endl;
1594 TR.Info <<
"auto_frag_insertion_weight for big fragments: " << F(7,5,
big_frag_insertion_weight_) <<
" " << big_frag_pos_coverage << std::endl;
1595 TR.Info <<
"auto_frag_insertion_weight for template chunks: " <<
1601 return "FoldTreeHybridize";