Error while solvation of protein

GROMACS version:2023.4
GROMACS modification: Yes/No
Hello,
I was prepare topology file for ligand with GAFF. And protein with force file a99SB-disp. Then convert the topology of ligand with acpype. Then include :

; Include ligand parameters
#include “jz4.prm”

statement in the topology of protein. Then i solvate system with water. But when I am adding ions in the solvated box it give me following error:

Fatal error:
Syntax error - File lig.prm, line 19
Last line read:
'1 2 yes 0.5 0.83333333 ’
Found a second defaults directive.

I am not understanding why this error is occurring?

The [ defaults ] directive should appear only once in a topology. Remove it from the newly included file.

Hello milosz,
Thanks for the suggestion,
However, after following your suggestion and commenting out the [default] section in the lig.itp and lig.prm files, I encountered an error

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

Fatal error:
Syntax error - File lig.itp, line 21
Last line read:
‘[ atomtypes ]’
Invalid order for directive atomtypes

Then, I commented out the ‘atomtypes’ section in all the files. However, it again showed me errors.

ERROR 1 [file lig.prm, line 19]:
** Incorrect number of atomtypes for dihedral (4 instead of 2 or 4)**

Generated 4277 of the 4278 non-bonded parameter combinations
Generating 1-4 interactions: fudge = 0.5

Generated 4278 of the 4278 1-4 parameter combinations

Excluding 3 bonded neighbours molecule type ‘UNK’

WARNING 1 [file lig.itp, line 19]:
** Too few parameters on line (source file**
** /home2/ashwani/Downloads/gromacs-2022.5/src/gromacs/gmxpreprocess/toppush.cpp, line 1900)**

ERROR 2 [file lig.itp, line 40]:
** moleculetype UNK is redefined**

I prepared my ligand file with GAFF. Then convert it with ParmED. So their is a problem in conversion? Or is there something else that I did wrong?

I have one more question: Are the .itp file and .prm file the same? Or in this step, I also made some mistakes?
I included this file last in the topology file:
#include “lig.prm”
However, I realized that the .itp and .prm files are the same. So, which file should I include here?"

In principle, .prm is not a format compatible with Gromacs, but if you have an .itp file and rename it to .prm it’s going to be fine. acpype can generate Gromacs files, so if you did so and the format is Gromacs-compatible (that’s the main IF), the extension will not make a difference.

However, the “Too few parameters on line” warning suggests something is wrong about the format in lig.itp, and you definitely should not have two molecules with the same molecule name (UNK here, as generic “unknown”). The “Incorrect number of atomtypes for dihedral” error also doesn’t look reassuring. Grompp is telling you in which lines the errors occur, so make sure the respective lines are consistent with Gromacs formatting.

Thanks Milosz.