Invalid order for directive atomtypes

GROMACS version:
GROMACS modification: Yes/No
I am trying run a simulation for a glycoprotein in a mixture solvent including water and ionic liquide, using parameters from swissparam.
I modified the topol.top file generated by pdb2gmx and added the following statement, before all other lines referring to the protein or ions :

#include “ligand.itp”
and that worked and I can run simulation in water without any problem.

But, about the .itp file of co-solvent, I tried different places such as after and before lines referring to the protein or ions and water,and every time after

gmx grompp -f ions.mdp -c solv.gro -p topol.top -o ions.tpr

I countered identical error:

Fatal error:
Syntax error - File C10.itp, line 7
Last line read:
'[ atomtypes ] ’
Invalid order for directive atomtypes

can you advice me how resolve this issue? or send an example of topol.top file?

Hi Azam,

I have encountered the same error a few times, too. I believe you can only have one [ atomtypes ] directive and I am pretty sure it has to come before any definition of molecule types, bonds, angles and dihedrals. And I mean: one in total, accounting for all .itp files.
What I have always resorted to is to ‘hack’ the .itp(s) and incude all atom types in a single file (first include), which is admittedly a bit sloppy but I could not find any better way to do it.

Michele

Dear Michele, thanks for your reply. Do you mean I have to add atomtypes of my solvent in to itp file of my ligand? how about pairtypes, atoms , bonds,…?
did you do this work for yourself and it worked?

Indeed, unless they are not included already (then I guess it would mean there is some atomtypes duplicate).
I believe you may have multiple declarations of molecule types and bonds, not sure about pairtypes.

Can you please tell how did you create .itp file for ligand. I tried ligand parametrization with CGenFF but the .str file has very large penalty values. so. I tried using swissparam website for the same and the .itp file and .par (i presume this is a parameter file) were included in system.top file but I’m getting errors like:

WARNING 46 [file jz4.par, line 59]:
Too few parameters on line (source file
/home/…/Downloads/gromacs-2018.3/src/gromacs/gmxpreprocess/toppush.cpp, line 977)

ERROR 9 [file jz4.par, line 60]:
Trying to add Buck.ham (SR) while the default nonbond type is LJ (SR)

ERROR 10 [file jz4.par, line 61]:
Trying to add Buck.ham (SR) while the default nonbond type is LJ (SR)

ERROR 11 [file jz4.par, line 62]:
Trying to add Buck.ham (SR) while the default nonbond type is LJ (SR)

ERROR 12 [file jz4.par, line 63]:
Trying to add Buck.ham (SR) while the default nonbond type is LJ (SR)

ERROR 13 [file jz4.par, line 64]:
Trying to add Buck.ham (SR) while the default nonbond type is LJ (SR)

Generated 100465 of the 100576 non-bonded parameter combinations
Generating 1-4 interactions: fudge = 1
Generated 66298 of the 100576 1-4 parameter combinations


Program: gmx grompp, version 2018.3
Source file: src/gromacs/gmxpreprocess/topio.cpp (line 799)

Fatal error:
Syntax error - File jz4.itp, line 7
Last line read:
'[ atomtypes ] ’
Invalid order for directive atomtypes