Rosetta
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
protocols::rosetta_scripts::RosettaScriptsParser Class Reference

Reading the xml file and generating the mover. More...

#include <RosettaScriptsParser.hh>

Inheritance diagram for protocols::rosetta_scripts::RosettaScriptsParser:
Inheritance graph
[legend]

Public Types

typedef utility::vector0< utility::tag::TagCOP > TagCOPs
 
typedef utility::tag::TagCOP TagCOP
 
typedef moves::MoverOP MoverOP
 
typedef std::pair< std::string, std::string > ImportTagName
 

Public Member Functions

 RosettaScriptsParser ()
 
 ~RosettaScriptsParser () override
 
ParsedProtocolOP generate_mover (std::string const &xml_fname, std::string const &current_input_name="", std::string const &current_output_name="")
 Convenience function to construct a ParsedProtocol from a file. More...
 
ParsedProtocolOP generate_mover (std::string const &xml_fname, utility::vector1< std::string > const &script_vars, std::string const &current_input_name="", std::string const &current_output_name="")
 Convenience function to construct a ParsedProtocol from a file. More...
 
ParsedProtocolOP generate_mover (utility::options::OptionCollection const &options, std::string const &current_input_name, std::string const &current_output_name, basic::resource_manager::ResourceManagerOP resource_manager)
 Convenience function to construct a ParsedProtocol from a file. More...
 
ParsedProtocolOP generate_mover (utility::options::OptionCollection const &options, std::string const &xml_fname, std::string const &current_input_name="", std::string const &current_output_name="", XmlObjectsOP xml_objects=nullptr, basic::resource_manager::ResourceManagerOP resource_manager=nullptr)
 Convenience function to construct a ParsedProtocol from a file. More...
 
ParsedProtocolOP generate_mover_xml_string (utility::options::OptionCollection const &options, std::string const &xml_text, std::string const &current_input_name, std::string const &current_output_name, XmlObjectsOP xml_objects)
 Convenience function to construct a ParsedProtocol from a string. More...
 
ParsedProtocolOP generate_mover (utility::options::OptionCollectionCOP options, std::string const &current_input_name, std::string const &current_output_name, basic::resource_manager::ResourceManagerOP resource_manager)
 Convenience function to construct a ParsedProtocol from a file. More...
 
ParsedProtocolOP generate_mover (utility::options::OptionCollectionCOP options, std::string const &xml_fname, std::string const &current_input_name="", std::string const &current_output_name="", XmlObjectsOP xml_objects=nullptr, basic::resource_manager::ResourceManagerOP resource_manager=nullptr)
 Convenience function to construct a ParsedProtocol from a file. More...
 
ParsedProtocolOP generate_mover_xml_string (utility::options::OptionCollectionCOP options, std::string const &xml_text, std::string const &current_input_name, std::string const &current_output_name, XmlObjectsOP xml_objects)
 Convenience function to construct a ParsedProtocol from a string. More...
 
TagCOP create_tag_from_xml (std::string const &xml_fname, utility::options::OptionCollection const &options)
 Create a tag from an XML file. Read from Script Vars options from a local options collection. More...
 
TagCOP create_tag_from_xml (std::string const &xml_fname, utility::vector1< std::string > const &script_vars)
 Create a tag from an XML file. Use Script Vars bariable to do any substitutions. Script Var String: "xx=yy" for xx% replacement in XML script. More...
 
TagCOP create_tag_from_xml_string (std::string const &xml_text, utility::options::OptionCollection const &options)
 Create a tag from an XML string. Read from Script Vars options from a local options collection. More...
 
TagCOP create_tag_from_xml_string (std::string const &xml_text, utility::vector1< std::string > const &script_vars)
 Create a tag from an XML string. Use Script Vars bariable to do any substitutions. Script Var String: "xx=yy" for xx% replacement in XML script. More...
 
ParsedProtocolOP parse_protocol_tag (utility::tag::TagCOP protocol_tag, utility::options::OptionCollection const &options)
 Create the ParsedProtocolMover for the protocol using a tag. More...
 
ParsedProtocolOP generate_mover_for_protocol (utility::tag::TagCOP protocol_tag, utility::options::OptionCollection const &options, std::string const &current_input_name="", std::string const &current_output_name="", XmlObjectsOP xml_objects=nullptr, basic::resource_manager::ResourceManagerOP resource_manager=nullptr)
 Create the ParsedProtocolMover for the protocol using a tag. More...
 
ParsedProtocolOP generate_mover_for_protocol (utility::tag::TagCOP protocol_tag, utility::options::OptionCollection const &options, basic::datacache::DataMap &data, std::string const &current_input_name="", std::string const &current_output_name="", XmlObjectsOP xml_objects=nullptr, basic::resource_manager::ResourceManagerOP resource_manager=nullptr)
 Create the ParsedProtocolMover for the protocol using a tag. More...
 
ParsedProtocolOP generate_mover_for_protocol (utility::tag::TagCOP protocol_tag, basic::datacache::DataMap &data, utility::options::OptionCollection const &options, XmlObjectsOP xml_objects=nullptr, basic::resource_manager::ResourceManagerOP resource_manager=nullptr)
 Create the ParsedProtocolMover for the protocol using a tag. More...
 
ParsedProtocolOP generate_mover_for_protocol (core::pose::Pose &, bool &, utility::tag::TagCOP protocol_tag, utility::options::OptionCollection const &options, std::string const &current_input_name="", std::string const &current_output_name="", XmlObjectsOP xml_objects=nullptr, basic::resource_manager::ResourceManagerOP resource_manager=nullptr)
 Create the ParsedProtocolMover for the protocol using a tag. More...
 
void initialize_data_map (basic::datacache::DataMap &data, utility::options::OptionCollection const &options)
 Initialize the passed datamap with the standard set of pre-defined RosettaScripts objects. More...
 
void read_in_and_recursively_replace_includes (std::string const &filename, std::string &substituted_contents, utility::vector1< std::string > filenames_encountered, core::Size const recursion_level, bool const do_not_recurse=false, std::string const &xml_text_for_top_level="") const
 Actually read in the XML file. Called recursively to read in XML files that this XML file includes. At the end of this operation, substituted_contents contains the contents of the XML file, with all xi:includes replaced with the contents of included XML files. Files are opened and closed here. More...
 
void parse_resources_tag (utility::tag::TagCOP resources_tag, basic::datacache::DataMap &data, basic::resource_manager::ResourceManagerOP resource_manager) const
 
void parse_apply_to_pose_tag (utility::tag::TagCOP apply_tag, basic::datacache::DataMap &data) const
 
void instantiate_filter (utility::tag::TagCOP const &tag_ptr, basic::datacache::DataMap &data) const
 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) const
 Instantiate a new mover and add it to the list of defined movers for this ROSETTASCRIPTS block. More...
 
void instantiate_packer_palette (utility::tag::TagCOP const &tag_ptr, basic::datacache::DataMap &data) const
 Instantiate a PackerPalette object. More...
 
void instantiate_taskoperation (utility::tag::TagCOP const &tag_ptr, basic::datacache::DataMap &data) const
 Instantiate a new task operation (used in IMPORT tag) More...
 
utility::tag::TagCOP 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. More...
 
void parse_import_tag (utility::tag::TagCOP import_tag, basic::datacache::DataMap &data) const
 
void import_tags (std::set< ImportTagName > &import_tag_names, utility::tag::TagCOP my_tag, basic::datacache::DataMap &data) const
 Import filters, movers, ... specified in the IMPORT tag in the order they were originally defined elsewhere in the script. More...
 
void validate_input_script_against_xsd (std::string const &fname, std::stringstream const &input_xml) const
 
void set_recursion_limit (utility::options::OptionCollection const &options)
 
void generate_mover (MoverOP &mover, bool new_input, std::string const &xml_file, std::string const &current_input_name="", std::string const &current_output_name="", bool guarantee_new_mover=false)
 Original, JD2-compatible mover generating function. More...
 
bool protocol_option_set (utility::options::OptionCollection const &options) const
 Checks the LOCAL options collection to see if a protocol has been set. More...
 

Static Public Member Functions

static 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...
 
static std::string xsd_for_rosetta_scripts ()
 
static void write_ROSETTASCRIPTS_complex_type (utility::tag::XMLSchemaDefinition &)
 
static std::string rosetta_scripts_element_name ()
 
static std::string rosetta_scripts_complex_type_naming_func (std::string const &element_name)
 
static void list_options_read (utility::options::OptionKeyList &read_options)
 List the command-line options used by this class. More...
 
static void substitute_variables_in_stream (std::istream &in, utility::vector1< std::string > const &script_vars, std::stringstream &out)
 Substitute xx==yy using the XML syntax %xx%%. / script_vars is a list of strings of "xx==yy". More...
 

Private Member Functions

bool has_slash_at_end (std::string const &str, core::Size const endpos) const
 Is the current tag one with a slash at the end? More...
 
bool has_double_percent_signs (std::string const &str, core::Size const endpos) const
 Is the current tag one with something that will be replaced by variable replacement? More...
 
TagCOP finish_creating_tag (std::string const &xml_fname, utility::vector1< std::string > const &script_vars, std::string const &substituted_contents) const
 To be called after the full xml tree has been loaded into a string from create_tag_from_xml*. More...
 
void load_native (std::string const &fname)
 Load a native into this class, which will be placed into the datamap as a resource upon generating mover(s). More...
 

Private Attributes

core::Size recursion_limit_
 The depth of the rabbit hole one can find oneself in by including XML files that include XML files. Defaults to 8. More...
 
core::pose::PoseOP native_pose_ = nullptr
 
utility::options::OptionCollectionCOP local_options_ = nullptr
 

Detailed Description

Reading the xml file and generating the mover.

Uses the Tag interface to the xml reader library in boost to parse an xml file that contains design protocol information.

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 – DEPRECATED/Removed. This section used to allow for applying certain movers to the pose prior to protocol start. This functionality has been removed. Anything other than an empty APPLY_TO_POSE section will raise an error.

xi:include statements can be placed anywhere to trigger read-in of another RosettaScripts XML file. Contents of the file replace the xi:include statement.

Member Typedef Documentation

◆ ImportTagName

typedef std::pair<std::string, std::string> protocols::rosetta_scripts::RosettaScriptsParser::ImportTagName

◆ MoverOP

◆ TagCOP

◆ TagCOPs

typedef utility::vector0< utility::tag::TagCOP > protocols::rosetta_scripts::RosettaScriptsParser::TagCOPs

Constructor & Destructor Documentation

◆ RosettaScriptsParser()

protocols::rosetta_scripts::RosettaScriptsParser::RosettaScriptsParser ( )

◆ ~RosettaScriptsParser()

protocols::rosetta_scripts::RosettaScriptsParser::~RosettaScriptsParser ( )
overridedefault

Member Function Documentation

◆ create_tag_from_xml() [1/2]

TagCOP protocols::rosetta_scripts::RosettaScriptsParser::create_tag_from_xml ( std::string const &  xml_fname,
utility::options::OptionCollection const &  options 
)

Create a tag from an XML file. Read from Script Vars options from a local options collection.

Create a tag from an XML file. Read from a local options collection.

◆ create_tag_from_xml() [2/2]

TagCOP protocols::rosetta_scripts::RosettaScriptsParser::create_tag_from_xml ( std::string const &  xml_fname,
utility::vector1< std::string > const &  script_vars 
)

Create a tag from an XML file. Use Script Vars bariable to do any substitutions. Script Var String: "xx=yy" for xx% replacement in XML script.

◆ create_tag_from_xml_string() [1/2]

TagCOP protocols::rosetta_scripts::RosettaScriptsParser::create_tag_from_xml_string ( std::string const &  xml_text,
utility::options::OptionCollection const &  options 
)

Create a tag from an XML string. Read from Script Vars options from a local options collection.

Create a tag from an XML string. Read from a local options collection.

◆ create_tag_from_xml_string() [2/2]

TagCOP protocols::rosetta_scripts::RosettaScriptsParser::create_tag_from_xml_string ( std::string const &  xml_text,
utility::vector1< std::string > const &  script_vars 
)

Create a tag from an XML string. Use Script Vars bariable to do any substitutions. Script Var String: "xx=yy" for xx% replacement in XML script.

◆ find_rosettascript_tag()

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().

◆ finish_creating_tag()

TagCOP protocols::rosetta_scripts::RosettaScriptsParser::finish_creating_tag ( std::string const &  xml_fname,
utility::vector1< std::string > const &  script_vars,
std::string const &  substituted_contents 
) const
private

To be called after the full xml tree has been loaded into a string from create_tag_from_xml*.

xml_fname only used for tracer output.

References protocols::rosetta_scripts::TR().

◆ generate_mover() [1/7]

void protocols::rosetta_scripts::RosettaScriptsParser::generate_mover ( moves::MoverOP in_mover,
bool  new_input,
std::string const &  xml_fname,
std::string const &  current_input_name = "",
std::string const &  current_output_name = "",
bool  guarantee_new_mover = false 
)

Original, JD2-compatible mover generating function.

@detals NOT accessible in PyRosetta. For general use and PyRosetta, use mover-returning generate_mover() functions. READS FROM GLOBAL OPTIONS.

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.

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 – DEPRECATED/Removed. This section used to allow for applying certain movers to the pose prior to protocol start. This functionality has been removed. Anything other than an empty APPLY_TO_POSE section will raise an error.

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.

xi:include statements can be placed anywhere to trigger read-in of another RosettaScripts XML file. Contents of the file replace the xi:include statement.

References protocols::jd2::current_output_name(), and protocols::rosetta_scripts::TR().

◆ generate_mover() [2/7]

ParsedProtocolOP protocols::rosetta_scripts::RosettaScriptsParser::generate_mover ( std::string const &  xml_fname,
std::string const &  current_input_name = "",
std::string const &  current_output_name = "" 
)

Convenience function to construct a ParsedProtocol from a file.

Reads in an RosettaScript from file, replaces script_vars if present, Then returns the full ParsedProtocol See also protocols::rosetta_scripts::XmlObjects

References protocols::jd2::current_output_name().

Referenced by protocols::rosetta_scripts::XmlObjects::create_from_file(), and protocols::rpc::JSON_RPC::run().

◆ generate_mover() [3/7]

ParsedProtocolOP protocols::rosetta_scripts::RosettaScriptsParser::generate_mover ( std::string const &  xml_fname,
utility::vector1< std::string > const &  script_vars,
std::string const &  current_input_name = "",
std::string const &  current_output_name = "" 
)

Convenience function to construct a ParsedProtocol from a file.

Reads in an RosettaScript from file, replaces script_vars if present, Then returns the full ParsedProtocol See also protocols::rosetta_scripts::XmlObjects

References protocols::jd2::current_output_name().

◆ generate_mover() [4/7]

ParsedProtocolOP protocols::rosetta_scripts::RosettaScriptsParser::generate_mover ( utility::options::OptionCollection const &  options,
std::string const &  current_input_name,
std::string const &  current_output_name,
basic::resource_manager::ResourceManagerOP  resource_manager 
)

Convenience function to construct a ParsedProtocol from a file.

Reads in an RosettaScript from file, replaces script_vars if present, Then returns the full ParsedProtocol See also protocols::rosetta_scripts::XmlObjects. Any Resources requested in the RESOURCES block will be retrieved from the ResourceManager and placed in the DataMap.

References protocols::jd2::current_output_name().

◆ generate_mover() [5/7]

ParsedProtocolOP protocols::rosetta_scripts::RosettaScriptsParser::generate_mover ( utility::options::OptionCollection const &  options,
std::string const &  xml_fname,
std::string const &  current_input_name = "",
std::string const &  current_output_name = "",
XmlObjectsOP  xml_objects = nullptr,
basic::resource_manager::ResourceManagerOP  resource_manager = nullptr 
)

Convenience function to construct a ParsedProtocol from a file.

Reads in an RosettaScript from file, replaces script_vars if present, Then returns the full ParsedProtocol See also protocols::rosetta_scripts::XmlObjects

References protocols::jd2::current_output_name().

◆ generate_mover() [6/7]

ParsedProtocolOP protocols::rosetta_scripts::RosettaScriptsParser::generate_mover ( utility::options::OptionCollectionCOP  options,
std::string const &  current_input_name,
std::string const &  current_output_name,
basic::resource_manager::ResourceManagerOP  resource_manager 
)

Convenience function to construct a ParsedProtocol from a file.

Reads in an RosettaScript from file, replaces script_vars if present, Then returns the full ParsedProtocol See also protocols::rosetta_scripts::XmlObjects. Any Resources requested in the RESOURCES block will be retrieved from the ResourceManager and placed in the DataMap.

Places an OptionCollectionCOP into the datamap for local option parsing.

References protocols::jd2::current_output_name().

◆ generate_mover() [7/7]

ParsedProtocolOP protocols::rosetta_scripts::RosettaScriptsParser::generate_mover ( utility::options::OptionCollectionCOP  options,
std::string const &  xml_fname,
std::string const &  current_input_name = "",
std::string const &  current_output_name = "",
XmlObjectsOP  xml_objects = nullptr,
basic::resource_manager::ResourceManagerOP  resource_manager = nullptr 
)

Convenience function to construct a ParsedProtocol from a file.

Reads in an RosettaScript from file, replaces script_vars if present, Then returns the full ParsedProtocol See also protocols::rosetta_scripts::XmlObjects

Places an OptionCollectionCOP into the datamap for local option parsing.

References protocols::jd2::current_output_name().

◆ generate_mover_for_protocol() [1/4]

ParsedProtocolOP protocols::rosetta_scripts::RosettaScriptsParser::generate_mover_for_protocol ( core::pose::Pose ,
bool &  ,
utility::tag::TagCOP  protocol_tag,
utility::options::OptionCollection const &  options,
std::string const &  current_input_name = "",
std::string const &  current_output_name = "",
XmlObjectsOP  xml_objects = nullptr,
basic::resource_manager::ResourceManagerOP  resource_manager = nullptr 
)
inline

Create the ParsedProtocolMover for the protocol using a tag.

This interface is preserved for (PyRosetta) backwards compatibility only. The Pose and bool (modified_pose) parameters are now unused.

References protocols::jd2::current_output_name(), and generate_mover_for_protocol().

◆ generate_mover_for_protocol() [2/4]

ParsedProtocolOP protocols::rosetta_scripts::RosettaScriptsParser::generate_mover_for_protocol ( utility::tag::TagCOP  protocol_tag,
basic::datacache::DataMap data,
utility::options::OptionCollection const &  options,
XmlObjectsOP  xml_objects = nullptr,
basic::resource_manager::ResourceManagerOP  resource_manager = nullptr 
)

Create the ParsedProtocolMover for the protocol using a tag.

Uses the passed DataMap for passing to parse_my_tag. This function does the heavy lifting.

Does not add any predefined objects to the data map (though in-tag defined objects will be added.)

References core::scoring::parse_score_function(), and protocols::rosetta_scripts::TR().

◆ generate_mover_for_protocol() [3/4]

ParsedProtocolOP protocols::rosetta_scripts::RosettaScriptsParser::generate_mover_for_protocol ( utility::tag::TagCOP  protocol_tag,
utility::options::OptionCollection const &  options,
basic::datacache::DataMap data,
std::string const &  current_input_name = "",
std::string const &  current_output_name = "",
XmlObjectsOP  xml_objects = nullptr,
basic::resource_manager::ResourceManagerOP  resource_manager = nullptr 
)

Create the ParsedProtocolMover for the protocol using a tag.

Load the datamap with the predefined object, then go through tags, generating object and the ParsedProtocol Mover. READS from LOCAL OptionCollection.

References protocols::jd2::current_output_name().

◆ generate_mover_for_protocol() [4/4]

ParsedProtocolOP protocols::rosetta_scripts::RosettaScriptsParser::generate_mover_for_protocol ( utility::tag::TagCOP  protocol_tag,
utility::options::OptionCollection const &  options,
std::string const &  current_input_name = "",
std::string const &  current_output_name = "",
XmlObjectsOP  xml_objects = nullptr,
basic::resource_manager::ResourceManagerOP  resource_manager = nullptr 
)

Create the ParsedProtocolMover for the protocol using a tag.

Load the datamap with the predefined object, then go through tags, generating object and the ParsedProtocol Mover. READS from LOCAL OptionCollection.

References protocols::jd2::current_output_name().

Referenced by generate_mover_for_protocol().

◆ generate_mover_xml_string() [1/2]

ParsedProtocolOP protocols::rosetta_scripts::RosettaScriptsParser::generate_mover_xml_string ( utility::options::OptionCollection const &  options,
std::string const &  xml_text,
std::string const &  current_input_name,
std::string const &  current_output_name,
XmlObjectsOP  xml_objects 
)

Convenience function to construct a ParsedProtocol from a string.

Reads in an RosettaScript from file, replaces script_vars if present, Then returns the full ParsedProtocol See also protocols::rosetta_scripts::XmlObjects

References protocols::jd2::current_output_name().

Referenced by protocols::rosetta_scripts::XmlObjects::create_from_string().

◆ generate_mover_xml_string() [2/2]

ParsedProtocolOP protocols::rosetta_scripts::RosettaScriptsParser::generate_mover_xml_string ( utility::options::OptionCollectionCOP  options,
std::string const &  xml_text,
std::string const &  current_input_name,
std::string const &  current_output_name,
XmlObjectsOP  xml_objects 
)

Convenience function to construct a ParsedProtocol from a string.

Reads in an RosettaScript from file, replaces script_vars if present, Then returns the full ParsedProtocol See also protocols::rosetta_scripts::XmlObjects

Places an OptionCollectionCOP into the datamap for local option parsing.

References protocols::jd2::current_output_name().

◆ has_double_percent_signs()

bool protocols::rosetta_scripts::RosettaScriptsParser::has_double_percent_signs ( std::string const &  str,
core::Size const  endpos 
) const
private

Is the current tag one with something that will be replaced by variable replacement?

Starting from endpos, crawl backward until we hit a '<' or ''. Return 'false' if the former is preceded by a percent sign and 'true' if we hit the latter.

Author
Vikram K. Mulligan (vmull.nosp@m.ig@u.nosp@m.w.edu)

Starting from endpos, crawl backward until we hit a '<' or ''. Return 'false' if the former and 'true' if the latter.

Author
Vikram K. Mulligan (vmull.nosp@m.ig@u.nosp@m.w.edu)

References protocols::kinmatch::str().

◆ has_slash_at_end()

bool protocols::rosetta_scripts::RosettaScriptsParser::has_slash_at_end ( std::string const &  str,
core::Size const  endpos 
) const
private

Is the current tag one with a slash at the end?

Starting from endpos, crawl backward until we hit a '/' or a non-whitespace character. Return true if and only if it's a slash, false otherwise.

Author
Vikram K. Mulligan (vmull.nosp@m.ig@u.nosp@m.w.edu)

References protocols::kinmatch::str().

◆ import_tags()

void protocols::rosetta_scripts::RosettaScriptsParser::import_tags ( std::set< ImportTagName > &  import_tag_names,
utility::tag::TagCOP  my_tag,
basic::datacache::DataMap data 
) const

Import filters, movers, ... specified in the IMPORT tag in the order they were originally defined elsewhere in the script.

References protocols::rosetta_scripts::TR().

◆ initialize_data_map()

void protocols::rosetta_scripts::RosettaScriptsParser::initialize_data_map ( basic::datacache::DataMap data,
utility::options::OptionCollection const &  options 
)

◆ instantiate_filter()

void protocols::rosetta_scripts::RosettaScriptsParser::instantiate_filter ( utility::tag::TagCOP const &  tag_ptr,
basic::datacache::DataMap data 
) const

Instantiate a new filter and add it to the list of defined filters for this ROSETTASCRIPTS block.

References protocols::rosetta_scripts::TR().

◆ instantiate_mover()

void protocols::rosetta_scripts::RosettaScriptsParser::instantiate_mover ( utility::tag::TagCOP const &  tag_ptr,
basic::datacache::DataMap data 
) const

Instantiate a new mover and add it to the list of defined movers for this ROSETTASCRIPTS block.

References protocols::rosetta_scripts::TR().

◆ instantiate_packer_palette()

void protocols::rosetta_scripts::RosettaScriptsParser::instantiate_packer_palette ( utility::tag::TagCOP const &  tag_ptr,
basic::datacache::DataMap data 
) const

Instantiate a PackerPalette object.

Author
Vikram K. Mulligan (vmull.nosp@m.ig@u.nosp@m.w.edu).

References protocols::rosetta_scripts::TR().

◆ instantiate_taskoperation()

void protocols::rosetta_scripts::RosettaScriptsParser::instantiate_taskoperation ( utility::tag::TagCOP const &  tag_ptr,
basic::datacache::DataMap data 
) const

Instantiate a new task operation (used in IMPORT tag)

References protocols::rosetta_scripts::TR().

◆ list_options_read()

void protocols::rosetta_scripts::RosettaScriptsParser::list_options_read ( utility::options::OptionKeyList &  read_options)
static

◆ load_native()

void protocols::rosetta_scripts::RosettaScriptsParser::load_native ( std::string const &  fname)
private

Load a native into this class, which will be placed into the datamap as a resource upon generating mover(s).

References core::import_pose::PDB_file, core::import_pose::pose_from_file(), and protocols::rosetta_scripts::TR().

◆ parse_apply_to_pose_tag()

void protocols::rosetta_scripts::RosettaScriptsParser::parse_apply_to_pose_tag ( utility::tag::TagCOP  apply_tag,
basic::datacache::DataMap data 
) const

◆ parse_import_tag()

void protocols::rosetta_scripts::RosettaScriptsParser::parse_import_tag ( utility::tag::TagCOP  import_tag,
basic::datacache::DataMap data 
) const

◆ parse_protocol_tag()

ParsedProtocolOP protocols::rosetta_scripts::RosettaScriptsParser::parse_protocol_tag ( utility::tag::TagCOP  protocol_tag,
utility::options::OptionCollection const &  options 
)

◆ parse_resources_tag()

void protocols::rosetta_scripts::RosettaScriptsParser::parse_resources_tag ( utility::tag::TagCOP  resources_tag,
basic::datacache::DataMap data,
basic::resource_manager::ResourceManagerOP  resource_manager 
) const

◆ protocol_option_set()

bool protocols::rosetta_scripts::RosettaScriptsParser::protocol_option_set ( utility::options::OptionCollection const &  options) const

Checks the LOCAL options collection to see if a protocol has been set.

◆ read_in_and_recursively_replace_includes()

void protocols::rosetta_scripts::RosettaScriptsParser::read_in_and_recursively_replace_includes ( std::string const &  filename,
std::string &  substituted_contents,
utility::vector1< std::string >  filenames_encountered,
core::Size const  recursion_level,
bool const  do_not_recurse = false,
std::string const &  xml_text_for_top_level = "" 
) const

Actually read in the XML file. Called recursively to read in XML files that this XML file includes. At the end of this operation, substituted_contents contains the contents of the XML file, with all xi:includes replaced with the contents of included XML files. Files are opened and closed here.

Note that filenames_encountered is passed by copy rather than by reference DELIBERATELY. This is so that it remains a list of parent files, so that only circular dependencies (attempts to include one's own parent, grandparent, etc.) are detected. If xml_text_for_top_level is set the filename passed will not be read and instead xml_text_for_top_level will be used as though it was the contents of the first file.

Author
Vikram K. Mulligan (vmull.nosp@m.ig@u.nosp@m.w.edu)
Rocco Moretti (rmore.nosp@m.ttia.nosp@m.se@gm.nosp@m.ail..nosp@m.com)

References protocols::abinitio::filename(), and protocols::rosetta_scripts::TR().

◆ register_factory_prototypes()

void protocols::rosetta_scripts::RosettaScriptsParser::register_factory_prototypes ( )
static

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 protocols::multistage_rosetta_scripts::MRSJobQueen::MRSJobQueen().

◆ rosetta_scripts_complex_type_naming_func()

std::string protocols::rosetta_scripts::RosettaScriptsParser::rosetta_scripts_complex_type_naming_func ( std::string const &  element_name)
static

◆ rosetta_scripts_element_name()

std::string protocols::rosetta_scripts::RosettaScriptsParser::rosetta_scripts_element_name ( )
static

◆ set_recursion_limit()

void protocols::rosetta_scripts::RosettaScriptsParser::set_recursion_limit ( utility::options::OptionCollection const &  options)

◆ substitute_variables_in_stream()

void protocols::rosetta_scripts::RosettaScriptsParser::substitute_variables_in_stream ( std::istream &  instream,
utility::vector1< std::string > const &  script_vars,
std::stringstream &  out 
)
static

Substitute xx==yy using the XML syntax %xx%%. / script_vars is a list of strings of "xx==yy".

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 core::sequence::end, core::conformation::membrane::out, and protocols::rosetta_scripts::TR().

Referenced by protocols::jd3::standard::perform_variable_substitution().

◆ validate_input_script_against_xsd()

void protocols::rosetta_scripts::RosettaScriptsParser::validate_input_script_against_xsd ( std::string const &  fname,
std::stringstream const &  input_xml 
) const

◆ write_ROSETTASCRIPTS_complex_type()

void protocols::rosetta_scripts::RosettaScriptsParser::write_ROSETTASCRIPTS_complex_type ( utility::tag::XMLSchemaDefinition &  xsd)
static

◆ xsd_for_rosetta_scripts()

std::string protocols::rosetta_scripts::RosettaScriptsParser::xsd_for_rosetta_scripts ( )
static

Member Data Documentation

◆ local_options_

utility::options::OptionCollectionCOP protocols::rosetta_scripts::RosettaScriptsParser::local_options_ = nullptr
private

◆ native_pose_

core::pose::PoseOP protocols::rosetta_scripts::RosettaScriptsParser::native_pose_ = nullptr
private

◆ recursion_limit_

core::Size protocols::rosetta_scripts::RosettaScriptsParser::recursion_limit_
private

The depth of the rabbit hole one can find oneself in by including XML files that include XML files. Defaults to 8.


The documentation for this class was generated from the following files: