46 #include <basic/prof.hh>
47 #include <basic/Tracer.hh>
48 #include <ObjexxFCL/format.hh>
52 #include <basic/options/keys/packing.OptionKeys.gen.hh>
55 #include <utility/vector0.hh>
56 #include <utility/vector1.hh>
61 using namespace ObjexxFCL;
69 static basic::Tracer
tt(
"core.pack.pack_rotamers",basic::t_info );
80 using namespace interaction_graph;
81 using namespace rotamer_set;
89 PROF_START( basic::PACK_ROTAMERS );
103 PROF_STOP ( basic::PACK_ROTAMERS );
147 using namespace ObjexxFCL::fmt;
148 using namespace interaction_graph;
149 using namespace rotamer_set;
157 Real best_bestenergy( 0.0 );
165 Real const final_score( scfxn( pose ) );
169 if ( task->design_residue(i) ) final_seq+= pose.
residue(i).
name1();
171 if ( final_seq.size() == 0 ) final_seq =
"-";
173 tt <<
"packloop: " << I(4,
run) <<
" rescore-deltaE: " << F(9,3,final_score - bestenergy ) <<
174 " seq: " << final_seq <<
" simannealerE: " << bestenergy <<
" rescoreE: " << final_score << std::endl;
176 results.push_back( std::make_pair( final_score, pose.
sequence() ) );
177 pose_list.push_back(
new pose::Pose( pose ) );
178 if (
run == 1 || bestenergy < best_bestenergy ) {
180 best_bestenergy = bestenergy;
197 using namespace interaction_graph;
203 scfxn.
setup_for_packing( pose, task->repacking_residues(), task->designing_residues() );
207 rotsets->set_task( task );
209 rotsets->build_rotamers( pose, scfxn, packer_neighbor_graph );
210 rotsets->prepare_sets_for_packing( pose, scfxn );
212 if ( basic::options::option[ basic::options::OptionKeys::packing::dump_rotamer_sets ] ) {
213 static int counter(0);
216 tt <<
"dump rotsets: " << filename << std::endl;
217 rotsets->dump_pdb( pose, filename );
220 ig = InteractionGraphFactory::create_interaction_graph( *task, *rotsets, pose, scfxn );
222 tt <<
"built " << rotsets->nrotamers() <<
" rotamers at "
223 << rotsets->nmoltenres() <<
" positions." << std::endl;
229 PROF_START( basic::GET_ENERGIES );
230 rotsets->compute_energies( pose, scfxn, packer_neighbor_graph, ig );
231 PROF_STOP( basic::GET_ENERGIES );
233 tt <<
"IG: " << ig->getTotalMemoryUsage() <<
" bytes" << std::endl;
249 if( edge_reweights ){
251 for(
Size ii = 1; ii<= rotsets->nmoltenres(); ++ii){
252 Size const res1id = rotsets->moltenres_2_resid( ii );
254 for( ig->reset_edge_list_iterator_for_node( ii ); !ig->edge_list_iterator_at_end(); ig->increment_edge_list_iterator() ){
258 if ( other_node < ii )
continue;
259 Size const res2id = rotsets->moltenres_2_resid( other_node );
260 ig->set_edge_weight( ii, other_node, edge_reweights->res_res_weight( pose, *task, res1id, res2id ) );
281 using namespace ObjexxFCL::fmt;
286 pack_rotamers_run( pose, task, rotsets, ig, rot_to_pack, bestrotamer_at_seqpos, bestenergy );
289 for (
uint ii = 1; ii <= rotsets->nmoltenres(); ++ii ) {
290 uint iiresid = rotsets->moltenres_2_resid( ii );
291 uint iibestrot = rotsets->rotid_on_moltenresidue( bestrotamer_at_seqpos( iiresid ) );
315 ObjexxFCL::FArray1D_int & bestrotamer_at_seqpos,
319 using namespace annealer;
321 bool start_with_current =
false;
323 bool calc_rot_freq =
false;
324 FArray1D< core::PackerEnergy > rot_freq( ig->get_num_total_states(), 0.0 );
335 task, rot_to_pack, bestrotamer_at_seqpos, bestenergy, start_with_current, ig,
336 rotsets, current_rot_index, calc_rot_freq, rot_freq );
340 if ( task->low_temp() > 0.0 ) annealer->set_lowtemp( task->low_temp() );
341 if ( task->high_temp() > 0.0 ) annealer->set_hightemp( task->high_temp() );
342 annealer->set_disallow_quench( task->disallow_quench() );
344 PROF_START( basic::SIMANNEALING );
346 PROF_STOP( basic::SIMANNEALING );
356 using namespace interaction_graph;
357 using namespace rotamer_set;
358 PROF_START( basic::PACK_ROTAMERS );
374 PROF_STOP ( basic::PACK_ROTAMERS );
386 using namespace interaction_graph;
391 scfxn.
setup_for_packing( pose, task->repacking_residues(), task->designing_residues() );
396 rotsets->set_task( task );
397 rotsets->build_rotamers( pose, scfxn, packer_neighbor_graph );
398 rotsets->prepare_sets_for_packing( pose, scfxn );
400 if ( basic::options::option[ basic::options::OptionKeys::packing::dump_rotamer_sets ] ) {
401 static int counter(0);
404 tt <<
"dump rotsets: " << filename << std::endl;
405 rotsets->dump_pdb( pose, filename );
408 ig = InteractionGraphFactory::create_interaction_graph( *task, *rotsets, pose, scfxn );
410 tt <<
"built " << rotsets->nrotamers() <<
" rotamers at "
411 << rotsets->nmoltenres() <<
" positions." << std::endl;
417 PROF_START( basic::GET_ENERGIES );
418 rotsets->compute_energies( pose, scfxn, packer_neighbor_graph, ig );
419 PROF_STOP( basic::GET_ENERGIES );
421 tt <<
"IG: " << ig->getTotalMemoryUsage() <<
" bytes" << std::endl;
436 using namespace ObjexxFCL::fmt;
437 using namespace annealer;
446 dynamic_cast<SymmetricConformation const &> ( pose.
conformation()) );
454 bool start_with_current =
false;
456 bool calc_rot_freq =
false;
457 FArray1D< core::PackerEnergy > rot_freq( ig->get_num_total_states(), 0.0 );
460 task, rot_to_pack, bestrotamer_at_seqpos, bestenergy, start_with_current, ig,
461 rotsets, current_rot_index, calc_rot_freq, rot_freq );
469 if ( task->low_temp() > 0.0 ) annealer->set_lowtemp( task->low_temp() );
470 if ( task->high_temp() > 0.0 ) annealer->set_hightemp( task->high_temp() );
471 annealer->set_disallow_quench( task->disallow_quench() );
473 PROF_START( basic::SIMANNEALING );
475 PROF_STOP( basic::SIMANNEALING );
478 for (
uint ii = 1; ii <= rotsets->nmoltenres(); ++ii ) {
479 uint iiresid = rotsets->moltenres_2_resid( ii );
480 uint iibestrot = rotsets->rotid_on_moltenresidue( bestrotamer_at_seqpos( iiresid ) );