Introduction to Molecular Dynamics

Here we learn step-by-step how to run a molecular dynamics simulation of a small protein in water solution using GROMACS. We will go through both how to set up the input files, as well as how to set up energy minimization and simulations at constant temperature and at constant pressure. Finally we briefly introduce some of the GROMACS tools for analyzing molecular simulation trajectories.

The tutorial is provided as an interactive Jupyter notebook based on GROMACS. You can run the tutorial online in your browser without installing anything, or download it to run locally with your own installed software.

To see the tutorial as plain text click here

Running this tutorial online

These tutorials are provided online for you for free thanks to mybinder.org and their sponsors.

Click to run a free online interactive binder at MyBinder.org. It will take several minutes to launch.

Alternatively, click to run a free online interactive binder at BioExcel-Binder. Note that a GitHub account is required to access BioExcel-Binder.

Running the tutorial offline

You will need to install some software on the terminal command line to be able to run the tutorial offline. Jupyter notebooks are built on Python, and the GROMACS tutorial content needs various other Python packages as well. Please follow the instructions below for your operating system to get a suitable terminal.

For MacOS users

You can use the standard Terminal app. You can launch a terminal via spotlight search, either click the magnifying glass icon in the top-left corner or press the Command-space key combination. Then type “Terminal” and press Return, and a terminal window will appear for you to use.

For Windows users

We strongly recommend to use (and install if necessary) the Windows Subsystem for Linux, WSL. Inside it, you will need Python 3 and the conda Python environment manager. A useful guide to doing this is found at https://github.com/kapsakcj/win10-linux-conda-how-to.

For Linux users

You can use the standard terminal. Press the ‘Ctrl-Alt-T` key combination and a terminal window will appear for you to use.

For all users once you have a terminal

First, install miniconda for Python 3 by following https://docs.conda.io/en/latest/miniconda.html#linux-installers

Then download an archive of the notebook and supporting files from this link

Save it to e.g. the “Downloads” folder in your home folder.

Open a command-line terminal, make a folder to run the tutorial, and change into it:

mkdir md-intro-tutorial
cd md-intro-tutorial

Unpack the files with

unzip ~/Downloads/md-intro-tutorial-main.zip

If this fails, you may need to install the unzip program, e.g. with sudo apt-get install unzip and then try again.

Now, use miniconda to make the environment for the GROMACS tutorials with:

# For all users, Linux, MacOS, and Windows users
conda env create --name md-intro-tutorial --file environment.yml

Activate it with:

conda activate md-intro-tutorial

Finally, you can launch the Jupyter notebook for the tutorial in your browser with

jupyter-notebook tutorial.ipynb