Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PackRotamersMoverLazy.cc
Go to the documentation of this file.
1 /// @file
2 /// @brief
3 /// @author Hetu Kamisetty
4 
5 // Unit headers
9 
10 // AUTO-REMOVED #include <protocols/moves/DataMap.hh>
11 // AUTO-REMOVED #include <protocols/rosetta_scripts/util.hh>
12 
13 // AUTO-REMOVED #include <core/pack/interaction_graph/InteractionGraphBase.hh>
14 // AUTO-REMOVED #include <core/pack/pack_rotamers.hh>
15 // AUTO-REMOVED #include <core/pack/rotamer_set/RotamerSets.hh>
17 // AUTO-REMOVED #include <core/pack/task/TaskFactory.hh>
18 // AUTO-REMOVED #include <core/pack/task/operation/TaskOperation.hh>
19 #include <core/pose/Pose.hh>
20 // AUTO-REMOVED #include <core/pose/PDBInfo.hh>
22 // AUTO-REMOVED #include <core/scoring/ScoreFunctionFactory.hh>
23 // AUTO-REMOVED #include <basic/options/option.hh>
24 #include <basic/Tracer.hh>
25 
26 // Utility Headers
27 #include <utility/exit.hh>
28 #include <utility/tag/Tag.hh>
29 // AUTO-REMOVED #include <utility/string_util.hh> // string_split
30 
31 // option key includes
32 // AUTO-REMOVED #include <basic/options/keys/packing.OptionKeys.gen.hh>
33 
35 #include <utility/vector0.hh>
36 #include <utility/vector1.hh>
37 #include <basic/options/keys/OptionKeys.hh>
38 
39 
40 namespace protocols {
41 namespace simple_moves {
42 
43 using namespace core;
44 using namespace basic::options;
45 using namespace pack;
46 using namespace task;
47 using namespace operation;
48 using namespace scoring;
49 
50 using basic::Warning;
51 using basic::t_warning;
52 static basic::Tracer TR("protocols.simple_moves.PackRotamersMoverLazy");
53 
55  ScoreFunctionCOP scorefxn,
56  PackerTaskCOP task,
57  core::Size nloop
58  ) : protocols::simple_moves::PackRotamersMover(scorefxn,task,nloop)
59 {}
60 
61 PackRotamersMoverLazy::PackRotamersMoverLazy() : protocols::simple_moves::PackRotamersMover("PackRotamersMoverLazy")
62 {}
63 
65 
66 void
68  TagPtr const tag,
69  protocols::moves::DataMap & datamap,
70  Filters_map const & filters,
71  protocols::moves::Movers_map const & movers,
72  Pose const & pose
73 )
74 {
75  if ( tag->getName() != "PackRotamersMoverLazy" ) {
76  TR(t_warning) << " received incompatible Tag " << tag << std::endl;
77  assert(false);
78  return;
79  }
80  if ( tag->hasOption("nloop") ) {
81  nloop(tag->getOption<Size>("nloop",1));
82  runtime_assert( nloop() > 0 );
83  }
84  parse_score_function( tag, datamap, filters, movers, pose );
85  parse_task_operations( tag, datamap, filters, movers, pose );
86 }
87 
88 /// PackRotamersMoverLazy
89 
90 
93 {
94  return "PackRotamersMoverLazy";
95 }
96 
97 void
99 {
100  this->setup(pose);//to bypass the protected status of setup()
101 }
102 void
104 {
105  //assume setup has been called once.
106 
107  core::PackerEnergy best_energy(0.);
108  Pose best_pose;
109  best_pose = pose;
110  for ( Size run(1); run <= nloop(); ++run ) {
111  // run SimAnnealer
112  core::PackerEnergy packer_energy( this->run( pose, rot_to_pack) );
113 // Real const score( scorefxn_( pose ) ); another option for deciding which is the 'best' result
114  if ( run == 1 || packer_energy < best_energy ) {
115  best_pose = pose;
116  best_energy = packer_energy;
117  }
118  }
119  if ( nloop() > 1 ) pose = best_pose;
120 
122  (*scorefxn_)(pose);
123 }
124 /*
125 core::PackerEnergy PackRotamersMoverLazy::run_with_ig( Pose & pose, utility::vector0< int > rot_to_pack, InteractionGraphBaseOP ig) const
126 {
127  return pack_rotamers_run( pose, task(), rotamer_sets(), ig, rot_to_pack );
128 }
129 */
130 
131 }//moves
132 }//protocols