# How can I pull 1 out of several molecules towards bilayer center

**URL:** <https://gromacs.bioexcel.eu/t/how-can-i-pull-1-out-of-several-molecules-towards-bilayer-center/7103>\
**Category:** User discussions\
**Tags:** umbrella-sampling\
**Created:** [August 30, 2023, 8:18am UTC](https://gromacs.bioexcel.eu/t/how-can-i-pull-1-out-of-several-molecules-towards-bilayer-center/7103 "2023-08-30T08:18:59Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![samapika](https://avatars.discourse-cdn.com/v4/letter/s/9fc348/32.png) [@samapika](https://gromacs.bioexcel.eu/u/samapika)\
**Post date:** [August 30, 2023, 8:19am UTC](https://gromacs.bioexcel.eu/t/how-can-i-pull-1-out-of-several-molecules-towards-bilayer-center/7103/1 "2023-08-30T08:19:00Z")

</div>

GROMACS version: 2020.2  
GROMACS modification: No  
I have 302 molecules in my bilayer systems. The molecules are mostly located at the interface of the bilayer. I want to pull just one of the molecule to the center of the bilayer. I have applied position restraint to the bilayer. But How can I apply position restraint to this 301 molecule and just pull 1 of them.

---

<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 30, 2023, 8:29am UTC](https://gromacs.bioexcel.eu/t/how-can-i-pull-1-out-of-several-molecules-towards-bilayer-center/7103/2 "2023-08-30T08:29:20Z")

</div>

You should not use position restraints. You should use the pull code with geometry=cylinder and have the membrane as reference group and one molecule as the other pull group. There are many publications with the setup and probably also tutorials.

---

<div class="post-metadata">

**Author:** ![samapika](https://avatars.discourse-cdn.com/v4/letter/s/9fc348/32.png) [@samapika](https://gromacs.bioexcel.eu/u/samapika)\
**Post date:** [August 30, 2023, 8:36am UTC](https://gromacs.bioexcel.eu/t/how-can-i-pull-1-out-of-several-molecules-towards-bilayer-center/7103/3 "2023-08-30T08:36:29Z")

</div>

Thanks for the suggestion. The pull group i intend to pull is just one among many. What If all of them get pulled if I do not apply constraint. That’s my confusion.

---

<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 30, 2023, 8:46am UTC](https://gromacs.bioexcel.eu/t/how-can-i-pull-1-out-of-several-molecules-towards-bilayer-center/7103/4 "2023-08-30T08:46:41Z")

</div>

That depends a bit on what you want to combine. You can pull many groups with respect to the same bilayer reference group.

---

<div class="post-metadata">

**Author:** ![samapika](https://avatars.discourse-cdn.com/v4/letter/s/9fc348/32.png) [@samapika](https://gromacs.bioexcel.eu/u/samapika)\
**Post date:** [August 30, 2023, 10:07am UTC](https://gromacs.bioexcel.eu/t/how-can-i-pull-1-out-of-several-molecules-towards-bilayer-center/7103/5 "2023-08-30T10:07:52Z")

</div>

; Pull code  
pull = yes  
pull\_ncoords = 1 ; only one reaction coordinate  
pull\_ngroups = 2 ; two groups defining one reaction coordinate  
pull\_group1\_name = PDMS  
pull\_group2\_name = DMPC  
pull\_coord1\_type = umbrella ; harmonic potential  
pull\_coord1\_geometry = cylinder ; simple distance increase  
pull\_coord1\_dim = N N Y  
pull\_coord1\_vec = 0 0 1  
pull\_coord1\_groups = 1 2  
pull\_coord1\_start = yes ; define initial COM distance \> 0  
pull\_coord1\_rate = -0.005 ; 0.01 nm per ps = 10 nm per ns  
pull\_coord1\_k = 3000 ; kJ mol^-1 nm^-2  
pull\_nstxout = 1  
pull\_nstfout = 1  
; ENFORCED ROTATION  
rotation = yes  
rot\_ngroups = 1  
rot\_group0 = DMPC\_DMS  
rot\_type0 = rm2-pf  
rot\_vec0 = 0.0 0.0 1.0  
rot\_pivot0 = 0.0 0.0 0.0  
rot-massw0 = no  
rot\_rate0 = 0  
rot\_k0 = 4000  
rot\_eps0 = 0.01  
Is the above defination of mdp file correct?

---

<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 30, 2023, 10:16am UTC](https://gromacs.bioexcel.eu/t/how-can-i-pull-1-out-of-several-molecules-towards-bilayer-center/7103/6 "2023-08-30T10:16:17Z")

</div>

group 1 should be the bilayer, which I guess it is not in your file.

Why do use the enforced rotation code?

---

<div class="post-metadata">

**Author:** ![MagnusL](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/magnusl/32/2380_2.png) [@MagnusL](https://gromacs.bioexcel.eu/u/MagnusL)\
**Post date:** [August 30, 2023, 11:28am UTC](https://gromacs.bioexcel.eu/t/how-can-i-pull-1-out-of-several-molecules-towards-bilayer-center/7103/7 "2023-08-30T11:28:31Z")

</div>

Do you mean that the selection groups that you use for pulling contain multiple molecules instead of just one? I.e., are there multiple PDMS molecules in the PDMS selection group? If that is the case then you just have to add a new selection group, containing just the molecule you want to pull, to your index file. And then you use that as pull group instead.

---

<div class="post-metadata">

**Author:** ![samapika](https://avatars.discourse-cdn.com/v4/letter/s/9fc348/32.png) [@samapika](https://gromacs.bioexcel.eu/u/samapika)\
**Post date:** [August 30, 2023, 12:38pm UTC](https://gromacs.bioexcel.eu/t/how-can-i-pull-1-out-of-several-molecules-towards-bilayer-center/7103/8 "2023-08-30T12:38:10Z")

</div>

I have 302 DMS. Among them I want to pull a single DMS to bilayer center, which I have renamed as PDMS and created an index of it. Similarly in the itp I have copied DMS itp and renamed DMS to PDMS to create a new itp. This new itp i inserted in the top making sure [moleculetype] defination in the gro file and top file are matching. Now I am pulling using the mdp and I have now removed rotation restraint. Still I get error.

---

<div class="post-metadata">

**Author:** ![MagnusL](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/magnusl/32/2380_2.png) [@MagnusL](https://gromacs.bioexcel.eu/u/MagnusL)\
**Post date:** [August 30, 2023, 3:56pm UTC](https://gromacs.bioexcel.eu/t/how-can-i-pull-1-out-of-several-molecules-towards-bilayer-center/7103/9 "2023-08-30T15:56:02Z")

</div>

It’s still not clear exactly what error you are getting, which means that it’s difficult to help you. Have you followed Berk’s instructions and set `pull_group1_name = DMPC` and `pull_group2_name = PDMS`?

---

<div class="post-metadata">

**Author:** ![mahisan](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@mahisan](https://gromacs.bioexcel.eu/u/mahisan)\
**Post date:** [September 27, 2023, 12:36pm UTC](https://gromacs.bioexcel.eu/t/how-can-i-pull-1-out-of-several-molecules-towards-bilayer-center/7103/10 "2023-09-27T12:36:05Z")

</div>

hi. i have a similar question!. i am a beginner PhD student in the field of md simulation and want to use umbrella sampling to study the permeation of my nanoparticle through a membrane. my system contains “ions, water, nanoparticle and membrane”  
i prepared 2 groups in my index file: (1) nano | (2) other (contain membrane, water and ion). is it correct as i just want to pull my nanoparticle?

so is this pulling code in my mdp file ok or i should modify it?

; Pull code  
pull = yes  
pull\_ncoords = 1 ; only one reaction coordinate  
pull\_ngroups = 2 ; two groups defining one reaction coordinate  
pull\_group1\_name = other  
pull\_group2\_name = nano  
pull\_coord1\_type = umbrella ; harmonic potential  
pull\_coord1\_geometry = direction ; simple distance increase  
pull\_coord1\_vec = 0 0 1  
pull\_coord1\_dim = N N Y  
pull\_coord1\_groups = 1 2  
pull\_coord1\_start = yes ; define initial COM distance \> 0  
pull\_coord1\_rate = -0.01 ; 0.01 nm per ps = 10 nm per ns  
pull\_coord1\_k = 1000 ; kJ mol^-1 nm^-2

thank you for your consideration.

---

<div class="post-metadata">

**Author:** ![MagnusL](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/magnusl/32/2380_2.png) [@MagnusL](https://gromacs.bioexcel.eu/u/MagnusL)\
**Post date:** [September 28, 2023, 8:11am UTC](https://gromacs.bioexcel.eu/t/how-can-i-pull-1-out-of-several-molecules-towards-bilayer-center/7103/11 "2023-09-28T08:11:32Z")

</div>

I would suggest making a new index group with only the membrane. Then set `pull_group1_name = membrane` (if that is what you called the index group). There’s no reason to involve the water and ions in the pulling.

---

<div class="post-metadata">

**Author:** ![mahisan](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@mahisan](https://gromacs.bioexcel.eu/u/mahisan)\
**Post date:** [September 28, 2023, 12:14pm UTC](https://gromacs.bioexcel.eu/t/how-can-i-pull-1-out-of-several-molecules-towards-bilayer-center/7103/13 "2023-09-28T12:14:01Z")

</div>

thank you so much for your kind answer.

but I have a few questions that I would be very grateful if you could help me as I don’t have an informed person around me to help me and my readings have confused me.

1- If I don’t include “water and ions”, what will happen to them during pulling?  
2- In similar codes for “pull-coord1-geometry” I have seen “distance, direction and cylinder” geometries. What is their difference? How do I know which geometry is better?  
3- I have seen that “pull-group1-pbcatom” and “pull-group2-pbcatom” are used in some codes. What is the reason and how is the number (COM) attributed to them determined?  
4- Is “pull\_group1\_name” always the fixed group and “pull\_group2\_name” the group on which the pull is to be performed?  
5- how large the pull group should be to use “pull-pbc-ref-prev-step-com”?  
6- Finally, a very trivial question, how do I know that the “pull\_coord1\_rate” and “pull\_coord1\_k” used were appropriate for my system?!

---

<div class="post-metadata">

**Author:** ![MagnusL](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/magnusl/32/2380_2.png) [@MagnusL](https://gromacs.bioexcel.eu/u/MagnusL)\
**Post date:** [September 29, 2023, 12:40pm UTC](https://gromacs.bioexcel.eu/t/how-can-i-pull-1-out-of-several-molecules-towards-bilayer-center/7103/14 "2023-09-29T12:40:30Z")

</div>

1. The water and ions will be unaffected by the pulling.
2. There is some more information at [https://manual.gromacs.org/current/user-guide/mdp-options.html#com-pulling](https://manual.gromacs.org/current/user-guide/mdp-options.html#com-pulling). For pulling through a membrane `cylinder` is usually a good choice, especially if the membrane is flexible, but `direction` usually works fine as well. More information is also available in [https://manual.gromacs.org/current/reference-manual/special/pulling.html](https://manual.gromacs.org/current/reference-manual/special/pulling.html).
3. This is also described in the links above. Large selection groups need a periodic boundary treatment, and one atom is used as a reference to find the closest (to the reference atom) periodic image of all atoms in the group. The atom number is based on the atom number in the coordinate system (not only the selection group). You will never go wrong if you pick a centrally located atom.
4. The first of the `pull-coord?-groups` is the reference group.
5. That is also described in [https://manual.gromacs.org/current/reference-manual/special/pulling.html](https://manual.gromacs.org/current/reference-manual/special/pulling.html). There is no specific rule, but if you have a very large group (let’s say group1) and your `pull-group1-pbcatom` moves so much (relative to the rest of the group) that other atoms end up in another periodic image you will see large fluctuations in the position of your pull group. Using the center of mass (of the previous step) as reference will avoid that. If you choose a centrally located atom you can (almost?) never go wrong if you choose `pull-pbc-ref-prev-step-com`.
6. It is difficult to know exactly what rate and force constant you should use. It will depend on what you want to study. There is no general answer. Have a look at the trajectories to see that nothing seems to break or distort too much. Run your analyses and check that they make sense. If your force is not high enough it might be difficult to pass through very resistive regions - your pulled group will not be close to the pulling target coordinate.

I hope that helps.

---

<div class="post-metadata">

**Author:** ![mahisan](https://avatars.discourse-cdn.com/v4/letter/m/ee7513/32.png) [@mahisan](https://gromacs.bioexcel.eu/u/mahisan)\
**Post date:** [September 29, 2023, 4:12pm UTC](https://gromacs.bioexcel.eu/t/how-can-i-pull-1-out-of-several-molecules-towards-bilayer-center/7103/15 "2023-09-29T16:12:07Z")

</div>

dear MagnusL  
thank you so much for your time and consideration.
