You are here

Relaxing experimental structure

9 posts / 0 new
Last post
Relaxing experimental structure

I need to measure the Rosetta "energy" of a set of conformations taken from the PDB. Before computing the energy I would like to relax the structures while keeping them as close as possible to the experimental structure. I guess I want something like this. Is that protocal available using PyRosseta? Or I should try to "implement it" my self.

I guess I could do something like:

def relaxation(pose, scorefxn):
	movemap = MoveMap()
	relax = FastRelax()
	return scorefxn(pose)


But I thing the "Relax With All-Heavy-Atom Constraints" is clever than this.

Post Situation: 
Thu, 2016-09-29 03:46

I think that's substantially similar to what you'd get from the C++ relax application with a similar flag set.  You should throw in code to increase the number of rotamers available to packing (whatever the pyrosetta equivalents of -ex1 -ex2 -use_input_sc -extrachi_cutoff 0 is).

Thu, 2016-09-29 07:31

You've got the jist of it. The relax application is simply nothing more that a commandline wrapper around the protocols.relax.Relax_main() function. That does some setup, if options call for it (adding constraints from constraint files, add electron density, adding symmetry, doing pre-relax superimposition), and then basically runs a default FastRelax on the structures.

The wrinkle with PyRosetta is that a bunch of the settings for FastRelax are set from the commanline options. It might be easiest to set them from the init function, but there are ways around it for certain flags. For example, to do `-relax:ramp_constraints false`, call `relax.read_script_file( "NO CST RAMPING", 5 )`, where 5 is the default number of repeats. For `-relax:coord_constrain_sidechains` it's the `relax.coord_constrain_sidechains(True)` call, and for constrain_relax_to_native_coords/constrain_relax_to_start_coords, it's the respective functions, as you've already noticed.

Quick note on constrain_relax_to_native_coords: in order for that to work, you'll need to set the native structure. How to do that depends on which versions of PyRosetta you have. You either have to set it with -in:file:native, or you have to call protocols::jd2::set_native_in_mover() on the FastRelaxMover. -- That might be a little convoluted, so I'd recommend instead just manually adding the coordinate constraints to the pose with protocols.relax.AtomCoordinateCstMover This should allow better control of the coordinate constraints you have. Just call the apply of the AtomCoordinateCstMover prior to calling the apply() of FastRelax. But if your goal is to keep them as close as possible to the input structure, I might recommend using relax.constrain_relax_to_start_coords(True) instead.

Also make sure that the scorefunction you use has the coordinate_constraint scoreterm turned on.

A final note, are you sure you want to turn off backbone movement? The coordinate constraints do a pretty good job of keeping the backbone in place, and much of the energy that you gain from the all-atom constrained relax comes from subtle movements in the backbone atoms. I'd recommend starting with a fully mobile (default) MoveMap, and only restricting degrees of freedom if you see particular problems. 

Thu, 2016-09-29 08:10

Also, if you want to keep as close as possible to the native structure, just to get the energy into the Rosetta energy function for further experiments, see Lucas and Roccos paper here.  Much of this can be done in PyRosetta, but some of it is a bit tricky.

Thu, 2016-09-29 08:50

Thanks everyone fot the input! I will try all  your suggestions.

Sat, 2016-10-01 09:21

I am still playing with parameters. And I have one more (related) question.

I wonder if I could turn the rosetta energy I get for each conformation into relative probabilities for those conformations. This should be simply computing the Boltzmann factors given the energy, but I am not sure with kT should I use and also I am not sure if this is a sensible thing to do.

Sun, 2016-10-02 03:29

I've thought about doing something like this before, and actually wrote a JobInputter to use this info to seed Rosetta.  I don't think this is a bad idea, its just not really done, so its a bit uncharted teratory.  Documentation is here if you want to try it.  Would be super interested in hearing if you do.

Sun, 2016-10-02 09:51

 Thanks for the answer and sorry for the delay. If I undestood correctly your jobinputter is a way to run ensemble-weighted computations using Rosetta. Is that right? While that seems interesting  what I need is something different (or maybe I missunderstood you).  I want to turn rosetta energy into weights for further computations outside Rosetta. The main problem for me is that I don't know the "correct" value  kT (or even is that thing exists).

Thu, 2016-10-06 02:59

I just realize I do not need to know kT, for what I want, just the relative difference bewteen two energies. Sorry for adding noise to the forum. Thanks!

Thu, 2016-10-06 03:29