GromacsWrapper — a Python framework for Gromacs¶
March 13, 2023
GromacsWrapper is a Python package (Python 2.7.x and Python ≥ 3.6) 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, 2019.x, 2020.x, 2021.x, and
2022.x are all supported. GromacsWrapper detects your Gromacs tools
and provides them as
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 ≥ 5.x)
or all the Gromacs tools available on your
GromacsWrapper to find the Gromacs installation.
Although GromacsWrapper has been used in published research over the last 10 years or so, there is no guarantee that any of the defaults chosen are suitable for any particular project or simulation setup.
It is your responsibility to ensure that you are running simulations with sensible parameters. Provide appropriate template files instead of the bundled defaults and check the logger output!
Please report bugs in the issue tracker and go to the discussions forum for questions.
Contributions are very welcome — start by raising an issue in the issue tracker to describe what feature you’re adding or what bug you’re fixing.
Other approaches to interfacing Python and GROMACS are listed under Alternatives to GromacsWrapper.
See Installation 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.
You also need to have a version of GROMACS installed.
The GromacsWrapper package is made available under the terms of the GNU Public License v3 (or any higher version at your choice) except as noted below. See the file COPYING for the licensing terms for all modules.
GromacsWrapper was written by Oliver Beckstein with contributions from many other people. Please see the file AUTHORS for all the names.
If you find this package useful and use it in published work I’d be grateful if it was acknowledged in text as
“… used GromacsWrapper (Oliver Beckstein et al, https://github.com/Becksteinlab/GromacsWrapper doi: 10.5281/zenodo.17901)”
or in the Acknowledgements section.
Please use the issue tracker to report bugs, installation problems,
and feature requests (mention
@orbeckst in the issue report) and
use the discussions forum for general questions.