{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"> ### In this tutorial we will cover:\n",
"> - which built-in resources are available\n",
"> - how to set your own default settings"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"## Built-in resources\n",
"\n",
"`biubuild` has three built-in data resources: the _CHARMM_ force field, the _PDBE compound library_, and _PubChem_ (remotely queried)."
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"```mermaid\n",
"\n",
"flowchart TB\n",
" node_1((\"CHARMM\"))\n",
" node_2[\"pre-defined linkages\"]\n",
" node_3((\"PDBE Compounds\"))\n",
" node_4[\"small molecules\"]\n",
" node_5((\"PubChem\"))\n",
" node_7[\"amino acids\"]\n",
" node_8[\"sugars\"]\n",
" node_9[\"lipids\"]\n",
" node_6[\"any other available molecule\"]\n",
" node_10[\"nucleotides\"]\n",
" node_1 --> node_2\n",
" node_3 --> node_4\n",
" node_3 --> node_7\n",
" node_3 --> node_8\n",
" node_3 --> node_9\n",
" node_5 --> node_6\n",
" node_3 --> node_10\n",
"\n",
"\n",
"```"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"### CHARMM Force Field\n",
"\n",
"In order to connect molecules together, the user may define their own `Linkage` by specifying which atoms to connect and which atoms to remove in the process. However, to make life easier, `biobuild` references the CHARMM force field which already specifies a number of linkage types - so-called `patches`. Each _patch_ specifies the atoms to connect and remove as well as the _internal coordinates_ around the newly formed bond. This allows biobuild to generate structures by pure matrix transformation as the resulting geometry is already specified. "
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"We can check what linkages are available by default using:"
]
},
{
"cell_type": "code",
"execution_count": 1,
"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": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[Linkage(SCK0),\n",
" Linkage(SCK1),\n",
" Linkage(LLLO),\n",
" Linkage(CERA),\n",
" Linkage(CERB),\n",
" Linkage(DAGA),\n",
" Linkage(DAGB),\n",
" Linkage(INS2A),\n",
" Linkage(INS2B),\n",
" Linkage(INS6A),\n",
" Linkage(INS6B),\n",
" Linkage(SGPA),\n",
" Linkage(TGPA),\n",
" Linkage(SGPB),\n",
" Linkage(TGPB),\n",
" Linkage(NGLA),\n",
" Linkage(11aa),\n",
" Linkage(11ab),\n",
" Linkage(11bb),\n",
" Linkage(12aa),\n",
" Linkage(12ab),\n",
" Linkage(12ba),\n",
" Linkage(12bb),\n",
" Linkage(13aa),\n",
" Linkage(13ab),\n",
" Linkage(13ba),\n",
" Linkage(13bb),\n",
" Linkage(14aa),\n",
" Linkage(14ab),\n",
" Linkage(14ba),\n",
" Linkage(14bb),\n",
" Linkage(16aa),\n",
" Linkage(16ab),\n",
" Linkage(16ba),\n",
" Linkage(SUCR),\n",
" Linkage(LCTL),\n",
" Linkage(AB15),\n",
" Linkage(SA23AB),\n",
" Linkage(LINK)]"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import biobuild as bb\n",
"\n",
"bb.available_linkages()"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"Each linkage is identified by an ID within the CHARMM force field - e.g. `12aa` stands for the `1->2 alpha glycosydic linkage`. Each of the pre-defined available linkages can be referenced by their (string) id when connecting molecules together.\n",
"\n",
"For example, we can connect two mannoses using a `12aa` linkage by:"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.plotly.v1+json": {
"config": {
"plotlyServerURL": "https://plot.ly"
},
"data": [
{
"customdata": [
[
"C1",
1,
1,
"MAN",
"A"
],
[
"C2",
2,
1,
"MAN",
"A"
],
[
"C3",
3,
1,
"MAN",
"A"
],
[
"C4",
4,
1,
"MAN",
"A"
],
[
"C5",
5,
1,
"MAN",
"A"
],
[
"C6",
6,
1,
"MAN",
"A"
],
[
"C1",
24,
2,
"MAN",
"A"
],
[
"C2",
25,
2,
"MAN",
"A"
],
[
"C3",
26,
2,
"MAN",
"A"
],
[
"C4",
27,
2,
"MAN",
"A"
],
[
"C5",
28,
2,
"MAN",
"A"
],
[
"C6",
29,
2,
"MAN",
"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]}