# Simulating protein-ligand-cofactor (Invalid order for directive atomtypes)

**URL:** <https://gromacs.bioexcel.eu/t/simulating-protein-ligand-cofactor-invalid-order-for-directive-atomtypes/9236>\
**Category:** User discussions\
**Created:** [May 28, 2024, 1:26am UTC](https://gromacs.bioexcel.eu/t/simulating-protein-ligand-cofactor-invalid-order-for-directive-atomtypes/9236 "2024-05-28T01:26:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mmahmed](https://avatars.discourse-cdn.com/v4/letter/m/cab0a1/32.png) [@mmahmed](https://gromacs.bioexcel.eu/u/mmahmed)\
**Post date:** [May 28, 2024, 1:26am UTC](https://gromacs.bioexcel.eu/t/simulating-protein-ligand-cofactor-invalid-order-for-directive-atomtypes/9236/1 "2024-05-28T01:26:02Z")

</div>

GROMACS version: 5.2  
GROMACS modification: No

Hello,

I am having a difficulty preparing a gromacs simulation system with a protein-cofactor-ligand system. No issue until the add ion stage, where I keep getting the famous

(

Fatal error:

Syntax error - File MOL\_updated.itp, line 13

Last line read:

‘[atomtypes]’

Invalid order for directive atomtypes

) error.

I tried to follow up the tutorials and the online suggestions on how to solve this issue, but I could not. Please find the complex, cofactor (NADPH) and ligand (MOL) topology files attached, as well as the solvated complex gro.

I appreciate any suggestion,

This is the command I am running (gmx\_mpi grompp -f ions.mdp -c solvated\_complex.gro -p topol\_complex\_standalone.top -o ions.tpr -maxwarn 5)

Thanks,

Marawan

[MOL\_updated.txt](https://gromacs.bioexcel.eu/uploads/short-url/A0QyzW2UMJAtJmKtt6nsRtBy5Dh.txt) (33.0 KB)  
[NDP.txt](https://gromacs.bioexcel.eu/uploads/short-url/oomghhGsVo8ExlF4CJHuxqdtkwv.txt) (39.9 KB)

---

<div class="post-metadata">

**Author:** ![mmahmed](https://avatars.discourse-cdn.com/v4/letter/m/cab0a1/32.png) [@mmahmed](https://gromacs.bioexcel.eu/u/mmahmed)\
**Post date:** [May 28, 2024, 1:36am UTC](https://gromacs.bioexcel.eu/t/simulating-protein-ligand-cofactor-invalid-order-for-directive-atomtypes/9236/2 "2024-05-28T01:36:36Z")

</div>

[solvated\_complex.txt](https://gromacs.bioexcel.eu/uploads/short-url/A1yo0YgaLRy4jtNsnYTI3VjThhK.txt) (2.2 MB)  
[topol\_complex.top](https://gromacs.bioexcel.eu/uploads/short-url/anQMLRqefFR8eVxVXRQFcTyA8Z.top) (1.0 MB)

---

<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:** [May 28, 2024, 11:33am UTC](https://gromacs.bioexcel.eu/t/simulating-protein-ligand-cofactor-invalid-order-for-directive-atomtypes/9236/3 "2024-05-28T11:33:55Z")

</div>

Firstly, `atom types` must come before all `atoms` entries. This means that you cannot have atom types defined in both MOL\_updated.itp and in NDP.itp. Make a separate .itp file containing only the atom types blocks from those two files (and remove it from those files). Include that file before the `#include "NDP.itp"` line in the .top file.

Secondly, in the NDP.itp file you should make sure that the `atoms` block comes after the `moleculetype` block.
