.. -*- 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*.

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_.

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.


.. _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.googlecode.com
.. _me: http://sbcb.bioch.ox.ac.uk/oliver/
.. _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

