.. -*- encoding: utf-8 -*-

==============================
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)
   ``gmxapi`` provides interfaces for managing and extending molecular
   dynamics simulation workflows. In this repository, a Python package
   provides the ``gmx`` module for high-level interaction with
   GROMACS. ``gmx.core`` provides 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
   <https://doi.org/10.1093/bioinformatics/bty484>`_

`gromacs_py`_ (Samuel Murail, Maxence Delaunay, Damien Espana)
   Gromacs_py is a Python library allowing a simplified use of the
   Gromacs MD simulation software. Gromacs_py can build a system
   topologie based on a pdb file, create the simulation system (pbc
   box, adding water and ions) and run minimisation, equilibration and
   production runs. One of the main objective of the Gromacs_py
   wrapper is to automatize routine operations for MD simulation of
   multiple systems.
   
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_.
  
ParmEd_
  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_  
  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.


.. _gmxapi: https://github.com/kassonlab/gmxapi
.. _copernicus: http://git.copernicus-computing.org/
.. _gmxscript: https://github.com/pslacerda/gmx
.. _XTC Library: http://www.gromacs.org/Developer_Zone/Programming_Guide/XTC_Library
.. _JGromacs: http://sbcb.bioch.ox.ac.uk/jgromacs/
.. _pymacs: http://wwwuser.gwdg.de/~dseelig/pymacs.html
.. _[gmx-developers] Python interface for Gromacs:
    http://lists.gromacs.org/pipermail/gmx-developers/2009-March/003179.html
.. _ctypes: http://docs.python.org/library/ctypes.html
.. _grompy: http://lists.gromacs.org/pipermail/gmx-developers/2009-March/003183.html
.. _grompy tar ball: http://article.gmane.org/gmane.science.biology.gromacs.devel/1185
.. _LOOS: http://loos.sourceforge.net
.. _LOOS documentation: http://loos.sourceforge.net/Docs/
.. _Grossfield lab: http://membrane.urmc.rochester.edu/Grossfield_Lab/Welcome.html
.. _VMD: http://www.ks.uiuc.edu/Research/vmd/
.. _Schulten lab: http://www.ks.uiuc.edu/
.. _bigdcd: http://www.ks.uiuc.edu/Research/vmd/script_library/scripts/bigdcd/
.. _MDAnalysis: http://mdanalysis.org
.. _GPL: http://www.gnu.org/licenses/ 
.. _numpy: http://numpy.scipy.org
.. _Charmm: http://www.charmm.org
.. _GROMACS: http://www.gromacs.org
.. _issue tracker: https://github.com/Becksteinlab/GromacsWrapper/issues
.. _ParmEd: http://parmed.github.io/ParmEd/html/index.html
.. _parmed.gromacs: http://parmed.github.io/ParmEd/html/api/parmed/parmed.gromacs.html
.. _`gromacs_py`: https://github.com/samuelmurail/gromacs_py
