GROMACS topology files for python
The gmxtop project provides a python interface to
- read and write toplogy and force field information from GROMACS-type top-files
- alter force field parameters
The gmxtop project derives this functionality from the kimmdy project, originally developed by the graeter-group, and includes only minor modifications to parts of the original code to operate independently.
The kimmdy project is licensed under the GNU General Public License v3.0 and, as a derivative work, the gmxtop project is distributed under the same license. See LICENSE for details.
- CMAP corrections (
[ cmaptypes ],[ cmap ]) are only passed through: they are read and written back unchanged, but not parsed into objects. Hence, CMAP terms are not generated for new residues and their atom numbers are not updated when atoms are renumbered. - CHARMM force field files use
#ifdef/#ifndefstatements within sections (e.g.#ifdef HEAVY_Hin[ atomtypes ]). This is not supported yet. Thus, CHARMM topologies can not be read directly. As a workaround, preprocess the topology withgromppfirst and use the resulting standalone topology:
gmx grompp -f empty.mdp -c conf.gro -p topol.top -pp topol_pp.topThe following tutorials are avaiable as Google Colab notebooks and hence do not require a local installation:
- Basic tutorial - Basic accessing of topology information with gmxtop
- Advanced tutorial - Advanded accessing of topology information with gmxtop
- Force field parameter tutorial - Adapting force field parameters with gmxtop
pip install gmxtopClone repository and move into
git clone git@github.com:graeter-group/gmxtop.git
cd gmxtopInstall repository
uv syncActivate virtual environment
source .venv/bin/activateVerify install by running the tests
pytest testsClone repository and move into
git clone git@github.com:graeter-group/gmxtop.git
cd gmxtopInstall repository into conda environment
conda create -n gmxtop python -y
conda activate gmxtop
pip install -e '.[dev]' # install with dev dependenciesVerify install by running the tests
pytest tests