{ "cells": [ { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "# Adding Resources\n", "\n", "> ### In this tutorial we will cover:\n", "> - how we can set custom default resources" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "If you checked out the tutorial on _built-in_ data resources you know that BuildAMol comes with a variety of molecular structures for the user to work with directly, such as compounds containing amino acids or sugars. These can be easily loaded using functions such as `load_sugars()`. However, what if we are working on a drug discovery project and would like to engineer small variations of a promising compound? We may have a structure of the compound itself but we don't want to keep re-loading them every time we open a new notebook to use buildamol. But we would like for it to be available by default. \n", "\n", "Luckily, BuildAMol allows us to set our own _defaults_ that can be loaded in every future session. We can add _custom linkages_ and _custom structures_ to the default CHARMM topology and PDBE Compounds, respecitively using functions `add_linkage` and `add_compound`. Here's how:" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Adding custom linkages\n", "\n", "You may know that you can refer to any registered linkage directly via its string identifier. For example, we can refer to a beta 1->4 glycosydic linkage by its id `14bb`. We do not need to get the linkage object first because BuildAMol will be able to interpret the id and search the linkage object automatically. To make a custom linkage available in such a way, we simply need to define it, give it an id (which is otherwise optional when creating a `Linkage` object). Then we call `add_linkage` with our new linkage and that's it!" ] }, { "cell_type": "code", "execution_count": 11, "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": 12, "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),\n", " Linkage(my_14_glyco_link)]" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import buildamol as bam\n", "\n", "# define a custom link\n", "my_link = bam.linkage(atom1=\"C1\", atom2=\"O4\", delete_in_target=[\"O1\", \"HO1\"], delete_in_source=[\"HO4\"], id=\"my_14_glyco_link\")\n", "\n", "# now add the link to the default CHARMM topology\n", "bam.add_linkage(my_link)\n", "\n", "# now we find it at the bottom of the list of 'out-of-the-box' available linkages\n", "bam.available_linkages()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "So, now with our custom linkage added to the default resources, we can for instance make a glucose polymer using:" ] }, { "cell_type": "code", "execution_count": 13, "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, "GLC", "A" ], [ "C2", 2, 1, "GLC", "A" ], [ "C3", 3, 1, "GLC", "A" ], [ "C4", 4, 1, "GLC", "A" ], [ "C5", 5, 1, "GLC", "A" ], [ "C6", 6, 1, "GLC", "A" ], [ "C1", 23, 2, "GLC", "A" ], [ "C2", 24, 2, "GLC", "A" ], [ "C3", 25, 2, "GLC", "A" ], [ "C4", 26, 2, "GLC", "A" ], [ "C5", 27, 2, "GLC", "A" ], [ "C6", 28, 2, "GLC", "A" ], [ "C1", 44, 3, "GLC", "A" ], [ "C2", 45, 3, "GLC", "A" ], [ "C3", 46, 3, "GLC", "A" ], [ "C4", 47, 3, "GLC", "A" ], [ "C5", 48, 3, "GLC", "A" ], [ "C6", 49, 3, "GLC", "A" ], [ "C1", 65, 4, "GLC", "A" ], [ "C2", 66, 4, "GLC", "A" ], [ "C3", 67, 4, "GLC", "A" ], [ "C4", 68, 4, "GLC", "A" ], [ "C5", 69, 4, "GLC", "A" ], [ "C6", 70, 4, "GLC", "A" ], [ "C1", 86, 5, "GLC", "A" ], [ "C2", 87, 5, "GLC", "A" ], [ "C3", 88, 5, "GLC", "A" ], [ "C4", 89, 5, "GLC", "A" ], [ "C5", 90, 5, "GLC", "A" ], [ "C6", 91, 5, "GLC", "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]}", "legendgroup": "C", "marker": { "color": "darkslategray", "opacity": 1, "size": [ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 ], "sizemode": "area", "sizeref": 0.0125, "symbol": "circle" }, "mode": "markers", "name": "C", "scene": "scene", "showlegend": true, "type": "scatter3d", "x": [ 8.00008872620539, 8.869329133567875, 10.2185745406163, 10.875138023496648, 9.928417969313866, 10.551911519131092, 4.279421777812658, 4.812962796533892, 6.286435627215825, 6.408932370490664, 5.813116823665707, 5.877799080086633, 3.12434093467413, 4.228261613535333, 5.058002102072048, 4.130010853019524, 3.0296989575155333, 2.06463280801794, 1.8948246970937017, 0.9917058174980087, 1.596245331307629, 3.0187120743880382, 3.8430339677713246, 5.247656818667664, 0.6746277818998989, 0.30286555903404166, 0.41961586392428973, 1.8419722397508378, 2.1545844264871477, 3.594148057016401 ], "y": [ 4.653673895218352, 5.740008918186926, 5.794325294450755, 4.411759050387242, 3.376897710859161, 1.9848263017233854, 5.311486741288491, 6.590650092497606, 6.390200674824091, 5.173760659591837, 3.9499252492067383, 2.7440857155314995, 4.418818569786122, 5.478069371030477, 5.281130832923053, 5.350818090281997, 4.297524259757008, 4.400812939884572, -0.10812378411966989, 1.1237068078103774, 2.1101276982522164, 2.465712914652844, 1.1824664662161186, 1.5238461511492376, -4.53291084572971, -3.9994455787413505, -2.4716830099227023, -2.0799027056243444, -2.6880516468592615, -2.350903258726991 ], "z": [ 16.12226664493348, 16.760505105134815, 16.03643496845723, 16.09940300577887, 15.487798438302226, 15.60096638960935, 12.742624760495964, 13.392337083193768, 13.761645691537147, 14.684574853081418, 13.985641578405492, 14.924354114132047, 8.002715485076195, 8.051683585364204, 9.324647423770845, 10.541407847126123, 10.39593331605483, 11.578047005871252, 6.3200149488783754, 6.420118305980362, 7.424706183242854, 6.981222791549849, 6.858548553571687, 6.358640004480151, 8.281334410649556, 6.895600432366971, 6.896978701091941, 7.309217143391371, 8.678050765852038, 9.069715824336015 ] }, { "customdata": [ [ "O2", 7, 1, "GLC", "A" ], [ "O3", 8, 1, "GLC", "A" ], [ "O4", 9, 1, "GLC", "A" ], [ "O5", 10, 1, "GLC", "A" ], [ "O6", 11, 1, "GLC", "A" ], [ "O2", 29, 2, "GLC", "A" ], [ "O3", 30, 2, "GLC", "A" ], [ "O4", 31, 2, "GLC", "A" ], [ "O5", 32, 2, "GLC", "A" ], [ "O6", 33, 2, "GLC", "A" ], [ "O2", 50, 3, "GLC", "A" ], [ "O3", 51, 3, "GLC", "A" ], [ "O4", 52, 3, "GLC", "A" ], [ "O5", 53, 3, "GLC", "A" ], [ "O6", 54, 3, "GLC", "A" ], [ "O2", 71, 4, "GLC", "A" ], [ "O3", 72, 4, "GLC", "A" ], [ "O4", 73, 4, "GLC", "A" ], [ "O5", 74, 4, "GLC", "A" ], [ "O6", 75, 4, "GLC", "A" ], [ "O1", 92, 5, "GLC", "A" ], [ "O2", 93, 5, "GLC", "A" ], [ "O3", 94, 5, "GLC", "A" ], [ "O4", 95, 5, "GLC", "A" ], [ "O5", 96, 5, "GLC", "A" ], [ "O6", 97, 5, "GLC", "A" ] ], "hovertemplate": "atom_element=O
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]}", "legendgroup": "O", "marker": { "color": "red", "opacity": 1, "size": [ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 ], "sizemode": "area", "sizeref": 0.0125, "symbol": "circle" }, "mode": "markers", "name": "O", "scene": "scene", "showlegend": true, "type": "scatter3d", "x": [ 8.214204425734204, 11.064046819238435, 12.101016926204586, 8.682985026086307, 9.72400225349688, 4.6945201934631315, 6.772774325919608, 7.786951976022726, 4.451857630044419, 5.430390966373112, 5.071340018724094, 6.0448285257957695, 4.8817237427804185, 2.316913889323759, 1.10552780560133, -0.3081007561085695, 0.7989314709575854, 3.6184712124039584, 3.2099326073320396, 6.053255601630695, -0.24712076709293407, -1.0397224949614254, 0.14586986766737442, 1.9420450814805592, 1.9974347508774162, 3.8495724064403465 ], "y": [ 7.004526694524948, 6.754861682405801, 4.431856905739039, 3.399621242097724, 1.0347251668057145, 7.678176724562481, 7.552784147380224, 4.933968200731953, 4.214097636533385, 1.5761781745917136, 5.34231524071908, 6.310616629708775, 5.096662093965195, 4.5193667044800305, 3.343776684758924, 0.7280907425762873, 3.2951419367485717, 3.3291169052943403, 0.29706662536503947, 0.34336408390085615, -4.028999323913058, -4.375654817872916, -1.970203780138926, -0.6562943253271833, -4.1065563625427295, -2.817083246739686 ], "z": [ 16.645455504913915, 16.672487225347943, 15.365193912872881, 16.18719419540373, 14.926866188374271, 12.473268438136474, 14.435359532483309, 14.977504099561163, 13.642188004314814, 14.232722018578858, 6.906162036545602, 9.416018117415575, 11.729927287818423, 9.177944245380484, 11.505047350465379, 6.862182554860344, 7.469959499746867, 7.949245789887564, 5.933333016936675, 6.355527161170869, 9.248680672651965, 6.583584526264871, 5.587170428240994, 7.383853635108437, 8.615422089995675, 10.396355044507732 ] }, { "customdata": [ [ "H1", 12, 1, "GLC", "A" ], [ "H2", 13, 1, "GLC", "A" ], [ "H3", 14, 1, "GLC", "A" ], [ "H4", 15, 1, "GLC", "A" ], [ "H5", 16, 1, "GLC", "A" ], [ "H61", 17, 1, "GLC", "A" ], [ "H62", 18, 1, "GLC", "A" ], [ "HO2", 19, 1, "GLC", "A" ], [ "HO3", 20, 1, "GLC", "A" ], [ "HO4", 21, 1, "GLC", "A" ], [ "HO6", 22, 1, "GLC", "A" ], [ "H1", 34, 2, "GLC", "A" ], [ "H2", 35, 2, "GLC", "A" ], [ "H3", 36, 2, "GLC", "A" ], [ "H4", 37, 2, "GLC", "A" ], [ "H5", 38, 2, "GLC", "A" ], [ "H61", 39, 2, "GLC", "A" ], [ "H62", 40, 2, "GLC", "A" ], [ "HO2", 41, 2, "GLC", "A" ], [ "HO3", 42, 2, "GLC", "A" ], [ "HO6", 43, 2, "GLC", "A" ], [ "H1", 55, 3, "GLC", "A" ], [ "H2", 56, 3, "GLC", "A" ], [ "H3", 57, 3, "GLC", "A" ], [ "H4", 58, 3, "GLC", "A" ], [ "H5", 59, 3, "GLC", "A" ], [ "H61", 60, 3, "GLC", "A" ], [ "H62", 61, 3, "GLC", "A" ], [ "HO2", 62, 3, "GLC", "A" ], [ "HO3", 63, 3, "GLC", "A" ], [ "HO6", 64, 3, "GLC", "A" ], [ "H1", 76, 4, "GLC", "A" ], [ "H2", 77, 4, "GLC", "A" ], [ "H3", 78, 4, "GLC", "A" ], [ "H4", 79, 4, "GLC", "A" ], [ "H5", 80, 4, "GLC", "A" ], [ "H61", 81, 4, "GLC", "A" ], [ "H62", 82, 4, "GLC", "A" ], [ "HO2", 83, 4, "GLC", "A" ], [ "HO3", 84, 4, "GLC", "A" ], [ "HO6", 85, 4, "GLC", "A" ], [ "H1", 98, 5, "GLC", "A" ], [ "H2", 99, 5, "GLC", "A" ], [ "H3", 100, 5, "GLC", "A" ], [ "H4", 101, 5, "GLC", "A" ], [ "H5", 102, 5, "GLC", "A" ], [ "H61", 103, 5, "GLC", "A" ], [ "H62", 104, 5, "GLC", "A" ], [ "HO1", 105, 5, "GLC", "A" ], [ "HO2", 106, 5, "GLC", "A" ], [ "HO3", 107, 5, "GLC", "A" ], [ "HO6", 108, 5, "GLC", "A" ] ], "hovertemplate": "atom_element=H
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]}", "legendgroup": "H", "marker": { "color": "lightgray", "opacity": 1, "size": [ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 ], "sizemode": "area", "sizeref": 0.0125, "symbol": "circle" }, "mode": "markers", "name": "H", "scene": "scene", "showlegend": true, "type": "scatter3d", "x": [ 7.055020185426322, 9.030345697281339, 10.061391357681558, 11.076160189744037, 9.759102545167531, 11.541373371665681, 10.638338936309598, 7.3501890345449965, 10.705990045082007, 12.747767971305946, 10.058146293047937, 3.2195576570293287, 4.238279886557619, 6.868573801454046, 5.865893071048014, 6.381474961702765, 6.904601638874491, 5.23792058846046, 3.7868110099976233, 6.71871626249516, 5.443584565507713, 2.504290326081252, 3.7800502853489704, 5.546421889348567, 3.6792988428058155, 3.4781398263797385, 2.6218319204629648, 1.5500710906125033, 4.610516360958409, 6.663819440967799, 0.4595938246184854, 1.4916910136858579, 0.9152198419046713, 1.62589805959156, 2.983177902390366, 3.911715576062666, 5.697113576057102, 5.185826668702493, -0.7496777205322704, -0.11801809567642402, 6.958626718949353, 0.6348329725044726, 0.9813160307542244, -0.29453055711324305, 2.5516638301853414, 1.4698744822586722, 3.738658673870412, 4.281955505839753, -0.07231478626794718, -1.1876858258093126, -0.7378952755865401, 4.745713359358138 ], "y": [ 4.581499716782729, 5.506781963277467, 6.076886339398849, 4.151431834094111, 3.6151934294878867, 1.9910829263869971, 1.7099031703867138, 7.041416944259252, 7.653542341232345, 5.070324946808429, 0.1283584160605189, 5.433716988135641, 6.809692953829707, 6.2213079431853195, 5.364014628584512, 3.736099819731116, 2.596844256770571, 2.9217379421572365, 7.859707148606053, 8.363311591168586, 0.7718135570035387, 4.5811645933424545, 6.472382533138391, 4.307123598086049, 6.342559646142245, 3.303088997554763, 4.320674079403297, 5.360895307820423, 5.45145055119542, 6.32923739933854, 3.347591692050206, -0.7942283185432304, 1.6007372671884295, 1.65048565221338, 2.969415384256315, 0.6995772586088408, 2.267466050573238, 1.9238348535068364, 0.0994558139464744, 3.1423061749438843, 0.48510379927088654, -5.622643124167124, -4.415877879138565, -2.0531446388898558, -2.4581446113667913, -2.2792872995256745, -1.2717656900376768, -2.834405748837942, -4.326940417446038, -5.331438731998715, -2.1878399527249646, -2.638088501350392 ], "z": [ 16.661522930197606, 17.813732931254865, 14.995432229325221, 17.139511091092256, 14.436676924094964, 15.145047430772768, 16.651983313077235, 17.078757378049378, 16.675020983777937, 15.696604000518555, 14.958757785639042, 12.5169949481221, 14.293097749453484, 12.855652098130337, 15.611352467476248, 13.07924392139362, 15.257419360125475, 15.78846302065317, 12.192653500189573, 13.910039640755704, 14.768439752944731, 7.1204785489762354, 8.059295480290984, 9.293182874164467, 10.59896104190288, 10.378374944231972, 12.510807914213384, 11.544031042567909, 6.062737445695484, 8.672821297001974, 12.224022133007175, 5.574424712122652, 5.442262572058891, 8.412675770435978, 6.014255292232626, 7.834463431959619, 7.015872131218956, 5.346772883489668, 6.274422475408754, 7.737695791951123, 6.048309009018382, 8.273528356794627, 6.150014021138501, 7.606242066346666, 6.572144618325574, 9.42262648438145, 9.030795528091137, 8.37629296965092, 10.152422324813788, 6.568820982558592, 5.259402723987679, 10.711096642690464 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 8.00008872620539, 8.869329133567875 ], "y": [ 4.653673895218352, 5.740008918186926 ], "z": [ 16.12226664493348, 16.760505105134815 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 8.00008872620539, 8.682985026086307 ], "y": [ 4.653673895218352, 3.399621242097724 ], "z": [ 16.12226664493348, 16.18719419540373 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 8.00008872620539, 7.055020185426322 ], "y": [ 4.653673895218352, 4.581499716782729 ], "z": [ 16.12226664493348, 16.661522930197606 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 8.00008872620539, 7.786951976022726 ], "y": [ 4.653673895218352, 4.933968200731953 ], "z": [ 16.12226664493348, 14.977504099561163 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 8.869329133567875, 10.2185745406163 ], "y": [ 5.740008918186926, 5.794325294450755 ], "z": [ 16.760505105134815, 16.03643496845723 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 8.869329133567875, 8.214204425734204 ], "y": [ 5.740008918186926, 7.004526694524948 ], "z": [ 16.760505105134815, 16.645455504913915 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 8.869329133567875, 9.030345697281339 ], "y": [ 5.740008918186926, 5.506781963277467 ], "z": [ 16.760505105134815, 17.813732931254865 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 10.2185745406163, 10.875138023496648 ], "y": [ 5.794325294450755, 4.411759050387242 ], "z": [ 16.03643496845723, 16.09940300577887 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 10.2185745406163, 11.064046819238435 ], "y": [ 5.794325294450755, 6.754861682405801 ], "z": [ 16.03643496845723, 16.672487225347943 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 10.2185745406163, 10.061391357681558 ], "y": [ 5.794325294450755, 6.076886339398849 ], "z": [ 16.03643496845723, 14.995432229325221 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 10.875138023496648, 9.928417969313866 ], "y": [ 4.411759050387242, 3.376897710859161 ], "z": [ 16.09940300577887, 15.487798438302226 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 10.875138023496648, 12.101016926204586 ], "y": [ 4.411759050387242, 4.431856905739039 ], "z": [ 16.09940300577887, 15.365193912872881 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 10.875138023496648, 11.076160189744037 ], "y": [ 4.411759050387242, 4.151431834094111 ], "z": [ 16.09940300577887, 17.139511091092256 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 9.928417969313866, 10.551911519131092 ], "y": [ 3.376897710859161, 1.9848263017233854 ], "z": [ 15.487798438302226, 15.60096638960935 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 9.928417969313866, 8.682985026086307 ], "y": [ 3.376897710859161, 3.399621242097724 ], "z": [ 15.487798438302226, 16.18719419540373 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 9.928417969313866, 9.759102545167531 ], "y": [ 3.376897710859161, 3.6151934294878867 ], "z": [ 15.487798438302226, 14.436676924094964 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 10.551911519131092, 9.72400225349688 ], "y": [ 1.9848263017233854, 1.0347251668057145 ], "z": [ 15.60096638960935, 14.926866188374271 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 10.551911519131092, 11.541373371665681 ], "y": [ 1.9848263017233854, 1.9910829263869971 ], "z": [ 15.60096638960935, 15.145047430772768 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 10.551911519131092, 10.638338936309598 ], "y": [ 1.9848263017233854, 1.7099031703867138 ], "z": [ 15.60096638960935, 16.651983313077235 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 8.214204425734204, 7.3501890345449965 ], "y": [ 7.004526694524948, 7.041416944259252 ], "z": [ 16.645455504913915, 17.078757378049378 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 11.064046819238435, 10.705990045082007 ], "y": [ 6.754861682405801, 7.653542341232345 ], "z": [ 16.672487225347943, 16.675020983777937 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 12.101016926204586, 12.747767971305946 ], "y": [ 4.431856905739039, 5.070324946808429 ], "z": [ 15.365193912872881, 15.696604000518555 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 9.72400225349688, 10.058146293047937 ], "y": [ 1.0347251668057145, 0.1283584160605189 ], "z": [ 14.926866188374271, 14.958757785639042 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 4.279421777812658, 4.812962796533892 ], "y": [ 5.311486741288491, 6.590650092497606 ], "z": [ 12.742624760495964, 13.392337083193768 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 4.279421777812658, 4.451857630044419 ], "y": [ 5.311486741288491, 4.214097636533385 ], "z": [ 12.742624760495964, 13.642188004314814 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 4.279421777812658, 3.2195576570293287 ], "y": [ 5.311486741288491, 5.433716988135641 ], "z": [ 12.742624760495964, 12.5169949481221 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 4.279421777812658, 4.8817237427804185 ], "y": [ 5.311486741288491, 5.096662093965195 ], "z": [ 12.742624760495964, 11.729927287818423 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 4.812962796533892, 6.286435627215825 ], "y": [ 6.590650092497606, 6.390200674824091 ], "z": [ 13.392337083193768, 13.761645691537147 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 4.812962796533892, 4.6945201934631315 ], "y": [ 6.590650092497606, 7.678176724562481 ], "z": [ 13.392337083193768, 12.473268438136474 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 4.812962796533892, 4.238279886557619 ], "y": [ 6.590650092497606, 6.809692953829707 ], "z": [ 13.392337083193768, 14.293097749453484 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 6.286435627215825, 6.408932370490664 ], "y": [ 6.390200674824091, 5.173760659591837 ], "z": [ 13.761645691537147, 14.684574853081418 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 6.286435627215825, 6.772774325919608 ], "y": [ 6.390200674824091, 7.552784147380224 ], "z": [ 13.761645691537147, 14.435359532483309 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 6.286435627215825, 6.868573801454046 ], "y": [ 6.390200674824091, 6.2213079431853195 ], "z": [ 13.761645691537147, 12.855652098130337 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 6.408932370490664, 5.813116823665707 ], "y": [ 5.173760659591837, 3.9499252492067383 ], "z": [ 14.684574853081418, 13.985641578405492 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 6.408932370490664, 7.786951976022726 ], "y": [ 5.173760659591837, 4.933968200731953 ], "z": [ 14.684574853081418, 14.977504099561163 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 6.408932370490664, 5.865893071048014 ], "y": [ 5.173760659591837, 5.364014628584512 ], "z": [ 14.684574853081418, 15.611352467476248 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 5.813116823665707, 5.877799080086633 ], "y": [ 3.9499252492067383, 2.7440857155314995 ], "z": [ 13.985641578405492, 14.924354114132047 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 5.813116823665707, 4.451857630044419 ], "y": [ 3.9499252492067383, 4.214097636533385 ], "z": [ 13.985641578405492, 13.642188004314814 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 5.813116823665707, 6.381474961702765 ], "y": [ 3.9499252492067383, 3.736099819731116 ], "z": [ 13.985641578405492, 13.07924392139362 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 5.877799080086633, 5.430390966373112 ], "y": [ 2.7440857155314995, 1.5761781745917136 ], "z": [ 14.924354114132047, 14.232722018578858 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 5.877799080086633, 6.904601638874491 ], "y": [ 2.7440857155314995, 2.596844256770571 ], "z": [ 14.924354114132047, 15.257419360125475 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 5.877799080086633, 5.23792058846046 ], "y": [ 2.7440857155314995, 2.9217379421572365 ], "z": [ 14.924354114132047, 15.78846302065317 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 4.6945201934631315, 3.7868110099976233 ], "y": [ 7.678176724562481, 7.859707148606053 ], "z": [ 12.473268438136474, 12.192653500189573 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 6.772774325919608, 6.71871626249516 ], "y": [ 7.552784147380224, 8.363311591168586 ], "z": [ 14.435359532483309, 13.910039640755704 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 5.430390966373112, 5.443584565507713 ], "y": [ 1.5761781745917136, 0.7718135570035387 ], "z": [ 14.232722018578858, 14.768439752944731 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 3.12434093467413, 4.228261613535333 ], "y": [ 4.418818569786122, 5.478069371030477 ], "z": [ 8.002715485076195, 8.051683585364204 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 3.12434093467413, 2.316913889323759 ], "y": [ 4.418818569786122, 4.5193667044800305 ], "z": [ 8.002715485076195, 9.177944245380484 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 3.12434093467413, 2.504290326081252 ], "y": [ 4.418818569786122, 4.5811645933424545 ], "z": [ 8.002715485076195, 7.1204785489762354 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 3.12434093467413, 3.6184712124039584 ], "y": [ 4.418818569786122, 3.3291169052943403 ], "z": [ 8.002715485076195, 7.949245789887564 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 4.228261613535333, 5.058002102072048 ], "y": [ 5.478069371030477, 5.281130832923053 ], "z": [ 8.051683585364204, 9.324647423770845 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 4.228261613535333, 5.071340018724094 ], "y": [ 5.478069371030477, 5.34231524071908 ], "z": [ 8.051683585364204, 6.906162036545602 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 4.228261613535333, 3.7800502853489704 ], "y": [ 5.478069371030477, 6.472382533138391 ], "z": [ 8.051683585364204, 8.059295480290984 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 5.058002102072048, 4.130010853019524 ], "y": [ 5.281130832923053, 5.350818090281997 ], "z": [ 9.324647423770845, 10.541407847126123 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 5.058002102072048, 6.0448285257957695 ], "y": [ 5.281130832923053, 6.310616629708775 ], "z": [ 9.324647423770845, 9.416018117415575 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 5.058002102072048, 5.546421889348567 ], "y": [ 5.281130832923053, 4.307123598086049 ], "z": [ 9.324647423770845, 9.293182874164467 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 4.130010853019524, 3.0296989575155333 ], "y": [ 5.350818090281997, 4.297524259757008 ], "z": [ 10.541407847126123, 10.39593331605483 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 4.130010853019524, 4.8817237427804185 ], "y": [ 5.350818090281997, 5.096662093965195 ], "z": [ 10.541407847126123, 11.729927287818423 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 4.130010853019524, 3.6792988428058155 ], "y": [ 5.350818090281997, 6.342559646142245 ], "z": [ 10.541407847126123, 10.59896104190288 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 3.0296989575155333, 2.06463280801794 ], "y": [ 4.297524259757008, 4.400812939884572 ], "z": [ 10.39593331605483, 11.578047005871252 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 3.0296989575155333, 2.316913889323759 ], "y": [ 4.297524259757008, 4.5193667044800305 ], "z": [ 10.39593331605483, 9.177944245380484 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 3.0296989575155333, 3.4781398263797385 ], "y": [ 4.297524259757008, 3.303088997554763 ], "z": [ 10.39593331605483, 10.378374944231972 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 2.06463280801794, 1.10552780560133 ], "y": [ 4.400812939884572, 3.343776684758924 ], "z": [ 11.578047005871252, 11.505047350465379 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 2.06463280801794, 2.6218319204629648 ], "y": [ 4.400812939884572, 4.320674079403297 ], "z": [ 11.578047005871252, 12.510807914213384 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 2.06463280801794, 1.5500710906125033 ], "y": [ 4.400812939884572, 5.360895307820423 ], "z": [ 11.578047005871252, 11.544031042567909 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 5.071340018724094, 4.610516360958409 ], "y": [ 5.34231524071908, 5.45145055119542 ], "z": [ 6.906162036545602, 6.062737445695484 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 6.0448285257957695, 6.663819440967799 ], "y": [ 6.310616629708775, 6.32923739933854 ], "z": [ 9.416018117415575, 8.672821297001974 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 1.10552780560133, 0.4595938246184854 ], "y": [ 3.343776684758924, 3.347591692050206 ], "z": [ 11.505047350465379, 12.224022133007175 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 1.8948246970937017, 0.9917058174980087 ], "y": [ -0.10812378411966989, 1.1237068078103774 ], "z": [ 6.3200149488783754, 6.420118305980362 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 1.8948246970937017, 3.2099326073320396 ], "y": [ -0.10812378411966989, 0.29706662536503947 ], "z": [ 6.3200149488783754, 5.933333016936675 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 1.8948246970937017, 1.4916910136858579 ], "y": [ -0.10812378411966989, -0.7942283185432304 ], "z": [ 6.3200149488783754, 5.574424712122652 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 1.8948246970937017, 1.9420450814805592 ], "y": [ -0.10812378411966989, -0.6562943253271833 ], "z": [ 6.3200149488783754, 7.383853635108437 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 0.9917058174980087, 1.596245331307629 ], "y": [ 1.1237068078103774, 2.1101276982522164 ], "z": [ 6.420118305980362, 7.424706183242854 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 0.9917058174980087, -0.3081007561085695 ], "y": [ 1.1237068078103774, 0.7280907425762873 ], "z": [ 6.420118305980362, 6.862182554860344 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 0.9917058174980087, 0.9152198419046713 ], "y": [ 1.1237068078103774, 1.6007372671884295 ], "z": [ 6.420118305980362, 5.442262572058891 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 1.596245331307629, 3.0187120743880382 ], "y": [ 2.1101276982522164, 2.465712914652844 ], "z": [ 7.424706183242854, 6.981222791549849 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 1.596245331307629, 0.7989314709575854 ], "y": [ 2.1101276982522164, 3.2951419367485717 ], "z": [ 7.424706183242854, 7.469959499746867 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 1.596245331307629, 1.62589805959156 ], "y": [ 2.1101276982522164, 1.65048565221338 ], "z": [ 7.424706183242854, 8.412675770435978 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 3.0187120743880382, 3.8430339677713246 ], "y": [ 2.465712914652844, 1.1824664662161186 ], "z": [ 6.981222791549849, 6.858548553571687 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 3.0187120743880382, 3.6184712124039584 ], "y": [ 2.465712914652844, 3.3291169052943403 ], "z": [ 6.981222791549849, 7.949245789887564 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 3.0187120743880382, 2.983177902390366 ], "y": [ 2.465712914652844, 2.969415384256315 ], "z": [ 6.981222791549849, 6.014255292232626 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 3.8430339677713246, 5.247656818667664 ], "y": [ 1.1824664662161186, 1.5238461511492376 ], "z": [ 6.858548553571687, 6.358640004480151 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 3.8430339677713246, 3.2099326073320396 ], "y": [ 1.1824664662161186, 0.29706662536503947 ], "z": [ 6.858548553571687, 5.933333016936675 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 3.8430339677713246, 3.911715576062666 ], "y": [ 1.1824664662161186, 0.6995772586088408 ], "z": [ 6.858548553571687, 7.834463431959619 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 5.247656818667664, 6.053255601630695 ], "y": [ 1.5238461511492376, 0.34336408390085615 ], "z": [ 6.358640004480151, 6.355527161170869 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 5.247656818667664, 5.697113576057102 ], "y": [ 1.5238461511492376, 2.267466050573238 ], "z": [ 6.358640004480151, 7.015872131218956 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 5.247656818667664, 5.185826668702493 ], "y": [ 1.5238461511492376, 1.9238348535068364 ], "z": [ 6.358640004480151, 5.346772883489668 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ -0.3081007561085695, -0.7496777205322704 ], "y": [ 0.7280907425762873, 0.0994558139464744 ], "z": [ 6.862182554860344, 6.274422475408754 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 0.7989314709575854, -0.11801809567642402 ], "y": [ 3.2951419367485717, 3.1423061749438843 ], "z": [ 7.469959499746867, 7.737695791951123 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 6.053255601630695, 6.958626718949353 ], "y": [ 0.34336408390085615, 0.48510379927088654 ], "z": [ 6.355527161170869, 6.048309009018382 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 0.6746277818998989, 0.30286555903404166 ], "y": [ -4.53291084572971, -3.9994455787413505 ], "z": [ 8.281334410649556, 6.895600432366971 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 0.6746277818998989, -0.24712076709293407 ], "y": [ -4.53291084572971, -4.028999323913058 ], "z": [ 8.281334410649556, 9.248680672651965 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 0.6746277818998989, 1.9974347508774162 ], "y": [ -4.53291084572971, -4.1065563625427295 ], "z": [ 8.281334410649556, 8.615422089995675 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 0.6746277818998989, 0.6348329725044726 ], "y": [ -4.53291084572971, -5.622643124167124 ], "z": [ 8.281334410649556, 8.273528356794627 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 0.30286555903404166, 0.41961586392428973 ], "y": [ -3.9994455787413505, -2.4716830099227023 ], "z": [ 6.895600432366971, 6.896978701091941 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 0.30286555903404166, -1.0397224949614254 ], "y": [ -3.9994455787413505, -4.375654817872916 ], "z": [ 6.895600432366971, 6.583584526264871 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 0.30286555903404166, 0.9813160307542244 ], "y": [ -3.9994455787413505, -4.415877879138565 ], "z": [ 6.895600432366971, 6.150014021138501 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 0.41961586392428973, 1.8419722397508378 ], "y": [ -2.4716830099227023, -2.0799027056243444 ], "z": [ 6.896978701091941, 7.309217143391371 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 0.41961586392428973, 0.14586986766737442 ], "y": [ -2.4716830099227023, -1.970203780138926 ], "z": [ 6.896978701091941, 5.587170428240994 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 0.41961586392428973, -0.29453055711324305 ], "y": [ -2.4716830099227023, -2.0531446388898558 ], "z": [ 6.896978701091941, 7.606242066346666 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 1.8419722397508378, 2.1545844264871477 ], "y": [ -2.0799027056243444, -2.6880516468592615 ], "z": [ 7.309217143391371, 8.678050765852038 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 1.8419722397508378, 1.9420450814805592 ], "y": [ -2.0799027056243444, -0.6562943253271833 ], "z": [ 7.309217143391371, 7.383853635108437 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 1.8419722397508378, 2.5516638301853414 ], "y": [ -2.0799027056243444, -2.4581446113667913 ], "z": [ 7.309217143391371, 6.572144618325574 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 2.1545844264871477, 3.594148057016401 ], "y": [ -2.6880516468592615, -2.350903258726991 ], "z": [ 8.678050765852038, 9.069715824336015 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 2.1545844264871477, 1.9974347508774162 ], "y": [ -2.6880516468592615, -4.1065563625427295 ], "z": [ 8.678050765852038, 8.615422089995675 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 2.1545844264871477, 1.4698744822586722 ], "y": [ -2.6880516468592615, -2.2792872995256745 ], "z": [ 8.678050765852038, 9.42262648438145 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 3.594148057016401, 3.8495724064403465 ], "y": [ -2.350903258726991, -2.817083246739686 ], "z": [ 9.069715824336015, 10.396355044507732 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 3.594148057016401, 3.738658673870412 ], "y": [ -2.350903258726991, -1.2717656900376768 ], "z": [ 9.069715824336015, 9.030795528091137 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 3.594148057016401, 4.281955505839753 ], "y": [ -2.350903258726991, -2.834405748837942 ], "z": [ 9.069715824336015, 8.37629296965092 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ -0.24712076709293407, -0.07231478626794718 ], "y": [ -4.028999323913058, -4.326940417446038 ], "z": [ 9.248680672651965, 10.152422324813788 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ -1.0397224949614254, -1.1876858258093126 ], "y": [ -4.375654817872916, -5.331438731998715 ], "z": [ 6.583584526264871, 6.568820982558592 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 0.14586986766737442, -0.7378952755865401 ], "y": [ -1.970203780138926, -2.1878399527249646 ], "z": [ 5.587170428240994, 5.259402723987679 ] }, { "hoverinfo": "skip", "line": { "color": "black", "width": 1.44 }, "mode": "lines", "showlegend": false, "type": "scatter3d", "x": [ 3.8495724064403465, 4.745713359358138 ], "y": [ -2.817083246739686, -2.638088501350392 ], "z": [ 10.396355044507732, 10.711096642690464 ] } ], "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": [ "bam.load_sugars()\n", "\n", "glc = bam.molecule(\"GLC\")\n", "\n", "# connect using only the string identifier\n", "# instead of the actual Linkage object\n", "new = bam.polymerize(glc, 5, \"my_14_glyco_link\")\n", "new.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "If we close the notebook, we will have lost `\"my_14_glyco_link\"` however. In order to ensure it is available in all future sessions, we can call `add_linkage` with the additional argument `overwrite=True`. This will permanently save the modified CHARMM topology as the new default." ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [], "source": [ "# now the linkage is available even the next time we open a new notebook or restart the kernel\n", "# bam.add_linkage(my_link, overwrite=True)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Adding custom structures\n", "\n", "While it is true that BuildAMol does not load sugar-compounds and the like automatically, it does actually load a default PDBE compounds instance (it just happens to be empty be default). It can be populated with anything we want, however, using the `add_compound` function. The function expects a molecule, alongside with some additional metadata such as identifiers and name synonyms by which the molecule can be found. The logic is identical to `add_linkage` and we can make the additions permanent using the `overwrite=True` argument when calling `add_compound`. " ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [], "source": [ "# first we need to make sure the molecule has a good id\n", "# the id can be anything, but it needs to be unique\n", "new.id = \"my_sugar\"\n", "\n", "# now let's add our small sugar compound to the PDBE compounds\n", "# we provide as metadata only two names for the compound (more options are available)\n", "bam.add_compound(new, names=[\"my first sugar\", \"glucose-mannose\"])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now we can check if `\"my_sugar\"` is available as a compound using `bam.has_compound`:" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(True, True)" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# the has_compound function accepts both the \n", "# registered id as well as any of the name synonyms or identifiers\n", "bam.has_compound(\"my_sugar\"), bam.has_compound(\"my first sugar\")" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [], "source": [ "# again we can make the compound available for the next time we open a new notebook or restart the kernel\n", "# by using the overwrite=True option\n", "bam.add_compound(new, names=[\"my first sugar\", \"glucose-mannose\"], overwrite=True)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "> #### Warning\n", "> Using the `add_compound` function using `overwrite=True` can lead to an unwanted consequence: all other loaded compounds are automatically also added to the default compounds! That means, since we called `load_sugars` before, now the default loaded compounds will include not only our `my_sugar` molecule but also all the sugars that we loaded before! To prevent this from happening it would be better first to create a new instance of `PDBECompounds`, add the compound there. Then use the `save_as_default_compounds` function to permanently set the defaults in this way." ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['my_sugar']" ] }, "execution_count": 18, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# make a new empty PDBECompounds object\n", "new_compounds = bam.PDBECompounds()\n", "\n", "# now we can add our compound to the new object\n", "new_compounds.add(new, type=\"CUSTOM-MOLECULES\", names=[\"my first sugar\", \"glucose-mannose\"])\n", "\n", "# check what compounds are now available in the new object\n", "new_compounds.ids" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now we can save this object as the future default using `save_as_default_compounds`, without saving the 1000-something sugar compounds that are currently also loaded." ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "1069" ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# save as defaults\n", "bam.save_as_default_compounds(new_compounds)\n", "\n", "# print the number of currently loaded compounds\n", "len(bam.get_default_compounds())" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "What if we have multiple compounds already added to our defaults which we would like to keep? The easiest way to handle this kind of scenario is using `subset_compounds_by_types` in order to get a new `PDBECompounds` object that only contains compounds of interest. For instance, if we always set the type of our custom molecules to be `CUSTOM-MOLECULES`, then we can always get our custom defaults using `subset_compounds_by_types(\"CUSTOM-MOLECULES\")`, add any new compound to this database, and use `save_as_default_compounds` to make sure we have our molecules available in the future. \n", "\n", "All this will leave the currently loaded default compounds of 1000-sugars and our custom molecules completely unaffected. " ] }, { "cell_type": "code", "execution_count": 20, "metadata": {}, "outputs": [], "source": [ "# get all custom compounds we may have already added in the past\n", "my_compounds = bam.subset_compounds_by_types(\"CUSTOM-MOLECULES\")\n", "\n", "# now add the new compounds to the existing ones\n", "my_compounds.add(new, type=\"CUSTOM-MOLECULES\", names=[\"my first sugar\", \"glucose-mannose\"])\n", "\n", "# (if we have not already done so) also add it to the current defaults (just don't use overwrite=True)\n", "bam.add_compound(new, type=\"CUSTOM-MOLECULES\", names=[\"my first sugar\", \"glucose-mannose\"])\n", "\n", "# now save the new compounds as defaults\n", "bam.save_as_default_compounds(my_compounds)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Handling updates\n", "\n", "Setting defaults like this will overwrite some files in your local BuildAMol package directory. Since BuildAMol comes with these same files when you install it, every update would overwrite your custom defaults again. To make sure your custom settings are not simply lost, be sure to call `export_custom_resources` before updating. This will export your CHARMM Topology and PDBECompounds database to external files in some directory of your choice. After the update you can use `import_custom_resources` to point to these files and re-set your precious settings (again `import_custom_resources` can be used transiently or permanently, depending on whether or not we use `overwrite=True` or not).\n", "\n", "> #### Note\n", "> These functions will use the currently loaded default compounds." ] }, { "cell_type": "code", "execution_count": 22, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(True, True)" ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# export the custom defaults we just made\n", "# to the current directory\n", "bam.export_custom_resources(\"./files\")\n", "\n", "# now we can load the custom resources from the current directory\n", "bam.import_custom_resources(\"./files\")\n", "\n", "# and again check for our custom glycan\n", "bam.has_compound(\"my_sugar\"), bam.has_compound(\"my first sugar\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Restoring BuildAMol defaults\n", "\n", "Made a mistake and now your compounds are messed up? You can always call `restore_default_compounds` or `restore_default_topology` to get the previous settings back. This will restore your settings to BuildAMol factory defaults, i.e. an empty component library! Make sure to first export any compounds you would like to keep using `subset_compounds_by_types` or more thoroughly using `export_compounds` and later use the `PDBECompounds.merge` method to create a custom library to your liking. " ] } ], "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.0" }, "orig_nbformat": 4 }, "nbformat": 4, "nbformat_minor": 2 }