# Can I insert two ligands with almost same itp files?

**URL:** https://gromacs.bioexcel.eu/t/can-i-insert-two-ligands-with-almost-same-itp-files/2209
**Category:** User discussions
**Created:** [May 23, 2021, 8:46pm UTC](https://gromacs.bioexcel.eu/t/can-i-insert-two-ligands-with-almost-same-itp-files/2209 "2021-05-23T20:46:59Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![lanselibai](https://avatars.discourse-cdn.com/v4/letter/l/e9c0ed/32.png) [@lanselibai](https://gromacs.bioexcel.eu/u/lanselibai)
#### Post date: [May 23, 2021, 8:46pm UTC](https://gromacs.bioexcel.eu/t/can-i-insert-two-ligands-with-almost-same-itp-files/2209/1 "2021-05-23T20:46:59Z")

</div>

GROMACS version:2021  
GROMACS modification: /No  
Here post your question

I have two ligands, ligand1 is the acid form of a buffer with 0 charge, ligand2 is the basic form of a buffer with -1 charge. Two ligands are mostly identical except ligand2 does not have a hydrogen so it is -1 charged. I submit their PDB to acpype and got ligand1.gro/top/itp and ligand2.gro/top/itp files.

I use `insert-molecules` and update the topol.top files based on [here](https://gromacs.bioexcel.eu/t/how-to-update-topology-file-after-insert-molecules/2206/4). If only one ligand is inserted, there is no problem to run  
`gmx grompp -f ions.mdp -c protein_solv.gro -p topol.top -o ions.tpr -maxwarn 1`

But if both ligands are inserted, the `gmx grompp -f ions.mdp ...` will give error:

```
Fatal error:
Syntax error - File ligand2.itp, line 3
Last line read:
'[atomtypes]'
Invalid order for directive atomtypes

```

I have already put the itp lines in the very beginning of the `topol.top` file:

```
; Include forcefield parameters
#include "amber14sb.ff/forcefield.itp"
#include "ligand1.itp"
#include "ligand2.itp"
```

---

<div class="post-metadata">

### Author: ![lanselibai](https://avatars.discourse-cdn.com/v4/letter/l/e9c0ed/32.png) [@lanselibai](https://gromacs.bioexcel.eu/u/lanselibai)
#### Post date: [May 24, 2021, 9:50pm UTC](https://gromacs.bioexcel.eu/t/can-i-insert-two-ligands-with-almost-same-itp-files/2209/2 "2021-05-24T21:50:26Z")

</div>

I got the solution, i.e. move (cut & paste) the `[atomtypes]` section from the `ligand.itp` to the `topol.top` under forcefield parameters

---

<div class="post-metadata">

### Author: ![sayan23us](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@sayan23us](https://gromacs.bioexcel.eu/u/sayan23us)
#### Post date: [April 22, 2024, 7:58am UTC](https://gromacs.bioexcel.eu/t/can-i-insert-two-ligands-with-almost-same-itp-files/2209/3 "2024-04-22T07:58:32Z")

</div>

Can you please show how your topol.top looks after the modification?  
I am also facing the same problem
