Skip to main content

Gromacs_py is a python library allowing a simplified use of the gromacs MD simulation software.

Project description Documentation Status


Gromacs_py is a python library allowing a simplified use of the gromacs MD simulation software. Gromacs_py can build topologie based on a pdb file, create the simulation system (box, add water and ions) and run minimisation, equilibration and production run. One of the main objective of the gromacs_py wrapper is to automatize routine operations for MD simulation of multiple systems.

Main features:

  • Python Scriptable simulation:
    • Topologie creation
    • Solvation
    • Ion insertion
    • Energy minimisation
    • Equilibration with position restraints
    • Production
    • GPU acceleration
  • Topologie manipulation starting from a raw PDB:
    • Amino acid protonation and pKa calculation using apbs/pdb2pqr
    • Position constraints file .itp creation
    • Cyclic petide topologie
  • Advanced simulation tools:
    • Monitor a simulation while running
    • Interrupt a simulation if a criterion is met (Not implemented yet)


  • Supported Gromacs versions:
    • 2019*
    • 2018*
    • 2017
    • 2016
    • 5.1
    • 5.0
  • Supported Python versions:
    • 3.8*
    • 3.7*
    • 3.6*
    • 3.5*
  • Supported OS:
    • osx*
    • linux*

* tested after each code submission.

Quick install

If gromacs (version >= 5.1) is already install, then install you need to install the gromacs_py library, and add the gromacs gmx command in the environmnent variable $PATH:

pip install gromacs_py

# Add gromacs 'gmx' path:
export PATH='*path_to_gromacs*/bin/':$PATH


Here is an example of a short simulation of the SH3 domain of phospholipase Cγ1. Seven successive steps are used:

  1. Topologie creation using
  2. Minimisation of the structure using
  3. Solvation of the system using
  4. Minimisation of the system using
  5. Equilibration of the system using
  6. Production run using
  7. Extension of the production run using
# Create topologie -f gromacs_py/test/input/1y0m.pdb  -o tmp/1y0m/top -vsite

# Minimize the protein structure -f tmp/1y0m/top/1y0m_pdb2gmx_box.pdb -p tmp/1y0m/top/ -o tmp/1y0m/em/  -n em_1y0m -nt 2

# Add water and ions -f tmp/1y0m/em/em_1y0m_compact.pdb -p tmp/1y0m/top/ -o tmp/1y0m_water_ions/top/  -n 1y0m_water_ions

# Minimize the system -f tmp/1y0m_water_ions/top/1y0m_water_ions_water_ion.gro -p tmp/1y0m_water_ions/top/ -o tmp/1y0m_water_ions/em/  -n em_1y0m

# Do three small equilibrations with postion contraints on heavy atoms (first), Carbon alpha (second) and low constraint on Carbon alpha (third) -f tmp/1y0m_water_ions/em/em_1y0m_compact.pdb -p tmp/1y0m_water_ions/top/ -o tmp/1y0m_water_ions/  -n 1y0m -HA_time 0.1 -CA_time 0.1 -CA_LOW_time 0.1

# Small production run of 0.1 ns -f tmp/1y0m_water_ions/02_equi_CA_LOW/equi_CA_LOW_1y0m.gro -p tmp/1y0m_water_ions/top/ -o tmp/1y0m_water_ions/03_prod -n 1y0m -time 0.1

# Extension of the simulation -s tmp/1y0m_water_ions/03_prod/prod_1y0m.tpr -time 0.2

# Remove simulation files
rm -r ./tmp

Or simply use one command to do all previous commands: -f gromacs_py/test/input/1y0m.pdb -o tmp/1y0m -vsite -HA_time 0.1 -CA_time 0.1 -CA_LOW_time 0.1 -prod_time 0.3


See also the list of contributors who participated in this project.


This project is licensed under the GNU General Public License v2.0 - see the LICENSE file for details.

Project details

Download files

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

Files for gromacs-py, version 1.2.1
Filename, size File type Python version Upload date Hashes
Filename, size gromacs_py-1.2.1-py2.py3-none-any.whl (1.3 MB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size gromacs_py-1.2.1.tar.gz (2.8 MB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page