![]() |
Rosetta Protocols
2014.35
|
Reading the xml file and generating the mover. More...
#include <RosettaScriptsParser.hh>
Public Member Functions | |
RosettaScriptsParser () | |
virtual | ~RosettaScriptsParser () |
virtual bool | generate_mover_from_pose (protocols::jd2::JobCOP job, core::pose::Pose &pose, protocols::moves::MoverOP &mover, bool new_input, std::string const xml_fname) |
MoverOP | generate_mover_for_protocol (Pose &pose, bool &modified_pose, utility::tag::TagCOP protocol_tag) |
MoverOP | parse_protocol_tag (Pose &pose, utility::tag::TagCOP protocol_tag) |
MoverOP | parse_protocol_tag (utility::tag::TagCOP protocol_tag) |
void | register_factory_prototypes () |
Factories avoid requiring compiler dependencies for all possible constructible derived classes, by allowing runtime registration of derived class prototypes. However, this requires pre-registration of a derived type with the factory prior to asking the factory to return an instance of that type. This method registers those additional derived classes that are available for construction in the RosettaScriptsParser context. TO-DO: replace this manual factory registration system with a load-time-initialized singleton scheme (see r32404 for example) More... | |
void | instantiate_filter (utility::tag::TagCOP const &tag_ptr, basic::datacache::DataMap &data, protocols::filters::Filters_map &filters, protocols::moves::Movers_map &movers, core::pose::Pose &pose) |
Instantiate a new filter and add it to the list of defined filters for this ROSETTASCRIPTS block. More... | |
void | instantiate_mover (utility::tag::TagCOP const &tag_ptr, basic::datacache::DataMap &data, protocols::filters::Filters_map &filters, protocols::moves::Movers_map &movers, core::pose::Pose &pose) |
Instantiate a new mover and add it to the list of defined movers for this ROSETTASCRIPTS block. More... | |
void | instantiate_taskoperation (utility::tag::TagCOP const &tag_ptr, basic::datacache::DataMap &data, protocols::filters::Filters_map &filters, protocols::moves::Movers_map &movers, core::pose::Pose &pose) |
Instantiate a new task operation (used in IMPORT tag) More... | |
utility::tag::TagCOP | find_rosettascript_tag (utility::tag::TagCOP rootTag, const std::string §ion_name, const std::string &option_name, const std::string &option_value) |
Recursively find a specific tag by option name and valie in any ROSETTASCRIPTS tag that's a child of rootTag. More... | |
void | import_tags (std::set< ImportTagName > &import_tag_names, utility::tag::TagCOP &my_tag, basic::datacache::DataMap &data, protocols::filters::Filters_map &filters, protocols::moves::Movers_map &movers, core::pose::Pose &pose) |
Import filters, movers, ... specified in the IMPORT tag in the order they were originally defined elsewhere in the script. More... | |
![]() | |
virtual | ~Parser () |
void | generate_mover_from_job (JobOP job, MoverOP &mover, bool new_input) |
generate_mover_from_job is the function called by the job distributor to request a mover. It is defined in the base class (this class) and handles unpackaging the job and passes the work to generate_mover_from_pose. The pose is repackaged into the JobOP so that jobs starting off that pose are properly modified. More... | |
Private Member Functions | |
int | process_includes (utility::tag::TagCOP root_tag, int &processed_includes) |
void | process_include_xml (utility::tag::TagCOP tag, utility::vector0< utility::tag::TagOP > &tags_from_includes, int &processed_includes) |
Process a single XML include file. More... | |
Static Private Member Functions | |
static void | substitute_variables_in_stream (std::istream &in, utility::options::StringVectorOption const &script_vars, std::stringstream &out) |
Create a variable substituted version of the input stream, given a StringVectorOption formated list of variables to substitiute. Each item in script_vars should be in the form of "variable=value", where "value" is the string to substitiute into the input stream whereever the string "%%variable%%" is found in the input. More... | |
Reading the xml file and generating the mover.
typedef std::pair<std::string, std::string> protocols::rosetta_scripts::RosettaScriptsParser::ImportTagName |
typedef protocols::moves::MoverFactory protocols::rosetta_scripts::RosettaScriptsParser::MoverFactory |
typedef protocols::moves::MoverFactoryOP protocols::rosetta_scripts::RosettaScriptsParser::MoverFactoryOP |
typedef utility::vector0< utility::tag::TagCOP > protocols::rosetta_scripts::RosettaScriptsParser::TagCOPs |
protocols::rosetta_scripts::RosettaScriptsParser::RosettaScriptsParser | ( | ) |
References register_factory_prototypes().
|
virtual |
TagCOP protocols::rosetta_scripts::RosettaScriptsParser::find_rosettascript_tag | ( | utility::tag::TagCOP | rootTag, |
const std::string & | section_name, | ||
const std::string & | option_name, | ||
const std::string & | option_value | ||
) |
Recursively find a specific tag by option name and valie in any ROSETTASCRIPTS tag that's a child of rootTag.
Referenced by protocols::pose_reporters::FilterReporter::parse_my_tag(), and protocols::pose_selectors::Filter::parse_my_tag().
MoverOP protocols::rosetta_scripts::RosettaScriptsParser::generate_mover_for_protocol | ( | Pose & | pose, |
bool & | modified_pose, | ||
utility::tag::TagCOP | protocol_tag | ||
) |
References basic::datacache::DataMap::add(), core::scoring::ScoreFunctionFactory::create_score_function(), DOCK_PATCH, filters, protocols::moves::MoverFactory::get_instance(), core::scoring::get_score_function(), import_tags(), instantiate_filter(), instantiate_mover(), output_tag, protocols::rosetta_scripts::parse_score_function(), parser, PRE_TALARIS_2013_STANDARD_WTS, process_includes(), protocol, runtime_assert, SCORE12_PATCH, soft_rep, SOFT_REP_DESIGN_WTS, TALARIS_2013, and protocols::rosetta_scripts::TR.
Referenced by generate_mover_from_pose(), and parse_protocol_tag().
|
virtual |
Uses the Tag interface to the xml reader library in boost to parse an xml file that contains design protocol information. A sample protocol file can be found in src/pilot/apps/sarel/dock_design.protocol. INCLUDES allows inclusion of additional module files (in XML format). SCOREFXNS provides a way to define scorefunctions as they are defined in the rosetta database, using the weights/patch convenctions. Several default scorefunctions are preset and can be used without defining them explicitly. FILTERS defines a set of filters that can be used together with the dockdesign movers to prune out poses that don't meet certain criteria MOVERS defines the movers that will be used PROTOCOLS is the only order-sensitive section where subsequent movers and filters are expected to be defined. These movers and filters were defined in the previous two sections. The order in which the protocols are specified by the user will be maintained by the DockDesign mover. APPLY_TO_POSE This section allows for certain movers to be applied to the pose prior to starting the DockDesign protocol. For instance, these movers could set constraints, such as favor_native_residue. In this case, for example, the weights of res_type_constraint in all of the scorefunctions that are defined in SCOREFXNS or by default are set to 1.0, but can be changed by the user globally (in the definition of the weight on the constraint), or in particular for each of the scorefunctions by changing the relevant term (which is set by default to the global value). OUTPUT is a section which allows the XML control of how things are output Notice that the order of the sections by which the protocol is written doesn't matter, BUT the order of the mover-filter pairs in PROTOCOLS section does matter.
Implements protocols::jd2::Parser.
References utility::io::izstream::close(), utility::tag::Tag::create(), generate_mover_for_protocol(), utility::io::izstream::good(), utility::io::izstream::open(), option, runtime_assert, substitute_variables_in_stream(), tag, protocols::rosetta_scripts::TR, user, and utility_exit_with_message.
Referenced by protocols::rpc::JSON_RPC::run().
void protocols::rosetta_scripts::RosettaScriptsParser::import_tags | ( | std::set< ImportTagName > & | import_tag_names, |
utility::tag::TagCOP & | my_tag, | ||
basic::datacache::DataMap & | data, | ||
protocols::filters::Filters_map & | filters, | ||
protocols::moves::Movers_map & | movers, | ||
core::pose::Pose & | pose | ||
) |
Import filters, movers, ... specified in the IMPORT tag in the order they were originally defined elsewhere in the script.
References instantiate_filter(), instantiate_mover(), instantiate_taskoperation(), key, tag, and protocols::rosetta_scripts::TR.
Referenced by generate_mover_for_protocol().
void protocols::rosetta_scripts::RosettaScriptsParser::instantiate_filter | ( | utility::tag::TagCOP const & | tag_ptr, |
basic::datacache::DataMap & | data, | ||
protocols::filters::Filters_map & | filters, | ||
protocols::moves::Movers_map & | movers, | ||
core::pose::Pose & | pose | ||
) |
Instantiate a new filter and add it to the list of defined filters for this ROSETTASCRIPTS block.
References protocols::filters::FilterFactory::get_instance(), runtime_assert, protocols::rosetta_scripts::TR, and type.
Referenced by generate_mover_for_protocol(), and import_tags().
void protocols::rosetta_scripts::RosettaScriptsParser::instantiate_mover | ( | utility::tag::TagCOP const & | tag_ptr, |
basic::datacache::DataMap & | data, | ||
protocols::filters::Filters_map & | filters, | ||
protocols::moves::Movers_map & | movers, | ||
core::pose::Pose & | pose | ||
) |
Instantiate a new mover and add it to the list of defined movers for this ROSETTASCRIPTS block.
References protocols::moves::MoverFactory::get_instance(), runtime_assert, protocols::rosetta_scripts::TR, and type.
Referenced by generate_mover_for_protocol(), and import_tags().
void protocols::rosetta_scripts::RosettaScriptsParser::instantiate_taskoperation | ( | utility::tag::TagCOP const & | tag_ptr, |
basic::datacache::DataMap & | data, | ||
protocols::filters::Filters_map & | filters, | ||
protocols::moves::Movers_map & | movers, | ||
core::pose::Pose & | pose | ||
) |
Instantiate a new task operation (used in IMPORT tag)
References basic::datacache::DataMap::add(), basic::datacache::DataMap::has(), runtime_assert, protocols::rosetta_scripts::TR, and type.
Referenced by import_tags().
MoverOP protocols::rosetta_scripts::RosettaScriptsParser::parse_protocol_tag | ( | Pose & | pose, |
utility::tag::TagCOP | protocol_tag | ||
) |
References generate_mover_for_protocol().
Referenced by protocols::rosetta_scripts::MultipleOutputWrapper::generate_pose(), protocols::rosetta_scripts::AdditionalOutputWrapper::generate_pose(), protocols::rosetta_scripts::MultipleOutputWrapper::parse_my_tag(), protocols::rosetta_scripts::AdditionalOutputWrapper::parse_my_tag(), protocols::rosetta_scripts::MultiplePoseMover::parse_my_tag(), and protocols::rosetta_scripts::MultiplePoseMover::process_pose().
MoverOP protocols::rosetta_scripts::RosettaScriptsParser::parse_protocol_tag | ( | utility::tag::TagCOP | protocol_tag | ) |
References generate_mover_for_protocol().
|
private |
Process a single XML include file.
References utility::tag::Tag::create(), filename(), MAX_INCLUDES, utility::io::izstream::open(), option, process_includes(), utility::options::StringVectorOption::push_back(), s, script_vars, utility::options::StringVectorOption::size(), substitute_variables_in_stream(), tag, protocols::rosetta_scripts::TR, and user.
Referenced by process_includes().
|
private |
References utility::pointer::const_pointer_cast(), MAX_INCLUDES, process_include_xml(), tag, and tags.
Referenced by generate_mover_for_protocol(), and process_include_xml().
void protocols::rosetta_scripts::RosettaScriptsParser::register_factory_prototypes | ( | ) |
Factories avoid requiring compiler dependencies for all possible constructible derived classes, by allowing runtime registration of derived class prototypes. However, this requires pre-registration of a derived type with the factory prior to asking the factory to return an instance of that type. This method registers those additional derived classes that are available for construction in the RosettaScriptsParser context. TO-DO: replace this manual factory registration system with a load-time-initialized singleton scheme (see r32404 for example)
Referenced by RosettaScriptsParser().
|
staticprivate |
Create a variable substituted version of the input stream, given a StringVectorOption formated list of variables to substitiute. Each item in script_vars should be in the form of "variable=value", where "value" is the string to substitiute into the input stream whereever the string "%%variable%%" is found in the input.
Having the return value be passed through a parameter is to get around some copy-constructor limitations of C++ streams.
References end, getline(), utility::options::StringVectorOption::size(), and protocols::rosetta_scripts::TR.
Referenced by generate_mover_from_pose(), and process_include_xml().