GROMACS File Guide
A quick reference for .gro, .top, .mdp, and .ndx files - and everything they produce.
Input files
.gro - Coordinates
A fixed-column text format holding every atom's position (and optionally velocity), plus the box vectors, at a single point in time. This is what a structure "looks like" at one instant.
.top - Topology
Defines which molecules are present, how many of each, and which force field parameters (bonds, angles, charges) apply to them. If your .gro and .top disagree about how many atoms exist, grompp will refuse to run.
.mdp - Simulation parameters
A plain-text control file: integration time step, thermostat/barostat settings, number of steps to run, and how often to write output. You edit this file directly to configure a run.
.ndx - Index groups
Optional named atom subsets, letting you apply a setting - like a position restraint - to just "Protein" or just "Backbone" instead of the whole system. Not always required; GROMACS has sensible default groups built in.
The pipeline
# 1. Pre-process: combine structure + topology + parameters
gmx grompp -f minim.mdp -c system.gro -p topol.top -o em.tpr
# 2. Run: actually execute the simulation
gmx mdrun -deffnm em
.tpr - Portable run input
Produced by grompp, consumed by mdrun. A self-contained binary snapshot of everything needed to run - you can hand someone a single .tpr file and they can reproduce your run without needing your original .gro/.top/.mdp separately.
Output files
| File | Contents |
|---|---|
.log | The full run log - the first place to look when something goes wrong |
.edr | Energy data (temperature, pressure, potential energy, etc.) over time |
.xtc | Compressed trajectory - atom positions over time, used for analysis |
.trr | Full-precision trajectory (positions, velocities, forces) - much larger than .xtc |
.cpt | Checkpoint file, written periodically, lets you safely resume an interrupted run |
Resuming an interrupted run
gmx mdrun -deffnm production -cpi production.cpt
Common naming convention
Most GROMACS tutorials use -deffnm to give every file from one step the same prefix (e.g. em.log, em.edr, em.tpr all belong to the "em" = energy minimization step). Keeping each stage's files under its own prefix makes a project folder much easier to navigate later.