# Preparation of Oxygen in Water

**URL:** <https://gromacs.bioexcel.eu/t/preparation-of-oxygen-in-water/9471>\
**Category:** User discussions\
**Tags:** simulation-setup\
**Created:** [June 21, 2024, 6:50pm UTC](https://gromacs.bioexcel.eu/t/preparation-of-oxygen-in-water/9471 "2024-06-21T18:50:34Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![bahrulabid\_2511](https://avatars.discourse-cdn.com/v4/letter/b/8baadc/32.png) [@bahrulabid\_2511](https://gromacs.bioexcel.eu/u/bahrulabid_2511)\
**Post date:** [June 21, 2024, 6:50pm UTC](https://gromacs.bioexcel.eu/t/preparation-of-oxygen-in-water/9471/1 "2024-06-21T18:50:35Z")

</div>

GROMACS version: 2022.2  
GROMACS modification: No

I want to run MD simulation of oxygen in water. Oxygen molecule was prepared by quantum calculation and Antechamber. Topology file prepared by acpype. First, I used gmx insert-molecules to set up the box. Then, I add water by gmx solvate. When I try gmx grompp, there is an error:

“No such molecule type SOL”

I searched on internet, someone sugget to add #include “oplsaa.ff/spce.itp” and remove SOL from [molecules]. I tried it, but other error come:

“ERROR 1 [file spce.itp, line 7]: Atomtype opls\_116 not found”

Can anyone help me? Here is the topology file:

; OXY\_GMX.top created by acpype (v: 2022.6.6) on Sat Jun 22 00:58:34 2024

[defaults]  
; nbfunc comb-rule gen-pairs fudgeLJ fudgeQQ  
1 2 yes 0.5 0.8333333333

[atomtypes]  
;name bond\_type mass charge ptype sigma epsilon Amb  
o o 0.00000 0.00000 A 2.95992e-01 8.78640e-01 ; 1.66 0.2100

[moleculetype]  
;name nrexcl  
OXY 3

[atoms]  
; nr type resi res atom cgnr charge mass ; qtot bond\_type  
1 o 1 OXY O 1 0.000000 16.00000 ; qtot 0.000  
2 o 1 OXY O1 2 0.000000 16.00000 ; qtot 0.000

[bonds]  
; ai aj funct r k  
1 2 1 1.4300e-01 3.2158e+05 ; O - O1

[system]  
OXY in water

[molecules]  
; Compound nmols  
OXY 1  
#include “oplsaa.ff/spce.itp”

---

<div class="post-metadata">

**Author:** ![bahrulabid\_2511](https://avatars.discourse-cdn.com/v4/letter/b/8baadc/32.png) [@bahrulabid\_2511](https://gromacs.bioexcel.eu/u/bahrulabid_2511)\
**Post date:** [June 21, 2024, 6:57pm UTC](https://gromacs.bioexcel.eu/t/preparation-of-oxygen-in-water/9471/2 "2024-06-21T18:57:49Z")

</div>

Is it because I neglect gmx pdb2gmx step? But, I feel stuck on how to solavte GAFF molecule with SPC/E water model

---

<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:** [June 21, 2024, 10:07pm UTC](https://gromacs.bioexcel.eu/t/preparation-of-oxygen-in-water/9471/3 "2024-06-21T22:07:12Z")

</div>

When you add the solvent, your `[atomtypes]` do not include the definition of water atom types. You can include the force field parameters with oplsaa.ff/forcefield.itp, but then remember not to duplicate `[defaults]`.

You will find an extended discussion of the different sections [in the manual](https://manual.gromacs.org/current/reference-manual/topologies/topology-file-formats.html).

---

<div class="post-metadata">

**Author:** ![bahrulabid\_2511](https://avatars.discourse-cdn.com/v4/letter/b/8baadc/32.png) [@bahrulabid\_2511](https://gromacs.bioexcel.eu/u/bahrulabid_2511)\
**Post date:** [June 22, 2024, 3:43am UTC](https://gromacs.bioexcel.eu/t/preparation-of-oxygen-in-water/9471/4 "2024-06-22T03:43:50Z")

</div>

I have tried to include ff parameter to the topology file, but the error was still happening.  
Do you know how to build system by acpype? I mean, in my case, is it correct when I do this step:

1. build system just containing oxygen by PACKMOL
2. define force field (GAFF) by Antechamber/AmberTools
3. make gromacs coordinate dan topology by acpype
4. gmx solvate to add water to the system

---

<div class="post-metadata">

**Author:** ![bahrulabid\_2511](https://avatars.discourse-cdn.com/v4/letter/b/8baadc/32.png) [@bahrulabid\_2511](https://gromacs.bioexcel.eu/u/bahrulabid_2511)\
**Post date:** [June 22, 2024, 3:49am UTC](https://gromacs.bioexcel.eu/t/preparation-of-oxygen-in-water/9471/5 "2024-06-22T03:49:29Z")

</div>

I also tried this step:

1. gmx pdb2gmx to make topology file just containing spce water
2. gmx insert-molecules to add oxygen to the system
3. edited topology file by including “oxy.itp” generated by acpype and added number of oxygen molecules in [molecules]
4. gmx solvate to add spce water fulfilling the box

Of course, the error still come.

---

<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:** [June 22, 2024, 10:26am UTC](https://gromacs.bioexcel.eu/t/preparation-of-oxygen-in-water/9471/6 "2024-06-22T10:26:26Z")

</div>

Look, your topology - however you prepare it - needs to have:

- a molecule definition for O2
- a molecule definition for SPC/E
- atomtypes for O2
- atomtypes for SPC/E

In the last step, you tried I believe you’re going to miss the definition of the `o` atomtype:

```auto
o o 0.00000 0.00000 A 2.95992e-01 8.78640e-01 ; 1.66 0.2100

```

so just manually insert it into your topology (e.g. create another `[atomtypes]` section after your `#include oplsaa.ff/forcefield.itp` in your `topol.top`).

Since your non-standard atomtypes for O2 come from external files, `gmx pdb2gmx` will not know it has to include them too.

---

<div class="post-metadata">

**Author:** ![bahrulabid\_2511](https://avatars.discourse-cdn.com/v4/letter/b/8baadc/32.png) [@bahrulabid\_2511](https://gromacs.bioexcel.eu/u/bahrulabid_2511)\
**Post date:** [June 22, 2024, 12:55pm UTC](https://gromacs.bioexcel.eu/t/preparation-of-oxygen-in-water/9471/7 "2024-06-22T12:55:12Z")

</div>

Can I add O2.itp file into …/gromacs/share/topamber99.ff or …/oplsaa.ff, because there are #include oplsaa.ff/forcefield.itp (or amber99.ff) in the .top file

---

<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:** [June 22, 2024, 3:41pm UTC](https://gromacs.bioexcel.eu/t/preparation-of-oxygen-in-water/9471/8 "2024-06-22T15:41:55Z")

</div>

That’s not a big issue in this case, but in general, never mix e.g. OPLS and Amber parameters.

Just include the molecule definition in the .top file, but remember that placement matters (best if you place it right _after_ `#include oplsaa.ff/forcefield.itp`). I’m assuming O2.itp has both `[atomtypes]` and `[moleculetype]` entries.

---

<div class="post-metadata">

**Author:** ![bahrulabid\_2511](https://avatars.discourse-cdn.com/v4/letter/b/8baadc/32.png) [@bahrulabid\_2511](https://gromacs.bioexcel.eu/u/bahrulabid_2511)\
**Post date:** [June 22, 2024, 6:07pm UTC](https://gromacs.bioexcel.eu/t/preparation-of-oxygen-in-water/9471/9 "2024-06-22T18:07:29Z")

</div>

Thank you for your guide. Let me ask the last question. As you said that mixing OPLS and Amber parameters is not a big deal in this case, but it is in other cases. So, because Antechamber generate Amber parameters, should I use amber99.ff instead of OPLS?
