Dear GMX-users,

I would like to share some scripts which help to automate MD and free energy 
calculations with Gromacs. They are written in Bash and thus can be easily 
customized for one's specific needs. At present everything is designed to run
absolute solvation free energy calculations of small organic molecules/ligands 
arbitrary (mixed) solvent. The following scripts are available: 

1) Pipeline for molecular dynamics simulations with Gromacs:
2) Pipeline for BAR absolute solvation free energy calculations:
3) Pipeline for 1 collective variable umbrella sampling for Gromacs + PLUMED:
4) Force field converter:
5) Python unit converter:

All scripts come with real life examples how to use them 
(, where you can find a one-click script, which performs all the computations in one go. If you
have difficulties, please, let me know, I can assist.

The pipeline scripts are intended to save user's time on writing a code for
automation of calculations. Below a more detailed description of the scripts
is given.

1. Pipeline for molecular dynamics simulations with Gromacs:
This script can perform in one go or separately the following steps: building 
the topology and coordinates of the system, performing energy minimization, NVT
 and NPT equilibration, production run MD:  

paracetamol dissolved in supercritical CO2 with addition of ethanol at 250 bar 
and 308.15K \
    --lbuildcoor   yes \
    --lbuildtop    yes \
    --FF           oplsaa \
    --box          3.5,3.5,3.5 \
    --components   paracetamol,ethanol,CO2 \
    -N             1,32,485 \
    --toppath      $p/top \
    --mdppath      $p/mdp \
    --mdseq        em,nvteq,npteq,run \
    --mdpkeys      ref_t=308.15,gen_temp=308.15,ref_p=250.0
    --emmdpkeys    nsteps=200 \
    --nvteqmdpkeys nsteps=5000 \
    --npteqmdpkeys nsteps=5000,nstxtcout=1000 \
    --runmdpkeys   nsteps=10000,nstxtcout=100,nstenergy=1000


2. Pipeline for BAR absolute solvation free energy calculations:

The script is an environment to automatize free energy calculations with 
Gromacs ( This script uses "" for running MD 
therefore it also inherits all the features of that script. It was designed 
to calculate solvation free energies and herefore operates with lambda_coul 
and lambda_vdw scaling parameters (see Gromacs manual). For each pair of lambda 
parameters it prepares the simulation setups. Then one can submit for each pair 
of lambda values equilibration and/or production simulation to a queue system. --couplemoltype paracetamol \
                --lcouplegro    yes \
0.0__0.0__0.0__0.2__0.3__0.4__0.5__0.6__0.7__0.8__1.0 \
0.0__0.5__1.0__1.0__1.0__1.0__1.0__1.0__1.0__1.0__1.0 \
                --grofile       `pwd`/initdata/system.gro \
                --runmdkeys     "--mdseq em,nvteq,npteq,run --lbuildtop no 
--lbuildcoor no --lbuildmdp yes --topfile `pwd`/initdata/ --mdppath 
`pwd`/mdp --nvteqmdpkeys nsteps=5000  --npteqmdpkeys nsteps=5000 --runmdpkeys 
nsteps=5000 --mdruncmd mdrun_d"


3. Pipeline for 1 collective variable umbrella sampling for Gromacs + PLUMED 

The script is an environment to calculate potential of mean force (PMF) for a 
single collection variable (CV) using PLUMED ( modified 
Gromacs package (  --CV 20:20:180 \
                 --CVunits degree \
                 --ks 300.0 \
                 --ksunits kJ/mol/rad^2 \
                 --leql yes \
                 --lrun yes 


4. Force field converter:
-------------------------------------------------------------------------------- is a python program which performs conversion between different file 
formats of classical force field for small molecules. Supplementary scripts 
 if the conversion was correct by comparing energies calculated before and after

Now ffconv can do the following:

to read:  
        1) OPLS-AA: Schrodinger ffld_server output
        2) AMBER topology file CHARMM force field file
        3) CHARMM molecule stream file
        4) PDB coordinate file
to write: 
        1) Gromacs topology itp files
        2) RISM-MOL topology file
        3) Amber topology file - only for single point calculations (e.g. with 

to test conversion to/from: 
        1) ffld_server (runs "ffld_server"), 
        2) AMBER (runs NAMD... yes, NAMD because AMBER is not free and 
                utilities (e.g. NAB) are not able to understand all the fields 
                of Amber topology file)
        3) CHARMM (runs charmm)

to store the topology files into local topology database, which is compatible 
"" pipeline system building capabilities.

EXAMPLE USAGE (convertion of ffld_server generated topology to Gromacs format)

### to GROMACS
# 1) convert
                      --toprog     GROMACS \
                      --ffname     oplsaa \
                      --moltopfn   paracetamol.ffld \
                      --ffconvpath $FFCONVPATH
# 2) check conversion
$FFCONVPATH/scripts/ \
                --mol       paracetamol \
                --fromprog  FFLDSERVER \
                --toprog    GROMACS \
                --confpath  `pwd` \
                --ldbstore1 yes \
                --ldbstore2 yes  \
                --dbpath    $FFCONVPATH/top \
                --ffname    oplsaa


The code is an objective oriented python code. First, the input topology files 
are read and stored in a molecule and/or ForceField objects. The information in 
these objects is used to write out the topology files. Therefore, to incorporate
a new force field format one has to write a function which fills in the 
to the objects and/or function which writes the objects information in the 
format. - contains the classes definition and internal functions.
func_*      - I/O functions 

So-far, unique functionality of (with respect to "" and 
"charmm_to_gromacs") is:
1) the ability to have automated OPLS-AA ligand topology creation for Gromacs
2) checking if the conversion was correct in each particular case
3) ability to be easily extended to other topology file formats
4) topology conversion into RISM-MOL and AMBER formats for single molecules 
RISM and 3D-RISM calculations.


5. Python unit converter:

The script takes two command line arguments and returns the factor to 
convert units. 

EXAMPLE USAGES:  kJ/mol/rad^2  kcal/mol/rad^2  mol*m^-3  nm^-3  kcal/mol  toGMX 

Also, one can load the module in his/her own python code.


Please, give your feedback to:
Please note, that it was observed that does not always work well 
with Mozilla Firefox (does not load pages, crashes). 
With recent Google Chrome no problems were observed. 

Hope this will be of help.
With kind regards,

(Former position)
Junior researcher
Institute of Solution Chemistry
Russian Academy of Sciences
Akademicheskaya St. 1
153045 Ivanovo, Russia

(Current position)
Sanofi-aventis R&D, 
Lead Generation to Compound Realisation, 
Structure Design & Informatics, 
94403 Vitry, France

Gromacs Users mailing list

* Please search the archive at before posting!

* Can't post? Read

* For (un)subscribe requests visit or send a 
mail to

Reply via email to