27 #include <utility/exit.hh>
28 #include <utility/string_util.hh>
29 #include <basic/Tracer.hh>
31 #include <utility/tag/Tag.hh>
34 #include <utility/vector0.hh>
35 #include <utility/vector1.hh>
36 #include <numeric/xyzVector.io.hh>
38 #include <boost/foreach.hpp>
39 #define foreach BOOST_FOREACH
42 #include <utility/excn/Exceptions.hh>
49 namespace ligand_docking {
51 static basic::Tracer
translate_tracer(
"protocols.ligand_docking.ligand_options.translate", basic::t_debug);
75 chain_ids_to_exclude_(),
82 translate_info_(translate_info),
83 chain_ids_to_exclude_(),
89 protocols::moves::Mover( that ),
90 translate_info_(that.translate_info_),
91 chain_ids_to_exclude_(that.chain_ids_to_exclude_),
92 tag_along_jumps_(that.tag_along_jumps_)
119 if ( tag->getName() !=
"Translate" ){
120 throw utility::excn::EXCN_RosettaScriptsOption(
"This should be impossible");
122 if ( ! tag->hasOption(
"chain") )
throw utility::excn::EXCN_RosettaScriptsOption(
"'Translate' mover requires chain tag");
123 if ( ! tag->hasOption(
"distribution") )
throw utility::excn::EXCN_RosettaScriptsOption(
"'Translate' mover requires distribution tag");
124 if ( ! tag->hasOption(
"angstroms") )
throw utility::excn::EXCN_RosettaScriptsOption(
"'Translate' mover requires angstroms tag");
125 if ( ! tag->hasOption(
"cycles") )
throw utility::excn::EXCN_RosettaScriptsOption(
"'Translate' mover requires cycles tag");
136 if(tag->hasOption(
"force")){
139 else if(tag->getOption<
std::string>(
"force") !=
"false")
140 throw utility::excn::EXCN_RosettaScriptsOption(
"'force' option is true or false");
143 if ( tag->hasOption(
"tag_along_chains") ){
146 foreach(
std::string tag_along_chain_str, tag_along_chain_strs){
170 if(grid_manager->
size() == 0)
198 translate_tracer.Debug<<
"making a uniform translator of up to " <<
translate_info_.
angstroms<<
" angstroms" << std::endl;
203 int best_score=100000;
211 int grid_value=best_score;
212 if ( grid->is_in_grid(c.x(), c.y(), c.z()) )
214 grid_value= grid->getValue(c.x(), c.y(), c.z());
216 if ( grid_value <= 0 ){
217 translate_tracer.Trace <<
"Accepting ligand position with nbr_atom at " << c << std::endl;
220 translate_tracer.Trace <<
"moving jump " << tag_along_jump<<
" the same amount"<< std::endl;
226 translate_tracer.Trace <<
"Rejecting ligand position with nbr_atom at " << c << std::endl;
229 best_score = grid_value;
236 translate_tracer.Trace <<
"Forcing neighbor atom to move (leading to a clash)" << std::endl;
245 translate_tracer <<
"WARNING: cannot find placement for this ligand. Keeping original position. Use the force option to force translation"<< std::endl;
260 int best_score=100000;
269 if ( grid->is_in_grid(c.x(), c.y(), c.z()) )
271 grid_value= grid->getValue(c.x(), c.y(), c.z()) <= 0;
273 if ( grid_value < 0 ){
274 translate_tracer.Trace <<
"Accepting ligand position with nbr_atom at " << c << std::endl;
277 translate_tracer.Trace <<
"Rejecting ligand position with nbr_atom at " << c << std::endl;
280 best_score = grid_value;
289 translate_tracer <<
"WARNING: cannot find placement for this ligand. Keeping original position. Use the force option to force translation"<< std::endl;
314 translate_tracer.Debug<<
"making a uniform translator of up to "<<
translate_info_.
angstroms<<
" angstroms"<< std::endl;
331 translate_tracer.Trace <<
"Doing a translate move" <<std::endl;
332 translate_mover->apply(pose);
340 if(score <= best_score)
344 translate_tracer.Trace <<
"accepted ligand position with score of " <<score <<std::endl;
348 translate_tracer.Trace <<
"rejected ligand position with score of "<<score <<std::endl;
361 std::set<core::Size>::const_iterator begin,
362 std::set<core::Size>::const_iterator
end