22 #include <utility/exit.hh>
23 #include <basic/Tracer.hh>
25 #include <numeric/random/random_permutation.hh>
30 #include <utility/vector0.hh>
31 #include <utility/vector1.hh>
32 #include <utility/tag/Tag.hh>
34 #include <utility/excn/Exceptions.hh>
35 #include <boost/foreach.hpp>
38 #define foreach BOOST_FOREACH
44 namespace ligand_docking {
46 static basic::Tracer
translate_tracer(
"protocols.ligand_docking.CompoundTranslate", basic::t_debug);
63 return "CompoundTranslate";
69 Mover(
"CompoundTranslate")
74 protocols::moves::Mover( that ),
75 translates_(that.translates_),
76 randomize_order_(that.randomize_order_),
77 allow_overlap_(that.allow_overlap_)
91 return "CompoundTranslate";
104 if ( tag->getName() !=
"CompoundTranslate" ){
105 throw utility::excn::EXCN_RosettaScriptsOption(
"This should be impossible");
107 if ( ! tag->hasOption(
"randomize_order")){
108 throw utility::excn::EXCN_RosettaScriptsOption(
"CompoundTranslate needs a 'randomize_order' option");
110 if ( ! tag->hasOption(
"allow_overlap")){
111 throw utility::excn::EXCN_RosettaScriptsOption(
"CompoundTranslate needs an 'allow_overlap' option");
115 if(allow_overlap_string ==
"true" || allow_overlap_string ==
"True")
117 else if(allow_overlap_string ==
"false" || allow_overlap_string ==
"False")
119 else throw utility::excn::EXCN_RosettaScriptsOption(
"'randomize_order' option takes arguments 'true' or 'false'");
123 if(allow_overlap_string ==
"true" || allow_overlap_string ==
"True")
125 else if(allow_overlap_string ==
"false" || allow_overlap_string ==
"False")
127 else throw utility::excn::EXCN_RosettaScriptsOption(
"'allow_overlap' option takes arguments 'true' or 'false'");
132 if( name ==
"Translate"){
134 translate->parse_my_tag(tag, datamap, filters, movers, pose);
137 else if( name ==
"Translates"){
138 if ( ! tag->hasOption(
"chain") )
throw utility::excn::EXCN_RosettaScriptsOption(
"'Translates' mover requires chain tag");
139 if ( ! tag->hasOption(
"distribution") )
throw utility::excn::EXCN_RosettaScriptsOption(
"'Translates' mover requires distribution tag");
140 if ( ! tag->hasOption(
"angstroms") )
throw utility::excn::EXCN_RosettaScriptsOption(
"'Translates' mover requires angstroms tag");
141 if ( ! tag->hasOption(
"cycles") )
throw utility::excn::EXCN_RosettaScriptsOption(
"'Translates' mover requires cycles tag");
154 if(tag->hasOption(
"force")){
156 translate_info.
force=
true;
157 else if(tag->getOption<
std::string>(
"force") !=
"false")
158 throw utility::excn::EXCN_RosettaScriptsOption(
"'force' option is true or false");
164 throw utility::excn::EXCN_RosettaScriptsOption(
"CompoundTranslate only takes Translate or Translates child tags");
173 std::set<core::Size> chains_to_translate;
179 core::Size chain_id= translate->get_chain_id(pose);
180 chains_to_translate.insert(chain_id);
185 translate->add_excluded_chains(chains_to_translate.begin(), chains_to_translate.end());
186 translate->apply(pose);
191 translate->add_excluded_chains(chains_to_translate.begin(), chains_to_translate.end());
192 translate->apply(pose);
193 core::Size chain_id= translate->get_chain_id(pose);
194 chains_to_translate.erase(chain_id);