Skip to main content

A Python wrapper around the GROMACS tools.

Project description

Build Status Code Coverage Documentation Latest release on zenodo (with DOI) black PRs Welcome! Anaconda.org package

A primitive Python wrapper around the Gromacs tools. The library is tested with GROMACS 4.6.5, 2018.x, 2019.x, 2020.x, 2021.x, 2022.x, 2023.x, 2024.x (and 5.x and 2016.x should also work). It supports Python 3.9–3.12 on Linux and macOS.

GromacsWrapper also provides a small library (cook book) of often-used recipes and helper functions to set up MD simulations.

Documentation is mostly provided through the python doc strings and available at https://gromacswrapper.readthedocs.org for recent releases.

The source code is available in the GromacsWrapper git repository.

Please be aware that this software is only minimally maintained and it most definitely contains bugs. It is your responsibility to ensure that you are running simulations with sensible parameters.

Quick Start

Given a PDB file 1iee.pdb, set up and run a simple simulation (assuming you have all other input files at hand such as the MDP files):

>>> import gromacs
>>> print(gromacs.release)
2018.2
>>> help(gromacs.pdb2gmx)
DESCRIPTION

gmx pdb2gmx reads a .pdb (or .gro) file, reads some database files,
adds hydrogens to the molecules and generates coordinates in GROMACS
...
...
OPTIONS

Options to specify input files:

-f      [<.gro/.g96/...>]  (eiwit.pdb)
          Structure file: gro g96 pdb brk ent esp tpr
...
...
>>> gromacs.pdb2gmx(f="1iee.pdb", o="protein.gro", p="topol.top",
...                 ff="oplsaa", water="tip4p")
>>> gromacs.editconf(f="protein.gro", o="boxed.gro",
...                  bt="dodecahedron", d=1.5, princ=True,
...                  input="Protein")
>>> gromacs.solvate(cp="boxed.gro", cs="tip4p", p="topol.top",
...                 o="solvated.gro")
>>> gromacs.grompp(f="emin.mdp", c="solvated.gro", p="topol.top",
...                o="emin.tpr")
>>> gromacs.mdrun(v=True, deffnm="emin")
>>> gromacs.grompp(f="md.mdp", c="emin.gro", p="topol.top", o="md.tpr")
>>> gromacs.mdrun(v=True, deffnm="md")

License

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.

Installation

Releases

The latest version of GromacsWrapper from PyPi can be installed with

pip install GromacsWrapper

or as a conda-forge package with conda from the conda-forge channel

conda install -c conda-forge gromacswrapper

Development version

The main branch in the GitHub source repository generally contains useful code but nevertheless, things can break in weird and wonderful ways. Please report issues through the Issue Tracker.

To use the development code base: checkout the main branch:

git clone https://github.com/Becksteinlab/GromacsWrapper.git

and install

pip install GromacsWrapper/

Code contributions are welcome. We use black for uniform code formatting so please install black and run it on your code.

Download and Availability

The GromacsWrapper home page is http://github.com/Becksteinlab/GromacsWrapper. The latest release of the package is being made available from https://github.com/Becksteinlab/GromacsWrapper/releases

You can also clone the GromacsWrapper git repository or fork for your own development:

git clone git://github.com/Becksteinlab/GromacsWrapper.git

Questions

Please ask questions in the Discussion forum (instead of private email).

Reporting Bugs and Contributing to GromacsWrapper

Please use the Issue Tracker to report bugs, installation problems, and feature requests. Ask questions in the Discussion forum.

Pull requests for bug fixes and enhancements are very welcome. See http://makeapullrequest.com for a general introduction on how make a pull request and contribute to open source projects.

Building Documentation

Install Sphinx:

pip install sphinx

and compile:

cd GromacsWrapper
python setup.py build_sphinx

Citing

Latest release on zenodo (with DOI)

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.

Thank you.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gromacswrapper-0.9.0.tar.gz (181.9 kB view details)

Uploaded Source

Built Distribution

GromacsWrapper-0.9.0-py3-none-any.whl (188.5 kB view details)

Uploaded Python 3

File details

Details for the file gromacswrapper-0.9.0.tar.gz.

File metadata

  • Download URL: gromacswrapper-0.9.0.tar.gz
  • Upload date:
  • Size: 181.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.3

File hashes

Hashes for gromacswrapper-0.9.0.tar.gz
Algorithm Hash digest
SHA256 838b28247cd5fa1709db0c9df83881972b700a6850d2fb4a407bcd55d4989a42
MD5 8ef7ec46edfa75f396ca9368eb69d2c2
BLAKE2b-256 2cc441ff2224b3929b74f8e35047e7f6eb7efb665a7ced7ef3a05d8785540686

See more details on using hashes here.

Provenance

File details

Details for the file GromacsWrapper-0.9.0-py3-none-any.whl.

File metadata

File hashes

Hashes for GromacsWrapper-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ed38bd5f38e9799c87a50661a3b1f147c77a45f57592a53495c8db04bcb3dc91
MD5 ba7cb3a87a40bb01c467d5bb4ff1c134
BLAKE2b-256 ab7ca0c828a704c53c3deee655900ee34b0bcec4c20b2114d4238fcbc392717f

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page