# Error while solvation of protein

**URL:** <https://gromacs.bioexcel.eu/t/error-while-solvation-of-protein/8419>\
**Category:** User discussions\
**Created:** [February 24, 2024, 5:49pm UTC](https://gromacs.bioexcel.eu/t/error-while-solvation-of-protein/8419 "2024-02-24T17:49:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Munazzah1](https://avatars.discourse-cdn.com/v4/letter/m/50afbb/32.png) [@Munazzah1](https://gromacs.bioexcel.eu/u/Munazzah1)\
**Post date:** [February 24, 2024, 5:49pm UTC](https://gromacs.bioexcel.eu/t/error-while-solvation-of-protein/8419/1 "2024-02-24T17:49:15Z")

</div>

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?

---

<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:** [February 25, 2024, 6:01pm UTC](https://gromacs.bioexcel.eu/t/error-while-solvation-of-protein/8419/2 "2024-02-25T18:01:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Munazzah1](https://avatars.discourse-cdn.com/v4/letter/m/50afbb/32.png) [@Munazzah1](https://gromacs.bioexcel.eu/u/Munazzah1)\
**Post date:** [February 26, 2024, 10:16am UTC](https://gromacs.bioexcel.eu/t/error-while-solvation-of-protein/8419/3 "2024-02-26T10:16:49Z")

</div>

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?"

---

<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:** [February 26, 2024, 11:55am UTC](https://gromacs.bioexcel.eu/t/error-while-solvation-of-protein/8419/4 "2024-02-26T11:55:57Z")

</div>

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](https://manual.gromacs.org/current/reference-manual/topologies/topology-file-formats.html).

---

<div class="post-metadata">

**Author:** ![Munazzah1](https://avatars.discourse-cdn.com/v4/letter/m/50afbb/32.png) [@Munazzah1](https://gromacs.bioexcel.eu/u/Munazzah1)\
**Post date:** [February 27, 2024, 6:50am UTC](https://gromacs.bioexcel.eu/t/error-while-solvation-of-protein/8419/5 "2024-02-27T06:50:43Z")

</div>

Thanks Milosz.
