Molecular dynamics (MD) simulates how atoms in a protein, membrane or protein–ligand complex move over time, using Newton's laws and a force field that describes how atoms attract and repel. Docking gives a static snapshot; MD shows whether a pose is stable, how a protein flexes and how water and ions take part. GROMACS is the most widely used free MD engine. This guide explains the standard protein-in-water workflow, step by step, and how to judge whether a simulation is trustworthy.
What you need
- A protein structure from the PDB or a good model (see how to read AlphaFold models before simulating a predicted structure).
- GROMACS installed (it runs on Linux, macOS and Windows via WSL; a GPU speeds it up many times).
- A force field. For proteins, CHARMM36m and AMBER ff14SB/ff19SB are common choices; pair the force field with its recommended water model.
Step 1: Prepare the structure
Remove crystallisation additives and water from the PDB file, decide which ligands and ions to keep, and fix missing atoms or loops. Check protonation states of histidines and other titratable residues at your pH; tools such as PDB2PQR/PROPKA help.
Step 2: Generate the topology
pdb2gmx builds the topology, which lists every atom, bond and parameter in the force field.
gmx pdb2gmx -f protein.pdb -o processed.gro -water tip3p -ignhA ligand needs its own parameters from a separate tool, such as CGenFF for CHARMM or ACPYPE/antechamber with GAFF2 for AMBER. Ligand parameterisation is where protein–ligand simulations most often go wrong, so check the generated parameters rather than trusting them blindly.
Step 3: Define the box and add water
gmx editconf -f processed.gro -o boxed.gro -c -d 1.0 -bt dodecahedron
gmx solvate -cp boxed.gro -cs spc216.gro -o solvated.gro -p topol.topA distance of at least 1.0 nm between the protein and the box edge prevents the protein from interacting with its own periodic image.
Step 4: Add ions
Neutralise the system's charge and add salt to physiological concentration (about 0.15 M NaCl).
gmx grompp -f ions.mdp -c solvated.gro -p topol.top -o ions.tpr
gmx genion -s ions.tpr -o ionised.gro -p topol.top -pname NA -nname CL -neutral -conc 0.15Step 5: Energy minimisation
Minimisation removes steric clashes left by building the system. Run steepest descent until the maximum force drops below about 1000 kJ/mol/nm and the potential energy is negative and stable.
Step 6: Equilibration (NVT, then NPT)
Equilibration lets the solvent settle around the protein while the protein's heavy atoms are held by position restraints.
- NVT (constant volume and temperature), about 100 ps, bringing the system to 300 K with a thermostat such as V-rescale.
- NPT (constant pressure and temperature), about 100 ps to 1 ns, settling the density at 1 bar with a barostat (C-rescale in recent GROMACS versions).
Check that temperature, pressure and density have reached stable plateaus before moving on.
Step 7: Production run
Release the restraints and run the production simulation. Length depends on the question: tens of nanoseconds can show whether a docked ligand stays put; folding, large conformational changes and binding kinetics need microseconds or enhanced sampling. Run at least three independent replicas with different starting velocities; one trajectory is an anecdote.
gmx grompp -f md.mdp -c npt.gro -t npt.cpt -p topol.top -o md.tpr
gmx mdrun -deffnm mdStep 8: Analysis
First correct for periodic boundaries with gmx trjconv so the protein does not appear broken across the box. Then:
- RMSD of the backbone over time: has the structure stabilised?
- RMSF per residue: which regions are flexible?
- Radius of gyration: is the protein staying compact?
- Hydrogen bonds and contacts between protein and ligand.
- Ligand RMSD after fitting on the protein: does the ligand stay in its pocket?
Binding free energies from MM/PBSA or MM/GBSA (gmx_MMPBSA) are popular but approximate; use them to rank related compounds, not as absolute affinities. Alchemical free-energy methods are more rigorous and more demanding.
Common mistakes
- Simulating a model with low-confidence regions as if it were a crystal structure.
- Using poorly checked ligand parameters.
- Running a single short trajectory and drawing strong conclusions.
- Mixing force fields and water models that were not designed together.
- Forgetting to correct periodic boundaries before computing RMSD.
Learn molecular dynamics
Start with a small, well-behaved protein such as lysozyme before moving to complexes. Our Molecular Dynamics Simulations course covers this whole GROMACS workflow, ligand parameterisation and analysis, with a certificate. It pairs naturally with Molecular Docking & Drug Discovery: see also our AutoDock Vina tutorial.
Written by the Solagene team for research and education. Found an error? Tell us and we will correct it.