6. Alternatives to GromacsWrapper¶
GromacsWrapper is simplistic; in particular it does not directly link to the GROMACS libraries but relies on Python wrappers to call GROMACS tools. Some people find this very crude (the author included). Other people have given more thought to the problem and you are encouraged to see if their efforts speed up your work more than does GromacsWrapper.
- gmxapi (M.E. Irrgang, J.M. Hays, and P.M. Kasson)
gmxapiprovides interfaces for managing and extending molecular dynamics simulation workflows. In this repository, a Python package provides the
gmxmodule for high-level interaction with GROMACS.
gmx.coreprovides Python bindings to the gmxapi C++ GROMACS external API.
Irrgang, M. E., Hays, J. M., & Kasson, P. M. gmxapi: a high-level interface for advanced control and extension of molecular dynamics simulations. Bioinformatics 2018. DOI: 10.1093/bioinformatics/bty484
- MDAnalysis (N. Michaud-Agrawal, E. J. Dennning, and O. Beckstein)
Reads various trajectories (dcd, xtc, trr) and makes coordinates available as numpy arrays. It also has a fairly sophisticated selection language, similar to Charmm or VMD.
A general tool for working with topology files for all the popular MD codes, including the parmed.gromacs module for ITP and TOP files.
- pymacs (Daniel Seeliger)
pymacs is a python module for dealing with structure files and trajectory data from the GROMACS molecular dynamics package. It has interfaces to some gromacs functions and uses gromacs routines for command line parsing, reading and writing of structure files (pdb,gro,…) and for reading trajectory data (only xtc at the moment). It is quite useful to write python scripts for simulation setup and analysis that can be combined with other powerful python packages like numpy, scipy or plotting libraries like pylab. It has an intuitive data structure (Model –> Chain –> Molecule –> Atom) and allows modifications at all levels like
Changing of atom, residue and chain properties (name, coordinate, b-factor,…
Deleting and inserting atoms, residues, chains
Straightforward selection of structure subsets
Structure building from sequence
Handling gromacs index files
- gmxscript (Pedro Lacerda)
gmxscript is a framework for GROMACS simulations. Its main goal is make simulation protocols easily reproducible and to define canonical steps to perform and analyze a simulation. The commands are stored in very readable and structured Python file that requires no programming knowledge except syntax.
- GROMACS XTC Library
Version 1.1 of the separate xtc/trr library contains example code to access a GROMACS trajectory from python. It appears to be based on grompy (also see below).
- various implementations of python wrappers
See the discussion on the gmx-developers mailinglist: check the thread [gmx-developers] Python interface for Gromacs
- grompy (René Pool, Martin Hoefling, Roland Schulz)
uses ctypes to wrap libgmx:
“Here’s a bunch of code I wrote to wrap libgmx with ctypes and make use of parts of gromacs functionality. My application for this was the processing of a trajectories using gromac’s pbc removal and fitting routines as well as reading in index groups etc. It’s very incomplete atm and also focused on wrapping libgmx with all gromacs types and definitions…
… so python here feels a bit like lightweight c-code glueing together gromacs library functions :-)
The attached code lacks a bit of documentation, but I included a test.py as an example using it.”
Roland Schulz added code:
“I added a little bit wrapper code to easily access the atom information in tpx. I attached the version. It is backward compatible …”
A working grompy tar ball (with Roland’s enhancements) is cached at gmane.org and the latest sources are hosted at https://github.com/GromPy
- LOOS (Grossfield lab at the University of Rochester)
The idea behind LOOS (Lightweight Object-Oriented Structure library) is to provide a lightweight C++ library for analysis of molecular dynamics simulations. This includes parsing a number of PDB variants, as well as the native system description and trajectory formats for CHARMM, NAMD, and Amber. LOOS is not intended to be an all-encompassing library and it is primarily geared towards reading data in and processing rather than manipulating the files and structures and writing them out.
The LOOS documentation is well written and comprehensive and the code is published under the GPL.
Copernicus is a Python-based client-server network that allows running of large and complicated MD simulation workflows. It supports GROMACS (grompp and mdrun).
- VMD (Schulten lab at UIUC)
VMD is a great analysis tool; the only downside is that (at the moment) trajectories have to fit into memory. In some cases this can be circumvented by reading a trajectory frame by frame using the bigdcd script (which might also work for GROMACS xtcs).
- JGromacs (Márton Münz and Philip C Biggin)
JGromacs is a Java library designed to facilitate the development of cross-platform analysis applications for Molecular Dynamics (MD) simulations. The package contains parsers for file formats applied by GROMACS. It provides a multilevel object-oriented representation of simulation data to integrate and interconvert sequence, structure and dynamics information. In addititon, a basic analysis toolkit is included in the package. The programmer is also provided with simple tools (e.g. XML-based configuration) to create applications with a user interface resembling the command-line UI of GROMACS applications.
Please open an issue in the issue tracker to let us know of other efforts so that they can be added here. Thanks.