# Difficulties with distance restraints of multiple molecules

**URL:** <https://gromacs.bioexcel.eu/t/difficulties-with-distance-restraints-of-multiple-molecules/2582>\
**Category:** User discussions\
**Tags:** mdp-parameters, mdrun\
**Created:** [July 23, 2021, 10:06am UTC](https://gromacs.bioexcel.eu/t/difficulties-with-distance-restraints-of-multiple-molecules/2582 "2021-07-23T10:06:04Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![MelbourneFL](https://avatars.discourse-cdn.com/v4/letter/m/e79b87/32.png) [@MelbourneFL](https://gromacs.bioexcel.eu/u/MelbourneFL)\
**Post date:** [July 23, 2021, 10:06am UTC](https://gromacs.bioexcel.eu/t/difficulties-with-distance-restraints-of-multiple-molecules/2582/1 "2021-07-23T10:06:04Z")

</div>

GROMACS version: 2021.1  
GROMACS modification: No  
Here post your question

Hello,

I have a problem with using NMR restraints in my system. I have a simulation including 10 glycolipids that was setup with CHARMM-GUI. This simulations runs fine but agreement to NMR-data could be better. So I try to improve it with restraints. Unfortunately this is giving me some trouble.

CHARMM-GUI set this up such that each of the 10 glycolipids has its own section in the topol.top:

#include “toppar/GLPA1.itp”  
#include “toppar/GLPA2.itp”  
#include “toppar/GLPA3.itp”  
#include “toppar/GLPA4.itp”  
#include “toppar/GLPA5.itp”  
#include “toppar/GLPA6.itp”  
#include “toppar/GLPA7.itp”  
#include “toppar/GLPA8.itp”  
#include “toppar/GLPA9.itp”  
#include “toppar/GLPA10.itp”

It is explicitly stated that a distance restraints section has be after the molecule for which it is meant or it will be for the wrong atoms. So this is my solution:

#include “toppar/GLPA1.itp”

[distance\_restraints]  
; ai aj type index type’ low up1 up2 fac  
56 124 1 0 1 1.5 1.5 4.0 1.0

#include “toppar/GLPA2.itp”

[distance\_restraints]  
; ai aj type index type’ low up1 up2 fac  
56 124 1 1 1 1.5 1.5 4.0 1.0

#include “toppar/GLPA3.itp”

[distance\_restraints]  
; ai aj type index type’ low up1 up2 fac  
56 124 1 2 1 1.5 1.5 4.0 1.0

#include “toppar/GLPA4.itp”

[distance\_restraints]  
; ai aj type index type’ low up1 up2 fac  
56 124 1 3 1 1.5 1.5 4.0 1.0

#include “toppar/GLPA5.itp”

[distance\_restraints]  
; ai aj type index type’ low up1 up2 fac  
56 124 1 4 1 1.5 1.5 4.0 1.0

#include “toppar/GLPA6.itp”

[distance\_restraints]  
; ai aj type index type’ low up1 up2 fac  
56 124 1 5 1 1.5 1.5 4.0 1.0

#include “toppar/GLPA7.itp”

[distance\_restraints]  
; ai aj type index type’ low up1 up2 fac  
56 124 1 6 1 1.5 1.5 4.0 1.0

#include “toppar/GLPA8.itp”

[distance\_restraints]  
; ai aj type index type’ low up1 up2 fac  
56 124 1 7 1 1.5 1.5 4.0 1.0

#include “toppar/GLPA9.itp”

[distance\_restraints]  
; ai aj type index type’ low up1 up2 fac  
56 124 1 8 1 1.5 1.5 4.0 1.0

#include “toppar/GLPA10.itp”

[distance\_restraints]  
; ai aj type index type’ low up1 up2 fac  
56 124 1 9 1 1.5 1.5 4.0 1.0

Also I use the following mdp options:

; CONSTRAINTS  
disre = ensemble  
disre-weighting = equal  
disre-mixed = no  
disre-fc = 300  
disre-tau = 5000  
nstdisreout = 50000

This works fine with gmx grompp but when I want to run the simulation I get this error in the log file:

Assertion failed:  
Condition: type\_max - type\_min + 1 == dd-\>nres  
All distance restraint parameter entries in the topology should be consecutive

So now I do understand the error message but i don’t know how to change the topol.top file to make that work. I also found a post on the mailing list that has the same problem (apparently the problem did not appear with 5.1.4), but it never got a reply: [https://mailman-1.sys.kth.se/pipermail/gromacs.org\_gmx-users/2019-January/123651.html](https://mailman-1.sys.kth.se/pipermail/gromacs.org_gmx-users/2019-January/123651.html)

Any ideas?

Alexander

---

<div class="post-metadata">

**Author:** ![MelbourneFL](https://avatars.discourse-cdn.com/v4/letter/m/e79b87/32.png) [@MelbourneFL](https://gromacs.bioexcel.eu/u/MelbourneFL)\
**Post date:** [August 9, 2021, 3:24pm UTC](https://gromacs.bioexcel.eu/t/difficulties-with-distance-restraints-of-multiple-molecules/2582/2 "2021-08-09T15:24:14Z")

</div>

I was on vacation and have now seen that nobody has replied in the meantime. So I’m just pushing this up once more to try to get some help.

Thanks!

Alexander

---

<div class="post-metadata">

**Author:** ![hess](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/hess/32/416_2.png) [@hess](https://gromacs.bioexcel.eu/u/hess)\
**Post date:** [August 17, 2021, 9:14am UTC](https://gromacs.bioexcel.eu/t/difficulties-with-distance-restraints-of-multiple-molecules/2582/3 "2021-08-17T09:14:01Z")

</div>

There is a bug in that grompp should have given you a clear error message. You should not get an assertion failure in mdrun.

I assume all your lipids that you want to restraints are identical. In that case you should be able to solve this by using a single moleculetype and specify a count of 10 molecules of this in the [system] section.

---

<div class="post-metadata">

**Author:** ![MelbourneFL](https://avatars.discourse-cdn.com/v4/letter/m/e79b87/32.png) [@MelbourneFL](https://gromacs.bioexcel.eu/u/MelbourneFL)\
**Post date:** [August 17, 2021, 9:31am UTC](https://gromacs.bioexcel.eu/t/difficulties-with-distance-restraints-of-multiple-molecules/2582/4 "2021-08-17T09:31:25Z")

</div>

Thanks for the answer. Yes all lipids are identical. So I’ll try your suggestion. But how would one solve this problem if you want to restrain different molecules at the same time? Wouldn’t that always require to have the restraints in different sections so that they are not consecutive?

Thanks again,

Alexander

---

<div class="post-metadata">

**Author:** ![alevilla](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/alevilla/32/439_2.png) [@alevilla](https://gromacs.bioexcel.eu/u/alevilla)\
**Post date:** [August 17, 2021, 9:32am UTC](https://gromacs.bioexcel.eu/t/difficulties-with-distance-restraints-of-multiple-molecules/2582/5 "2021-08-17T09:32:23Z")

</div>

Hi

> [@MelbourneFL](#):
>
> [distance\_restraints]  
> ; ai aj type index type’ low up1 up2 fac  
> 56 124 1 5 1 1.5 1.5 4.0 1.0

Just a small note GROMACS use “nm” as length units. It seems that low up1 and up2 are on the larger side.

Alessandra

---

<div class="post-metadata">

**Author:** ![MelbourneFL](https://avatars.discourse-cdn.com/v4/letter/m/e79b87/32.png) [@MelbourneFL](https://gromacs.bioexcel.eu/u/MelbourneFL)\
**Post date:** [August 17, 2021, 9:49am UTC](https://gromacs.bioexcel.eu/t/difficulties-with-distance-restraints-of-multiple-molecules/2582/6 "2021-08-17T09:49:29Z")

</div>

Thanks for the heads up but that is actually intentional for my project.

Alexander
