GROMACS version:2024.3
@obZehn
@milosz.wieczor
Hello,
I am facing an issue with the define in my .mdp file. I wrote the following line in my md.mdp file:
define = -DPOSRESS
After running the gmx grompp -f md.mdp command, the generated mdout.mdp file correctly includes:
define = -DPOSRESS
However, when I extract the .mdp file from the .tpr file using the command:
gmx dump -s md_file.tpr -om dump_md_output.mdp,
the define = -DPOSRESS line is missing from the dump_md_output.mdp file.
The define line is missing in the extracted dump_md_output.mdp file, even though I specified it in the original md.mdp file.
How can I confirm that the restraints are properly applied during the simulation? thank you in advance for your help.
Hi!
“Defines” themselves are not recorded into TPR, but they affect what topology is recorded.
For example, if the topology file has a statement like:
#ifdef POSRES_WATER
[ position_restraints ]
; i funct fcx fcy fcz
1 1 1000 1000 1000
#endif
If the MDP file has define = -DPOSRES_WATER
, then the generated TPR file will have these constraints applied to solvent molecules, and if you do gmx dump
, you will see it:
molblock (1):
moltype = 1 "SOL"
#molecules = 16766
#posres_xA = 50298
posres_xA (50298x3):
posres_xA[ 0]={ 2.30000e-01, 6.28000e-01, 1.13000e-01}
posres_xA[ 1]={ 1.37000e-01, 6.26000e-01, 1.50000e-01}
(and many more lines, for each restrained atom)
And if you do not have the define, the generated topology will not have the restraints in it:
molblock (1):
moltype = 1 "SOL"
#molecules = 16766
#posres_xA = 0
#posres_xB = 0
molblock (2):
So, the defines do their work before the topology is written and are not necessary after that.
Thank you so much for your clarification. I highly appreciate it. In the topology file, I mentioned:
I want to apply flat-bottom position restraints. I have a couple of questions:
- Is there any threshold for the force needed to keep a specific atom in place?
- How critical is the whitespace between the numbers and between the first number and the wall?
I want to keep the atoms in the xy-plane by setting g=5 and in the xz-plane by setting g=4.
Restraints are virtual springs attaching atoms to certain points; lower values of the spring constant mean the atom can move around more but also decrease the risk of system instability and distort physics less. How strong the springs should be depends on forces the atom is subjected to and what you want from your simulation. k=5000 kJ/mol/nm² ~ 12 kcal/mol/Ų is moderately strong.
Not critical, as long as there are whitespaces or tabs separating the values it’s ok. See File formats - GROMACS 2024.4 documentation