Member Site › Forums › PyRosetta › PyRosetta – General › Parsing XML tags using pyrosetta
- This topic has 1 reply, 2 voices, and was last updated 9 years, 2 months ago by Anonymous.
-
AuthorPosts
-
-
October 19, 2015 at 1:37 pm #2312Anonymous
Hi,
I’d like to be able to use some of the rosetta_scripts xml scripts that have been described in publications, but I’d like to be able to use pyrosetta to carry out the procedure. Lots of movers and filters have a “parse_my_tag” function, and I’m wondering if it’s possible to use pyrosetta call these function with a mover object created in pyrosetta. As an example I’ve been trying to call this function from an “InterfaceAnalzyerMover” object, but it’s not clear to me how to create a “TagCOP” objcet with the appropriate XML string, or how to properly create and use a Filters_map and Movers_map.
Thanks,
R
-
October 19, 2015 at 3:25 pm #11275Anonymous
Ideally, there’s a way to invoke whatever the tag does by using other property setters on the object. For example, the InterfaceAnalyserMover has a number of set_* functions which correspond pretty much with the corresponding XML option (pack_separated -> set_pack_separated(); packstat -> set_compute_packstat(); etc. ).
This isn’t always true, though. Some movers/filters are set up such that they’re only easily usable from XML. I’ve never done it, so I don’t know how workable it is in PyRosetta, but the utility.tag.Tag.create() function (it’s a class/static function) should return an object which should be usable as a “TagCOP” parameter.
The Filters_map, MoversMap and DataMap objects are protocols.filters.Filters_map, protocols::moves::Movers_map, and basic.datacache.DataMap. The former two are simply aliases for std::map< std::string const, FilterOP > and std::map< std::string const, MoverOP >, so you might have issues creating them at the Python level. (See http://www.pyrosetta.org/faq#TOC-3.-How-do-I-std::map-objects- though.)
One option is to simply make a full RosettaScripts XML file, parse the string with Tag.create() , and then pass it to protocols.rosetta_scripts.RosettaScriptsParser::generate_mover_for_protocol(). This should give you back a fully set up Mover which encapsulates the full protocol.
-
-
AuthorPosts
- You must be logged in to reply to this topic.