# Gromacs topology error

**URL:** <https://gromacs.bioexcel.eu/t/gromacs-topology-error/6354>\
**Category:** User discussions\
**Tags:** forcefield\
**Created:** [May 8, 2023, 12:43pm UTC](https://gromacs.bioexcel.eu/t/gromacs-topology-error/6354 "2023-05-08T12:43:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rochik](https://avatars.discourse-cdn.com/v4/letter/r/ecc23a/32.png) [@Rochik](https://gromacs.bioexcel.eu/u/Rochik)\
**Post date:** [May 8, 2023, 12:43pm UTC](https://gromacs.bioexcel.eu/t/gromacs-topology-error/6354/1 "2023-05-08T12:43:03Z")

</div>

GROMACS version: 2020.3  
Hello guys,  
I’m working on a system of an enzyme+ two ligands. I have topology and coordinate files of the protein in Amber format and by using acpype I converted them to gromacs format. I also have the .itp files of the ligands on my directory.  
I want Gromacs to read a force filed (amber14SB) from my directory.  
This is my topology file that I made some changes, for example I included the .itp files of the ligands.

; Include forcefield parameters  
#include “amber14sb\_OL15.ff/forcefield.itp”

; Include ligands topology  
#include “lg1.itp”

; Include ligands topology  
#include “lg2.itp”

[atomtypes]  
;name bond\_type mass charge ptype sigma epsilon Amb  
N3 N3 0.00000 0.00000 A 3.25000e-01 7.11280e-01 ; 1.82 0.1700  
H H 0.00000 0.00000 A 1.06908e-01 6.56888e-02 ; 0.60 0.0157  
CX CX 0.00000 0.00000 A 3.39967e-01 4.57730e-01 ; 1.91 0.1094  
HP HP 0.00000 0.00000 A 1.95998e-01 6.56888e-02 ; 1.10 0.0157  
A2C A2C 0.00000 0.00000 A 3.39967e-01 4.57730e-01 ; 1.91 0.1094  
HC HC 0.00000 0.00000 A 2.64953e-01 6.56888e-02 ; 1.49 0.0157  
A3C A3C 0.00000 0.00000 A 3.39967e-01 4.57730e-01 ; 1.91 0.1094  
CT CT 0.00000 0.00000 A 3.39967e-01 4.57730e-01 ; 1.91 0.1094  
C C 0.00000 0.00000 A 3.39967e-01 3.59824e-01 ; 1.91 0.0860  
O O 0.00000 0.00000 A 2.95992e-01 8.78640e-01 ; 1.66 0.2100  
N N 0.00000 0.00000 A 3.25000e-01 7.11280e-01 ; 1.82 0.1700  
XC XC 0.00000 0.00000 A 3.39967e-01 3.59824e-01 ; 1.91 0.0860  
H1 H1 0.00000 0.00000 A 2.47135e-01 6.56888e-02 ; 1.39 0.0157  
C8 C8 0.00000 0.00000 A 3.39967e-01 4.57730e-01 ; 1.91 0.1094  
N2 N2 0.00000 0.00000 A 3.25000e-01 7.11280e-01 ; 1.82 0.1700  
CA CA 0.00000 0.00000 A 3.39967e-01 3.59824e-01 ; 1.91 0.0860  
OH OH 0.00000 0.00000 A 3.06647e-01 8.80314e-01 ; 1.72 0.2104  
HO HO 0.00000 0.00000 A 0.00000e+00 0.00000e+00 ; 0.00 0.0000  
CO CO 0.00000 0.00000 A 8.90899e-02 4.18400e-02 ; 0.50 0.0100  
O2 O2 0.00000 0.00000 A 2.95992e-01 8.78640e-01 ; 1.66 0.2100  
C\* C\* 0.00000 0.00000 A 3.39967e-01 3.59824e-01 ; 1.91 0.0860  
CW CW 0.00000 0.00000 A 3.39967e-01 3.59824e-01 ; 1.91 0.0860  
H4 H4 0.00000 0.00000 A 2.51055e-01 6.27600e-02 ; 1.41 0.0150  
NA NA 0.00000 0.00000 A 3.25000e-01 7.11280e-01 ; 1.82 0.1700  
CN CN 0.00000 0.00000 A 3.39967e-01 3.59824e-01 ; 1.91 0.0860  
HA HA 0.00000 0.00000 A 2.59964e-01 6.27600e-02 ; 1.46 0.0150  
CB CB 0.00000 0.00000 A 3.39967e-01 3.59824e-01 ; 1.91 0.0860  
S S 0.00000 0.00000 A 3.53241e-01 1.18156e+00 ; 1.98 0.2824  
SH SH 0.00000 0.00000 A 3.53241e-01 1.18156e+00 ; 1.98 0.2824  
CC CC 0.00000 0.00000 A 3.39967e-01 3.59824e-01 ; 1.91 0.0860  
NB NB 0.00000 0.00000 A 3.25000e-01 7.11280e-01 ; 1.82 0.1700  
CR CR 0.00000 0.00000 A 3.39967e-01 3.59824e-01 ; 1.91 0.0860  
H5 H5 0.00000 0.00000 A 2.42146e-01 6.27600e-02 ; 1.36 0.0150  
HS HS 0.00000 0.00000 A 1.08903e-01 5.18816e-02 ; 0.61 0.0124  
CV CV 0.00000 0.00000 A 3.39967e-01 3.59824e-01 ; 1.91 0.0860

[moleculetype]  
;name nrexcl  
protein 3

[atoms]  
; nr type resi res atom cgnr charge mass ; qtot bond\_type  
1 N3 1 LEU N 1 0.101000 14.01000 ; qtot 0.101  
2 H 1 LEU H1 2 0.214800 1.00800 ; qtot 0.316  
3 H 1 LEU H2 3 0.214800 1.00800 ; qtot 0.531  
4 H 1 LEU H3 4 0.214800 1.00800 ; qtot 0.745  
5 CX 1 LEU CA 5 0.010400 12.01000 ; qtot 0.756  
6 HP 1 LEU HA 6 0.105300 1.00800 ; qtot 0.861  
7 A2C 1 LEU CB 7 -0.024400 12.01000 ; qtot 0.837  
.  
.  
.  
.  
.  
.  
.  
; Include Position restraint file  
#ifdef POSRES  
#include “posre.itp”  
#endif

; Include water topology  
#include “amber99sb.ff/tip3p.itp”

#ifdef POSRES\_WATER  
; Position restraint for each water oxygen  
[position\_restraints]  
; i funct fcx fcy fcz  
1 1 1000 1000 1000  
#endif

; Include topology for ions  
#include “amber99sb.ff/ions.itp”

[system]  
; Name  
Protein in water

[molecules]  
; Compound nmols  
Protein 1  
lg1 1  
lg2 1

But, at the step of adding ions to the system, I saw this error:  
Fatal error:  
Syntax error - File topol.top, line 11  
Last line read:  
‘[atomtypes]’  
Invalid order for directive atomtypes.  
Could you please let me know what should I do now?

---

<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:** [May 8, 2023, 12:55pm UTC](https://gromacs.bioexcel.eu/t/gromacs-topology-error/6354/2 "2023-05-08T12:55:42Z")

</div>

I assume lg1.itp and lg2.itp define moleculetypes. That should happen after defining the atomtypes. So move those to includes to after the atomtypes section.

---

<div class="post-metadata">

**Author:** ![Rochik](https://avatars.discourse-cdn.com/v4/letter/r/ecc23a/32.png) [@Rochik](https://gromacs.bioexcel.eu/u/Rochik)\
**Post date:** [May 8, 2023, 1:03pm UTC](https://gromacs.bioexcel.eu/t/gromacs-topology-error/6354/3 "2023-05-08T13:03:46Z")

</div>

Thank you so much, you’re right. It worked!
