# GenTopo: A python tool kit for generating gromacs topology template

**URL:** <https://gromacs.bioexcel.eu/t/gentopo-a-python-tool-kit-for-generating-gromacs-topology-template/2285>\
**Category:** Third party tools and files\
**Created:** [June 3, 2021, 7:03am UTC](https://gromacs.bioexcel.eu/t/gentopo-a-python-tool-kit-for-generating-gromacs-topology-template/2285 "2021-06-03T07:03:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Masrul](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/masrul/32/234_2.png) [@Masrul](https://gromacs.bioexcel.eu/u/Masrul)\
**Post date:** [June 3, 2021, 7:03am UTC](https://gromacs.bioexcel.eu/t/gentopo-a-python-tool-kit-for-generating-gromacs-topology-template/2285/1 "2021-06-03T07:03:52Z")

</div>

## GenTopo: A python toolkit for generating gromacs topology template.

## Source

Code link: [GitHub - masrul/GenTopo: Gromacs topology template generator](https://github.com/masrul/GenTopo)

## Description

For non-standard Force-field (which cannot be invoked through **pdb2gmx** ), this tool can be used to generate gromacs topology template. It uses slightly different approach than **x2top**. It requires a PDB file of the molecule, [which has two extra entries after the 80th column/character respectively atomTypes and charges](https://github.com/masrul/GenTopo/blob/main/Examples/test.pdb). An example PDB file can be found in Example/test.pdb. It is recommended to have connectivity information in the PDB file, but not mandatory. If connectivity is missing, then the code will generate connectivity information using the heuristic of Van der Waals radius of atoms. In addition to internal coordinates, it also creates all required bondTypes, angleTypes, and dihedralTypes. **GenTopo** is independent of particular force filed, it simply creates template. **User needs to provide required parameters once template is created**. An example topology template created by **GenTopo** can be found in Example/topol.top.

```python
# File name: Example/test.py
# python test.py 

from GenTopo.Coord import PDBobj
from GenTopo.Graph import MolGraph
from GenTopo.GMXTopo import Topo

# load a PDB file
mol = PDBobj("test.pdb") 

# Create a Molecular Graph for generating bond, angles, dihedral etc. 
graph = MolGraph(mol, guessImpropers=True)

# Now create gromacs topology by passing mol and graph 
gmx = Topo(mol, graph)

# write topology file 
gmx.write("topol.top")

```

## Features

- PDB to gromacs template

- Generates internal coordinates

- Generates types

- Support periodic molecule

## Installation:

```bash
git clone https://github.com/masrul/GenTopo 
cd GenTopo
pip install . 

```

**Contact Person:** Masrul Huda  
**Email:** : mmh568@msstate.edu

---

<div class="post-metadata">

**Author:** ![Ranbir720](https://avatars.discourse-cdn.com/v4/letter/r/e495f1/32.png) [@Ranbir720](https://gromacs.bioexcel.eu/u/Ranbir720)\
**Post date:** [April 4, 2024, 2:49pm UTC](https://gromacs.bioexcel.eu/t/gentopo-a-python-tool-kit-for-generating-gromacs-topology-template/2285/2 "2024-04-04T14:49:29Z")

</div>

Sir i tried using this for my system , but it shows error . Iam attaching the screenshot of the same

 ![1712242132898596820840165705320](https://europe1.discourse-cdn.com/flex017/uploads/bioexcel1/original/2X/6/69958940630c998f44ccacfbb3a87ba72449d727.jpeg)
