# Generation of .itp files for small molecules for OPLS and AMBER force fields in the GROMACS package

**URL:** <https://gromacs.bioexcel.eu/t/generation-of-itp-files-for-small-molecules-for-opls-and-amber-force-fields-in-the-gromacs-package/12347>\
**Category:** User discussions\
**Created:** [July 9, 2025, 6:28am UTC](https://gromacs.bioexcel.eu/t/generation-of-itp-files-for-small-molecules-for-opls-and-amber-force-fields-in-the-gromacs-package/12347 "2025-07-09T06:28:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Devid](https://avatars.discourse-cdn.com/v4/letter/d/22d042/32.png) [@Devid](https://gromacs.bioexcel.eu/u/Devid)\
**Post date:** [July 9, 2025, 6:28am UTC](https://gromacs.bioexcel.eu/t/generation-of-itp-files-for-small-molecules-for-opls-and-amber-force-fields-in-the-gromacs-package/12347/1 "2025-07-09T06:28:32Z")

</div>

Dear users  
I want to simulate a protein-ligand system containing a small molecule in the GROMACS package using both the OPLS and AMBER force fields. For this, I need to generate `.itp` files for the small molecule compatible with each force field. I have tried generating them using [LigParGen](http://zarbi.chem.yale.edu/ligpargen/) for OPLS and [acpype](https://github.com/llazzaro/acpype) for AMBER, as suggested by GROMACS tutorial.

However, the generated files contain atom types like `opls_818`, `opls_839`, etc., for OPLS, and `p5`, `oh`, etc., for AMBER, which do not appear to be directly compatible with GROMACS.

Could anyone suggest an alternative approach or point out if I am doing something wrong? Any help would be greatly appreciated.

 ![image](https://europe1.discourse-cdn.com/flex017/uploads/bioexcel1/original/2X/a/a58333b75a4ba0b827c6a2a3907bf78b1ace8a0a.png)  
 ![image](https://europe1.discourse-cdn.com/flex017/uploads/bioexcel1/original/2X/e/ee0899df32b66a1225cdab32fc99781df71c4552.png)

---

<div class="post-metadata">

**Author:** ![lmullender](https://avatars.discourse-cdn.com/v4/letter/l/8dc957/32.png) [@lmullender](https://gromacs.bioexcel.eu/u/lmullender)\
**Post date:** [July 14, 2025, 1:45pm UTC](https://gromacs.bioexcel.eu/t/generation-of-itp-files-for-small-molecules-for-opls-and-amber-force-fields-in-the-gromacs-package/12347/2 "2025-07-14T13:45:15Z")

</div>

Your issue is not that OPLS and AMBER aren’t directly compatible with GROMACS (which they are), but that you’re mixing the two, which is generally a bad idea. You have a bunch of OPLS atomtypes in your `[atomtypes]` directive, and then you’re adding AMBER-style atomtypes in the `[atoms]` directive.  
E.g., if you’re using OPLS, the `type` part of your atom definition should be something like `opls_XXX`. Both LigParGen and acpype should generate `.top` and `.itp` files that are intended to be used together, so just deciding for one of them should do the trick.

---

<div class="post-metadata">

**Author:** ![Devid](https://avatars.discourse-cdn.com/v4/letter/d/22d042/32.png) [@Devid](https://gromacs.bioexcel.eu/u/Devid)\
**Post date:** [July 31, 2025, 11:59am UTC](https://gromacs.bioexcel.eu/t/generation-of-itp-files-for-small-molecules-for-opls-and-amber-force-fields-in-the-gromacs-package/12347/3 "2025-07-31T11:59:20Z")

</div>

Hi [lmullender](https://gromacs.bioexcel.eu/u/lmullender)

Thank you for your response.

Actually, I was generating the .itp file separately for the molecule using two different forcefields for two different MD simulations. I first tried the molecule in LigParGen for OPLS forcefield, which generated atom types like _opls\_818_, _opls\_839_, etc. However, I also need the .itp for the Amber forcefield for another simulation, which generated atom types like _p5_, _oh_, etc. Unfortunately, both of these are not compatible with GROMACS 2020.4.

---

<div class="post-metadata">

**Author:** ![lmullender](https://avatars.discourse-cdn.com/v4/letter/l/8dc957/32.png) [@lmullender](https://gromacs.bioexcel.eu/u/lmullender)\
**Post date:** [July 31, 2025, 12:33pm UTC](https://gromacs.bioexcel.eu/t/generation-of-itp-files-for-small-molecules-for-opls-and-amber-force-fields-in-the-gromacs-package/12347/4 "2025-07-31T12:33:16Z")

</div>

Hi Devid,

Does that mean you tried it with other GROMACS versions and it worked? I don’t know what exactly your steps are, but like I said, the issue is not that OPLS and Amber force fields aren’t compatible with GROMACS, but that they not compatible with _each other_. That means, if you’re using e.g. LigParGen/OPLS to generate your ligand.itp file, you should also use the OPLS force field for the rest of your topology. GROMACS doesn’t care what the atom types are called, as long as they match. If you only tell it about the OPLS atom types like _opls\_XXX_, but then you add atoms that have an Amber-style atom type (e.g. _p5, oh_), gromacs won’t know what to do with that.

If you’re willing to share your .top and .itp files, maybe we could help you in more detail.

---

<div class="post-metadata">

**Author:** ![Devid](https://avatars.discourse-cdn.com/v4/letter/d/22d042/32.png) [@Devid](https://gromacs.bioexcel.eu/u/Devid)\
**Post date:** [September 6, 2025, 10:06am UTC](https://gromacs.bioexcel.eu/t/generation-of-itp-files-for-small-molecules-for-opls-and-amber-force-fields-in-the-gromacs-package/12347/5 "2025-09-06T10:06:28Z")

</div>

Dear [lmullender](https://gromacs.bioexcel.eu/t/generation-of-itp-files-for-small-molecules-for-opls-and-amber-force-fields-in-the-gromacs-package/12347/4)

Sorry for the delayed reply.

I tried this with GROMACS 2020.4, but it didn’t work. I need to simulate a protein with small molecule ligand, I generated it externally and incorporated it into the protein topology.I created the .itp file using LigParGen and added the topology data to the system’s topology file, but the simulation still failed. I also tried ACPYPE for the AMBER force field, with the same result.

I’ve attached the .itp files generated by both LigParGen and ACPYPE (saved in .txt format for uploading to the forums).

Thank you for your time.

[LigParGen\_adp.itp.txt](https://gromacs.bioexcel.eu/uploads/short-url/6glvk4VnZBpGQx63hWrpdcww9wc.txt) (23.5 KB)

[acpype\_ADP\_H\_GMX.itp.txt](https://gromacs.bioexcel.eu/uploads/short-url/qcodhoeenghiLB9RIgqBhT5JfYs.txt) (28.0 KB)

---

<div class="post-metadata">

**Author:** ![lmullender](https://avatars.discourse-cdn.com/v4/letter/l/8dc957/32.png) [@lmullender](https://gromacs.bioexcel.eu/u/lmullender)\
**Post date:** [September 8, 2025, 2:03pm UTC](https://gromacs.bioexcel.eu/t/generation-of-itp-files-for-small-molecules-for-opls-and-amber-force-fields-in-the-gromacs-package/12347/6 "2025-09-08T14:03:23Z")

</div>

Hi Devid!

Could you also attach the topology file you are using? And also, which specific error are you getting?
