# Generating a topology file for multiple combined residues

**URL:** <https://gromacs.bioexcel.eu/t/generating-a-topology-file-for-multiple-combined-residues/9988>\
**Category:** User discussions\
**Created:** [August 26, 2024, 3:23am UTC](https://gromacs.bioexcel.eu/t/generating-a-topology-file-for-multiple-combined-residues/9988 "2024-08-26T03:23:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![unagi](https://avatars.discourse-cdn.com/v4/letter/u/4da419/32.png) [@unagi](https://gromacs.bioexcel.eu/u/unagi)\
**Post date:** [August 26, 2024, 3:23am UTC](https://gromacs.bioexcel.eu/t/generating-a-topology-file-for-multiple-combined-residues/9988/1 "2024-08-26T03:23:01Z")

</div>

GROMACS version:2024.1  
GROMACS modification: Yes/No

I inserted three different molecules into a box. I only have the individual itp files for these three, but what I need is the topology file for the entire box containing all the components. How do I approach this?

---

<div class="post-metadata">

**Author:** ![obZehn](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/obzehn/32/2629_2.png) [@obZehn](https://gromacs.bioexcel.eu/u/obZehn)\
**Post date:** [August 26, 2024, 9:21am UTC](https://gromacs.bioexcel.eu/t/generating-a-topology-file-for-multiple-combined-residues/9988/2 "2024-08-26T09:21:02Z")

</div>

Dear @unagi

The topology (.top) is just a description of your system. After loading the force field and molecules definitions, you have to specify the number of molecules you have in the box. You can find more information about how to structure the topology in the manual. However, I suggest you to go through some basic tutorial first so that you can have first hand experience with pre-made topologies, like [here](http://www.mdtutorials.com/gmx/) and [here](https://tutorials.gromacs.org/).

---

<div class="post-metadata">

**Author:** ![unagi](https://avatars.discourse-cdn.com/v4/letter/u/4da419/32.png) [@unagi](https://gromacs.bioexcel.eu/u/unagi)\
**Post date:** [September 2, 2024, 2:42am UTC](https://gromacs.bioexcel.eu/t/generating-a-topology-file-for-multiple-combined-residues/9988/3 "2024-09-02T02:42:56Z")

</div>

i tried making it as shown below, but I’m getting the error but i just got the individual itp files from LIGPARGEN:  
Fatal error:  
Syntax error - File alginate.itp, line 6  
Last line read:  
‘[atomtypes]’  
Invalid order for directive atomtypes

```auto
#include "forcefield.itp"
#include "eps.itp"
#include "rhamnolipid.itp"
#include "alginate.itp"

[molecules]
; Compound #mols
eps 290
rhamnolipid 14
alginate 23

```

---

<div class="post-metadata">

**Author:** ![MagnusL](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/magnusl/32/2380_2.png) [@MagnusL](https://gromacs.bioexcel.eu/u/MagnusL)\
**Post date:** [September 2, 2024, 9:32am UTC](https://gromacs.bioexcel.eu/t/generating-a-topology-file-for-multiple-combined-residues/9988/4 "2024-09-02T09:32:58Z")

</div>

See [Common errors when using GROMACS - GROMACS 2024.2 documentation](https://manual.gromacs.org/2024.2/user-guide/run-time-errors.html#invalid-order-for-directive-xxx) for more information. One solution is to move the `[atomtypes]` sections from the eps.itp, rhamnolipid.itp and alginate.itp to a new file (e.g., “ligand\_atom\_types.itp”) and then update the topology to:

```auto
#include "forcefield.itp"
#include "ligand_atom_types.itp"
#include "eps.itp"
#include "rhamnolipid.itp"
#include "alginate.itp"

```
