GromacsWrapper — a Python framework for Gromacs




July 21, 2020

GromacsWrapper is a Python package (Python 2.7.x and Python > 3.4) that wraps system calls to Gromacs tools into thin classes. This allows for fairly seamless integration of the gromacs tools into Python scripts. This is generally superior to shell scripts because of Python’s better error handling and superior data structures. It also allows for modularization and code re-use. In addition, commands, warnings and errors are logged to a file so that there exists a complete history of what has been done.

Gromacs versions 4.6.x, 2016.x, 2018.x, and 2019.x are all supported. GromacsWrapper detects your Gromacs tools and provides them as gromacs.grompp(), gromacs.mdrun(), etc, regardless of your Gromacs version, which allows one to write scripts that are broadly Gromacs-version agnostic. Source your GMXRC file or make the gmx binary (for versions ≥ 2016) or all the gromacs tools available on your PATH for GromacsWrapper to find the Gromacs installation.

See INSTALL for download and installation instructions. The Quick Start provides a brief example of how to use GromacsWrapper in the most basic fashion.

The source code itself is available in the GromacsWrapper git repository.


Please be aware that this is beta software that most definitely contains bugs. The API is not stable yet and can change between releases.

It is your responsibility to ensure that you are running simulations with sensible parameters.

The package and the documentation are still in flux and any feedback, bug reports, suggestions and contributions are very welcome. See the package README: GromacsWrapper for contact details.

See also

Other approaches to interfacing Python and Gromacs are listed under Alternatives to GromacsWrapper.

Indices and tables