Get Started
In this tutorial we will be simulating hydrogen atom transfer in a simple ACE/NME-capped Alanine molecule in a box of water.
Installation
Prerequisites
python3.9
or highergromacs
(tested with version 2021.4,gmx
should be available in thePATH
)
Optional:
plumed
-patched version ofgromacs
(for the homolysis reaction).
Let’s first create a directory and a virtual environment for kimmdy
:
mkdir kimmdy-tutorial
cd kimmdy-tutorial
python -m venv .venv
source .venv/bin/activate
To install KIMMDY, the builtin reaction plugins and the analysis tools use
pip install kimmdy[reactions,analysis]
Setup the Simulation
Download and unzip the input files to this directory.
# TODO: add link to gihtub user content
wget ...
unzip setup.zip
The kimmdy.yml
file 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
Our starting structure is a simple ACE/NME-capped Alanine molecule in a box of water. Note, how it has a missing hydrogen atom on the alpha carbon. This is a radical. We will use the builtin hat_reaction
to simulate hydrogen atom transfer reactions from nearby hydrogens to the radical position.
Start the KIMMDY run with the 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 energy alanine_hat_000 --open-plot --terms Potential Kinetic
Visualize where the radicals end up:
kimmdy-analysis radical_population alanine_hat_000 --open-plot --open-vmd
In VMD, color the atoms by beta factor to show the radical occupancy.
Plot the reaction rates:
kimmdy-analysis rates alanine_hat_000
In the alanine_hat_000/analysis
directory you will then find a plot of rates for each possible reaction at every step they were queried, e.g.
Or do all of the above directly from python:
from kimmdy.analysis import concat_trj, plot_energy, radical_population, plot_rates
'alanine_hat_000', open_vmd=True)
concat_trj('alanine_hat_000', terms=['Potential', 'Kinetic'], open_plot=True)
plot_energy('alanine_hat_000', open_plot=True, open_vmd=True)
radical_population('alanine_hat_000') plot_rates(
Congratulations, you have successfully run your first KIMMDY simulation!