GROMACS includes many tools for preparing, running and analysing molecular dynamics simulations. These are all structured as part of a single gmx wrapper binary, and invoked with commands like gmx grompp. mdrun is the only other binary that can be built; in the normal build it can be run with gmx mdrun. Documentation for these can be found at the respective sections below, as well as on man pages (e.g., gmx-grompp(1)) and with gmx help command or gmx command -h.
If you’ve installed an MPI version of GROMACS, by default the gmx binary is called gmx_mpi and you should adapt accordingly.
All GROMACS commands require an option before any arguments (i.e., all command-line arguments need to be preceded by an argument starting with a dash, and values not starting with a dash are arguments to the preceding option). Most options, except for boolean flags, expect an argument (or multiple in some cases) after the option name. The argument must be a separate command-line argument, i.e., separated by space, as in -f traj.xtc. If more than one argument needs to be given to an option, they should be similarly separated from each other. Some options also have default arguments, i.e., just specifying the option without any argument uses the default argument. If an option is not specified at all, a default value is used; in the case of optional files, the default might be not to use that file (see below).
All GROMACS command options start with a single dash, whether they are single- or multiple-letter options. However, two dashes are also recognized (starting from 5.1).
In addition to command-specific options, some options are handled by the gmx wrapper, and can be specified for any command. See wrapper binary help for the list of such options. These options are recognized both before the command name (e.g., gmx -quiet grompp) as well as after the command name (e.g., gmx grompp -quiet). There is also a -hidden option that can be specified in combination with -h to show help for advanced/developer-targeted options.
Most analysis commands can process a trajectory with fewer atoms than the run input or structure file, but only if the trajectory consists of the first n atoms of the run input or structure file.
Options that accept files names have features that support using default file names (where the default file name is specific to that option):
All such options will accept file names without a file extension. The extension is automatically appended in such a case. When multiple input formats are accepted, such as a generic structure format, the directory will be searched for files of each type with the supplied or default name. When no file with a recognized extension is found, an error is given. For output files with multiple formats, a default file type will be used.
Some file formats can also be read from compressed (.Z or .gz) formats.
The information in these topics is also accessible through gmx help topic on the command line.
Starting from GROMACS 5.0, some of the analysis commands (and a few other commands as well) have changed significantly.
One main driver for this has been that many new tools mentioned below now accept selections through one or more command-line options instead of prompting for a static index group. To take full advantage of selections, the interface to the commands has changed somewhat, and some previous command-line options are no longer present as the same effect can be achieved with suitable selections. Please see Selection syntax and usage additional information on how to use selections.
In the process, some old analysis commands have been removed in favor of more powerful functionality that is available through an alternative tool. For removed or replaced commands, this page documents how to perform the same tasks with new tools. For new commands, a brief note on the available features is given. See the linked help for the new commands for a full description.
This section lists only major changes; minor changes like additional/removed options or bug fixes are not typically included.
Symbolic links from 5.0 are no longer supported. The only way to invoke a command is through gmx <command>.
new
gmx pairdist has been introduced as a selection-enabled replacement for gmx mindist (gmx mindist still exists unchanged). It can calculate min/max pairwise distances between a pair of selections, including, e.g., per-residue minimum distances or distances from a single point to a set of residue-centers-of-mass.
rewritten
gmx rdf has been rewritten for 5.1 to use selections for specifying the points from which the RDFs are calculated. The interface is mostly the same, except that there are new command-line options to specify the selections. The following additional changes have been made:
Version 5.0 introduced the gmx wrapper binary. For backwards compatibility, this version still creates symbolic links by default for old tools: e.g., g_order <options> is equivalent to gmx order <options>, and g_order is simply a symbolic link on the file system.
replaced
This tool has been removed in 5.0. A replacement is gmx distance.
You can provide your existing index file to gmx distance, and it will calculate the same distances. The differences are:
You can produce any combination of output files. Compared to g_bond, gmx distance -oall is currently missing labels for the output columns.
replaced
This tool has been removed in 5.0. A replacement is gmx distance (for most options) or gmx select (for -dist or -lt).
If you had index groups A and B in index.ndx for g_dist, you can use the following command to compute the same distance with gmx distance:
gmx distance -n index.ndx -select 'com of group "A" plus com of group "B"' -oxyz -oall
The -intra switch is replaced with -nopbc.
If you used -dist D, you can do the same calculation with gmx select:
gmx select -n index.ndx -select 'group "B" and within D of com of group "A"' -on/-oi/-os/-olt
You can select the output option that best suits your post-processing needs (-olt is a replacement for g_dist -dist -lt)
new
gmx distance has been introduced as a selection-enabled replacement for various tools that computed distances between fixed pairs of atoms (or centers-of-mass of groups). It has a combination of the features of g_bond and g_dist, allowing computation of one or multiple distances, either between atom-atom pairs or centers-of-mass of groups, and providing a combination of output options that were available in one of the tools.
new
gmx gangle has been introduced as a selection-enabled replacement for g_sgangle. In addition to supporting atom-atom vectors, centers-of-mass can be used as endpoints of the vectors, and there are a few additional angle types that can be calculated. The command also has basic support for calculating normal angles between three atoms and/or centers-of-mass, making it a partial replacement for gmx angle as well.
gmx protonate
replaced
This was a very old tool originally written for united atom force fields, where it was necessary to generate all hydrogens after running a trajectory in order to calculate e.g. distance restraint violations. The functionality to simply protonate a structure is available in gmx pdb2gmx. If there is significant interest, we might reintroduce it after moving to new topology formats in the future.
new
This tool has been introduced in 5.0. It uses a Monte Carlo sampling method to calculate the fraction of free volume within the box (using a probe of a given size).
rewritten
This tool has been rewritten in 5.0, and renamed to gmx sasa (the underlying surface area calculation algorithm is still the same).
The main difference in the new tool is support for selections. Instead of prompting for an index group, a (potentially dynamic) selection for the calculation can be given with -surface. Any number of output groups can be given with -output, allowing multiple parts of the surface area to be computed in a single run. The total area of the -surface group is now always calculated.
The tool no longer automatically divides the surface into hydrophobic and hydrophilic areas, and there is no -f_index option. The same effects can be obtained by defining suitable selections for -output. If you want output that contains the same numbers as with the old tool for a calculation group A and output group B, you can use
gmx sasa -surface 'group "A"' -output '"Hydrophobic" group "A" and charge {-0.2 to 0.2}; "Hydrophilic" group "B" and not charge {-0.2 to 0.2}; "Total" group "B"'
Solvation free energy estimates are now calculated only if separately requested with -odg, and are written into a separate file.
Output option -i for a position restraint file is not currently implemented in the new tool, but would not be very difficult to add if requested.
replaced
This tool has been removed in 5.0. A replacement is gmx gangle (for angle calculation) and gmx distance (for -od, -od1, -od2).
If you had index groups A and B in index.ndx for g_sgangle, you can use the following command to compute the same angle with gmx gangle:
gmx gangle -n index.ndx -g1 vector/plane -group1 'group "A"' -g2 vector/plane -group2 'group "B"' -oav
You need to select either vector or plane for the -g1 and -g2 options depending on which one your index groups specify.
If you only had a single index group A in index.ndx and you used g_sgangle -z or -one, you can use:
gmx gangle -n index.ndx -g1 vector/plane -group1 'group "A"' -g2 z/t0 -oav
For the distances, you can use gmx distance to compute one or more distances as you want. Both distances between centers of groups or individual atoms are supported using the new selection syntax.
This tool has been split to gmx solvate and gmx insert-molecules.
This tool has been renamed gmx convert-tpr.