AlphaFold Model to GROMACS: Prepare a Predicted Structure
Skip to content

AlphaFold Model to GROMACS: Prepare a Prediction for MD

AlphaFold Model to GROMACS: Prepare a Prediction for MD

To run molecular dynamics on an AlphaFold model in GROMACS, first read the pLDDT score stored in the B-factor column, trim low-confidence termini (and any signal peptide or initiator methionine absent from the mature protein), add back missing cofactors, check histidine protonation, then run gmx pdb2gmx. Confirm the trimmed core is stable with a backbone RMSD plot.

This guide is written by the StemSkills Lab team (10+ years in structural bioinformatics, drug design and molecular modeling). It is for students whose only structure is a prediction from the AlphaFold Protein Structure Database or ColabFold, and who need it in a GROMACS-ready state. It sits in the simulation stage of our computational biology skills roadmap. If you have not set up any protein in GROMACS before, the general workflow is in how to prepare a protein for molecular dynamics; this post covers only what is different when the input is a prediction.

We use one real file throughout: AF-P69905-F1-model_v6.pdb, the AlphaFold DB model of human hemoglobin subunit alpha (UniProt P69905, 142 residues). It is small, mostly very high confidence, and it still shows three of the traps covered below.

Why does an AlphaFold model need extra preparation before MD?

An experimental PDB entry and a prediction fail in different ways. A crystal structure usually has missing loops, alternate locations and waters. An AlphaFold model has none of those: every residue in the UniProt sequence is present, there are no hydrogens, no waters and no HETATM records. That looks clean, but it hides three problems.

  • Every residue is modelled, confident or not. Disordered termini and linkers come out as long, extended strands with low confidence. In a water box they flop around, reach across the periodic boundary and dominate your RMSD.
  • The sequence is the precursor, not the mature protein. AlphaFold DB models the full UniProt sequence, so signal peptides, propeptides and initiator methionines that are cleaved in the cell are still attached.
  • Ligands, metals and cofactors are absent. The AlphaFold DB models are single chains predicted without ligands. Our hemoglobin model has an empty heme pocket, although UniProt annotates His88 as the proximal heme-binding residue.

The backbone itself is often excellent where confidence is high. In the CASP14 assessment AlphaFold reached a median backbone accuracy of 0.96 Å (r.m.s.d.95), as reported in Jumper et al., Nature 596, 583 (2021). The AlphaFold DB now covers over 214 million protein sequences (Varadi et al., Nucleic Acids Research 52, D368, 2024), so for many students a prediction is the only starting point that exists. The job is to keep the confident core and deal honestly with the rest.

Where is pLDDT stored, and how do I read it from the file?

AlphaFold writes its per-residue confidence, pLDDT (0 to 100), into the B-factor column (columns 61 to 66) of every atom in the residue. ColabFold PDB outputs follow the same convention. Download the model from the entry page, or with:

wget https://alphafold.ebi.ac.uk/files/AF-P69905-F1-model_v6.pdb

The version suffix changes when the database is updated, so copy the current link from the entry page if this one fails. Then print residue name, number and pLDDT for every C-alpha. Fixed-column parsing is safer than splitting on spaces, because PDB fields can run together:

grep '^ATOM' AF-P69905-F1-model_v6.pdb | \
  awk 'substr($0,13,4)==" CA " {print substr($0,18,3), substr($0,23,4)+0, substr($0,61,6)+0}'

For this model the first lines are:

MET 1 65.38
VAL 2 91.12
LEU 3 97.94

Only Met1 is below 70; everything from residue 2 to 142 scores above 90. To count weak residues in any model:

grep '^ATOM' model.pdb | awk 'substr($0,13,4)==" CA " && substr($0,61,6)+0 < 70 {n++} END {print n+0, "residues below 70"}'

AlphaFold DB colours its models in four bands. Use them to decide what each region is fit for in a simulation:

pLDDT bandAlphaFold DB labelWhat it usually meansWhat to do before MD
Above 90Very highBackbone and most side chains reliableKeep as is
70 to 90ConfidentBackbone generally right, some side chains offKeep; watch it in RMSF
50 to 70LowUncertain placement, often loops or edgesKeep if internal; consider trimming if terminal
Below 50Very lowOften disordered in reality, not a real structureTrim if it is a terminal tail; do not interpret its motion

The link between very low pLDDT and disorder was examined across the human proteome in Tunyasuvunakool et al., Nature 596, 590 (2021). For how pLDDT relates to PAE, the inter-domain confidence map, read our guide to interpreting AlphaFold pLDDT and PAE scores. Check PAE before you simulate a multi-domain protein: two confident domains with high PAE between them have an unreliable relative orientation.

What should I trim, and how do I do it in PyMOL?

Trim three kinds of segment, and only these:

  1. Low-confidence terminal tails. A contiguous run of residues below 50 (or below 70, if it is clearly an extended strand) at the N- or C-terminus.
  2. Segments absent from the mature protein. Open the UniProt entry, go to “PTM / Processing” and look for Signal, Propeptide, Transit peptide and Initiator methionine features. For P69905 UniProt lists “Initiator methionine 1, Removed” and the mature chain as residues 2 to 142.
  3. Nothing internal, by default. Cutting a low-confidence loop out of the middle of a chain creates a gap. GROMACS will treat the two ends as bonded neighbours if they stay in one chain, which is wrong. If an internal region truly must go, split the chain and cap both new ends (for example with ACE and NME), and say so in your methods.

In PyMOL, colour by pLDDT first, so you see what you are cutting:

load AF-P69905-F1-model_v6.pdb, af
spectrum b, red_white_blue, af, minimum=50, maximum=90
select lowconf, af and b < 70
remove af and resi 1
save af_trimmed.pdb, af

Red is weak, blue is confident. For a protein with a disordered 30-residue N-terminal tail, the remove line would be remove af and resi 1-30, after you have confirmed with the awk output that residue 31 is where confidence climbs. Keep the original residue numbering; it matches UniProt, which makes every later comparison easier. If you are new to the PyMOL command line, our post on mutating a residue in PyMOL covers loading, selecting and saving.

What does AlphaFold leave out that the simulation needs?

Before you build a topology, compare the model with what is known about the protein:

  • Cofactors and metals. Heme, zinc, iron-sulfur clusters, NAD and similar groups are missing. For our model, simulating hemoglobin alpha without heme would be simulating an apo globin, which is a different system. The usual fix is to superpose the model on an experimental structure of the same protein, copy the cofactor coordinates across, and build a cofactor topology. Our guide to docking a ligand into an AlphaFold model covers pocket checks for predicted structures.
  • Partner chains. Hemoglobin is a tetramer; the AlphaFold DB file is one alpha chain. Interfaces that are buried in the complex are exposed in the monomer. If the question is about the complex, predict it as a complex (see AlphaFold-Multimer with ColabFold) or start from an experimental assembly.
  • Disulfides. AlphaFold often places paired cysteines at bonding distance. gmx pdb2gmx prints a special atom distance matrix and links cysteine pairs it judges close enough; read that output and check every bond against UniProt “Disulfide bond” annotations. Our model has a single cysteine, so no bond is expected.

A useful rule: if a paper on your protein describes something bound to it, assume the AlphaFold model does not contain it.

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.

Join the waitlist (free) →

How do I set protonation states for an AlphaFold model?

AlphaFold files carry no hydrogens, so every protonation decision is yours. By default gmx pdb2gmx makes lysine and arginine charged, aspartate and glutamate deprotonated, termini charged (NH3+ and COO-), and assigns each histidine to ND1, NE2 or both based on hydrogen-bonding geometry. That default is reasonable at pH 7 for most surface residues, but histidines and buried acids deserve a check.

Our hemoglobin model has 10 histidines, so it is a good case for PROPKA3 (Olsson et al., Journal of Chemical Theory and Computation 7, 525, 2011):

pip install propka
propka3 af_trimmed.pdb

Read the predicted pKa values in af_trimmed.pka. A histidine with a predicted pKa well above your simulation pH should be doubly protonated; then set it by hand with the interactive flag described below. Note that a predicted pKa is only as good as the side-chain placement, which is weaker in the 70 to 90 band. Our full guide to protein protonation states for docking and MD explains each choice.

What is the pdb2gmx command for an AlphaFold model?

With a trimmed, checked file, the topology step is short:

gmx pdb2gmx -f af_trimmed.pdb -o af_processed.gro -p topol.top -i posre.itp \
  -ff amber99sb-ildn -water tip3p -ignh
  • -ff amber99sb-ildn and -water tip3p skip the interactive menus. Both ship with GROMACS; use the force field your lab or protocol specifies.
  • -ignh ignores hydrogens in the input. An AlphaFold file has none, but add it anyway if the file has passed through another program (PyMOL, Chimera, a pKa tool) that may have added hydrogens with different names.
  • Add -his to pick each histidine state interactively, using your PROPKA results.
  • Add -ter only if you need non-default termini. The gmx pdb2gmx manual page warns that AMBER force fields use special terminal residue forms that are incompatible with the -ter mechanism.

The same manual reminds users that “it is up to the user to verify the correctness of the input data”. For a predicted structure that sentence carries extra weight. Each flag is explained in our gmx pdb2gmx tutorial.

Then build the box, solvent and ions as for any protein:

gmx editconf -f af_processed.gro -o af_box.gro -c -d 1.0 -bt dodecahedron
gmx solvate -cp af_box.gro -cs spc216.gro -o af_solv.gro -p topol.top
gmx grompp -f ions.mdp -c af_solv.gro -p topol.top -o ions.tpr
gmx genion -s ions.tpr -o af_ions.gro -p topol.top -pname NA -nname CL -neutral

Trimming pays off here. An untrimmed model with an extended tail forces a much larger box for the same 1.0 nm margin, and that means many more water molecules for no scientific gain. Continue with energy minimisation and NVT and NPT equilibration.

How do I check that the trimmed model is stable?

After equilibration, run a short production simulation and measure the backbone RMSD of the confident core only. Including the remaining flexible ends would hide what the folded part is doing. Build an index group with gmx select (residues 5 to 138 here, chosen to leave out the outermost few residues of each end):

gmx select -s md.tpr -on core.ndx -select 'backbone and resnr 5 to 138'
gmx rms -s md.tpr -f md_center.xtc -n core.ndx -o rmsd_core.xvg -tu ns

Choose the core group for both the fit and the calculation. A core RMSD that rises and then flattens into a plateau is the expected picture. One that keeps climbing points to a problem with the model, the missing cofactor, or the protonation states. Pair it with per-residue RMSF to see whether the flexibility sits where pLDDT was lowest; our guide to RMSD and RMSF analysis in GROMACS and plotting XVG files in Python cover the analysis. For how long to run before you trust the plateau, see how long to run an MD simulation.

Which starting structure should I use: AlphaFold DB, ColabFold or experimental?

Starting pointStrengthMain preparation workBest for
Experimental PDB entryObserved coordinates, often with ligands and partnersMissing loops, alternate locations, waters, HETATM recordsAny protein that has one, especially with a bound ligand
AlphaFold DB modelInstant download, full UniProt sequence, pLDDT includedTrimming tails and precursor segments, adding cofactorsSingle-chain proteins with no experimental structure
ColabFold predictionYour own sequence, mutants and complexesSame as AlphaFold DB, plus choosing among ranked modelsMutants, constructs, complexes, proteins absent from the database

If an experimental structure exists, it is usually the better start, and the AlphaFold model becomes a tool for filling its gaps (see fixing missing residues and loops). Our comparison of AlphaFold, homology models and experimental structures goes further.

What errors do AlphaFold files cause in GROMACS, and how do I fix them?

  • “Atom … in residue … was not found in rtp entry”. Hydrogens with names the force field does not recognise, usually added by another program after download. Fix: add -ignh and let pdb2gmx rebuild them.
  • “Residue … not found in residue topology database”. Not caused by AlphaFold itself, which writes only standard amino acids, but it appears as soon as you paste in a cofactor. Fix: build a separate topology for the cofactor and include it in topol.top, as in our protein-ligand MD tutorial.
  • A bond stretched across a gap. You removed an internal segment and left both ends in one chain. Fix: restore the segment, or split into two chains with caps.
  • “The cut-off length is longer than half the shortest box vector” from grompp. The box is too small for the cut-off, which can happen after manual box edits. Fix: rebuild the box with gmx editconf -d 1.0 or larger.
  • Huge RMSD from the first nanosecond. Usually an untrimmed tail, not the fold. Fix: compute RMSD on the core index group, and trim terminal residues below 50 before the next run.
  • Net charge far from what you expect. A forgotten propeptide or a histidine set by default. Fix: check UniProt processing features and the pdb2gmx histidine assignments, then rerun genion with -neutral.

If the model also needs a quality check beyond pLDDT before you invest compute time, run it through the steps in how to validate a protein structure, and our GROMACS learning path lists what to study next.

Frequently asked questions

Can I run MD directly on an AlphaFold model without changes?

GROMACS will usually accept it, because the file holds only standard residues. Whether the result means anything depends on trimming disordered tails, removing precursor segments, adding missing cofactors and checking protonation. Skip those and your trajectory mostly describes the artefacts.

What pLDDT cutoff should I use for trimming?

There is no single official cutoff for MD. A common, defensible choice is to trim contiguous terminal runs below 50 (very low) and to inspect terminal runs between 50 and 70 case by case. State the rule you used in your methods.

Does MD refine an AlphaFold model?

Short MD tells you whether the confident core is stable under a force field. It is not a reliable way to fix low-confidence regions; those can drift anywhere without any test of being right. Treat MD here as a stability check, not a correction step.

Should I renumber residues after trimming?

Keep UniProt numbering where you can. It lets you map results back to mutations, binding sites and papers. pdb2gmx has a -renum option, but you rarely need it.

Do ColabFold models store pLDDT the same way?

Yes, ColabFold PDB outputs also put pLDDT in the B-factor column, so the awk command above works on them. Run it on each ranked model before choosing one to simulate.

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.

Join the waitlist (free) →

Think you know Protein Structure Prediction?
Take the free StemSkills assessment and earn a verifiable certificate you can download and add to your LinkedIn profile.
Start the free assessment

Keep going

Steered MD in GROMACS: Pull a Ligand Out, Read the Force Set up a GROMACS pull-code run, pull a ligand out of its pocket, plot pullf.xvg against pullx.xvg and… Foldseek Tutorial: Find Structurally Similar Proteins Search your AlphaFold model against the PDB and AlphaFold DB with Foldseek, read E-value, probability and TM-score, and… TM-align Tutorial: Compare Protein Structures by TM-score Install TM-align, compare a predicted model with an experimental structure, read both TM-scores correctly and see why RMSD…
See live workshops