# Gromacs not reading POSRES even though it is pointed to in topology

**URL:** <https://gromacs.bioexcel.eu/t/gromacs-not-reading-posres-even-though-it-is-pointed-to-in-topology/4255>\
**Category:** User discussions\
**Tags:** mdp-parameters, restraints, simulation-setup\
**Created:** [June 2, 2022, 3:42pm UTC](https://gromacs.bioexcel.eu/t/gromacs-not-reading-posres-even-though-it-is-pointed-to-in-topology/4255 "2022-06-02T15:42:54Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![dkonstan](https://avatars.discourse-cdn.com/v4/letter/d/87869e/32.png) [@dkonstan](https://gromacs.bioexcel.eu/u/dkonstan)\
**Post date:** [June 2, 2022, 3:42pm UTC](https://gromacs.bioexcel.eu/t/gromacs-not-reading-posres-even-though-it-is-pointed-to-in-topology/4255/1 "2022-06-02T15:42:55Z")

</div>

GROMACS versions: 2022 and 2021  
GROMACS modification: No

Hi gromacs,  
I am running a simulation of a protein with water and some other ingredients and I am having trouble restraining the protein heavy atoms, even though I specify  
#ifdef POSRES  
#include “posre\_Protein\_chain\_A2.itp”  
#endif

in the protein topology component itp file and define = -DPOSRES in the mdp file. The posre\_\* file has all the heavy atoms of the protein listed with restraint strengths. Below is my topology for your reference. The Urea.itp and TMAO.itp files are defined elsewhere and included here, as are the other itp files. I can post them too if needed.

Thank you very much!  
Dan

* * *

; Include forcefield parameters  
#include “/gpfs/loomis/project/hammes\_schiffer/as3586/shslocal/apps/gromacs/share/gromacs/top/amber14sb\_OL15.ff/forcefield.itp”

[atomtypes]  
; name mass charge ptype sigma epsilon  
CUR 12.0107 0.921 A 0.37700 0.41700  
HUR 1.00800 0.285 A 0.15800 0.08800  
OUR 15.99940 -0.675 A 0.31000 0.56000  
NUR 14.0067 -0.693 A 0.31100 0.50000  
OTM 15.99940 -0.910 A 0.32660 0.63790  
NTM 14.0067 0.700 A 0.29260 0.83600  
CTM 12.01100 -0.260 A 0.36000 0.28260  
HTM 1.00800 0.110 A 0.21010 0.07730

[nonbond\_params]  
; i j func sigma epsilon (urea-TMAO epsilon scaled by 1.10)

CUR CTM 1 0.36840 0.37761  
CUR HTM 1 0.28144 0.19749  
CUR OTM 1 0.35090 0.56733  
CUR NTM 1 0.33213 0.64948  
HUR CTM 1 0.23849 0.17347  
HUR HTM 1 0.18220 0.09072  
HUR OTM 1 0.22716 0.26062  
HUR NTM 1 0.21501 0.29836  
OUR CTM 1 0.33407 0.43760  
OUR HTM 1 0.25521 0.22886  
OUR OTM 1 0.31819 0.65745  
OUR NTM 1 0.30117 0.75264  
NUR CTM 1 0.33460 0.41349  
NUR HTM 1 0.25562 0.21626  
NUR OTM 1 0.31871 0.62123  
NUR NTM 1 0.30166 0.71118

; i j func sigma epsilon (TMAO-TMAO epsilon scaled by 0.90)

OTM OTM 1 0.32660 0.57411  
OTM NTM 1 0.30913 0.65724  
OTM CTM 1 0.34289 0.38212  
OTM HTM 1 0.26195 0.19985  
NTM NTM 1 0.29260 0.75240  
NTM CTM 1 0.32456 0.43745  
NTM HTM 1 0.24794 0.22879  
CTM CTM 1 0.36000 0.25434  
CTM HTM 1 0.27502 0.13302  
HTM HTM 1 0.21010 0.06957

#include “/home/dk758/project/ureaTMAO/NetzM/Urea.itp”  
#include “/home/dk758/project/ureaTMAO/NetzM/TMAO.itp”

; Include chain topologies  
#include “topol\_Ion\_chain\_A.itp”  
#include “topol\_Protein\_chain\_A2.itp”

; Include water topology  
#include “/gpfs/loomis/project/hammes\_schiffer/as3586/shslocal/apps/gromacs/share/gromacs/top/amber14sb\_OL15.ff/tip3p.itp”

#ifdef POSRES\_WATER  
; Position restraint for each water oxygen  
[position\_restraints]  
; i funct fcx fcy fcz  
1 1 1000 1000 1000  
#endif

; Include topology for ions  
#include “/gpfs/loomis/project/hammes\_schiffer/as3586/shslocal/apps/gromacs/share/gromacs/top/amber14sb\_OL15.ff/ions.itp”

[system]  
; Name  
Built with Packmol

[molecules]  
; Compound #mols  
Ion\_chain\_A 1  
UR 28  
TMO 28  
Protein\_chain\_A2 1  
SOL 1351

---

<div class="post-metadata">

**Author:** ![jalemkul](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/jalemkul/32/18_2.png) [@jalemkul](https://gromacs.bioexcel.eu/u/jalemkul)\
**Post date:** [June 2, 2022, 4:07pm UTC](https://gromacs.bioexcel.eu/t/gromacs-not-reading-posres-even-though-it-is-pointed-to-in-topology/4255/2 "2022-06-02T16:07:16Z")

</div>

What makes you think the restraints aren’t working?

---

<div class="post-metadata">

**Author:** ![dkonstan](https://avatars.discourse-cdn.com/v4/letter/d/87869e/32.png) [@dkonstan](https://gromacs.bioexcel.eu/u/dkonstan)\
**Post date:** [June 2, 2022, 4:09pm UTC](https://gromacs.bioexcel.eu/t/gromacs-not-reading-posres-even-though-it-is-pointed-to-in-topology/4255/3 "2022-06-02T16:09:04Z")

</div>

It’s because the heavy atoms move appreciably the traj.trr from the simulation. They clearly are not restrained…they are moving around :-)

---

<div class="post-metadata">

**Author:** ![rpsingh](https://avatars.discourse-cdn.com/v4/letter/r/c57346/32.png) [@rpsingh](https://gromacs.bioexcel.eu/u/rpsingh)\
**Post date:** [June 2, 2022, 5:45pm UTC](https://gromacs.bioexcel.eu/t/gromacs-not-reading-posres-even-though-it-is-pointed-to-in-topology/4255/4 "2022-06-02T17:45:51Z")

</div>

If you are restraining only the protein, are the amino acid residues in the beginning of the gro file? E.g., if there are 100K atoms (protein + water + ions + any other species) but your posres file has only 10K atoms, grompp will spit a message saying that only the first 10K atoms will be restrained. (you might have missed it if using -maxwarn). If that is the case, try renumbering the protein chain residues to appear at the beginning.

Another point is: what is the force constant being used? Too small fc like 2 or 5 will be just too small to hold the protein.

---

<div class="post-metadata">

**Author:** ![dkonstan](https://avatars.discourse-cdn.com/v4/letter/d/87869e/32.png) [@dkonstan](https://gromacs.bioexcel.eu/u/dkonstan)\
**Post date:** [June 2, 2022, 6:00pm UTC](https://gromacs.bioexcel.eu/t/gromacs-not-reading-posres-even-though-it-is-pointed-to-in-topology/4255/5 "2022-06-02T18:00:39Z")

</div>

On second thought, I have reason to believe the restraints ARE working, because when I take a system minimized with restrained protein and then try to run dynamics without minimizing the whole system first, the simulation crashes, but after I minimize everything things are fine. I just didn’t expect the atoms to move AT ALL when restrained, but I guess 1000 kj/mol is not that strong of a restraint, and that’s the default. It is probably ok that they vibrate a bit. Is that correct?

---

<div class="post-metadata">

**Author:** ![jalemkul](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/jalemkul/32/18_2.png) [@jalemkul](https://gromacs.bioexcel.eu/u/jalemkul)\
**Post date:** [June 2, 2022, 6:11pm UTC](https://gromacs.bioexcel.eu/t/gromacs-not-reading-posres-even-though-it-is-pointed-to-in-topology/4255/6 "2022-06-02T18:11:53Z")

</div>

> [@dkonstan](#):
>
> I just didn’t expect the atoms to move AT ALL when restrained, but I guess 1000 kj/mol is not that strong of a restraint, and that’s the default. It is probably ok that they vibrate a bit. Is that correct?

Yes, a restraint penalizes motion. It doesn’t prevent it.

---

<div class="post-metadata">

**Author:** ![dkonstan](https://avatars.discourse-cdn.com/v4/letter/d/87869e/32.png) [@dkonstan](https://gromacs.bioexcel.eu/u/dkonstan)\
**Post date:** [June 2, 2022, 6:16pm UTC](https://gromacs.bioexcel.eu/t/gromacs-not-reading-posres-even-though-it-is-pointed-to-in-topology/4255/7 "2022-06-02T18:16:28Z")

</div>

I am coming from mostly working with OpenMM where you often set your own restraints and I used to set them very high, probably a lot higher than is default in GROMACS, that’s why I had this misunderstanding. Thank you for helping me!
