You are here

How to relax only one domain of a protein and keep the rest of them fixed

15 posts / 0 new
Last post
How to relax only one domain of a protein and keep the rest of them fixed

Dear Rosetta users,

I have created the missing domain of an X-ray structure by homology modeling and I would like to refine only this part. Is there an easy way to define a residue range in Rosetta and restrict relaxation to these residues rather than writing my own constraints file that includes only atoms from the experimentally derived part? If not what kind of constraints should I impose to the experimentally derived part of my protein (distance, dihedral, etc.)?

thanks in advance,

Post Situation: 
Sun, 2011-04-10 03:16

I've farmed this out for an answer from someone who actually knows. In the meantime, setting very tight CoordinateConstraints on the existing xray coordinates ought to work.

There is a flag called "constrain_relax_segments" but I don't know how it works - I would guess you specify either the regions that SHOULD move, or the regions that should NOT move.

Mon, 2011-04-11 11:10

From Hayretin:

"I checked as I was curious and the relax applications did take the fix_residues_to_native flag but after I ran it, it looks like it has changed other parts of the protein as well (slightly moved the loops). Maybe it is pymol rendering but in any case the applications does take the flag and seems to be mainly working on that part.

~/rosetta/mini/bin/relax.macosgccrelease -database ~/rosetta/minirosetta_database/ -s xx.pdb -fix_residues_to_native x x"

Tue, 2011-04-12 09:43

this is essentially what I'm trying to do here:

using PyRosetta. I've managed to get a simple script working now that recapitulates FastRelax on a specified loop. Hope that helps.

Tue, 2011-04-12 10:09


-constrain_relax_segments flag takes a loop definition file as an input, thus I suppose it relaxes the specified loop only. I suspect this is what jtmacd was trying to do with PyRosetta. I'm currently testing the -fix_residues_to_native flag.


I have the notion that relaxing a loop is different from relaxing a whole domain. I have tried to selectively relax my missing domain using the loop relax protocol invoked by this GUI:

but all the secondary structure of the domain disappeared.

Wed, 2011-04-13 07:16

Hi tevang,

You mean it is moving parts of the domain other than the loop you want to refine? My relax script doesn't do this. I can upload a more user friendly version if you want to give it a try.

Wed, 2011-04-13 07:28


Actually I want to relax a whole domain not just a loop. Perhaps it wasn't clear from the title of my post, but now I 've changed it.

The GUI I've mentioned relaxes only the selected loops but the problem is it brakes them in most of the cases. Does your script do that? If not I would be very keen on trying it.

Wed, 2011-04-13 09:21

No it doesn't break the loops as I've added a chainbreak term to the score function with help from smlewis.

See attached script.

the arguments are:

python reference.pdb pdb_to_relax.pdb start_resnum end_resnum

reference_pdb is just used to calculate RMSDs at the end but you can just put in the same file as for pdb_to_relax if you don't have something to compare to. The resnums are internal Rosetta residue numbers not PDB residue numbers.

Let me know if this works. I've tried to reproduce what fast relax does.

It outputs to test_out.pdb but you can change this to something more user friendly.

Wed, 2011-04-13 09:43


thanks for the script! It works in PyRoseta v1.1 for 3/4 loops but brakes one (actually it's missing) even when I don't select it for relaxation. This loop is 18 aa long and was create with MODELLER and is removed from the relaxed loop models. It also doens't work in PyRoseta v2b, I get this error message:

Traceback (most recent call last):
File "", line 20, in
pose = Pose(input_pdb)
Boost.Python.ArgumentError: Python argument types in
Pose.__init__(Pose, str)
did not match C++ signature:
__init__(_object*, core::pose::Pose src, unsigned long residue_begin, unsigned long residue_end)
__init__(_object*, core::pose::Pose src)

Please contact me at my email adress: for more information about the structure because this discussion is off topic.


I used the flag -fix_residues_to_native but it doesn't loop to have an effect on the conformation. I didn't have time to do enough sampling so this I run the fast relax protocol: a) on the whole protein with no restraints, b) on the whole protein with -constrain_relax_to_start_coords, c) on the whole protein with -constrain_relax_to_start_coords and -ramp_constraints, d) on the whole protein with -fix_residues_to_native 1 330 480 1068, e) on the whole protein with -fix_residues_to_native 480 1068. The domain I created with comparative modeling spans from 331 to 479. So I measured the Ca RMSD of the common residues among all cases, namely 480-1068, and found the following values (in Angstroms): a) 1.099, b) 0.768, c) 0.710, d) 1.163, e) 1.059

As you see the RMSD in the cases where I used the -fix_residues_to_native flag (d,e) is comparable with the RMSD of the fully flexible structure (a). Of course I didn't do enough sampling to support my findings from a first view it doesn't seem to work. Is there any way to increase the weights on the constraints that -fix_residues_to_native flag imposes?

And with respect to Hayretin's command line, I used this one instead: /home/thomas/Programs/Rosetta/rosetta_source/bin/relax.default.linuxgccrelease -database /home/thomas/Programs/Rosetta/rosetta_database @flags -fix_residues_to_native .... I guess it is correct.

@smlewis and jtmacd

The 18 aa long loop that is missing from the relaxed loop models is also missing from the relaxed decoys.

Thu, 2011-04-14 09:19

It doesn't work with PyRosetta 2 as I think they've changed the API.

I suspect there's some problem with your input PDB format on the loop that is missing - does it have occupancy values that are 0.00?

If there's a way of doing what my script is doing with Rosetta 3.2 applications then I'd like to try it but I didn't manage to find it so that's why I started playing with PyRosetta.

Thu, 2011-04-14 09:31

We are well beyond my understanding of the relax code (and I haven't been able to get the relax people interested in it). It may be that fix_residues_to_native only works with abrelax, and not regular relax, I am not sure.

I don't see a command line flag for relax that appears to affect constraint weights other than the ramping one. The variable name for the ramping one implies it ramps down, not up. You may be able to turn ramping OFF and alter line 396 of to set the coordinate constraint weight as high as you like.

I second jtmacd that zero occupancies are a likely culprit.

Thu, 2011-04-14 11:25

Hi Guys!

Indeed, the missing loop residues had zero occupancies, so I changed them to 1.00 using the "" script and the loop residues were included in the relaxed loop model. Yet the relaxed full-length structures still don't have the 18 aa of the loop even in the complete absence of constraints.

As for whole-structure relaxation I switched -ramp_constraints to 0, modified the coordinate constraint weights (values 0.5, 1, 2, 100) and did a little bit of sampling. What I found was that the the Ca RMSD of the common residues among all cases, namely 480-1068, dropped the most when I set -constrain_relax_to_start_coords to 1 and weight to 2 (lowest RMSD 0.699 A.), and the very next parameterization that lowered the RMSD was when -fix_residues_to_native 480 1068 and weight = 2 (lowest RMSD 1041 A.). As you see the "fast relax" protocol perturbs the structure too much. Are there any flags that lower the cycles of refinement in "fast relax" mode?

Mon, 2011-04-18 13:34

A) It may be worth checking that you edited the occupancies and not the B-factors?

B) Try the flag relax::default_repeats. It appears to have a default of either 5 or 8, so maybe you can try 3? This is a guess, I don't really know what the flag does. You can try running relax, WITHOUT this flag, WITH the flag show_accessed_options - that will report at the end of the run if it ever even checks that flag (which I am not sure of).

Mon, 2011-04-18 13:46

Hi guys!

I couldn't find any option(s) in Rosetta 3.2 that relaxes one domain of a protein and keeps the rest of them fixed effectively. Are you aware of any advancements in this regard in Rosetta 3.3 ?

I am also interested in adding a missing domain to a crystal structure through comparative modeling. Do you know if it is possible to leave the new domain flexible but keep the rest of the protein rigid during comparative modeling?

Thu, 2011-11-03 14:38

Partial relax is achievable with RosettaScripts; partial abinitio works too, somehow. The 2011 demos collection (unreleased, but you can get it here: explains how. The two to look at are "relax a large structure" for the former, and "homology modeling with end extension" for the latter (I think). There's also a thread on these boards started in August 2011 for partial relax discussing RosettaScripts; I can't find it but it's there somewhere.

Fri, 2011-11-04 08:12