Initializing DockDesignParser in PyRosetta

Member Site Forums PyRosetta PyRosetta – General Initializing DockDesignParser in PyRosetta

Viewing 3 reply threads
  • Author
    • #1563

        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?


      • #8652

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

        • #8663

            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.

          • #8670

              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.

            • #8653

                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.

              • #8655

                  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.

                • #8677

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

                Viewing 3 reply threads
                • You must be logged in to reply to this topic.