0. Getting Started

Let’s jump right in!

Installation

Prerequisites

  • python3.9 or higher
  • gromacs (tested with version 2021.4, gmx should be available in the PATH)

Optional:

  • plumed-patched version of gromacs

Installation

Let’s first create a virtual environment for kimmdy:

mkdir kimmdy-tutorial
cd kimmdy-tutorial
python -m venv .venv
source .venv/bin/activate

Because we’ll be using optional reaction plugins directly from the git repository, we’ll need to install kimmdy from GitHub with the plugins extra:

# TODO: update with https instead of ssh when repo is public
pip install 'git+ssh://git@github.com/hits-mbm-dev/kimmdy.git#egg=kimmdy[plugins]'
# pip install 'git+ssh://git@github.com/hits-mbm-dev/kimmdy.git#egg&subdirectory=plugins'
# pip install 'git+ssh://git@github.com/hits-mbm-dev/kimmdy.git@docs/config-completion#egg=kimmdy[plugins]'

Setup the Simulation

Download the example kimmdy.yml file to this directory. It should look like this:

kimmdy.yml
dryrun: false
max_tasks: 100
name: 'hat_tf_000'
gromacs_alias: 'gmx'
top: 'Ala_out.top'
gro: 'npt.gro'
ndx: 'index.ndx'
mds:
  equilibrium:
    mdp: 'md.mdp'
  relax:
    mdp: 'md_slow.mdp'
changer:
  coordinates:
    md: 'relax'      
reactions:
  hat_reaction:
    frequency_factor: 100000000
    h_cutoff: 3
    polling_rate: 1

sequence:
- equilibrium
- mult: 2
  tasks:
  - equilibrium
  - reactions

Let’s also fetch the other input files:

# TODO: while dev, copy run in example dir
# from KIMMDY root directory
cd example/alanine_hat_naive

Our starting structure is a simple ACE/NME-capped Alanine molecule in a box of water.

Start a KIMMDY run with kimmdy command:

Run the Simulation

kimmdy

You can also run kimmdy directly from python with

from kimmdy.cmd import kimmdy_run
kimmdy_run()

Analyse the Simulation

Concatenate the trajectories from the individual steps into one for viewing:

kimmdy-analysis trjcat alanine_hat_000 --open-vmd

Check the energy of the system:

kimmdy-analysis plot_energy alanine_hat_000 --open-plot --terms Potential Kinetic

Visualize where the radical ended up:

kimmdy-analysis radical_population alanine_hat_000 --open-plot --open-vmd

Plot the reaction rates:

kimmdy-analysis plot_rates alanine_hat_000

Or do all oft the above directly from python:

from kimmdy.analysis import concat_trj, plot_energy, radical_population, plot_rates
concat_trj('alanine_hat_000', open_vmd=True)
plot_energy('alanine_hat_000', terms=['Potential', 'Kinetic'], open_plot=True)
radical_population('alanine_hat_000', open_plot=True, open_vmd=True)
plot_rates('alanine_hat_000')
Back to top