# Changing the position of pulling molecule while doing umbrella sampling in each window

**URL:** <https://gromacs.bioexcel.eu/t/changing-the-position-of-pulling-molecule-while-doing-umbrella-sampling-in-each-window/1474>\
**Category:** User discussions\
**Created:** [January 21, 2021, 6:52am UTC](https://gromacs.bioexcel.eu/t/changing-the-position-of-pulling-molecule-while-doing-umbrella-sampling-in-each-window/1474 "2021-01-21T06:52:46Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![nasrola\_hayati](https://avatars.discourse-cdn.com/v4/letter/n/46a35a/32.png) [@nasrola\_hayati](https://gromacs.bioexcel.eu/u/nasrola_hayati)\
**Post date:** [January 21, 2021, 6:52am UTC](https://gromacs.bioexcel.eu/t/changing-the-position-of-pulling-molecule-while-doing-umbrella-sampling-in-each-window/1474/1 "2021-01-21T06:52:46Z")

</div>

GROMACS version: 2018  
GROMACS modification: Yes/No  
Hi,  
I’m doing umbrella sampling in the way that Dr. Lemkul did in the gromaces tutorial.

As procedure said, after pulling section I chose configurations with specific distances and did umbrella sampling simulations. The problem is after brief NPT\_umbrella, the distance didn’t change but after md\_umbrella, the distances changed about 0.2 nm (more or less, it changed!).

For instance:  
after pulling:  
conf26 =\> distance: 5.773 nm  
after NPT\_umbrella =\> distance: 5.773 nm  
after md\_umbrella =\> distance: 6.33 nm

I must say that the space between configurations is 0.1 nm, so 0.2 nm change in distance seems unusual. What should I do? It’s negligible or I have to do somethimg?

I did plenty of simulations to solve this,  
I increased NPT\_umbrella and md\_umbrella simulation time,  
I set restrain (for one specific atom near its COM) for my pulling molecules.  
In the case I put restrain for whole pulling molecule, it stay in its position but i don’t think that’s right.

Any help will be appreciated.  
Thanks,  
nasrollah

---

<div class="post-metadata">

**Author:** ![milosz.wieczor](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@milosz.wieczor](https://gromacs.bioexcel.eu/u/milosz.wieczor)\
**Post date:** [January 21, 2021, 1:47pm UTC](https://gromacs.bioexcel.eu/t/changing-the-position-of-pulling-molecule-while-doing-umbrella-sampling-in-each-window/1474/2 "2021-01-21T13:47:40Z")

</div>

Hi,

How big is your box? Once your distances approach half of the box size, you might be running into issues with PBC, and a box of \>10 nm would already count as large. Have you checked the evolution of the values with time? Do they jump suddenly?

Best,  
MW

---

<div class="post-metadata">

**Author:** ![nasrola\_hayati](https://avatars.discourse-cdn.com/v4/letter/n/46a35a/32.png) [@nasrola\_hayati](https://gromacs.bioexcel.eu/u/nasrola_hayati)\
**Post date:** [January 21, 2021, 2:28pm UTC](https://gromacs.bioexcel.eu/t/changing-the-position-of-pulling-molecule-while-doing-umbrella-sampling-in-each-window/1474/3 "2021-01-21T14:28:20Z")

</div>

My box is 7_7_14 and I don’t know it jumped or went through time! How do I understand that?  
I don’t know if this is a serious problem or not! Should it be in the exact position along the umbrella sampling simulation?

Thanks,  
nasrollah

---

<div class="post-metadata">

**Author:** ![milosz.wieczor](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@milosz.wieczor](https://gromacs.bioexcel.eu/u/milosz.wieczor)\
**Post date:** [January 21, 2021, 3:35pm UTC](https://gromacs.bioexcel.eu/t/changing-the-position-of-pulling-molecule-while-doing-umbrella-sampling-in-each-window/1474/4 "2021-01-21T15:35:28Z")

</div>

What do you mean by 7714, what are your box vectors?

US is based on restraints, not constraints, so the actual distance usually fluctuates around the location of the minimum of the harmonic potential, but jumping by almost 0.6 nm is usually quite a lot. There can be many issues, from PBC to an underestimated force constant to errors in group definitions.

However, remember that free energy methods cannot really be used in a black-box manner - you should be at least aware of fundamental issues with molecular simulations. We can help you fix the issue at hand if you post your .mdp pull-code section and/or plot of your .xvg files, but there’s more to getting a successful and reliable free energy estimate than that.

Best,  
Miłosz

---

<div class="post-metadata">

**Author:** ![nasrola\_hayati](https://avatars.discourse-cdn.com/v4/letter/n/46a35a/32.png) [@nasrola\_hayati](https://gromacs.bioexcel.eu/u/nasrola_hayati)\
**Post date:** [January 21, 2021, 4:24pm UTC](https://gromacs.bioexcel.eu/t/changing-the-position-of-pulling-molecule-while-doing-umbrella-sampling-in-each-window/1474/5 "2021-01-21T16:24:00Z")

</div>

My box vectors are 7 7 14 (as x y z).

I’ve tested US for some configuration and as you said, they fluctuated. Case by case the value of fluctuation is low or high.

; Pull code  
pull = yes  
pull\_ncoords = 1  
pull\_ngroups = 2  
pull\_group1\_name = group-1  
pull\_group2\_name = group-2  
pull\_coord1\_type = umbrella  
pull\_coord1\_geometry = distance  
pull\_coord1\_dim = N N Y  
pull\_coord1\_groups = 1 2  
pull\_coord1\_start = yes  
pull\_coord1\_rate = 0.0  
pull\_coord1\_k = 1000 ;kJ mol^-1 nm^-2

US\_pullx.xvg

 ![Screen Shot 2021-01-21 at 7.51.43 PM](https://europe1.discourse-cdn.com/flex017/uploads/bioexcel1/original/1X/2c86bccf4dd56706965072ed405e954171b293d7.png)

US\_pullf.xvg

 ![Screen Shot 2021-01-21 at 7.50.22 PM](https://europe1.discourse-cdn.com/flex017/uploads/bioexcel1/original/1X/2cb3d67d052b010b853d79efdc74f1eb7f0d505e.png)

regards,  
nasrollah

---

<div class="post-metadata">

**Author:** ![milosz.wieczor](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@milosz.wieczor](https://gromacs.bioexcel.eu/u/milosz.wieczor)\
**Post date:** [January 21, 2021, 4:50pm UTC](https://gromacs.bioexcel.eu/t/changing-the-position-of-pulling-molecule-while-doing-umbrella-sampling-in-each-window/1474/6 "2021-01-21T16:50:35Z")

</div>

So here your distance remains close to its initial value (5.77 nm) - nothing wrong about this, that’s exactly the idea of US. I was more worried about the 6.33 nm value you mentioned in the first post; PBC looks ok though, if your coordinate is only calculated in the Z direction, it should be fine up to 14/2 = 7 nm.

Best,  
Miłosz

---

<div class="post-metadata">

**Author:** ![nasrola\_hayati](https://avatars.discourse-cdn.com/v4/letter/n/46a35a/32.png) [@nasrola\_hayati](https://gromacs.bioexcel.eu/u/nasrola_hayati)\
**Post date:** [January 21, 2021, 5:30pm UTC](https://gromacs.bioexcel.eu/t/changing-the-position-of-pulling-molecule-while-doing-umbrella-sampling-in-each-window/1474/7 "2021-01-21T17:30:22Z")

</div>

But after each simulation I evaluated the distance using **gmx distance** command and it gave me 6.33 nm for distance between COMs.

Please see the picture below:

 ![Screen Shot 2021-01-21 at 8.51.24 PM](https://europe1.discourse-cdn.com/flex017/uploads/bioexcel1/original/1X/2b905c66c27699d2e50e7bcad6e394a7b05645b3.jpeg)

Which distance is important in this case? Average distance from **gmx distance** or the distance from **US\_pullx.xvg**?

regards,  
nasrollah

---

<div class="post-metadata">

**Author:** ![milosz.wieczor](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@milosz.wieczor](https://gromacs.bioexcel.eu/u/milosz.wieczor)\
**Post date:** [January 21, 2021, 7:10pm UTC](https://gromacs.bioexcel.eu/t/changing-the-position-of-pulling-molecule-while-doing-umbrella-sampling-in-each-window/1474/8 "2021-01-21T19:10:14Z")

</div>

The one from .xvg reports how Gromacs’ pull code “saw” the distance during the simulation. So it’s suitable for reconstructing your PMF using WHAM.

Here my guess is that .xvg from the run is reporting only the Z-component of the distance (due to the pull\_coord1\_dim = N N Y setting), while gmx distance reports the “full” 3D distance. I imagine dist.xyz also contains individual components of the vector; if so, you can check whether that’s the case.

Best,  
Miłosz

---

<div class="post-metadata">

**Author:** ![nasrola\_hayati](https://avatars.discourse-cdn.com/v4/letter/n/46a35a/32.png) [@nasrola\_hayati](https://gromacs.bioexcel.eu/u/nasrola_hayati)\
**Post date:** [January 21, 2021, 7:13pm UTC](https://gromacs.bioexcel.eu/t/changing-the-position-of-pulling-molecule-while-doing-umbrella-sampling-in-each-window/1474/9 "2021-01-21T19:13:01Z")

</div>

Thanks a lot.

best regards,  
nasrollah

---

<div class="post-metadata">

**Author:** ![S.Z](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@S.Z](https://gromacs.bioexcel.eu/u/S.Z)\
**Post date:** [January 21, 2021, 8:01pm UTC](https://gromacs.bioexcel.eu/t/changing-the-position-of-pulling-molecule-while-doing-umbrella-sampling-in-each-window/1474/10 "2021-01-21T20:01:13Z")

</div>

Hi Nasrola,  
Just use a stiffer spring (a higher pull\_coord1\_k) for those unhappy windows, It doesn’t necessarily need to have a similar pull\_coord1\_k for all windows.

Cheers,  
Salman

---

<div class="post-metadata">

**Author:** ![nasrola\_hayati](https://avatars.discourse-cdn.com/v4/letter/n/46a35a/32.png) [@nasrola\_hayati](https://gromacs.bioexcel.eu/u/nasrola_hayati)\
**Post date:** [January 22, 2021, 9:27am UTC](https://gromacs.bioexcel.eu/t/changing-the-position-of-pulling-molecule-while-doing-umbrella-sampling-in-each-window/1474/11 "2021-01-22T09:27:23Z")

</div>

Hi Salman,  
How much should I increase the value for pull\_coord1\_k? Is there any rules or it’s just empirical?

regards,  
nasrollah

---

<div class="post-metadata">

**Author:** ![milosz.wieczor](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@milosz.wieczor](https://gromacs.bioexcel.eu/u/milosz.wieczor)\
**Post date:** [January 22, 2021, 11:42am UTC](https://gromacs.bioexcel.eu/t/changing-the-position-of-pulling-molecule-while-doing-umbrella-sampling-in-each-window/1474/12 "2021-01-22T11:42:58Z")

</div>

Remember that for WHAM, you need overlap in the histograms between each pair of neighboring US windows. So it’s empirical, but two conditions limit the value from above and below: a low constant will allow the system to go towards “preferred” regions yielding unsampled free energy barrier regions, while a high one will restrain the system too much so that no two neighboring distributions will overlap.

Checking the overlap is usually explained in standard US tutorials, such as this: [GROMACS Tutorial 5 - Methane-methane PMF from window sampling — BioSFLab homepage](https://www.svedruziclab.com/tutorials/gromacs/5-umbrella/)

---

<div class="post-metadata">

**Author:** ![nasrola\_hayati](https://avatars.discourse-cdn.com/v4/letter/n/46a35a/32.png) [@nasrola\_hayati](https://gromacs.bioexcel.eu/u/nasrola_hayati)\
**Post date:** [January 24, 2021, 8:21pm UTC](https://gromacs.bioexcel.eu/t/changing-the-position-of-pulling-molecule-while-doing-umbrella-sampling-in-each-window/1474/13 "2021-01-24T20:21:46Z")

</div>

Thanks Milosz, I’ve checked that.  
It’s very helpful and my problem has been solved.

Regards,  
nasrollah
