Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Commands for the relax application


This document was last edited October 2nd 2012 by Roland A. Pache. This application in mini was created and documented by Mike Tyka, et al.

Purpose and Algorithm

The "relax" application in Rosetta carries out the task of simple structural refinement of fullatom Rosetta models. It can also read Centroid models, in which case it will convert the model into a fullatom model and pack the sidechains. Relax does not carry out any extensive refinement and only searches the local conformational space neighbourhood.


Relax takes as input one or more structures in silent or PDB format. All JD2 options apply (see JD2 Documentation for more details)

FoldTree output

Relax outputs one or more structures in silent or PDB format. All JD2 output options apply (see JD2 Documentation for more details) As always -nstruct regulates the number of outputs per input structure.

Command Line Options

Sample command

relax.linuxgccrelease -database ~/rosetta_database -in:file:s input.pdb -in:file:fullatom -native 1a19.pdb -out:file:silent default.out -relax:quick

Relax can take all general file IO options common to all Rosetta applications written with JD2: (see JD2 documentation for details)

   -database                 Path to rosetta databases
   -in:file:s                Input pdb file(s)
   -in:file:silent           Input silent file
   -in:file:fullatom         Read as fullatom input structure
   -score:weights            Supply a different weights file (default is score12)
   -score:patch              Supply a different patch file (default is score12)
   -run:shuffle              Use shuffle mode, treat structures in random order
   -nstruct                  Make how many decoys per input structure ?

Options specific to relax

   Simple Options:
   -relax:fast               Do a simple, small cycle number (5)  fast relax (DEFAULT)
   -relax:thorough           Do a preset, large cycle number (15) fast relax

   Advanced Options:
   -relax:script <file>      Do custom script relax (you can supply a custom script file)
   -relax:jump_move false    Set all jumps to unmovable during minimization. 
   -relax:bb_move false      Set all backbone torsion angles to unmovable during minimization. 
   -relax:chi_move false     Set all chi torsion angles to unmovable during minimization. 
   -in:file:movemap          Read in custom movemap (can be used to specifically define which jumps, bb and chi torsion angles are movable and which ones are not. By default, all are movable. Definitions in the custom movemap override the more general jump_move, bb_move and chi_move commands above. )

   Constraints: If you want constraints on for the entire relax run, set ramp_constraints to false (below) along with the other constraint flags. Constraints can be provided using either the cst_fa_file or cst_file options. If both options are used, priority will be given to the cst_fa_file constraints. Default weights for the constraints are 0. Built in options include backbone coordinate constraints, sidechain coordinate constraints and sidechain pairwise constraints. 
   -constraints:cst_fa_file  <filename>      Add constraints from the fullatom constraint file(*)
   -constraints:cst_fa_weight <weight>       Weight to be used for the constraints in the cst_fa_file.
   -constraints:cst_file  <filename>         Add constraints from the constraint file(*)
   -constraints:cst_weight   <weight>        Weight to be used for the constraints in the cst_file.
   -relax:constrain_relax_to_start_coords    Add coordinate constraints to backbone heavy atoms, based on the input structure.
   -relax:constrain_relax_to_native_coords   Add coordinate constraints to backbone heavy atoms, based on the structure passed to -in:file:native.
   -relax:coord_constrain_sidechains         Also add coordinate constraints to sidechain heavy atoms (requires one of previous two options)
   -relax:coord_cst_stdev    <stdev>         Set the strength of coordinate constraints (smaller=tighter)
   -relax:coord_cst_width    <width>         If set, use flat-bottomed constraints instead of harmonic constraints, with a bottom width of <width>
   -relax:sc_cst_maxdist   <dist>            Add pairwise atom constraints to sidechain atoms up to dist apart from one another.
   -relax:ramp_constraints   false           When explicitly set to false, do not ramp down constraints (does not affect ramping in custom scripts)

   Deprecated Modes (don't use):
   -relax:classic            Do an old old deprecated "classic" relax mode (slow and poor performance)

(*) See Constraint File Format


The example above with input files can be found in demo/relax/ Just execute the script.


Relax returns full-atom relaxed structures. Relax is a general purpose protocol and used in many different applications where fullatom structures are required at the end. In most cases relax is the last step in a larger protocol and the lowest energy structures are of interest to the user.

Description of algorithm

For virtually all situations it should be sufficient to use either -relax:quick or -relax:thorough and not worry about all the options.

The fast relax modes work by running many sidechain repack and minimisation cycles ramping up and down the repulsive weight of the forcefield. This sort of "pulses" the structure in successive collapse and expansion phases which "wiggles" the atoms into a low energy state. No explicit moves are done (this was found not to be useful as most moves are rejected and dont help lowering the energy). Not that despite that fact, the structure can change up to 2-3 A from the starting conformation during the minimisation cycles.

FastRelax is a more modern version of the initial fast relax algotihm which is more flexible and allows definition of a specific script of relax events (how exactly the repack and minimisation cycles are interlaced and what paramters they should take). This is defined in a script file. An example script file looks like this:

repeat 15
ramp_repack_min 0.02  0.01
ramp_repack_min 0.250 0.01
ramp_repack_min 0.550 0.01
ramp_repack_min 1     0.00001

The above command chain would do 15 repeats of a ramp-profile of 0.02, 0.25, 0.550 and 1.0 of the repulsive weight. At each step a repack is followed by a minimisation with a tolerance of 0.01,0.01,0.01 and 0.00001 respectively. Over all the weight would pulse in this order 0.02, 0.25, 0.550, 1.0, 0.02, 0.25, 0.550, 1.0, 0.02, 0.25, 0.550, 1.0, 0.02, 0.25, 0.550, 1.0 ... The lowest energy structure encountered at the full weight is reported back at the end.

NOTE: It should virtually never be necessary to mess with the preset script or parameters! Dont touch unless you know what you're doing!

Relax Script Format description:

Valid commands include:

repeat <loopcount>

starts a section to be repeated <loopcount> times - end the block with "endrepeat". Nested loop are NOT supported.


is the end marker of a loop. loops may NOT be nested! (this is not a programming language. well it is. but a very simple one.)


compares the energy of the current pose and the best_pose and replaces the best pose with the current pose if it's energy is lower.


Load the best_pose into the current working pose, replacing it.


Load the starting pose into the current working pose, replacing it.

Sets the best_pose to the current pose whatever the energy of the current pose.

dump <number>

Dumps a pdbfile called dump_<number>.pdb

scale:<scoretype> <scale>

Scales the scoretype's default value by whatever the scale number is. For ex, scale:fa_rep 0.1 will take the original fa_rep weight and set it to 0.1 * original weight.

weight:<scoretype> <weight>

Sets the weight of the scoretype to whatever the weight number is. ALSO CHANGES DEFAULT WEIGHT. This is so in weight, scale, scale routines the scale will be using the user-defined weight, which seems to make more sense. For ex, weight:fa_rep 0.2 will take set fa_rep to 0.2


Outputs the current weights. If a parameter is not outputted, then its weight is 0. Most useful when redirecting stdout to a file, and only one input structure.

coord_cst_weight <scale>

Sets the coordinate_constraint weight to <scale>*start_weight. This is used when using the commandline options -constrain_relax_to_native_coords and -constrain_relax_to_start_coords.


Triggers a full repack

min <tolerance>

Triggers a dfp minimization with a given tolernace (0.001 is a decent value)

ramp_repack_min <scale:fa_rep> <min_tolerance> [ <coord_cst_weight = 0.0> ]

Causes a typical ramp, then repack then minimize cycle - i.e. bascially combines the three commands scale:fa_rep, repack and min (and possible coord_cst_weight)

These two scripts are equivalent:

scale:fa_rep 0.5
min 0.001


ramp_repack_min 0.5 0.001
batch_shave <keep_proportion>

Valid for batchrelax only - ignored in normal FastRelax In Batchrelax it will remove the worst structures from the current pool and leave only <keep_proportion>. I.e. the command

batch_shave 0.75

Will remove the worst 75% of structures from the current working pool.


will quit with immediate effect

A typical FastRelax script is: (this in fact is the default command script)

repeat 5
ramp_repack_min 0.02  0.01     1.0
ramp_repack_min 0.250 0.01     0.5
ramp_repack_min 0.550 0.01     0.0
ramp_repack_min 1     0.00001  0.0

Special Notes on BatchRelax

For developers only:

For development and optimization, these options are also present. These are provided on a as-is basis with no guarantee of functionality or purpose. Use with care.

  Options specific to the fast relax mode (normally you don't need to meddle with these!)

   -relax:script                Script file
   -relax:script_max_accept     Limit number of best accepts, default = 10000000