22 #include <basic/Tracer.hh>
23 #include <utility/tag/Tag.hh>
25 #include <basic/options/keys/enzdes.OptionKeys.gen.hh>
26 #include <basic/options/option.hh>
31 #include <utility/vector0.hh>
32 #include <utility/excn/Exceptions.hh>
33 #include <utility/vector1.hh>
44 static basic::Tracer
tr(
"protocols.enzdes.AddorRemoveCsts");
60 return "AddOrRemoveMatchCsts";
64 :
Mover(
"AddOrRemoveMatchCsts"),
65 option_cstfile_(
""), cstfile_(
""),
66 cst_action_(
VOID), keep_covalent_(false),
67 accept_blocks_missing_header_(false), fail_on_constraints_missing_(true)
69 if( basic::options::option[basic::options::OptionKeys::enzdes::cstfile].user() ){
70 option_cstfile_ = basic::options::option[basic::options::OptionKeys::enzdes::cstfile].value();
85 option_cstfile_(other.option_cstfile_), cstfile_(other.cstfile_),
86 cst_action_(other.cst_action_), keep_covalent_(other.keep_covalent_),
87 accept_blocks_missing_header_(other.accept_blocks_missing_header_),
88 fail_on_constraints_missing_(other.fail_on_constraints_missing_),
112 tr.Warning <<
"Warning: apply function of enzdes constraints mover called even though no cstfile has been specified on the commandline, in the tag, or programmatically. This function will have no effect." << std::endl;
123 cst_io->add_pregenerated_constraints_to_pose( pose,
sfxn_ );
129 utility_exit_with_message(
"Illegal action for AddOrRemoveMatchCsts mover specified.");
144 tr.Warning <<
"WARNING: No name for the enzdes .cst file was specified in either the options, the xml tag, or programatically. AddOrRemoveMatchCsts will turn into a null operation." << std::endl;
152 throw utility::excn::EXCN_RosettaScriptsOption(
"Illegal or no value for cst_instruction in xml tag given. Has to be either 'add_new', 'add_pregenerated', or 'remove'.");
161 utility::lua::LuaObject
const & ,
162 utility::lua::LuaObject
const & ,
167 tr.Warning <<
"WARNING: No name for the enzdes .cst file was specified in either the options, the xml tag, or programatically. AddOrRemoveMatchCsts will turn into a null operation." << std::endl;
170 std::string cst_instruction = def[
"cst_instruction"] ? def[
"cst_instruction" ].to<
std::string>() :
"void";
175 utility_exit_with_message(
"Illegal or no value for cst_instruction in xml tag given. Has to be either 'add_new', 'add_pregenerated', or 'remove'.");
178 keep_covalent_ = def[
"keep_covalent"] ? def[
"keep_covalent" ].to<
bool>() :
false;
198 std::map< std::string, toolbox::match_enzdes_util::EnzConstraintIOOP>::const_iterator enzio_it =
cstfile_map_.find( cstfile );
200 tr.Warning <<
"WARNING: trying to get an EnzConstraintIOOP object for cstfile " << cstfile <<
" that hasn't been instantiated yet. Returning NULL pointer." << std::endl;
203 return enzio_it->second;
211 std::map< std::string, toolbox::match_enzdes_util::EnzConstraintIOOP >::iterator cstio_it =
cstfile_map_.find( cstfile );
215 new_cst_io->read_enzyme_cstfile( cstfile );
216 cstfile_map_.insert( std::pair< std::string, toolbox::match_enzdes_util::EnzConstraintIOOP >( cstfile, new_cst_io ) );
219 return cstio_it->second;