Calculation of pairwise interactions of two residues


I wanted to calculate the pairwise interaction energy of two residues in my protein. I understand that I have to change the energygrps option in the *.mdp file and then, generate tpr and finally use the mdrun -rerun option. However, I am unable to find how energygrps has to be changed? Do I need to make a different index file altogether, if so, how do I specify this in the *mdp?



Make an index group for each residue and specify whatever they are named as the energygrps.

1 Like

Hi, Thanks for a quick answer @jalemkul. I have a follow up question. I have carried out long simulations and energygrps is not included in my *.mdp file. In this case could I use mdrun -rerun option or would I have to start a completely new simulation where energygrps is given explicitly?

Also, just to check, the index file could be created using following steps:
(1) gmx make_ndx -f tpr -o index.ndx.
(2) splitres 1 (1 = protein)
(3) ri x1 (residue x1)
(4) ri x2 (residue x2)
(5) del 1-y (y = rest of the indices in the file, except x1 and x2)

If I were to create it manually:
[residue 1]

In *.mdp:
energygrps = residue1 and residue 2

I make separate index file for each residue. and, in *mdp, add two arguments in energygrps? "
energygrps = index1.ndx and index2.ndx"

Thankyou, in advance.

You do not need to delete the other index groups. The index file has to be passed to grompp to create a new .tpr file that will be used by mdrun -rerun.

1 Like

Thankyou so much for your quick replies!


I am sorry, a really weird thing is happening. I am using:
gmx_mpi grompp -f minimization.mdp -n index.ndx -c input.gro -r input.gro -p -o test.tpr
But, GROMACS isn’t asking me for an input (despite adding the -n flag), which it should. Because the command is in accordance with the gromacs documentation (gmx grompp)

In the mdout.mdp, it looks like this:
; Selection of energy groups
energygrps =

You will not need to provide any input. grompp looks for custom groups in the .mdp file and if it finds them in the .ndx file, it carries on happily. If something is missing, it triggers a fatal error. I don’t know why the output is blank but you can use gmx dump to check the actual contents of the .tpr file.

1 Like