34 #include <basic/Tracer.hh>
37 #include <utility/sql_database/DatabaseSessionManager.hh>
38 #include <utility/tag/Tag.hh>
39 #include <utility/vector1.hh>
42 #include <cppdb/frontend.h>
48 #include <utility/vector0.hh>
52 #include <utility/excn/Exceptions.hh>
61 using std::stringstream;
89 using utility::sql_database::sessionOP;
92 using cppdb::statement;
94 static Tracer
TR(
"protocols.features.RotamerRecoveryFeatures");
115 protocol_(src.protocol_),
116 comparer_(src.comparer_),
117 task_factory_(src.task_factory_)
137 dependencies.push_back(
"ResidueFeatures");
156 string scorefxn_name = tag->getOption<
string>(
"scorefxn",
"score12");
161 if(tag->hasOption(
"mover") || tag->hasOption(
"mover_name")){
162 if(tag->hasOption(
"reference_name")){
163 throw utility::excn::EXCN_RosettaScriptsOption(
164 "Both 'mover_name' and 'reference_name' were supplied. "
165 "Please specify at most one to indicate which protocols should "
166 "be used to run RotamerRecovery.");
170 tag->getOption<
string>(
"mover") :
171 tag->getOption<
string>(
"mover_name"), movers);
173 }
else if(tag->hasOption(
"reference_name")){
174 if(tag->hasOption(
"mover")){
175 throw utility::excn::EXCN_RosettaScriptsOption(
176 "Both 'mover' and 'reference_name' were supplied. "
177 "Please specify at most one to indicate which protocols "
178 "should be used to run RotamerRecovery.");
181 if(tag->hasOption(
"mover_name")){
182 throw utility::excn::EXCN_RosettaScriptsOption(
183 "Both 'mover_name' and 'reference_name' were supplied. "
184 "Please specify at most one to indicate which protocols "
185 "should be used to run RotamerRecovery.");
188 if(tag->hasOption(
"protocol") &&
189 !tag->getOption<
string>(
"protocol").
compare(
190 "RRProtocolReferenceStructure")){
191 throw utility::excn::EXCN_RosettaScriptsOption(
192 "Specifying 'reference_name' is only compatible with the "
193 "'RRProtocolReferenceStructure' protocol.");
201 string const & protocol_name(tag->getOption<
string>(
202 "protocol",
"RRProtocolMinPack"));
203 if(!protocol_name.compare(
"RRProtocolMover")){
204 throw utility::excn::EXCN_RosettaScriptsOption(
205 "Please specify 'mover_name' with the 'RRProtocolMover' "
206 "rotamer recovery protocol.");
207 }
else if(!protocol_name.compare(
"RRProtocolReferenceStructure")){
208 throw utility::excn::EXCN_RosettaScriptsOption(
209 "Please specify 'reference_name' with 'RRProtocolReferenceStructure' "
210 "rotamer recovery protocol.");
212 protocol_ = factory->get_rotamer_recovery_protocol(protocol_name);
219 if(
protocol_->get_name() ==
"RRProtocolRTMin"){
220 if(tag->hasOption(
"nonideal")){
223 if(tag->hasOption(
"cartesian")){
228 string const & comparer_name(tag->getOption<
string>(
229 "comparer",
"RRComparerAutomorphicRMSD"));
230 comparer_ = factory->get_rotamer_recovery_comparer(comparer_name);
232 if(tag->hasOption(
"recovery_threshold")){
233 comparer_->set_recovery_threshold(tag->getOption<
Real>(
"recovery_threshold"));
244 Pose const & pose_in,
246 boost::uuids::uuid
const struct_id,
252 reporter->set_struct_id1(struct_id);
264 packer_task->restrict_to_repacking();
265 packer_task->restrict_to_residues(relevant_residues);
266 packer_task->initialize_from_command_line();
268 rotamer_recovery.
run(pose, *
scfxn_, *packer_task);