{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Making a Rotaxane (easy)\n",
"\n",
"> ### In this tutorial we will cover:\n",
"> - how we can use BuildAMol when we want to combine multiple molecules into one system\n",
"> - how we can use BuildAMol's RotatronBuilder to align a circular molecule along a scaffold"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The primary purpose of BuildAMol is to build individual molecular structures. However, sometimes we want to assemble a system with multiple individual molecules that form a system, for instance when doing molecular dynamics simulations. \n",
"\n",
"In this tutorial we will be assembling a rotaxane. Rotaxanes are compounds that consist of a scaffold-like structure around which a circular molecule is wrapped. However, there is no covalent bond between the scaffold and ring. \n",
"\n",
"For this tutorial we shall be building this compound below from a paper by [Tian et al. (2020)](https://www.nature.com/articles/s41467-020-14576-7)\n",
"\n",
""
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"As we can see, the final compound on the right consists of two individual molecules. One circular structure (blue) and the scaffold (green and orange). \n",
"\n",
"We will first build the components separately and then assemble a system for PDB export from these."
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
" \n",
" "
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"import plotly\n",
"plotly.offline.init_notebook_mode()"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"import buildamol as bam\n",
"\n",
"bam.load_small_molecules()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Making the ring"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Let's start by making the ring-structure. We can see that the basic unit is an ethanol molecule that is repeated eight times. We could make a linear polymer of ethanol molecules and then circularize it to get the ring structure. However, there is actually a much faster way of getting our desired structure. Namely, we can make a circular alkane ring of the right size and simple change the element of every third carbon to oxygen to achieve the same result, just faster! Why faster? Because BuildAMol has an extention to make cyclic alkanes directly without any need for optimization. Here's how:"
]
},
{
"cell_type": "code",
"execution_count": 6,
"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,
"ALK",
"A"
],
[
"C2",
2,
1,
"ALK",
"A"
],
[
"C4",
4,
1,
"ALK",
"A"
],
[
"C5",
5,
1,
"ALK",
"A"
],
[
"C7",
7,
1,
"ALK",
"A"
],
[
"C8",
8,
1,
"ALK",
"A"
],
[
"C10",
10,
1,
"ALK",
"A"
],
[
"C11",
11,
1,
"ALK",
"A"
],
[
"C13",
13,
1,
"ALK",
"A"
],
[
"C14",
14,
1,
"ALK",
"A"
],
[
"C16",
16,
1,
"ALK",
"A"
],
[
"C17",
17,
1,
"ALK",
"A"
],
[
"C19",
19,
1,
"ALK",
"A"
],
[
"C20",
20,
1,
"ALK",
"A"
],
[
"C22",
22,
1,
"ALK",
"A"
],
[
"C23",
23,
1,
"ALK",
"A"
]
],
"hovertemplate": "atom_element=C
x=%{x}
y=%{y}
z=%{z}
__marker_size=%{marker.size}
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}
__marker_size=%{marker.size}
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}
__marker_size=%{marker.size}
atom_id=%{customdata[0]}
atom_serial=%{customdata[1]}
residue_serial=%{customdata[2]}
residue_name=%{customdata[3]}
chain_id=%{customdata[4]}