gmx_wrapper

A thin wrapper for Gromacs


Keywords
gromacs, wrapper
License
Other
Install
pip install gmx_wrapper==0.2

Documentation

Gromacs Wrapper

Example usage:

from gmx_wrapper import Gromacs
from my_utils import AppendToTop

gmx = Gromacs()
gmx.solvate('-box 4 4 4 -o water.pdb')
AppendToTop('template.top','water.pdb')
gmx.grompp('-f md.mdp -c water.pdb -p template.top -o md.tpr')
gmx.mdrun('-deffnm md -nt {:d}'.format(num_threads))
gmx.mdrun_mpi(num_threads, '-deffnm md -plumed plumed.dat')
gmx.trjconv('-s md.tpr -f md.xtc -dt 100 -o md_dt100.xtc', stdin="System\n")

What it's for

  • Handles program calling differences between versions 4 and 5
  • Raises exceptions of type GromacsError when Gromacs exits in error
  • TODO: Handle interactive programs
  • There are other versions differences, especially with mdp files. This does not handle those differences, because all this wrapper does is make program calls with arguments. At most, it may deal with program interaction (e.g. g_energy, make_ndx), but it won't make topology or mdp files.
  • More complex interactions will have to be handled by other modules,