{ "cells": [ { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "# Getting Started\n", "\n", "Welcome to the first `biobuild` tutorial, where we shall learn the basics of operating with `biobuild`!\n", "\n", "> ### In this tutorial we will cover:\n", "> - which (main) classes and modules exist and when to use them\n", "> - how to read input to make `Molecule`s\n", "> - how to connect two molecules together" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "## Main Classes in `biobuild`\n", "\n", "The most important class is the `Molecule` class which houses ~90% of all functionality that the average user is likely to use. \n", "Next, comes the `Linkage` class that defines how multiple molecules can be connected, so the user can build larger structures. Third,\n", "are the `ResidueGraph` and `Rotatron` environments of the `optimizers` module - to optimize conformations. Finally, the `MoleculeViewer3D` may come in quite handy. It is essentially just a plotly 3D-plot but it can be selectively colored easily so as to highlight specific parts of your molecule - it is a great tool to check if your building process is working (or to debug why it may not be). Finally, the `resources` module houses a wealth of reference structures for users to use when building their favourite structures.\n", "\n", "That's already about it! Of course, there is a lot more - but everything else is mostly underneath the surface and will most likely not bother the average user directly. " ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "```mermaid\n", "\n", "flowchart TB\n", " node_0[\"core\"]\n", " node_1(\"Molecule\")\n", " node_2(\"ResidueGraph\")\n", " node_3(\"MoleculeViewer3D\")\n", " node_4[\"Optimizers\"]\n", " node_6(\"Rotatron\")\n", " node_7{\"{}_optimize\"}\n", " node_5[\"Linkage\"]\n", " node_8[\"resources\"]\n", " node_1 -.-> node_2\n", " node_1 -.-> node_3\n", " node_0 --- node_1\n", " node_4 --- node_6\n", " node_4 --- node_7\n", " node_6 -.-> node_7\n", " node_2 -.-> node_7\n", " node_0 --- node_5\n", "\n", "```" ] }, { "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()\n", "\n", "import biobuild as bb" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Resources\n", "\n", "biobuild includes the _PDBE_ component library for small molecules (or at least a pretty large part of it). Since this is quite large, biobuild will not by default load any data, but offers a buch of functions for the user to load what they are interested in using selectively. We can also set defaults that are always loaded if we want to re-use our own custom builds in different sessions. \n", "\n", "Available pre-loadable sets are:\n", "\n", "```python\n", "# to load the amino acid and derivative compounds\n", "bb.load_amino_acids()\n", "\n", "# to load nucleotide and derivative compounds\n", "bb.load_nucleic_acids()\n", "\n", "# to load sugar and derivative compounds\n", "bb.load_sugars()\n", "\n", "# to load miscallaneous small molecules of less than 40 atoms\n", "bb.load_small_molecules()\n", "```" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "### Molecules\n", "\n", "Molecules are the essential data unit in `biobuild`. Each Molecule houses atoms that form a molecular structure. We can generate Molecules from:\n", "- a PDB or CIF file (e.g. \"my_structure.pdb\")\n", "- a PDB ID (e.g. \"GLC\" - the PDB id for alpha-D-glucose)\n", "- a trivial name (e.g. \"triacetamide\")\n", "- a chemical formula (e.g. \"C2H6O\" - caution, may produce ambiguities!)\n", "- SMILES and InChI/InChIKey\n", "\n", "The `Molecule` class has classmethods for all of these named `from_pdb`, `from_compound` (for PDB ID, name etc.), `from_pubchem` and so forth. But there also exists the toplevel `molecule` function that will try to automatically figure out the user input and generate a molecule for you." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "customdata": [ [ "N", 1, 1, "SER", "A" ] ], "hovertemplate": "atom_element=N
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]}", "legendgroup": "N", "marker": { "color": "blue", "opacity": 1, "symbol": "circle" }, "mode": "markers", "name": "N", "scene": "scene", "showlegend": true, "type": "scatter3d", "x": [ 1.525 ], "y": [ 0.493 ], "z": [ -0.608 ] }, { "customdata": [ [ "CA", 2, 1, "SER", "A" ], [ "C", 3, 1, "SER", "A" ], [ "CB", 5, 1, "SER", "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]}", "legendgroup": "C", "marker": { "color": "darkslategray", "opacity": 1, "symbol": "circle" }, "mode": "markers", "name": "C", "scene": "scene", "showlegend": true, "type": "scatter3d", "x": [ 0.1, -0.053, -0.642 ], "y": [ 0.469, 0.004, -0.489 ], "z": [ -0.252, 1.173, -1.184 ] }, { "customdata": [ [ "O", 4, 1, "SER", "A" ], [ "OG", 6, 1, "SER", "A" ], [ "OXT", 7, 1, "SER", "A" ] ], "hovertemplate": "atom_element=O
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]}", "legendgroup": "O", "marker": { "color": "red", "opacity": 1, "symbol": "circle" }, "mode": "markers", "name": "O", "scene": "scene", "showlegend": true, "type": "scatter3d", "x": [ 0.751, -0.496, -1.084 ], "y": [ -0.76, -0.049, 0.44 ], "z": [ 1.649, -2.535, 1.913 ] }, { "customdata": [ [ "H", 8, 1, "SER", "A" ], [ "H2", 9, 1, "SER", "A" ], [ "HA", 10, 1, "SER", "A" ], [ "HB2", 11, 1, "SER", "A" ], [ "HB3", 12, 1, "SER", "A" ], [ "HG", 13, 1, "SER", "A" ], [ "HXT", 14, 1, "SER", "A" ] ], "hovertemplate": "atom_element=H
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]}", "legendgroup": "H", "marker": { "color": "lightgray", "opacity": 1, "symbol": "circle" }, "mode": "markers", "name": "H", "scene": "scene", "showlegend": true, "type": "scatter3d", "x": [ 1.867, 1.574, -0.316, -0.225, -1.699, -0.978, -1.183 ], "y": [ -0.449, 0.707, 1.471, -1.491, -0.507, -0.679, 0.142 ], "z": [ -0.499, -1.593, -0.354, -1.081, -0.92, -3.088, 2.828 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 1.525, 0.1 ], "y": [ 0.493, 0.469 ], "z": [ -0.608, -0.252 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 1.525, 1.867 ], "y": [ 0.493, -0.449 ], "z": [ -0.608, -0.499 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 1.525, 1.574 ], "y": [ 0.493, 0.707 ], "z": [ -0.608, -1.593 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 0.1, -0.053 ], "y": [ 0.469, 0.004 ], "z": [ -0.252, 1.173 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 0.1, -0.642 ], "y": [ 0.469, -0.489 ], "z": [ -0.252, -1.184 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 0.1, -0.316 ], "y": [ 0.469, 1.471 ], "z": [ -0.252, -0.354 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 5.76 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ -0.053, 0.751 ], "y": [ 0.004, -0.76 ], "z": [ 1.173, 1.649 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ -0.053, -1.084 ], "y": [ 0.004, 0.44 ], "z": [ 1.173, 1.913 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ -0.642, -0.496 ], "y": [ -0.489, -0.049 ], "z": [ -1.184, -2.535 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ -0.642, -0.225 ], "y": [ -0.489, -1.491 ], "z": [ -1.184, -1.081 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ -0.642, -1.699 ], "y": [ -0.489, -0.507 ], "z": [ -1.184, -0.92 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ -0.496, -0.978 ], "y": [ -0.049, -0.679 ], "z": [ -2.535, -3.088 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ -1.084, -1.183 ], "y": [ 0.44, 0.142 ], "z": [ 1.913, 2.828 ] } ], "layout": { "scene": { "xaxis": { "showgrid": false, "showline": false, "showticklabels": false }, "yaxis": { "showgrid": false, "showline": false, "showticklabels": false }, "zaxis": { "showgrid": false, "showline": false, "showticklabels": false } }, "template": { "data": { "bar": [ { "error_x": { "color": "rgb(36,36,36)" }, "error_y": { "color": "rgb(36,36,36)" }, "marker": { "line": { "color": "white", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "white", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "rgb(36,36,36)", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "rgb(36,36,36)" }, "baxis": { "endlinecolor": "rgb(36,36,36)", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "rgb(36,36,36)" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "colorscale": [ [ 0, "#440154" ], [ 0.1111111111111111, "#482878" ], [ 0.2222222222222222, "#3e4989" ], [ 0.3333333333333333, "#31688e" ], [ 0.4444444444444444, "#26828e" ], [ 0.5555555555555556, "#1f9e89" ], [ 0.6666666666666666, "#35b779" ], [ 0.7777777777777778, "#6ece58" ], [ 0.8888888888888888, "#b5de2b" ], [ 1, "#fde725" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "colorscale": [ [ 0, "#440154" ], [ 0.1111111111111111, "#482878" ], [ 0.2222222222222222, "#3e4989" ], [ 0.3333333333333333, "#31688e" ], [ 0.4444444444444444, "#26828e" ], [ 0.5555555555555556, "#1f9e89" ], [ 0.6666666666666666, "#35b779" ], [ 0.7777777777777778, "#6ece58" ], [ 0.8888888888888888, "#b5de2b" ], [ 1, "#fde725" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "colorscale": [ [ 0, "#440154" ], [ 0.1111111111111111, "#482878" ], [ 0.2222222222222222, "#3e4989" ], [ 0.3333333333333333, "#31688e" ], [ 0.4444444444444444, "#26828e" ], [ 0.5555555555555556, "#1f9e89" ], [ 0.6666666666666666, "#35b779" ], [ 0.7777777777777778, "#6ece58" ], [ 0.8888888888888888, "#b5de2b" ], [ 1, "#fde725" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "line": { "color": "white", "width": 0.6 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "colorscale": [ [ 0, "#440154" ], [ 0.1111111111111111, "#482878" ], [ 0.2222222222222222, "#3e4989" ], [ 0.3333333333333333, "#31688e" ], [ 0.4444444444444444, "#26828e" ], [ 0.5555555555555556, "#1f9e89" ], [ 0.6666666666666666, "#35b779" ], [ 0.7777777777777778, "#6ece58" ], [ 0.8888888888888888, "#b5de2b" ], [ 1, "#fde725" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "colorscale": [ [ 0, "#440154" ], [ 0.1111111111111111, "#482878" ], [ 0.2222222222222222, "#3e4989" ], [ 0.3333333333333333, "#31688e" ], [ 0.4444444444444444, "#26828e" ], [ 0.5555555555555556, "#1f9e89" ], [ 0.6666666666666666, "#35b779" ], [ 0.7777777777777778, "#6ece58" ], [ 0.8888888888888888, "#b5de2b" ], [ 1, "#fde725" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "marker": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "colorscale": [ [ 0, "#440154" ], [ 0.1111111111111111, "#482878" ], [ 0.2222222222222222, "#3e4989" ], [ 0.3333333333333333, "#31688e" ], [ 0.4444444444444444, "#26828e" ], [ 0.5555555555555556, "#1f9e89" ], [ 0.6666666666666666, "#35b779" ], [ 0.7777777777777778, "#6ece58" ], [ 0.8888888888888888, "#b5de2b" ], [ 1, "#fde725" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "rgb(237,237,237)" }, "line": { "color": "white" } }, "header": { "fill": { "color": "rgb(217,217,217)" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "colorscale": { "diverging": [ [ 0, "rgb(103,0,31)" ], [ 0.1, "rgb(178,24,43)" ], [ 0.2, "rgb(214,96,77)" ], [ 0.3, "rgb(244,165,130)" ], [ 0.4, "rgb(253,219,199)" ], [ 0.5, "rgb(247,247,247)" ], [ 0.6, "rgb(209,229,240)" ], [ 0.7, "rgb(146,197,222)" ], [ 0.8, "rgb(67,147,195)" ], [ 0.9, "rgb(33,102,172)" ], [ 1, "rgb(5,48,97)" ] ], "sequential": [ [ 0, "#440154" ], [ 0.1111111111111111, "#482878" ], [ 0.2222222222222222, "#3e4989" ], [ 0.3333333333333333, "#31688e" ], [ 0.4444444444444444, "#26828e" ], [ 0.5555555555555556, "#1f9e89" ], [ 0.6666666666666666, "#35b779" ], [ 0.7777777777777778, "#6ece58" ], [ 0.8888888888888888, "#b5de2b" ], [ 1, "#fde725" ] ], "sequentialminus": [ [ 0, "#440154" ], [ 0.1111111111111111, "#482878" ], [ 0.2222222222222222, "#3e4989" ], [ 0.3333333333333333, "#31688e" ], [ 0.4444444444444444, "#26828e" ], [ 0.5555555555555556, "#1f9e89" ], [ 0.6666666666666666, "#35b779" ], [ 0.7777777777777778, "#6ece58" ], [ 0.8888888888888888, "#b5de2b" ], [ 1, "#fde725" ] ] }, "colorway": [ "#1F77B4", "#FF7F0E", "#2CA02C", "#D62728", "#9467BD", "#8C564B", "#E377C2", "#7F7F7F", "#BCBD22", "#17BECF" ], "font": { "color": "rgb(36,36,36)" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "white", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "white", "polar": { "angularaxis": { "gridcolor": "rgb(232,232,232)", "linecolor": "rgb(36,36,36)", "showgrid": false, "showline": true, "ticks": "outside" }, "bgcolor": "white", "radialaxis": { "gridcolor": "rgb(232,232,232)", "linecolor": "rgb(36,36,36)", "showgrid": false, "showline": true, "ticks": "outside" } }, "scene": { "xaxis": { "backgroundcolor": "white", "gridcolor": "rgb(232,232,232)", "gridwidth": 2, "linecolor": "rgb(36,36,36)", "showbackground": true, "showgrid": false, "showline": true, "ticks": "outside", "zeroline": false, "zerolinecolor": "rgb(36,36,36)" }, "yaxis": { "backgroundcolor": "white", "gridcolor": "rgb(232,232,232)", "gridwidth": 2, "linecolor": "rgb(36,36,36)", "showbackground": true, "showgrid": false, "showline": true, "ticks": "outside", "zeroline": false, "zerolinecolor": "rgb(36,36,36)" }, "zaxis": { "backgroundcolor": "white", "gridcolor": "rgb(232,232,232)", "gridwidth": 2, "linecolor": "rgb(36,36,36)", "showbackground": true, "showgrid": false, "showline": true, "ticks": "outside", "zeroline": false, "zerolinecolor": "rgb(36,36,36)" } }, "shapedefaults": { "fillcolor": "black", "line": { "width": 0 }, "opacity": 0.3 }, "ternary": { "aaxis": { "gridcolor": "rgb(232,232,232)", "linecolor": "rgb(36,36,36)", "showgrid": false, "showline": true, "ticks": "outside" }, "baxis": { "gridcolor": "rgb(232,232,232)", "linecolor": "rgb(36,36,36)", "showgrid": false, "showline": true, "ticks": "outside" }, "bgcolor": "white", "caxis": { "gridcolor": "rgb(232,232,232)", "linecolor": "rgb(36,36,36)", "showgrid": false, "showline": true, "ticks": "outside" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "rgb(232,232,232)", "linecolor": "rgb(36,36,36)", "showgrid": false, "showline": true, "ticks": "outside", "title": { "standoff": 15 }, "zeroline": false, "zerolinecolor": "rgb(36,36,36)" }, "yaxis": { "automargin": true, "gridcolor": "rgb(232,232,232)", "linecolor": "rgb(36,36,36)", "showgrid": false, "showline": true, "ticks": "outside", "title": { "standoff": 15 }, "zeroline": false, "zerolinecolor": "rgb(36,36,36)" } } } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# make sure we have amino acids available\n", "bb.load_amino_acids()\n", "\n", "# get a serine\n", "ser = bb.molecule(\"SER\") # (using the PDB id)\n", "\n", "# check what it looks like\n", "ser.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can always check out if a compound is available in a loaded set using the `has_compound` function. But even if a specific compound is not available\n", "biobuild can retrieve the molecular structure directly from PubChem to guarantee a smooth workflow!" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "False" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# check if we have diacetamide\n", "bb.has_compound(\"diacetamide\")" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "customdata": [ [ "O1", 1, 1, "UNK", "A" ], [ "O2", 2, 1, "UNK", "A" ] ], "hovertemplate": "atom_element=O
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]}", "legendgroup": "O", "marker": { "color": "red", "opacity": 1, "symbol": "circle" }, "mode": "markers", "name": "O", "scene": "scene", "showlegend": true, "type": "scatter3d", "x": [ 1.4126, -1.4128 ], "y": [ -1.2387, -1.2388 ], "z": [ 0.0021, -0.0045 ] }, { "customdata": [ [ "N1", 3, 1, "UNK", "A" ] ], "hovertemplate": "atom_element=N
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]}", "legendgroup": "N", "marker": { "color": "blue", "opacity": 1, "symbol": "circle" }, "mode": "markers", "name": "N", "scene": "scene", "showlegend": true, "type": "scatter3d", "x": [ -0.0001 ], "y": [ 0.6228 ], "z": [ 0.0038 ] }, { "customdata": [ [ "C1", 4, 1, "UNK", "A" ], [ "C2", 5, 1, "UNK", "A" ], [ "C3", 6, 1, "UNK", "A" ], [ "C4", 7, 1, "UNK", "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]}", "legendgroup": "C", "marker": { "color": "darkslategray", "opacity": 1, "symbol": "circle" }, "mode": "markers", "name": "C", "scene": "scene", "showlegend": true, "type": "scatter3d", "x": [ 1.2341, -1.2342, 2.381, -2.3805 ], "y": [ -0.0239, -0.024, 0.9511, 0.9515 ], "z": [ 0.0049, -0.0009, -0.0062, 0.0007 ] }, { "customdata": [ [ "H1", 8, 1, "UNK", "A" ], [ "H2", 9, 1, "UNK", "A" ], [ "H3", 10, 1, "UNK", "A" ], [ "H4", 11, 1, "UNK", "A" ], [ "H5", 12, 1, "UNK", "A" ], [ "H6", 13, 1, "UNK", "A" ], [ "H7", 14, 1, "UNK", "A" ] ], "hovertemplate": "atom_element=H
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]}", "legendgroup": "H", "marker": { "color": "lightgray", "opacity": 1, "symbol": "circle" }, "mode": "markers", "name": "H", "scene": "scene", "showlegend": true, "type": "scatter3d", "x": [ -0.0002, 3.3262, 2.3822, 2.2873, -2.3264, -2.3386, -3.3287 ], "y": [ 1.6402, 0.4099, 1.5068, 1.6495, 1.5897, 1.5714, 0.4071 ], "z": [ 0.004, 0.091, -0.948, 0.8303, -0.8857, 0.9008, -0.0116 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 1.4126, 1.2341 ], "y": [ -1.2387, -0.0239 ], "z": [ 0.0021, 0.0049 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ -1.4128, -1.2342 ], "y": [ -1.2388, -0.024 ], "z": [ -0.0045, -0.0009 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ -0.0001, 1.2341 ], "y": [ 0.6228, -0.0239 ], "z": [ 0.0038, 0.0049 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ -0.0001, -1.2342 ], "y": [ 0.6228, -0.024 ], "z": [ 0.0038, -0.0009 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ -0.0001, -0.0002 ], "y": [ 0.6228, 1.6402 ], "z": [ 0.0038, 0.004 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 1.2341, 2.381 ], "y": [ -0.0239, 0.9511 ], "z": [ 0.0049, -0.0062 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ -1.2342, -2.3805 ], "y": [ -0.024, 0.9515 ], "z": [ -0.0009, 0.0007 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 2.381, 3.3262 ], "y": [ 0.9511, 0.4099 ], "z": [ -0.0062, 0.091 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 2.381, 2.3822 ], "y": [ 0.9511, 1.5068 ], "z": [ -0.0062, -0.948 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 2.381, 2.2873 ], "y": [ 0.9511, 1.6495 ], "z": [ -0.0062, 0.8303 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ -2.3805, -2.3264 ], "y": [ 0.9515, 1.5897 ], "z": [ 0.0007, -0.8857 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ -2.3805, -2.3386 ], "y": [ 0.9515, 1.5714 ], "z": [ 0.0007, 0.9008 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ -2.3805, -3.3287 ], "y": [ 0.9515, 0.4071 ], "z": [ 0.0007, -0.0116 ] } ], "layout": { "scene": { "xaxis": { "showgrid": false, "showline": false, "showticklabels": false }, "yaxis": { "showgrid": false, "showline": false, "showticklabels": false }, "zaxis": { "showgrid": false, "showline": false, "showticklabels": false } }, "template": { "data": { "bar": [ { "error_x": { "color": "rgb(36,36,36)" }, "error_y": { "color": "rgb(36,36,36)" }, "marker": { "line": { "color": "white", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "white", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "rgb(36,36,36)", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "rgb(36,36,36)" }, "baxis": { "endlinecolor": "rgb(36,36,36)", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "rgb(36,36,36)" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "colorscale": [ [ 0, "#440154" ], [ 0.1111111111111111, "#482878" ], [ 0.2222222222222222, "#3e4989" ], [ 0.3333333333333333, "#31688e" ], [ 0.4444444444444444, "#26828e" ], [ 0.5555555555555556, "#1f9e89" ], [ 0.6666666666666666, "#35b779" ], [ 0.7777777777777778, "#6ece58" ], [ 0.8888888888888888, "#b5de2b" ], [ 1, "#fde725" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "colorscale": [ [ 0, "#440154" ], [ 0.1111111111111111, "#482878" ], [ 0.2222222222222222, "#3e4989" ], [ 0.3333333333333333, "#31688e" ], [ 0.4444444444444444, "#26828e" ], [ 0.5555555555555556, "#1f9e89" ], [ 0.6666666666666666, "#35b779" ], [ 0.7777777777777778, "#6ece58" ], [ 0.8888888888888888, "#b5de2b" ], [ 1, "#fde725" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "colorscale": [ [ 0, "#440154" ], [ 0.1111111111111111, "#482878" ], [ 0.2222222222222222, "#3e4989" ], [ 0.3333333333333333, "#31688e" ], [ 0.4444444444444444, "#26828e" ], [ 0.5555555555555556, "#1f9e89" ], [ 0.6666666666666666, "#35b779" ], [ 0.7777777777777778, "#6ece58" ], [ 0.8888888888888888, "#b5de2b" ], [ 1, "#fde725" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "line": { "color": "white", "width": 0.6 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "colorscale": [ [ 0, "#440154" ], [ 0.1111111111111111, "#482878" ], [ 0.2222222222222222, "#3e4989" ], [ 0.3333333333333333, "#31688e" ], [ 0.4444444444444444, "#26828e" ], [ 0.5555555555555556, "#1f9e89" ], [ 0.6666666666666666, "#35b779" ], [ 0.7777777777777778, "#6ece58" ], [ 0.8888888888888888, "#b5de2b" ], [ 1, "#fde725" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "colorscale": [ [ 0, "#440154" ], [ 0.1111111111111111, "#482878" ], [ 0.2222222222222222, "#3e4989" ], [ 0.3333333333333333, "#31688e" ], [ 0.4444444444444444, "#26828e" ], [ 0.5555555555555556, "#1f9e89" ], [ 0.6666666666666666, "#35b779" ], [ 0.7777777777777778, "#6ece58" ], [ 0.8888888888888888, "#b5de2b" ], [ 1, "#fde725" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "marker": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "colorscale": [ [ 0, "#440154" ], [ 0.1111111111111111, "#482878" ], [ 0.2222222222222222, "#3e4989" ], [ 0.3333333333333333, "#31688e" ], [ 0.4444444444444444, "#26828e" ], [ 0.5555555555555556, "#1f9e89" ], [ 0.6666666666666666, "#35b779" ], [ 0.7777777777777778, "#6ece58" ], [ 0.8888888888888888, "#b5de2b" ], [ 1, "#fde725" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "rgb(237,237,237)" }, "line": { "color": "white" } }, "header": { "fill": { "color": "rgb(217,217,217)" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "colorscale": { "diverging": [ [ 0, "rgb(103,0,31)" ], [ 0.1, "rgb(178,24,43)" ], [ 0.2, "rgb(214,96,77)" ], [ 0.3, "rgb(244,165,130)" ], [ 0.4, "rgb(253,219,199)" ], [ 0.5, "rgb(247,247,247)" ], [ 0.6, "rgb(209,229,240)" ], [ 0.7, "rgb(146,197,222)" ], [ 0.8, "rgb(67,147,195)" ], [ 0.9, "rgb(33,102,172)" ], [ 1, "rgb(5,48,97)" ] ], "sequential": [ [ 0, "#440154" ], [ 0.1111111111111111, "#482878" ], [ 0.2222222222222222, "#3e4989" ], [ 0.3333333333333333, "#31688e" ], [ 0.4444444444444444, "#26828e" ], [ 0.5555555555555556, "#1f9e89" ], [ 0.6666666666666666, "#35b779" ], [ 0.7777777777777778, "#6ece58" ], [ 0.8888888888888888, "#b5de2b" ], [ 1, "#fde725" ] ], "sequentialminus": [ [ 0, "#440154" ], [ 0.1111111111111111, "#482878" ], [ 0.2222222222222222, "#3e4989" ], [ 0.3333333333333333, "#31688e" ], [ 0.4444444444444444, "#26828e" ], [ 0.5555555555555556, "#1f9e89" ], [ 0.6666666666666666, "#35b779" ], [ 0.7777777777777778, "#6ece58" ], [ 0.8888888888888888, "#b5de2b" ], [ 1, "#fde725" ] ] }, "colorway": [ "#1F77B4", "#FF7F0E", "#2CA02C", "#D62728", "#9467BD", "#8C564B", "#E377C2", "#7F7F7F", "#BCBD22", "#17BECF" ], "font": { "color": "rgb(36,36,36)" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "white", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "white", "polar": { "angularaxis": { "gridcolor": "rgb(232,232,232)", "linecolor": "rgb(36,36,36)", "showgrid": false, "showline": true, "ticks": "outside" }, "bgcolor": "white", "radialaxis": { "gridcolor": "rgb(232,232,232)", "linecolor": "rgb(36,36,36)", "showgrid": false, "showline": true, "ticks": "outside" } }, "scene": { "xaxis": { "backgroundcolor": "white", "gridcolor": "rgb(232,232,232)", "gridwidth": 2, "linecolor": "rgb(36,36,36)", "showbackground": true, "showgrid": false, "showline": true, "ticks": "outside", "zeroline": false, "zerolinecolor": "rgb(36,36,36)" }, "yaxis": { "backgroundcolor": "white", "gridcolor": "rgb(232,232,232)", "gridwidth": 2, "linecolor": "rgb(36,36,36)", "showbackground": true, "showgrid": false, "showline": true, "ticks": "outside", "zeroline": false, "zerolinecolor": "rgb(36,36,36)" }, "zaxis": { "backgroundcolor": "white", "gridcolor": "rgb(232,232,232)", "gridwidth": 2, "linecolor": "rgb(36,36,36)", "showbackground": true, "showgrid": false, "showline": true, "ticks": "outside", "zeroline": false, "zerolinecolor": "rgb(36,36,36)" } }, "shapedefaults": { "fillcolor": "black", "line": { "width": 0 }, "opacity": 0.3 }, "ternary": { "aaxis": { "gridcolor": "rgb(232,232,232)", "linecolor": "rgb(36,36,36)", "showgrid": false, "showline": true, "ticks": "outside" }, "baxis": { "gridcolor": "rgb(232,232,232)", "linecolor": "rgb(36,36,36)", "showgrid": false, "showline": true, "ticks": "outside" }, "bgcolor": "white", "caxis": { "gridcolor": "rgb(232,232,232)", "linecolor": "rgb(36,36,36)", "showgrid": false, "showline": true, "ticks": "outside" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "rgb(232,232,232)", "linecolor": "rgb(36,36,36)", "showgrid": false, "showline": true, "ticks": "outside", "title": { "standoff": 15 }, "zeroline": false, "zerolinecolor": "rgb(36,36,36)" }, "yaxis": { "automargin": true, "gridcolor": "rgb(232,232,232)", "linecolor": "rgb(36,36,36)", "showgrid": false, "showline": true, "ticks": "outside", "title": { "standoff": 15 }, "zeroline": false, "zerolinecolor": "rgb(36,36,36)" } } } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# get a diacetamide (using its name)\n", "# since diacetamide was not available in the loaded set of compounds\n", "# biobuild will automatically download it from PubChem\n", "tri = bb.molecule(\"diacetamide\")\n", "\n", "# check what it looks like\n", "tri.show()" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "### Linkage \n", "\n", "Now assuming we want to take _diacetamide_ and connect the _serine_ to it. We can define a `Linkage` to specify which atoms to link between the two. To do so, we need to know what the atoms are labelled as (another reason to always visualize the structures). In the Linkage definition we specify, for instance, that the diacetamide-N1 should be connected to serine-C. In the process, we remove the diacetamide-H1 and the serine's OXT and HXT.\n", "\n", "> #### Note\n", "> The linkages do *not* need to follow chemical reasoning - they only connect structures by adding and removing connections. Hence, we could connect the molecules by one of the methyl-groups making one of the hydrogens the leaving group (even though chemically such a reaction would probably never occur) - biobuild builds structures, but it does not imitate chemical reactions! " ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "# define the linkage between the two molecules\n", "# remember to check the atom labelling as these atom labels must match\n", "# the existing atom labels in both molecules\n", "link = bb.linkage(atom1=\"N1\", atom2=\"C\", delete_in_target=[\"H1\"], delete_in_source=[\"OXT\", \"HXT\"])" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "Now we can connect the two molecules for example using the `connect` function:" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "customdata": [ [ "O1", 1, 1, "UNK", "A" ], [ "O2", 2, 1, "UNK", "A" ], [ "O", 17, 2, "SER", "A" ], [ "OG", 19, 2, "SER", "A" ] ], "hovertemplate": "atom_element=O
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]}", "legendgroup": "O", "marker": { "color": "red", "opacity": 1, "symbol": "circle" }, "mode": "markers", "name": "O", "scene": "scene", "showlegend": true, "type": "scatter3d", "x": [ 1.4126, -1.4128, 0.24036153842376318, 0.7145795858491959 ], "y": [ -1.2387, -1.2388, 2.4061365953058824, 3.5235548977794493 ], "z": [ 0.0021, -0.0045, -1.0130051085485123, 3.240567458223224 ] }, { "customdata": [ [ "N1", 3, 1, "UNK", "A" ], [ "N", 14, 2, "SER", "A" ] ], "hovertemplate": "atom_element=N
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]}", "legendgroup": "N", "marker": { "color": "blue", "opacity": 1, "symbol": "circle" }, "mode": "markers", "name": "N", "scene": "scene", "showlegend": true, "type": "scatter3d", "x": [ -0.0001, -0.9349590090177038 ], "y": [ 0.6228, 3.8378492809411178 ], "z": [ 0.0038, 0.9445327318400285 ] }, { "customdata": [ [ "C1", 4, 1, "UNK", "A" ], [ "C2", 5, 1, "UNK", "A" ], [ "C3", 6, 1, "UNK", "A" ], [ "C4", 7, 1, "UNK", "A" ], [ "CA", 15, 2, "SER", "A" ], [ "C", 16, 2, "SER", "A" ], [ "CB", 18, 2, "SER", "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]}", "legendgroup": "C", "marker": { "color": "darkslategray", "opacity": 1, "symbol": "circle" }, "mode": "markers", "name": "C", "scene": "scene", "showlegend": true, "type": "scatter3d", "x": [ 1.2341, -1.2342, 2.381, -2.3805, -0.3009730477857126, -0.00021594680465866723, 0.9994056236128839 ], "y": [ -0.0239, -0.024, 0.9511, 0.9515, 2.55446531365818, 1.8024427905977491, 2.809581300583055 ], "z": [ 0.0049, -0.0009, -0.0062, 0.0007, 1.2745696895915128, 0.004031893609317564, 2.0367265921955418 ] }, { "customdata": [ [ "H2", 8, 1, "UNK", "A" ], [ "H3", 9, 1, "UNK", "A" ], [ "H4", 10, 1, "UNK", "A" ], [ "H5", 11, 1, "UNK", "A" ], [ "H6", 12, 1, "UNK", "A" ], [ "H7", 13, 1, "UNK", "A" ], [ "H", 20, 2, "SER", "A" ], [ "H2", 21, 2, "SER", "A" ], [ "HA", 22, 2, "SER", "A" ], [ "HB2", 23, 2, "SER", "A" ], [ "HB3", 24, 2, "SER", "A" ], [ "HG", 25, 2, "SER", "A" ] ], "hovertemplate": "atom_element=H
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]}", "legendgroup": "H", "marker": { "color": "lightgray", "opacity": 1, "symbol": "circle" }, "mode": "markers", "name": "H", "scene": "scene", "showlegend": true, "type": "scatter3d", "x": [ 3.3262, 2.3822, 2.2873, -2.3264, -2.3386, -3.3287, -0.2789758322250007, -1.0223117191561606, -0.976392069137388, 1.6742381863939781, 1.4698493880062249, 1.5594941337658028 ], "y": [ 0.4099, 1.5068, 1.6495, 1.5897, 1.5714, 0.4071, 4.346753581722776, 4.348977138643939, 1.9653386394669528, 3.3989250255078125, 1.8577255373834802, 3.6628744936096105 ], "z": [ 0.091, -0.948, 0.8303, -0.8857, 0.9008, -0.0116, 0.37277099439086503, 1.8102924081426335, 1.894410723529029, 1.4156171122307677, 2.281516850594804, 3.6897249550287374 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 1.4126, 1.2341 ], "y": [ -1.2387, -0.0239 ], "z": [ 0.0021, 0.0049 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ -1.4128, -1.2342 ], "y": [ -1.2388, -0.024 ], "z": [ -0.0045, -0.0009 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ -0.0001, 1.2341 ], "y": [ 0.6228, -0.0239 ], "z": [ 0.0038, 0.0049 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ -0.0001, -1.2342 ], "y": [ 0.6228, -0.024 ], "z": [ 0.0038, -0.0009 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ -0.0001, -0.00021594680465866723 ], "y": [ 0.6228, 1.8024427905977491 ], "z": [ 0.0038, 0.004031893609317564 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 1.2341, 2.381 ], "y": [ -0.0239, 0.9511 ], "z": [ 0.0049, -0.0062 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ -1.2342, -2.3805 ], "y": [ -0.024, 0.9515 ], "z": [ -0.0009, 0.0007 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 2.381, 3.3262 ], "y": [ 0.9511, 0.4099 ], "z": [ -0.0062, 0.091 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 2.381, 2.3822 ], "y": [ 0.9511, 1.5068 ], "z": [ -0.0062, -0.948 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 2.381, 2.2873 ], "y": [ 0.9511, 1.6495 ], "z": [ -0.0062, 0.8303 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ -2.3805, -2.3264 ], "y": [ 0.9515, 1.5897 ], "z": [ 0.0007, -0.8857 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ -2.3805, -2.3386 ], "y": [ 0.9515, 1.5714 ], "z": [ 0.0007, 0.9008 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ -2.3805, -3.3287 ], "y": [ 0.9515, 0.4071 ], "z": [ 0.0007, -0.0116 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ -0.9349590090177038, -0.3009730477857126 ], "y": [ 3.8378492809411178, 2.55446531365818 ], "z": [ 0.9445327318400285, 1.2745696895915128 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ -0.9349590090177038, -0.2789758322250007 ], "y": [ 3.8378492809411178, 4.346753581722776 ], "z": [ 0.9445327318400285, 0.37277099439086503 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ -0.9349590090177038, -1.0223117191561606 ], "y": [ 3.8378492809411178, 4.348977138643939 ], "z": [ 0.9445327318400285, 1.8102924081426335 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ -0.3009730477857126, -0.00021594680465866723 ], "y": [ 2.55446531365818, 1.8024427905977491 ], "z": [ 1.2745696895915128, 0.004031893609317564 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ -0.3009730477857126, 0.9994056236128839 ], "y": [ 2.55446531365818, 2.809581300583055 ], "z": [ 1.2745696895915128, 2.0367265921955418 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ -0.3009730477857126, -0.976392069137388 ], "y": [ 2.55446531365818, 1.9653386394669528 ], "z": [ 1.2745696895915128, 1.894410723529029 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 5.76 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ -0.00021594680465866723, 0.24036153842376318 ], "y": [ 1.8024427905977491, 2.4061365953058824 ], "z": [ 0.004031893609317564, -1.0130051085485123 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 0.9994056236128839, 0.7145795858491959 ], "y": [ 2.809581300583055, 3.5235548977794493 ], "z": [ 2.0367265921955418, 3.240567458223224 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 0.9994056236128839, 1.6742381863939781 ], "y": [ 2.809581300583055, 3.3989250255078125 ], "z": [ 2.0367265921955418, 1.4156171122307677 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 0.9994056236128839, 1.4698493880062249 ], "y": [ 2.809581300583055, 1.8577255373834802 ], "z": [ 2.0367265921955418, 2.281516850594804 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 0.7145795858491959, 1.5594941337658028 ], "y": [ 3.5235548977794493, 3.6628744936096105 ], "z": [ 3.240567458223224, 3.6897249550287374 ] } ], "layout": { "scene": { "xaxis": { "showgrid": false, "showline": false, "showticklabels": false }, "yaxis": { "showgrid": false, "showline": false, "showticklabels": false }, "zaxis": { "showgrid": false, "showline": false, "showticklabels": false } }, "template": { "data": { "bar": [ { "error_x": { "color": "rgb(36,36,36)" }, "error_y": { "color": "rgb(36,36,36)" }, "marker": { "line": { "color": "white", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "white", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "rgb(36,36,36)", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "rgb(36,36,36)" }, "baxis": { "endlinecolor": "rgb(36,36,36)", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "rgb(36,36,36)" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "colorscale": [ [ 0, "#440154" ], [ 0.1111111111111111, "#482878" ], [ 0.2222222222222222, "#3e4989" ], [ 0.3333333333333333, "#31688e" ], [ 0.4444444444444444, "#26828e" ], [ 0.5555555555555556, "#1f9e89" ], [ 0.6666666666666666, "#35b779" ], [ 0.7777777777777778, "#6ece58" ], [ 0.8888888888888888, "#b5de2b" ], [ 1, "#fde725" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "colorscale": [ [ 0, "#440154" ], [ 0.1111111111111111, "#482878" ], [ 0.2222222222222222, "#3e4989" ], [ 0.3333333333333333, "#31688e" ], [ 0.4444444444444444, "#26828e" ], [ 0.5555555555555556, "#1f9e89" ], [ 0.6666666666666666, "#35b779" ], [ 0.7777777777777778, "#6ece58" ], [ 0.8888888888888888, "#b5de2b" ], [ 1, "#fde725" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "colorscale": [ [ 0, "#440154" ], [ 0.1111111111111111, "#482878" ], [ 0.2222222222222222, "#3e4989" ], [ 0.3333333333333333, "#31688e" ], [ 0.4444444444444444, "#26828e" ], [ 0.5555555555555556, "#1f9e89" ], [ 0.6666666666666666, "#35b779" ], [ 0.7777777777777778, "#6ece58" ], [ 0.8888888888888888, "#b5de2b" ], [ 1, "#fde725" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "line": { "color": "white", "width": 0.6 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "colorscale": [ [ 0, "#440154" ], [ 0.1111111111111111, "#482878" ], [ 0.2222222222222222, "#3e4989" ], [ 0.3333333333333333, "#31688e" ], [ 0.4444444444444444, "#26828e" ], [ 0.5555555555555556, "#1f9e89" ], [ 0.6666666666666666, "#35b779" ], [ 0.7777777777777778, "#6ece58" ], [ 0.8888888888888888, "#b5de2b" ], [ 1, "#fde725" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "colorscale": [ [ 0, "#440154" ], [ 0.1111111111111111, "#482878" ], [ 0.2222222222222222, "#3e4989" ], [ 0.3333333333333333, "#31688e" ], [ 0.4444444444444444, "#26828e" ], [ 0.5555555555555556, "#1f9e89" ], [ 0.6666666666666666, "#35b779" ], [ 0.7777777777777778, "#6ece58" ], [ 0.8888888888888888, "#b5de2b" ], [ 1, "#fde725" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "marker": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "colorscale": [ [ 0, "#440154" ], [ 0.1111111111111111, "#482878" ], [ 0.2222222222222222, "#3e4989" ], [ 0.3333333333333333, "#31688e" ], [ 0.4444444444444444, "#26828e" ], [ 0.5555555555555556, "#1f9e89" ], [ 0.6666666666666666, "#35b779" ], [ 0.7777777777777778, "#6ece58" ], [ 0.8888888888888888, "#b5de2b" ], [ 1, "#fde725" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "rgb(237,237,237)" }, "line": { "color": "white" } }, "header": { "fill": { "color": "rgb(217,217,217)" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "colorscale": { "diverging": [ [ 0, "rgb(103,0,31)" ], [ 0.1, "rgb(178,24,43)" ], [ 0.2, "rgb(214,96,77)" ], [ 0.3, "rgb(244,165,130)" ], [ 0.4, "rgb(253,219,199)" ], [ 0.5, "rgb(247,247,247)" ], [ 0.6, "rgb(209,229,240)" ], [ 0.7, "rgb(146,197,222)" ], [ 0.8, "rgb(67,147,195)" ], [ 0.9, "rgb(33,102,172)" ], [ 1, "rgb(5,48,97)" ] ], "sequential": [ [ 0, "#440154" ], [ 0.1111111111111111, "#482878" ], [ 0.2222222222222222, "#3e4989" ], [ 0.3333333333333333, "#31688e" ], [ 0.4444444444444444, "#26828e" ], [ 0.5555555555555556, "#1f9e89" ], [ 0.6666666666666666, "#35b779" ], [ 0.7777777777777778, "#6ece58" ], [ 0.8888888888888888, "#b5de2b" ], [ 1, "#fde725" ] ], "sequentialminus": [ [ 0, "#440154" ], [ 0.1111111111111111, "#482878" ], [ 0.2222222222222222, "#3e4989" ], [ 0.3333333333333333, "#31688e" ], [ 0.4444444444444444, "#26828e" ], [ 0.5555555555555556, "#1f9e89" ], [ 0.6666666666666666, "#35b779" ], [ 0.7777777777777778, "#6ece58" ], [ 0.8888888888888888, "#b5de2b" ], [ 1, "#fde725" ] ] }, "colorway": [ "#1F77B4", "#FF7F0E", "#2CA02C", "#D62728", "#9467BD", "#8C564B", "#E377C2", "#7F7F7F", "#BCBD22", "#17BECF" ], "font": { "color": "rgb(36,36,36)" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "white", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "white", "polar": { "angularaxis": { "gridcolor": "rgb(232,232,232)", "linecolor": "rgb(36,36,36)", "showgrid": false, "showline": true, "ticks": "outside" }, "bgcolor": "white", "radialaxis": { "gridcolor": "rgb(232,232,232)", "linecolor": "rgb(36,36,36)", "showgrid": false, "showline": true, "ticks": "outside" } }, "scene": { "xaxis": { "backgroundcolor": "white", "gridcolor": "rgb(232,232,232)", "gridwidth": 2, "linecolor": "rgb(36,36,36)", "showbackground": true, "showgrid": false, "showline": true, "ticks": "outside", "zeroline": false, "zerolinecolor": "rgb(36,36,36)" }, "yaxis": { "backgroundcolor": "white", "gridcolor": "rgb(232,232,232)", "gridwidth": 2, "linecolor": "rgb(36,36,36)", "showbackground": true, "showgrid": false, "showline": true, "ticks": "outside", "zeroline": false, "zerolinecolor": "rgb(36,36,36)" }, "zaxis": { "backgroundcolor": "white", "gridcolor": "rgb(232,232,232)", "gridwidth": 2, "linecolor": "rgb(36,36,36)", "showbackground": true, "showgrid": false, "showline": true, "ticks": "outside", "zeroline": false, "zerolinecolor": "rgb(36,36,36)" } }, "shapedefaults": { "fillcolor": "black", "line": { "width": 0 }, "opacity": 0.3 }, "ternary": { "aaxis": { "gridcolor": "rgb(232,232,232)", "linecolor": "rgb(36,36,36)", "showgrid": false, "showline": true, "ticks": "outside" }, "baxis": { "gridcolor": "rgb(232,232,232)", "linecolor": "rgb(36,36,36)", "showgrid": false, "showline": true, "ticks": "outside" }, "bgcolor": "white", "caxis": { "gridcolor": "rgb(232,232,232)", "linecolor": "rgb(36,36,36)", "showgrid": false, "showline": true, "ticks": "outside" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "rgb(232,232,232)", "linecolor": "rgb(36,36,36)", "showgrid": false, "showline": true, "ticks": "outside", "title": { "standoff": 15 }, "zeroline": false, "zerolinecolor": "rgb(36,36,36)" }, "yaxis": { "automargin": true, "gridcolor": "rgb(232,232,232)", "linecolor": "rgb(36,36,36)", "showgrid": false, "showline": true, "ticks": "outside", "title": { "standoff": 15 }, "zeroline": false, "zerolinecolor": "rgb(36,36,36)" } } } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# connect the two molecules\n", "new = bb.connect(tri, ser, link)\n", "\n", "# and check what it looks like\n", "new.show()" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "### Optimization \n", "\n", "If we observe a clash in the resulting conformation, we can apply an optimization. This is where the `optimizers` module comes into play. Biobuild uses a rotational optimization system to find conformations without the need for molecular dynamics. This can be efficient or very expensive (up to unsolvable, in fact!) depending on the pre-processing / pre-thinking that the user provided. But don't worry, just don't try to optimize around 100 bonds at once (that won't work, trust me!).\n", "\n", "In general the workflow of optimization works like this:\n", "- decide on how \"detailed\" (=computationally expensive) your structure should be represented during optimization\n", "- decide on which bonds to rotate around\n", "- choose an optimization algorithm\n", "- run and check out the structure" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "For this example we will choose:\n", "- full details (since it is a small structure)\n", "- only bonds that are relatively \"central\" \n", "- a genetic algorithm" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "customdata": [ [ "O1", 1, 1, "UNK", "A" ], [ "O2", 2, 1, "UNK", "A" ], [ "O", 17, 2, "SER", "A" ], [ "OG", 19, 2, "SER", "A" ] ], "hovertemplate": "atom_element=O
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]}", "legendgroup": "O", "marker": { "color": "red", "opacity": 1, "symbol": "circle" }, "mode": "markers", "name": "O", "scene": "scene", "showlegend": true, "type": "scatter3d", "x": [ 1.4126, -1.4128, 0.35500316185676195, 0.3401381039658491 ], "y": [ -1.2387, -1.2388, 2.406141149094607, 3.5235062016016747 ], "z": [ 0.0021, -0.0045, -0.9788494200750885, 3.3010641736192716 ] }, { "customdata": [ [ "N1", 3, 1, "UNK", "A" ], [ "N", 14, 2, "SER", "A" ] ], "hovertemplate": "atom_element=N
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]}", "legendgroup": "N", "marker": { "color": "blue", "opacity": 1, "symbol": "circle" }, "mode": "markers", "name": "N", "scene": "scene", "showlegend": true, "type": "scatter3d", "x": [ -0.0001, -1.036252274662634 ], "y": [ 0.6228, 3.8378615255482194 ], "z": [ 0.0038, 0.8315977826907782 ] }, { "customdata": [ [ "C1", 4, 1, "UNK", "A" ], [ "C2", 5, 1, "UNK", "A" ], [ "C3", 6, 1, "UNK", "A" ], [ "C4", 7, 1, "UNK", "A" ], [ "CA", 15, 2, "SER", "A" ], [ "C", 16, 2, "SER", "A" ], [ "CB", 18, 2, "SER", "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]}", "legendgroup": "C", "marker": { "color": "darkslategray", "opacity": 1, "symbol": "circle" }, "mode": "markers", "name": "C", "scene": "scene", "showlegend": true, "type": "scatter3d", "x": [ 1.2341, -1.2342, 2.381, -2.3805, -0.4441553166964094, -0.00021594680465866723, 0.760630956039896 ], "y": [ -0.0239, -0.024, 0.9511, 0.9515, 2.5544596293012765, 1.8024427905977491, 2.8095379936615825 ], "z": [ 0.0049, -0.0009, -0.0062, 0.0007, 1.2318948787043433, 0.004031893609317564, 2.1376415679400425 ] }, { "customdata": [ [ "H2", 8, 1, "UNK", "A" ], [ "H3", 9, 1, "UNK", "A" ], [ "H4", 10, 1, "UNK", "A" ], [ "H5", 11, 1, "UNK", "A" ], [ "H6", 12, 1, "UNK", "A" ], [ "H7", 13, 1, "UNK", "A" ], [ "H", 20, 2, "SER", "A" ], [ "H2", 21, 2, "SER", "A" ], [ "HA", 22, 2, "SER", "A" ], [ "HB2", 23, 2, "SER", "A" ], [ "HB3", 24, 2, "SER", "A" ], [ "HG", 25, 2, "SER", "A" ] ], "hovertemplate": "atom_element=H
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]}", "legendgroup": "H", "marker": { "color": "lightgray", "opacity": 1, "symbol": "circle" }, "mode": "markers", "name": "H", "scene": "scene", "showlegend": true, "type": "scatter3d", "x": [ 3.3262, 2.3822, 2.2873, -2.3264, -2.3386, -3.3287, -0.31922592780570125, -1.221941180860052, -1.1859853894589698, 1.5020233448538767, 1.200004019341319, 1.1282029587287994 ], "y": [ 0.4099, 1.5068, 1.6495, 1.5897, 1.5714, 0.4071, 4.346756355120094, 4.348982793098109, 1.9653423973467525, 3.398872302511417, 1.8576689275317868, 3.6628018102416946 ], "z": [ 0.091, -0.948, 0.8303, -0.8857, 0.9008, -0.0116, 0.3385376744402578, 1.6817134689202464, 1.7704977288261503, 1.5977115741249306, 2.4345684818268007, 3.8438196600964285 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 1.4126, 1.2341 ], "y": [ -1.2387, -0.0239 ], "z": [ 0.0021, 0.0049 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ -1.4128, -1.2342 ], "y": [ -1.2388, -0.024 ], "z": [ -0.0045, -0.0009 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ -0.0001, 1.2341 ], "y": [ 0.6228, -0.0239 ], "z": [ 0.0038, 0.0049 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ -0.0001, -1.2342 ], "y": [ 0.6228, -0.024 ], "z": [ 0.0038, -0.0009 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ -0.0001, -0.00021594680465866723 ], "y": [ 0.6228, 1.8024427905977491 ], "z": [ 0.0038, 0.004031893609317564 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 1.2341, 2.381 ], "y": [ -0.0239, 0.9511 ], "z": [ 0.0049, -0.0062 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ -1.2342, -2.3805 ], "y": [ -0.024, 0.9515 ], "z": [ -0.0009, 0.0007 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 2.381, 3.3262 ], "y": [ 0.9511, 0.4099 ], "z": [ -0.0062, 0.091 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 2.381, 2.3822 ], "y": [ 0.9511, 1.5068 ], "z": [ -0.0062, -0.948 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 2.381, 2.2873 ], "y": [ 0.9511, 1.6495 ], "z": [ -0.0062, 0.8303 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ -2.3805, -2.3264 ], "y": [ 0.9515, 1.5897 ], "z": [ 0.0007, -0.8857 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ -2.3805, -2.3386 ], "y": [ 0.9515, 1.5714 ], "z": [ 0.0007, 0.9008 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ -2.3805, -3.3287 ], "y": [ 0.9515, 0.4071 ], "z": [ 0.0007, -0.0116 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ -1.036252274662634, -0.4441553166964094 ], "y": [ 3.8378615255482194, 2.5544596293012765 ], "z": [ 0.8315977826907782, 1.2318948787043433 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ -1.036252274662634, -0.31922592780570125 ], "y": [ 3.8378615255482194, 4.346756355120094 ], "z": [ 0.8315977826907782, 0.3385376744402578 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ -1.036252274662634, -1.221941180860052 ], "y": [ 3.8378615255482194, 4.348982793098109 ], "z": [ 0.8315977826907782, 1.6817134689202464 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ -0.4441553166964094, -0.00021594680465866723 ], "y": [ 2.5544596293012765, 1.8024427905977491 ], "z": [ 1.2318948787043433, 0.004031893609317564 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ -0.4441553166964094, 0.760630956039896 ], "y": [ 2.5544596293012765, 2.8095379936615825 ], "z": [ 1.2318948787043433, 2.1376415679400425 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ -0.4441553166964094, -1.1859853894589698 ], "y": [ 2.5544596293012765, 1.9653423973467525 ], "z": [ 1.2318948787043433, 1.7704977288261503 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 5.76 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ -0.00021594680465866723, 0.35500316185676195 ], "y": [ 1.8024427905977491, 2.406141149094607 ], "z": [ 0.004031893609317564, -0.9788494200750885 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 0.760630956039896, 0.3401381039658491 ], "y": [ 2.8095379936615825, 3.5235062016016747 ], "z": [ 2.1376415679400425, 3.3010641736192716 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 0.760630956039896, 1.5020233448538767 ], "y": [ 2.8095379936615825, 3.398872302511417 ], "z": [ 2.1376415679400425, 1.5977115741249306 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 0.760630956039896, 1.200004019341319 ], "y": [ 2.8095379936615825, 1.8576689275317868 ], "z": [ 2.1376415679400425, 2.4345684818268007 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 0.3401381039658491, 1.1282029587287994 ], "y": [ 3.5235062016016747, 3.6628018102416946 ], "z": [ 3.3010641736192716, 3.8438196600964285 ] } ], "layout": { "scene": { "xaxis": { "showgrid": false, "showline": false, "showticklabels": false }, "yaxis": { "showgrid": false, "showline": false, "showticklabels": false }, "zaxis": { "showgrid": false, "showline": false, "showticklabels": false } }, "template": { "data": { "bar": [ { "error_x": { "color": "rgb(36,36,36)" }, "error_y": { "color": "rgb(36,36,36)" }, "marker": { "line": { "color": "white", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "white", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "rgb(36,36,36)", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "rgb(36,36,36)" }, "baxis": { "endlinecolor": "rgb(36,36,36)", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "rgb(36,36,36)" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "colorscale": [ [ 0, "#440154" ], [ 0.1111111111111111, "#482878" ], [ 0.2222222222222222, "#3e4989" ], [ 0.3333333333333333, "#31688e" ], [ 0.4444444444444444, "#26828e" ], [ 0.5555555555555556, "#1f9e89" ], [ 0.6666666666666666, "#35b779" ], [ 0.7777777777777778, "#6ece58" ], [ 0.8888888888888888, "#b5de2b" ], [ 1, "#fde725" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "colorscale": [ [ 0, "#440154" ], [ 0.1111111111111111, "#482878" ], [ 0.2222222222222222, "#3e4989" ], [ 0.3333333333333333, "#31688e" ], [ 0.4444444444444444, "#26828e" ], [ 0.5555555555555556, "#1f9e89" ], [ 0.6666666666666666, "#35b779" ], [ 0.7777777777777778, "#6ece58" ], [ 0.8888888888888888, "#b5de2b" ], [ 1, "#fde725" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "colorscale": [ [ 0, "#440154" ], [ 0.1111111111111111, "#482878" ], [ 0.2222222222222222, "#3e4989" ], [ 0.3333333333333333, "#31688e" ], [ 0.4444444444444444, "#26828e" ], [ 0.5555555555555556, "#1f9e89" ], [ 0.6666666666666666, "#35b779" ], [ 0.7777777777777778, "#6ece58" ], [ 0.8888888888888888, "#b5de2b" ], [ 1, "#fde725" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "line": { "color": "white", "width": 0.6 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "colorscale": [ [ 0, "#440154" ], [ 0.1111111111111111, "#482878" ], [ 0.2222222222222222, "#3e4989" ], [ 0.3333333333333333, "#31688e" ], [ 0.4444444444444444, "#26828e" ], [ 0.5555555555555556, "#1f9e89" ], [ 0.6666666666666666, "#35b779" ], [ 0.7777777777777778, "#6ece58" ], [ 0.8888888888888888, "#b5de2b" ], [ 1, "#fde725" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "colorscale": [ [ 0, "#440154" ], [ 0.1111111111111111, "#482878" ], [ 0.2222222222222222, "#3e4989" ], [ 0.3333333333333333, "#31688e" ], [ 0.4444444444444444, "#26828e" ], [ 0.5555555555555556, "#1f9e89" ], [ 0.6666666666666666, "#35b779" ], [ 0.7777777777777778, "#6ece58" ], [ 0.8888888888888888, "#b5de2b" ], [ 1, "#fde725" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "marker": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" }, "colorscale": [ [ 0, "#440154" ], [ 0.1111111111111111, "#482878" ], [ 0.2222222222222222, "#3e4989" ], [ 0.3333333333333333, "#31688e" ], [ 0.4444444444444444, "#26828e" ], [ 0.5555555555555556, "#1f9e89" ], [ 0.6666666666666666, "#35b779" ], [ 0.7777777777777778, "#6ece58" ], [ 0.8888888888888888, "#b5de2b" ], [ 1, "#fde725" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "rgb(237,237,237)" }, "line": { "color": "white" } }, "header": { "fill": { "color": "rgb(217,217,217)" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 1, "tickcolor": "rgb(36,36,36)", "ticks": "outside" } }, "colorscale": { "diverging": [ [ 0, "rgb(103,0,31)" ], [ 0.1, "rgb(178,24,43)" ], [ 0.2, "rgb(214,96,77)" ], [ 0.3, "rgb(244,165,130)" ], [ 0.4, "rgb(253,219,199)" ], [ 0.5, "rgb(247,247,247)" ], [ 0.6, "rgb(209,229,240)" ], [ 0.7, "rgb(146,197,222)" ], [ 0.8, "rgb(67,147,195)" ], [ 0.9, "rgb(33,102,172)" ], [ 1, "rgb(5,48,97)" ] ], "sequential": [ [ 0, "#440154" ], [ 0.1111111111111111, "#482878" ], [ 0.2222222222222222, "#3e4989" ], [ 0.3333333333333333, "#31688e" ], [ 0.4444444444444444, "#26828e" ], [ 0.5555555555555556, "#1f9e89" ], [ 0.6666666666666666, "#35b779" ], [ 0.7777777777777778, "#6ece58" ], [ 0.8888888888888888, "#b5de2b" ], [ 1, "#fde725" ] ], "sequentialminus": [ [ 0, "#440154" ], [ 0.1111111111111111, "#482878" ], [ 0.2222222222222222, "#3e4989" ], [ 0.3333333333333333, "#31688e" ], [ 0.4444444444444444, "#26828e" ], [ 0.5555555555555556, "#1f9e89" ], [ 0.6666666666666666, "#35b779" ], [ 0.7777777777777778, "#6ece58" ], [ 0.8888888888888888, "#b5de2b" ], [ 1, "#fde725" ] ] }, "colorway": [ "#1F77B4", "#FF7F0E", "#2CA02C", "#D62728", "#9467BD", "#8C564B", "#E377C2", "#7F7F7F", "#BCBD22", "#17BECF" ], "font": { "color": "rgb(36,36,36)" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "white", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "white", "polar": { "angularaxis": { "gridcolor": "rgb(232,232,232)", "linecolor": "rgb(36,36,36)", "showgrid": false, "showline": true, "ticks": "outside" }, "bgcolor": "white", "radialaxis": { "gridcolor": "rgb(232,232,232)", "linecolor": "rgb(36,36,36)", "showgrid": false, "showline": true, "ticks": "outside" } }, "scene": { "xaxis": { "backgroundcolor": "white", "gridcolor": "rgb(232,232,232)", "gridwidth": 2, "linecolor": "rgb(36,36,36)", "showbackground": true, "showgrid": false, "showline": true, "ticks": "outside", "zeroline": false, "zerolinecolor": "rgb(36,36,36)" }, "yaxis": { "backgroundcolor": "white", "gridcolor": "rgb(232,232,232)", "gridwidth": 2, "linecolor": "rgb(36,36,36)", "showbackground": true, "showgrid": false, "showline": true, "ticks": "outside", "zeroline": false, "zerolinecolor": "rgb(36,36,36)" }, "zaxis": { "backgroundcolor": "white", "gridcolor": "rgb(232,232,232)", "gridwidth": 2, "linecolor": "rgb(36,36,36)", "showbackground": true, "showgrid": false, "showline": true, "ticks": "outside", "zeroline": false, "zerolinecolor": "rgb(36,36,36)" } }, "shapedefaults": { "fillcolor": "black", "line": { "width": 0 }, "opacity": 0.3 }, "ternary": { "aaxis": { "gridcolor": "rgb(232,232,232)", "linecolor": "rgb(36,36,36)", "showgrid": false, "showline": true, "ticks": "outside" }, "baxis": { "gridcolor": "rgb(232,232,232)", "linecolor": "rgb(36,36,36)", "showgrid": false, "showline": true, "ticks": "outside" }, "bgcolor": "white", "caxis": { "gridcolor": "rgb(232,232,232)", "linecolor": "rgb(36,36,36)", "showgrid": false, "showline": true, "ticks": "outside" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "rgb(232,232,232)", "linecolor": "rgb(36,36,36)", "showgrid": false, "showline": true, "ticks": "outside", "title": { "standoff": 15 }, "zeroline": false, "zerolinecolor": "rgb(36,36,36)" }, "yaxis": { "automargin": true, "gridcolor": "rgb(232,232,232)", "linecolor": "rgb(36,36,36)", "showgrid": false, "showline": true, "ticks": "outside", "title": { "standoff": 15 }, "zeroline": false, "zerolinecolor": "rgb(36,36,36)" } } } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "from biobuild import optimizers\n", "\n", "# step (1)\n", "# make a graph representation of the molecule\n", "graph = new.get_atom_graph() \n", "\n", "# step (2)\n", "# get edges/bonds to rotate around\n", "# we choose only edges/bonds that have at least 10 atoms before and after them\n", "rotatable_edges = graph.find_rotatable_edges(min_descendants=10, min_ancestors=10)\n", "\n", "# step (3)\n", "# make an environment\n", "# we use the DistanceRotatron environment\n", "env = optimizers.DistanceRotatron(graph, rotatable_edges)\n", "\n", "# step (4) and (5)\n", "# run the optimization algorithm\n", "new_optimized = optimizers.optimize(new, env, algorithm=\"genetic\")\n", "\n", "# and check what it looks like\n", "new.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Formats and Integrations\n", "\n", "Now that we have a structure we like we can for instance save it as a _PDB_ or _mmCIF_ file. If we have more intricate interests in the molecules we have built we can export them directly to `rdkit` or `openbabel` objects for further analysis. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "To make working with different data formats as easy as possible, each biobuild Molecule can be created and saved to the following formats:\n", "\n", "```mermaid\n", "flowchart TB\n", "\n", " node_1(\"Molecule\")\n", " node_2([\"PDB\"])\n", " node_3([\"mmCIF\"])\n", " node_9([\"Molfile\"])\n", " node_11((\"SMILES\"))\n", " node_4([\"JSON\\n(biobuild)\"])\n", " node_5([\"pickle\\n(biobuild)\"])\n", " node_6{{\"rdkit\\n(Chem.rdchem.Mol)\"}}\n", " node_7{{\"openbabel\\n(pybel.Molecule)\"}}\n", " node_8{{\"biopython\\n(PDB.Structure)\"}}\n", " node_10{{\"openmm\\n(openmm.PDBFile)\"}}\n", " node_2 <--> node_1\n", " node_3 <--> node_1\n", " node_9 <-.-> node_1\n", " node_11 <-.-> node_1\n", " node_4 <--> node_1\n", " node_5 <--> node_1\n", " node_6 <--> node_1\n", " node_7 <--> node_1\n", " node_8 <--> node_1\n", " node_10 <--> node_1\n", " \n", "```\n", "\n", "Here are is a table with the corresponding methods available in the `Molecule` class:\n", "\n", "| Format | As input | As output |\n", "| --------- | ------------- | -------------- |\n", "| PDB | `from_pdb` | `to_pdb` |\n", "| mmCIF | `from_cif` | `to_cif` |\n", "| Molfile | `from_molfile` | `to_molfile` |\n", "| SMILES | `from_smiles` | `to_smiles` |\n", "| JSON | `from_json` | `to_json` |\n", "| pickle | `load` | `save` |\n", "| rdkit | `from_rdkit` | `to_rdkit` |\n", "| openbabel | `from_pybel` | `to_pybel` |\n", "| openmm | `from_openmm` | `to_openmm` | \n", "| biopython | `` | `to_biopython` |" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [], "source": [ "# so let's save our small molecule to a PDB file\n", "new.to_pdb(\"our_first_molecule.pdb\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "With that we have reached already the end of this first little introduction into what biobuild can do, and how it feels to work with biobuild. Thanks a lot for reading this far! And good luck with whatever you may do with biobuild in your projects!" ] } ], "metadata": { "kernelspec": { "display_name": "glyco2", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.2" }, "orig_nbformat": 4 }, "nbformat": 4, "nbformat_minor": 2 }