You are here

How to optimize the orientations of polar hydrogens in PyRosetta

6 posts / 0 new
Last post
How to optimize the orientations of polar hydrogens in PyRosetta


I wonder if there is a way to trigger the optimization of polar hydrogens in PyRosetta just like the "-no_optH" option in Rosetta when reading structure information from PDB files into Pose. Because I found many potential hydrogen bonds in the original PDB structures were interrupted by the wrongly added hydrogens by default which result very high energy scores.

I have not found any routines to set free the movemenet of hydrogens in the MoveMap settings.

And by the way, is there a way to supress the std outputs like "core" and "basic" in PyRosetta, just like the "-mute" or "-output:level" options in Rosetta? Because the debug outputs of my scripts are always flooded by them...

Many thx!


Post Situation: 
Sat, 2012-04-28 16:33

PyRosetta accepts the same flags as C++ rosetta - you just have to manually set the flags. -optH and -mute will work in the same fashion.

I know there's a thread somewhere around here explaining how to do it, but I can't find it at the moment - if you can't find it, or don't already know how to set options in pyrosetta, post again and I'll find someone who does.

Note you'd need the opth option set before reading the pose from PDB; I hope the tracer system re-checks that option at some time other than initialization. It may be possible to get the tracers to allow access to muting them in-code.

If you want to optimize hydrogens directly, try the TaskOperation "OptH" or the function core::pack::optimizeH.

Sat, 2012-04-28 19:13

Suppressing std output in PyRosetta is done the same way as in Rosetta - by specifying "-mute" command line option. In PyRosetta you can do this by adding "extra_options" keyword argument to init, like this:

import rosetta
rosetta.init(extra_options="-mute basic core")

You can also use '-mute all' if you want to mute all channels.

Sat, 2012-04-28 20:13

Hi Steven and Sergey,

Thanks a lot for the prompt replies! The core::pack::optimizeH function works well for my requirement.

But setteing "extra_options" by rosetta.init(extra_options="-mute basic core") is not accepted by PyRosetta. An exception was thrown as "TypeError: init() got an unexpected keyword argument 'extra_options' ". The rosetta.init(*argv) function seems to require a string argument. So I tried to pass the string "app -database D:\Program Files\PyRosetta\rosetta_database -ex1 -ex2aro -mute basic core" to it, but another warning was thrown:
"core.init: ROSETTA3_DB not defined
Warning: Unable to locate database file chemical/atom_type_sets/fa_standard/"

Since the atom types cannot be located, the structure cannot be loaded from PDB and the program exit. Is there anything I did stupid? Or is my PyRosetta version too old (mine is PyRosetta.Windows-v2.011-r45995)?

Thx a lot and best regards


Sat, 2012-04-28 22:26

Hi xfliu,

You right, version v2.011-r45995 is too old for this. Could you try the following? I think it could work on your version:

Try: rosetta.init(['app', '-database', 'D:\Program Files\PyRosetta\rosetta_database', '-ex1', '-ex2aro', '-mute', 'basic', 'core'])

Mon, 2012-04-30 07:59

Yes, Sergey, this list formatted argument can be accepted by my current PyRosetta. But I will update it to the latest version anyway later.

Thanks a lot!


Mon, 2012-04-30 08:29