{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Performing Molecular Dynamics\n",
"\n",
"> ### In this tutorial we will cover:\n",
"> - how we can use BuildAMol when we want to do MD simulations"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Investigating the dynamics of molecular structures is done in many different fields of research, from microbiology to pharmacology, to material sciences. If we already have a structure to go on then we can use tools like VMD, CHARMM, or AMBER to perform molecular dynamics (MD) simulations. If we do not have a structure available we need to build it first - which is where BuildAMol comes in! \n",
"\n",
"We can build a molecule of interest and then export it as a Mol file (or other format) for use with the respective MD software of choice. In this tutorial we showcase the entire workflow of building a molecule (in BuildAMol), parametrizing the molecule (CHARMM-GUI), and running an MD simulation (OpenMM)... "
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
" \n",
" "
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"import plotly\n",
"plotly.offline.init_notebook_mode()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Let's start by making some molecule that we can study..."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import buildamol as bam\n",
"\n",
"bam.load_small_molecules()\n",
"\n",
"benzene = bam.get_compound(\"benzene\")\n",
"amine = bam.get_compound(\"dimethylamine\")\n",
"\n",
"amine.autolabel()\n",
"benzene.autolabel()"
]
},
{
"cell_type": "code",
"execution_count": 69,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/Users/noahhk/anaconda3/envs/glyco2/lib/python3.11/site-packages/plotly/express/_core.py:1985: FutureWarning:\n",
"\n",
"When grouping with a length-1 list-like, you will need to pass a length-1 tuple to get_group in a future version of pandas. Pass `(name,)` instead of `name` to silence this warning.\n",
"\n"
]
},
{
"data": {
"application/vnd.plotly.v1+json": {
"config": {
"plotlyServerURL": "https://plot.ly"
},
"data": [
{
"customdata": [
[
"C1",
1,
1,
"BNZ",
"A"
],
[
"C2",
2,
1,
"BNZ",
"A"
],
[
"C3",
3,
1,
"BNZ",
"A"
],
[
"C4",
4,
1,
"BNZ",
"A"
],
[
"C5",
5,
1,
"BNZ",
"A"
],
[
"C6",
6,
1,
"BNZ",
"A"
],
[
"C1",
11,
2,
"DMN",
"A"
],
[
"C2",
12,
2,
"DMN",
"A"
],
[
"C1",
19,
3,
"DMN",
"A"
],
[
"C2",
20,
3,
"DMN",
"A"
],
[
"C1",
27,
4,
"DMN",
"A"
],
[
"C2",
28,
4,
"DMN",
"A"
],
[
"C1",
34,
5,
"BNZ",
"A"
],
[
"C2",
35,
5,
"BNZ",
"A"
],
[
"C3",
36,
5,
"BNZ",
"A"
],
[
"C4",
37,
5,
"BNZ",
"A"
],
[
"C5",
38,
5,
"BNZ",
"A"
],
[
"C6",
39,
5,
"BNZ",
"A"
],
[
"C1",
44,
6,
"DMN",
"A"
],
[
"C2",
45,
6,
"DMN",
"A"
],
[
"C1",
52,
7,
"DMN",
"A"
],
[
"C2",
53,
7,
"DMN",
"A"
],
[
"C1",
61,
8,
"DMN",
"A"
],
[
"C2",
62,
8,
"DMN",
"A"
],
[
"C1",
69,
9,
"BNZ",
"A"
],
[
"C2",
70,
9,
"BNZ",
"A"
],
[
"C3",
71,
9,
"BNZ",
"A"
],
[
"C4",
72,
9,
"BNZ",
"A"
],
[
"C5",
73,
9,
"BNZ",
"A"
],
[
"C6",
74,
9,
"BNZ",
"A"
],
[
"C1",
79,
10,
"DMN",
"A"
],
[
"C2",
80,
10,
"DMN",
"A"
],
[
"C1",
87,
11,
"DMN",
"A"
],
[
"C2",
88,
11,
"DMN",
"A"
],
[
"C1",
96,
12,
"DMN",
"A"
],
[
"C2",
97,
12,
"DMN",
"A"
],
[
"C1",
104,
13,
"BNZ",
"A"
],
[
"C2",
105,
13,
"BNZ",
"A"
],
[
"C3",
106,
13,
"BNZ",
"A"
],
[
"C4",
107,
13,
"BNZ",
"A"
],
[
"C5",
108,
13,
"BNZ",
"A"
],
[
"C6",
109,
13,
"BNZ",
"A"
],
[
"C1",
114,
14,
"DMN",
"A"
],
[
"C2",
115,
14,
"DMN",
"A"
],
[
"C1",
122,
15,
"DMN",
"A"
],
[
"C2",
123,
15,
"DMN",
"A"
],
[
"C1",
131,
16,
"DMN",
"A"
],
[
"C2",
132,
16,
"DMN",
"A"
]
],
"hovertemplate": "atom_element=C
x=%{x}
y=%{y}
z=%{z}
atom_id=%{customdata[0]}
atom_serial=%{customdata[1]}
residue_serial=%{customdata[2]}
residue_name=%{customdata[3]}
chain_id=%{customdata[4]}
x=%{x}
y=%{y}
z=%{z}
atom_id=%{customdata[0]}
atom_serial=%{customdata[1]}
residue_serial=%{customdata[2]}
residue_name=%{customdata[3]}
chain_id=%{customdata[4]}
x=%{x}
y=%{y}
z=%{z}
atom_id=%{customdata[0]}
atom_serial=%{customdata[1]}
residue_serial=%{customdata[2]}
residue_name=%{customdata[3]}
chain_id=%{customdata[4]}