Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DockingPrepackProtocol.cc
Go to the documentation of this file.
1 // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;
2 // rm-trailing-spaces:t -*-
3 // vi: set ts=2 noet:
4 //
5 // (c) Copyright Rosetta Commons Member Institutions.
6 // (c) This file is part of the Rosetta software suite and is made available
7 // under license.
8 // (c) The Rosetta software is developed by the contributing members of the
9 // Rosetta Commons.
10 // (c) For more information, see http://www.rosettacommons.org.
11 // Questions about this can be
12 // (c) addressed to University of Washington UW TechTransfer,
13 // email: license@u.washington.edu.
14 
15 /// @file DockingPrepackProtocol.cc
16 /// @brief Prepacking of the bound sturcture before docking.
17 /// @author Robin A Thottungal (raugust1@jhu.edu)
18 
19 // Unit Headers
21 
22 // Package headers
27 
28 // Project headers
30 // AUTO-REMOVED #include <core/pack/task/PackerTask.hh>
32 
35 
40 
41 #include <basic/options/option.hh>
42 #include <basic/options/keys/docking.OptionKeys.gen.hh>
43 
44 // Utility Headers
45 #include <basic/Tracer.hh>
46 
47 // AUTO-REMOVED #include <core/pack/task/operation/TaskOperation.hh>
48 
49 #include <protocols/jd2/Job.hh>
50 #include <utility/vector0.hh>
51 #include <utility/vector1.hh>
52 
53 
54 using basic::T;
55 using namespace protocols::docking;
56 using namespace protocols::moves;
57 using namespace core;
58 using namespace pack::task;
60 
61 static basic::Tracer TR("protocols.docking.DockingPrepackProtocol");
62 
63 namespace protocols{
64 namespace docking{
65 
67 {
68  Mover::type( "DockingPrepackProtocol" );
72 }
73 
74 
76 {
77  trans_magnitude_ = 1000.0;
79  dock_ppk_ = false;
80 }
81 
83 }
84 
86 {
87  using namespace basic::options;
88  if( option[ OptionKeys::docking::dock_rtmin ].user() )
89  set_rt_min(option[ OptionKeys::docking::dock_rtmin ]());
90 
91  if( option[ OptionKeys::docking::sc_min ].user() )
92  set_sc_min(option[ OptionKeys::docking::sc_min ]());
93 
94  if( option[ OptionKeys::docking::partners ].user() )
95  set_partners(option[ OptionKeys::docking::partners ]());
96 
97  if( option[ OptionKeys::docking::dock_ppk ].user() )
98  set_dock_ppk(option[ OptionKeys::docking::dock_ppk ]());
99 }
100 
102 {
103  dock_ppk_ = dock_ppk;
104 }
105 
107 {
108  using namespace basic::options;
109 
110  option.add_relevant( OptionKeys::docking::dock_rtmin );
111  option.add_relevant( OptionKeys::docking::sc_min );
112  option.add_relevant( OptionKeys::docking::partners );
113 }
114 
116  core::pose::Pose & pose )
117 {
118  // Creating a job compatible with JD2
120  //job_ = jd2::JobDistributor::get_instance()->current_job();
121  core::Real score_pose = ( *scorefxn() )( pose ); // scoring the pose
122  // Getting the name of current job
123  std::string job_name (JobDistributor::get_instance()->job_outputter()->output_name( job ) );
124  job->add_string_real_pair("E"+outfilename, score_pose);
125  JobDistributor::get_instance()->job_outputter()->other_pose( job, pose, outfilename+"_");
126 
127 }
128 
130 {
132  prepack_full_repack_->score_function( scorefxn_pack() );
133  prepack_full_repack_->task_factory( task_factory() );
135 
136  if ( rt_min() ){
138  rtmin_mover_->score_function( scorefxn_pack() );
139  rtmin_mover_->task_factory( task_factory() );
140  pack_operations_->add_mover(rtmin_mover_);
141  }
142  if ( sc_min() ){
144  scmin_mover_->set_scorefxn( scorefxn_pack() );
145  scmin_mover_->set_task_factory( task_factory() );
146  pack_operations_->add_mover( scmin_mover_ );
147  }
148 
149 }
150 
152  // Robin Notes!!!!!!!!!!!!!!!!!!!!!!!!!!
153  // setup_foldtree asserts movable jumps to be atleast 1
154  // I am not sure how the partner flag & movable_jumps communicate
155  // What if the the partner flag is A_B_C and movable jumps is 1
156  /// May need to write a method to change the number of movable
157  // jumps based on the partner flag!!!!
158  // Possible breaking of code, needs to get changed later
160  tf2()->set_prepack_only(true);
161  tf2()->create_and_attach_task_factory( this, pose );
163 }
164 
166 {
167  finalize_setup(pose);
168 
169  score_and_output("initial",pose);
170 
171  //Move each partners away from the others
172  for( DockJumps::const_iterator jump = movable_jumps().begin() ; jump != movable_jumps().end() ; ++jump ) {
173  rigid::RigidBodyTransMoverOP translate_away( new rigid::RigidBodyTransMover(pose, *jump) );
174  translate_away->step_size( trans_magnitude_ );
175  translate_away->apply(pose);
176  }
177  score_and_output("away",pose);
178 
179  // packing the unbound structures
180  pack_operations_->apply( pose );
181  score_and_output("away_packed",pose);
182 
183  //bringing the packed structures together
184  for( DockJumps::const_iterator jump= movable_jumps().begin() ; jump != movable_jumps().end(); ++jump ) {
185  //rigid::RigidBodyTransMoverOP translate_back ( new rigid::RigidBodyTransMover(pose, *jump) );
186  //translate_back->step_size( trans_magnitude_ );
187  //translate_back->trans_axis().negate();
188  //translate_back->apply(pose);
191  }
192 
193  if (dock_ppk_){
194  pack_operations_->apply( pose );
195  }
196  score_and_output("prepack",pose);
197 }
198 
200  return "DockingPrepackProtocol";
201 }
202 
203 }
204 }