Steered MD in GROMACS: Pull a Ligand Out, Read the Force

Steered molecular dynamics (SMD) in GROMACS pulls a ligand out of its pocket with a virtual spring that moves at a set rate. You switch it on with the pull code in the mdp file, then plot the force from pullf.xvg against the distance in pullx.xvg. The peak of that curve is the rupture force.
This guide is written by the StemSkills Lab team (10+ years in structural bioinformatics, drug design and molecular modeling). It assumes you already have an equilibrated protein-ligand complex. If you do not, build one first with our protein-ligand MD simulation tutorial in GROMACS, which sits in the wider learn molecular dynamics with GROMACS guide.
What is steered molecular dynamics, and what does it measure?
SMD adds an external bias that drags one group of atoms (here, the ligand) away from another (the protein or its pocket). The idea goes back to the Schulten group’s simulations of biotin leaving avidin, published as Izrailev et al., Biophysical Journal 72, 1568 (1997), which set out to imitate atomic force microscopy (AFM) experiments on single molecules.
What you measure is the force the spring has to apply over time. While the ligand still holds its hydrogen bonds, salt bridges and hydrophobic contacts, the spring stretches and the force climbs. When the key contacts break, the ligand slips forward and the force drops. That maximum is called the rupture force, and it gives you a way to compare ligands that were pulled the same way. It is a non-equilibrium quantity, so it is not a binding free energy (more on this below).
Typical student uses:
- Ranking a few docked analogues by how hard they are to pull out, after docking and a short MD run.
- Finding which residues hold the ligand last before it leaves (the “gatekeepers” of the exit path).
- Generating starting frames along an unbinding path for umbrella sampling.
SMD has been shown to discriminate active from inactive inhibitors in a real enzyme series: Colizzi et al., Journal of the American Chemical Society 132, 7361 (2010) used pulling simulations to separate the two classes. That is a ranking result, not an affinity prediction, and you should present your own results the same way.
Constant velocity or constant force: which pulling mode should you use?
GROMACS offers both through pull-coord1-type. For ligand unbinding, almost every student project should start with constant velocity.
| Mode | mdp setting | What is fixed | What you read out | Best for |
|---|---|---|---|---|
| Constant velocity | pull-coord1-type = umbrella with a non-zero pull-coord1-rate | Spring speed and stiffness | Force against distance or time; peak (rupture) force; work | Ranking ligands; finding the exit path; seeding umbrella windows |
| Constant force | pull-coord1-type = constant-force | The force itself | Time until the ligand leaves under that load | Asking “does it come out under X pN, and how fast” |
| Umbrella sampling (not SMD) | umbrella, rate 0, many windows | Restrained positions along the path | Potential of mean force (PMF), a free energy profile | An actual binding free energy estimate |
The name of the constant-velocity type confuses many students. It is called umbrella because it uses a harmonic (spring) potential. As Justin Lemkul’s tutorial puts it, “This procedure is NOT umbrella sampling.” The pulling becomes constant velocity because you also give it a rate.
For constant force, the sign convention catches people out. The GROMACS mdp options manual says that in this mode pull-coord1-k is the force constant of a linear potential, and therefore the negative of the force, in kJ mol-1 nm-1. So with distance geometry, a negative k pushes the groups apart. The manual also notes that pull-coord1-init and pull-coord1-rate are not used in constant-force mode.
How do you prepare the system before pulling?
Three things decide whether the pull works: the box, the index groups and the restraints.
1. Make the box long enough along the pull direction
With distance or direction geometry, GROMACS measures the pull distance with periodic corrections, so it must stay below half the box length. If the ligand starts about 1 nm from the pocket centre and you pull it a further 2.5 nm, the box needs to be longer than about 7 nm along that axis. A box built for plain MD with a 1.0 nm margin is often too short. Rebuild it with gmx editconf before solvating, or orient the complex so the exit vector lies along the long axis.
2. Create index groups for the reference and the ligand
Use the pocket residues (for example all residues within about 0.5 nm of the ligand) as the reference group rather than the whole protein. A small reference group gives a cleaner pulling direction.
gmx make_ndx -f npt.gro -o index.ndx
# at the prompt, for example:
# r LIG (your ligand's residue name)
# r 45 78 81 120 (your pocket residues)
# name 21 Pocket (use the group number make_ndx printed)
# q3. Restrain the protein, but not the pocket
Without restraints, the spring drags the whole protein along with the ligand and the force never builds. The standard fix is a position restraint on C-alpha atoms. Restraining every heavy atom freezes the pocket side chains and inflates the force, so avoid the default posre.itp here.
gmx genrestr -f protein_only.gro -o posre_CA.itp -fc 1000 1000 1000
# choose the C-alpha group at the promptThen include it in the protein topology inside #ifdef POSRES_CA … #endif and set define = -DPOSRES_CA in the mdp. The atom numbers in a restraint file count from the start of that molecule, so generate it from protein-only coordinates (see troubleshooting).
What goes in the pull-code mdp block?
Copy your NPT mdp, keep the same force field, cut-off, thermostat and barostat settings, then change the run section and add the pull block. Every option below is in the current GROMACS mdp reference (checked against the GROMACS 2026.4 documentation). If any of the other lines are unfamiliar, our GROMACS mdp file guide explains them.
; smd.mdp: constant-velocity pull of LIG out of the pocket
define = -DPOSRES_CA
integrator = md
dt = 0.002 ; ps
nsteps = 250000 ; 500 ps
continuation = yes
nstxout-compressed = 500 ; one frame per ps
; Pull code
pull = yes
pull-ncoords = 1
pull-ngroups = 2
pull-group1-name = Pocket ; reference group
pull-group2-name = LIG ; pulled group
pull-coord1-type = umbrella ; harmonic spring
pull-coord1-geometry = distance ; along the COM-COM vector
pull-coord1-dim = Y Y Y
pull-coord1-groups = 1 2
pull-coord1-start = yes ; add the starting COM distance to init
pull-coord1-init = 0
pull-coord1-rate = 0.005 ; nm/ps, so the spring moves 2.5 nm in 500 ps
pull-coord1-k = 1000 ; kJ mol^-1 nm^-2
pull-nstxout = 50
pull-nstfout = 50What each choice does:
pull-coord1-start = yesmakes the spring start at the current pocket-ligand distance, so there is no jolt at step zero.pull-coord1-rateis the spring speed. Lemkul’s umbrella sampling tutorial uses 0.01 nm/ps (10 nm per ns) with k = 1000 kJ mol-1 nm-2 over 500 ps to separate two peptides. For a small ligand, starting at half that rate is a sensible first test.pull-coord1-kis the spring stiffness. Too soft and the ligand lags far behind the spring; too stiff and the force trace becomes very noisy.- Geometry.
distancefollows the line between the two centres of mass, which suits open pockets. For a buried pocket, usedirectionand setpull-coord1-vecto an exit vector you chose by inspecting the structure, so the ligand does not get dragged through protein.cylinderis designed for pulling relative to a layer such as a membrane. pull-nstxoutandpull-nstfoutboth default to 50 steps. Keep them equal so the two files line up row by row.
Want the guided, hands-on version?
Our live Molecular Modeling & MD Simulations cohort bootcamp takes you from zero to running real docking and MD workflows, with a portfolio project for your grad-school applications.
How do you run the pull and get pullx.xvg and pullf.xvg?
gmx grompp -f smd.mdp -c npt.gro -t npt.cpt -r npt.gro -p topol.top -n index.ndx -o smd.tpr
gmx mdrun -deffnm smd -px pullx.xvg -pf pullf.xvg-r npt.grosupplies the reference coordinates for the position restraints. Leave it out and grompp stops when restraints are active.-n index.ndxis how grompp finds thePocketandLIGgroups.-pxand-pfname the two pull outputs explicitly. Without them,-deffnmgives prefixed names, and scripts that expectpullx.xvgfail to find the files.
pullx.xvg holds time (ps) and the pull coordinate value (nm). pullf.xvg holds time and the spring force (kJ mol-1 nm-1). Always read the @ s0 legend lines in the header before you trust a column, because options such as pull-print-components add extra columns.
Before you plot anything, watch the trajectory in VMD or PyMOL and confirm the ligand left by a sensible route and the protein kept its fold. Our guide on visualising a GROMACS trajectory in VMD covers centring and fixing periodic jumps first.
How do you read the force-distance curve and the rupture force?
This short Python script pairs the two files, plots force against distance, and prints the peak force and the work done by the spring.
import numpy as np
import matplotlib.pyplot as plt
x = np.loadtxt("pullx.xvg", comments=("#", "@"))
f = np.loadtxt("pullf.xvg", comments=("#", "@"))
n = min(len(x), len(f))
t, dist, force = x[:n, 0], x[:n, 1], f[:n, 1]
rate = 0.005 # nm/ps, same as pull-coord1-rate
i = np.argmax(force)
print(f"Peak force {force[i]:.0f} kJ/mol/nm "
f"({force[i] * 1.66:.0f} pN) at {t[i]:.0f} ps, d = {dist[i]:.2f} nm")
work = rate * np.trapezoid(force, t) # kJ/mol; NumPy 2.x name
print(f"Work done by the spring: {work:.0f} kJ/mol")
plt.plot(dist, force, lw=0.6)
plt.xlabel("Pocket-ligand COM distance (nm)")
plt.ylabel("Pull force (kJ mol$^{-1}$ nm$^{-1}$)")
plt.savefig("force_distance.png", dpi=300)The 1.66 factor converts kJ mol-1 nm-1 to piconewtons (1 kJ mol-1 nm-1 is about 1.66 pN). On NumPy versions before 2.0, replace np.trapezoid with np.trapz. For more plotting options see how to plot GROMACS xvg files in Python.
How to read the shape:
- Rising slope. The spring stretches while the ligand stays bound.
- Peak. The rupture force. Note the time, then open that frame and list the contacts breaking around it (for example with
gmx hbondorgmx mindistbetween the ligand and the pocket residues). - Several smaller peaks. The ligand passed through intermediate states, often a second contact set near the pocket mouth. These are worth describing in a thesis.
- Low plateau. The ligand is in solvent. The force does not reach zero because the spring keeps dragging it through water.
The raw trace is noisy because pullf.xvg stores instantaneous forces. Smooth it with a running average for the figure, report the peak from the smoothed curve, and state the window you used. GROMACS can also write averaged values directly with pull-fout-average = yes.
How many replicates and which pulling speed do you need?
One pull is an anecdote. Each pull starts from different velocities and takes a slightly different path, so peak forces scatter. Run several independent pulls per ligand (five is a reasonable minimum for a student project), each with fresh velocities (gen-vel = yes, continuation = no, gen-seed = -1) or from different frames of your equilibrium run. Report the mean and standard deviation of the peak force.
Pulling speed matters even more. Simulations pull very fast: 0.01 nm/ps equals 10 m/s, while AFM experiments retract at micrometres per second or slower, roughly a million to ten million times slower. Rupture force grows with loading rate, a relationship analysed in Evans and Ritchie, Biophysical Journal 72, 1541 (1997). In practice:
- Compare ligands only at the same rate, k, geometry and direction.
- Repeat the comparison at a second, slower rate (for example 0.0025 nm/ps, which needs twice the steps for the same distance). If the ranking holds at both speeds, you can trust it far more.
- Never compare your absolute numbers with an AFM paper.
Why is an SMD force not a binding free energy?
A fast pull drives the system out of equilibrium, so part of the work is dissipated as friction rather than going into the free energy change. A peak force is therefore a kinetic, protocol-dependent number.
There is a formal bridge. Jarzynski’s equality (Physical Review Letters 78, 2690, 1997) links the free energy difference to an exponential average of the work over many non-equilibrium pulls. Because the average is dominated by rare low-work pulls, a handful of student-scale replicates gives a biased estimate. If you need a binding free energy, use the pull only to generate frames and then run umbrella sampling in GROMACS for the binding free energy. For a faster end-point estimate on the bound state, see MM/PBSA binding free energy in GROMACS.
| Method | Output | Cost | Claim you can make |
|---|---|---|---|
| SMD (this guide) | Peak force, work, exit path | Low: a few short runs per ligand | “Ligand A needs more force to unbind than B under identical pulling” |
| MM/PBSA | End-point energy estimate | Low to moderate | Relative ranking, with known approximations |
| Umbrella sampling + WHAM | PMF along the path | High: many windows | A free energy of unbinding along that coordinate |
What errors do students hit, and how do you fix them?
- grompp says a group referenced in the mdp was not found in the index file. The name in
pull-group1-nameorpull-group2-namemust match an index group exactly, including case. Rungmx make_ndxagain and pass-n index.ndxto grompp. - grompp complains that the distance between pull groups is larger than 0.49 times the box size. The box is too short along the pull direction. Build a longer box, pull a shorter distance (lower
nstepsor rate), or usedirection-periodic, which the manual says requires a box that is not dynamic (no pressure scaling) in the pull dimensions. - grompp stops because the position restraint reference file is missing. Add
-r npt.gro. - The force grows in a straight line and the ligand never leaves, or the protein drifts with it. The restraints are not active. Check that
define = -DPOSRES_CAmatches the#ifdefname and that the include sits inside the protein’s[ moleculetype ]section. - grompp reports a restraint atom index out of range, or the wrong atoms are restrained.
genrestrnumbers atoms from 1 within the coordinates you gave it. If you ran it on the full solvated system, or the protein has several chains with separate topologies, the numbering is wrong. Generate it from protein-only coordinates, per chain if needed. - The ligand tunnels through the protein, or the protein partly unfolds. The rate is too fast, k is too high, or the COM-COM line points into the protein. Slow down, and switch to
directionwith an exit vector toward the pocket opening. - The force jumps by hundreds of units in one frame. Often a periodic image problem with a large or flexible reference group. Use a compact pocket group, or set
pull-pbc-ref-prev-step-com = yeswith a central atom given inpull-group1-pbcatom.
For context on how SMD fits into a full MD skill set, see the computational biology skills roadmap.
Frequently asked questions
Is steered MD the same as umbrella sampling?
No. SMD moves the restraint continuously and measures force out of equilibrium. Umbrella sampling holds the system at many fixed positions and combines them (for example with gmx wham) into a free energy profile. An SMD run is often used to generate the starting frames for umbrella sampling.
What pull rate and force constant should I start with?
A common starting point is k = 1000 kJ mol-1 nm-2 with a rate between 0.0025 and 0.01 nm/ps, in line with widely used GROMACS tutorials. Check that the protein keeps its fold, then repeat at a second rate to confirm your ligand ranking does not depend on speed.
Can I report the peak force as binding affinity?
No. A peak force depends on pulling speed, spring stiffness, direction and geometry. Report it as a relative comparison between ligands pulled under identical conditions, with replicates and standard deviations.
Which file has the force and which has the distance?
pullf.xvg has the force in kJ mol-1 nm-1; pullx.xvg has the pull coordinate in nm. Both start with time in ps, so pair them by row when the two output intervals are equal.
Do I need a GPU for steered MD?
No, but it helps. A 500 ps pull of a solvated protein-ligand system is a short run, but five replicates for two ligands at two speeds add up. Our guide to running GROMACS on a free Google Colab GPU is one way to get through them on a student budget.
Want the guided, hands-on version?
Our live Molecular Modeling & MD Simulations cohort bootcamp takes you from zero to running real docking and MD workflows, with a portfolio project for your grad-school applications.
