# Insert-molecules at exact predefined positions;how to use positions.dat and -ci option/configuration

**URL:** <https://gromacs.bioexcel.eu/t/insert-molecules-at-exact-predefined-positions-how-to-use-positions-dat-and-ci-option-configuration/3703>\
**Category:** User discussions\
**Created:** [February 20, 2022, 12:50am UTC](https://gromacs.bioexcel.eu/t/insert-molecules-at-exact-predefined-positions-how-to-use-positions-dat-and-ci-option-configuration/3703 "2022-02-20T00:50:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jukern](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@jukern](https://gromacs.bioexcel.eu/u/jukern)\
**Post date:** [February 20, 2022, 12:50am UTC](https://gromacs.bioexcel.eu/t/insert-molecules-at-exact-predefined-positions-how-to-use-positions-dat-and-ci-option-configuration/3703/1 "2022-02-20T00:50:25Z")

</div>

Hi all,

I have a question regarding the insertion of small molecule to an existing .gro file at exactly predefined position using the insert-molecules command.

I have the configuration in a file (ci.gro) which I would like to insert into another file (f.gro). The box size is the same for both files. I placed the molecule in the ci.gro file exactly at the position where I want it to be in the resulting file.

I have already browsed for a solution and what I found is always referring to the last paragraph of the help information.

So if I understand correctly I should use a positions.dat file. As the positions of the ci.gro are the same as I intended for the resulting file, the predefined displacements in the positions.dat file needs to be zero (positions.dat containing: ‘0 0 0’).

So here is what I did:  
(all files attached below)

> gmx insert-molecules -f f.gro -ci -ci.gro -ip positions.dat -o output.gro -replace

(sry, I named all files .dat in order to upload and deleted water, f.gro had more water in it, ignore water)  
[ci.dat](https://gromacs.bioexcel.eu/uploads/short-url/v8dOpbwu5yDTfF9Y4E3vGx5k6CO.dat) (1.6 KB)  
[f.dat](https://gromacs.bioexcel.eu/uploads/short-url/vtQdK6AhaPs2wSCgMZIXyieBUT8.dat) (142.2 KB)  
Uploading: output1.dat…  
Uploading: positions.dat…

But this do not give me the right results (ci.gro is placed outside the box). Obviously I get something wrong.  
Any help would be very appreciated.

Thanks  
Best regards

---

<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:** [February 20, 2022, 2:44am UTC](https://gromacs.bioexcel.eu/t/insert-molecules-at-exact-predefined-positions-how-to-use-positions-dat-and-ci-option-configuration/3703/2 "2022-02-20T02:44:08Z")

</div>

> [@jukern](#):
>
> I have the configuration in a file (ci.gro) which I would like to insert into another file (f.gro). The box size is the same for both files. I placed the molecule in the ci.gro file exactly at the position where I want it to be in the resulting file.

If this is the case, simply paste the coordinates of `ci.gro` into `f.gro` and update the number of atoms on the second line of the file. There’s nothing more complicated you need to do than that.

---

<div class="post-metadata">

**Author:** ![jukern](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@jukern](https://gromacs.bioexcel.eu/u/jukern)\
**Post date:** [February 20, 2022, 2:34pm UTC](https://gromacs.bioexcel.eu/t/insert-molecules-at-exact-predefined-positions-how-to-use-positions-dat-and-ci-option-configuration/3703/3 "2022-02-20T14:34:37Z")

</div>

Thanks for your response.

If I just paste the coordinates, there is a chance that the inserted molecule will overlap with the water molecules in the box. So in this case, do I need to remove those water molecules manually or is there any tool that can do this for me?

---

<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:** [February 20, 2022, 3:53pm UTC](https://gromacs.bioexcel.eu/t/insert-molecules-at-exact-predefined-positions-how-to-use-positions-dat-and-ci-option-configuration/3703/4 "2022-02-20T15:53:33Z")

</div>

It is always simpler to add all solutes before adding solvent.

---

<div class="post-metadata">

**Author:** ![jukern](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@jukern](https://gromacs.bioexcel.eu/u/jukern)\
**Post date:** [February 21, 2022, 10:48am UTC](https://gromacs.bioexcel.eu/t/insert-molecules-at-exact-predefined-positions-how-to-use-positions-dat-and-ci-option-configuration/3703/5 "2022-02-21T10:48:14Z")

</div>

Thanks again for your response.

That makes totally sense. The reason why I`am approaching it this way is because I was told to prefer adding molecules rather than start to equilibrate the whole system again (the file I’m inserting to originates from a previous simulation). But I have continuously had the notion that this was not the most convenient way. In order to prepare a simulation I was advised to run a 100 ns nvt simulation with positional restraints followed by a 100 ns npt simulation with positional restraints as well. Then I would run a 500ns free simulation.

Are these long simulations reasonable? I tend to think 100ns each is way inflated. From what I have learned so far I would say 1ns at most are completely legit.

---

<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:** [February 21, 2022, 7:01pm UTC](https://gromacs.bioexcel.eu/t/insert-molecules-at-exact-predefined-positions-how-to-use-positions-dat-and-ci-option-configuration/3703/6 "2022-02-21T19:01:05Z")

</div>

If you add molecules after equilibration, you’ve perturbed the solvent structure and you have to re-equilibrate, anyway. I don’t see a point in trying to preserve some previously equilibrated coordinates in that case. It’s a new system after you’ve added something to it.

In the presence of restraints, 100 ns is a really long time. Unless there’s some compelling reason to think that relaxation of the unrestrained parts of the system really fall on that time scale, I’d say it’s too much. Certainly properties like temperature and density equilibrate in 1-10 ns.
