How do I pass .itp position restraints to grompp?

GROMACS version: 2023
GROMACS modification: No

Hi everyone, this is my first time posting here :)

I downloaded gromacs 2023 today and I’ve been going through the tutorial I found here: Lysozyme in Water

In the first step of the tutorial, we use pdb2gmx to produce the topology, position restraint, and post-processed structure files. This is the command:

gmx pdb2gmx -f 1AKI_clean.pdb -o 1AKI_processed.gro -water spce

A file, posre.itp was generated with the position restrains but wouldn’t be relevant until the equilibration part of the tutorial. I got through the system creation and minimization fine.

When I got to the equilibration part of the tutorial, Lysozyme in Water, it recalls the posre.itp file and implies that we’re going to use it but the next command is

gmx grompp -f nvt.mdp -c em.gro -r em.gro -p topol.top -o nvt.tpr

which fails with the output:

WARNING 1 [file topol.top, line 33879]:
The following macros were defined in the ‘define’ mdp field with the -D
prefix, but were not used in the topology:
POSRES
If you haven’t made a spelling error, either use the macro you defined,
or don’t define the macro


Program: gmx grompp, version 2023
Source file: src/gromacs/gmxpreprocess/grompp.cpp (line 638)

Fatal error:
No molecules were defined in the system

From the docs on grompp, the -r is for the position restraints but I’m not passing posre.itp to grompp at all here, in fact grompp will refuse to take an itp file with the -r flag. I thought this might be a typo in the tutorial? I looked at the very first topology file generated by pdb2gmx and it includes blocks at the end for including posre.itp and other system properties. All subsequent topology files, which were given as inputs to solvate, grompp, and genion (in that order), retained this appended section at the end. However, the topology file that I am left with after minimizing with

gmx grompp -f minim.mdp -c 1AKI_solv_ions.gro -p topol.top -o em.tpr
gmx mdrun -v -deffnm em

lacks these include blocks. Running grompp with topol.top in previous steps did not erase these blocks, so I’m guessing that the output of mdrun was a topology that lacked them.

How can I get this information to be retained after minimization in the topology file or how can I use the mdrun generated topology file in conjuction with the pdb2gxm generated itp file?

Thank you! Any and all help is appreciated!

Summary of what I’ve done:

gmx pdb2gmx -f 1AKI_clean.pdb -o 1AKI_processed.gro -water spce
gmx editconf -f 1AKI_processed.gro -o 1AKI_newbox.gro -c -d 1.0 -bt cubic
gmx solvate -cp 1AKI_newbox.gro -cs spc216.gro -o 1AKI_solv.gro -p topol.top
gmx grompp -f ions.mdp -c 1AKI_solv.gro -p topol.top -o ions.tpr
gmx genion -s ions.tpr -o 1AKI_solv_ions.gro -p topol.top -pname NA -nname CL -neutral
gmx grompp -f minim.mdp -c 1AKI_solv_ions.gro -p topol.top -o em.tpr
gmx mdrun -v -deffnm em
gmx energy -f em.edr -o potential.xvg
gmx grompp -f nvt.mdp -c em.gro -r em.gro -p topol.top -o nvt.tpr
^ Failure

From what I can tell, it seems the commands you input should be correct, so maybe you could check if one of the inputs for selecting the forcefield during pdb2gmx or for selecting the solvent molecule during genion was incorrect?

Also, you mentioned the first 3 topology files had the position restraint blocks but the 4th one didn’t, is that correct? Would you be able to track down which steps generated those topology files? From what I understand, there should only be 3 .top files at this point, one from the first pdb2gmx command, one from the solvate command and one from the genion command which should be the latest one you’re using for generating both em.tpr and nvt.tpr. The em step shouldn’t result in a new .top file since no atoms are being added or removed

1 Like

I kept the files for each step (data, solvation, minimization, and equilibration) in separate directories, copying the files from the previous directory into the next to continue. So the top at the end of the pdb2gmx stage was copied to /solvation and used as the inputs to those commands, etc. I’ll go through the tutorial again this morning from scratch and examine the tops after each step to see what might have happened. Thank you for your help!

I re-ran it and it was fine `:D I really should have just done that before posting here :P I’m not sure what went wrong the first time, but the equilibration is running! Thanks!

1 Like