You are here

Initializing DockDesignParser in PyRosetta

7 posts / 0 new
Last post
Initializing DockDesignParser in PyRosetta

I'm trying to parse a RosettaScript in PyRosetta. In order to do that, I need to initialize the DockDesignParser, I do it in the following fashion:

dpp = protocols.jd2.DockDesignParser()
some_job = protocols.jd2.Job(protocols.jd2.InnerJob("job",0),0)
pose = pose_from_pdb('..')
some_mover = protocols.moves.Mover() (or some_mover = protocols.rosetta_scripts.ParsedProtocol())

yields the following error:
ArgumentError: Python argument types in
DockDesignParser.generate_mover_from_pose(DockDesignParser, Job, Pose, Mover, bool, str)
did not match C++ signature:
generate_mover_from_pose(DockDesignParser_exposer_callback {lvalue}, utility::pointer::owning_ptr job, core::pose::Pose {lvalue} pose, utility::pointer::owning_ptr {lvalue} mover, bool new_input, std::string xml_fname)
generate_mover_from_pose(protocols::jd2::DockDesignParser {lvalue}, utility::pointer::owning_ptr job, core::pose::Pose {lvalue} pose, utility::pointer::owning_ptr {lvalue} mover, bool new_input, std::string xml_fname)

It seems that the arguments are incompatible .. I had tried many combinations but none seem to work. Anyone have any idea what I'm missing?


Post Situation: 
Mon, 2013-04-22 01:56

DockDesignParser::generate_mover_from_pose( JobCOP, Pose & pose, MoverOP & in_mover, bool new_input, std::string const xml_fname ){

You need a MoverOP, and a JobCOP; you appear to be trying to pass Job and Mover (not in a pointer).

Mon, 2013-04-22 07:31

My understanding is that PyRosetta should handle this automatically. Such as when most Rosetta functions/classes take ScoreFunctionOPs - in PyRosetta you don't need to explicitly create the ScoreFunctionOP to use the classes + functions. Perhaps its the COP that's giving problems? I forwarded the post to Sergey.

Mon, 2013-04-22 08:20

It seems strange that "utility::pointer::owning_ptr job" does not have the {lvalue} tag - lvalue means "location value", which means "hey I'm a pointer" - which this should be. This is speaking from general principles...I have no idea how the C++/python interface actually works here.

Mon, 2013-04-22 09:03

Lior, the problem was due to type signature of generate_mover_from_pose function. I have committed the path, so this error should be fixed in >=r54973. Please check if it works for you.

Mon, 2013-04-22 17:51

Actually, after examining the code in details it clear that generate_mover_from_pose as it is now will never work in PyRosetta. The reason for this is that it return its results thought passed references - this is impossible in Python ( ie generate_mover_from_pose(..., MoverOP &, ...) ). What I would recommend will be to rewrite this function in C++ and made it return MoverOP instead (and return MoverOP pointing to NULL if you need a failure flag) - that way it will work with PyRosetta. - Let me know if you need my help with this.

Tue, 2013-04-23 10:32

Thanks a lot Sergey!
I'll give it a try :-)

Thu, 2013-04-25 10:19