{"cells": [{"cell_type": "markdown", "metadata": {}, "source": ["# Introduction to Molecular Dynamics simulations with OpenMM"]}, {"cell_type": "markdown", "metadata": {}, "source": ["Running Molecular Dynamics (MD) simulations of all possible kinds of molecular systems in a correct and efficient way is a non-trivial task. Luckily, there are many different programs and packages out there to help you with that. Due to the complexity of the matter, however, these programs are mostly not exactly straightforward to use. All of them have their strengths and weaknesses and come with their own flavor of addressing the exercise of representing molecules *in silico* and propagating their configuration through time. The basic concepts underlying their design are often very similar, though. We chose the open source toolkit [OpenMM](http://openmm.org/) to practically introduce you to the art of molecular simulations, because it provides a relatively well accessible interface in Python. Although it is not as feature rich out of the box as other solutions, it is successfully used in daily research.\n", "\n", "We will show you here step-by-step how to setup and run a standard *NVT* MD simulation of a protein in water with [OpenMM](http://openmm.org/). Refer to the official website for installation instructions (OpenMM is available in the conda package manager) and documentation. We will also need some kind of molecule viewer to inspect molecular structures. We can recommend [VMD](https://www.ks.uiuc.edu/Research/vmd/) for this purpose (also available via conda)."]}, {"cell_type": "markdown", "metadata": {"ExecuteTime": {"end_time": "2020-04-27T08:13:20.426372Z", "start_time": "2020-04-27T08:13:20.419466Z"}}, "source": ["```bash\n", "conda install -c omnia -c conda-forge openmm\n", "conda install -c conda-forge vmd\n", "```"]}, {"cell_type": "markdown", "metadata": {}, "source": ["To completely follow this introduction, you will also need the [PDBFixer](https://github.com/openmm/pdbfixer.git) that has to be installed separately. You will not need the PDBFixer for the upcoming exercise. "]}, {"cell_type": "markdown", "metadata": {}, "source": ["```bash\n", "$ git clone https://github.com/openmm/pdbfixer.git\n", "$ cd pdbfixer\n", "$ python setup.py install\n", "```"]}, {"cell_type": "markdown", "metadata": {}, "source": ["## Pre-requirements"]}, {"cell_type": "code", "execution_count": 1, "metadata": {"ExecuteTime": {"end_time": "2020-11-24T10:32:23.182362Z", "start_time": "2020-11-24T10:32:22.857676Z"}}, "outputs": [], "source": ["import shlex # Optional\n", "import subprocess # Optional\n", "\n", "import matplotlib as mpl\n", "import matplotlib.pyplot as plt"]}, {"cell_type": "code", "execution_count": 2, "metadata": {"ExecuteTime": {"end_time": "2020-11-24T10:32:25.391906Z", "start_time": "2020-11-24T10:32:25.373837Z"}}, "outputs": [], "source": ["# Matplotlib configuration\n", "mpl.rcParams.update(mpl.rcParamsDefault)\n", "mpl.rc_file('../../matplotlibrc', use_default_template=False)"]}, {"cell_type": "markdown", "metadata": {}, "source": ["## Primer on molecular structure files"]}, {"cell_type": "markdown", "metadata": {}, "source": ["A central element of every molecular simulation is the (atomic) structure of the system of interest. In a classic MD simulation every atom in the system is represented as a point in $\\mathbb{R}^3$ with $x$-, $y$-, and $z$-coordinates. We need to provide these coordinates in a machine (and human) readable, consistent format to be of any use in a computer simulation. A popular file format, especially for biochemical systems, is the [PDB file format](http://www.wwpdb.org/documentation/file-format). PDB files (filename extension .pdb) are text files and can be opened with the text editor of your choice. Many (crystal-, NMR-, cryoEM-, ...) structures that can be used as starting structures in simulations are available in the [RCSB Protein Data Bank (PDB)](https://www.rcsb.org/) for everyone to download. Structures in this data base are identified by a letter code \u2013 the PDB-ID. For our example, we use the *Structure of the carbohydrate-recognition domain of human Langerin* with the PDB-ID 3P5G. Langerin is an endocytic pattern recognition receptor important for the human immune system."]}, {"cell_type": "markdown", "metadata": {"ExecuteTime": {"end_time": "2020-04-24T13:46:52.868314Z", "start_time": "2020-04-24T13:46:52.863400Z"}}, "source": ["