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
  • Coordinate manipulation:
    • Changing atom names, chain, coordinates, …
    • Insertion of N copy of a molecule in a system for flooding simulation
    • Linear peptide creation
  • Advanced simulation tools:
    • Monitor a simulation while running
    • Interrupt a simulation if a criterion is met


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

* tested after each code submission.

Quick install

Add several conda channels for dependencies:

conda config --add channels conda-forge
conda config --add channels bioconda
conda config --add channels samuel.murail

Then install gromacs_py:

conda install gromacs_py

see Installation for details.


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
gromacs_py/ -f gromacs_py/test/input/1y0m.pdb  -o tmp/1y0m/top -vsite

# Minimize the protein structure
gromacs_py/ -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
gromacs_py/ -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
gromacs_py/ -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)
gromacs_py/ -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
gromacs_py/ -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
gromacs_py/ -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:

gromacs_py/ -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.0.0.post5
Filename, size File type Python version Upload date Hashes
Filename, size gromacs_py-1.0.0.post5.tar.gz (947.4 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page