{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Simulating Glycan Shielding\n", "\n", "Proteins that are glycosylated have parts of their surface covered by the attached glycan chains. This makes them inaccessible for certain interactions such as with antibodies. To ascertain the \"shielding effect\" of glycans on a protein surface one can use molecular dynamics to obtain high quality conformers, albeit at a high computational cost. \n", "\n", "Glycosylator offers a simple quick-simulation tool to sample glycan conformations on a glycosylated scaffold without the need for extensive computational resources. To that end Glycosylator provides the `GlycoShield` class and the top-level `quickshield` function. These will generate a dataframe containing an \"exposure score\" for each residue in the scaffold, which is a measure of how much a residue is \"covered\" by glycan chains and thus not exposed to the environment. Lower values indicate higher coverage by glycans and vice versa." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import glycosylator as gl\n", "gl.visual.set_backend(\"py3dmol\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Using `quickshield`\n", "\n", "The most convenient way to simulate shielding is the `quickshield` function. It accepts a glycosylated `Scaffold` object as input and returns a `GlycoShield` which contains the data we are interested in. Let's see how:" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "application/3dmoljs_load.v0": "
\n

You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
\n jupyter labextension install jupyterlab_3dmol

\n
\n", "text/html": [ "
\n", "

You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
\n", " jupyter labextension install jupyterlab_3dmol

\n", "
\n", "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# first load a scaffold\n", "protein = gl.Protein.load(\"./files/protein_optimized.pkl\")\n", "for i, glycan in enumerate(protein.glycans):\n", " glycan.id = f\"glycan-{i}\"\n", "protein.show()" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "|████████████████████████████████████████| 156/156 [100%] in 3:01.7 (0.86/s) \n" ] } ], "source": [ "# now run the quickshield\n", "shield = gl.quickshield(protein)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can now inspect the exposure data by plotting it using plotly or matplotlib like so:" ] }, { "cell_type": "code", "execution_count": 11, "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": [ { "alignmentgroup": "True", "hovertemplate": "chain=A
serial=%{x}
exposure=%{marker.color}", "legendgroup": "", "marker": { "color": [ 249.98337284296557, 333.7435322533687, 134.14962514836324, 167.02552933030782, 270.7237623690465, 144.6709561036967, 307.27658315552526, 145.10790169247875, 286.82454865578416, 143.3430750254618, 314.5460810598224, 145.17042159923528, 131.56332358116535, 235.8068762130024, 319.4567996440746, 174.95222341578662, 279.25582320363833, 164.5990275402984, 273.3471848555327, 264.197715073926, 174.0340028985413, 270.5644133675877, 147.40392189202822, 268.3057311057932, 177.85135916727742, 286.89793421905637, 142.9423227720739, 196.63903803978292, 292.1608115943697, 109.60125875356208, 313.2539056316024, 210.1297318567409, 290.6177228054545, 305.3711079420291, 148.12617890889427, 218.7314001943508, 304.79803657073955, 333.9595855154342, 202.80911894590724, 289.092984371663, 129.70586682457886, 307.72546227000174, 226.76415454659036, 282.8059024812954, 280.1810849488289, 151.740311716165, 215.78130285931795, 208.40333387110155, 260.00241188983546, 176.42279279682634, 188.9569879695094, 227.82710539164373, 259.82845808738324, 119.16868625006876, 253.2587072864348, 232.6199198936844, 221.48796920399246, 175.51140883747897, 246.04506372680706, 209.08214325247408, 244.6538077458252, 276.2989375446628, 220.29688839335455, 151.09401590837723, 267.5932289161872, 192.00940869495483, 253.14521435668738, 269.107258230938, 247.75852639311734, 256.3799727611312, 177.20231854230076, 252.86773363526603, 269.08745657509974, 290.14176278298845, 282.2211120561945, 148.95158914956042, 246.2533174998319, 286.76909377123326, 268.2823539193619, 126.21817597916652, 268.6529038086404, 273.7643245509414, 286.40464734930407, 105.06288351724135, 280.5791020820802, 288.71030571694087, 271.2123845399555, 283.428487643475, 74.09734984212098, 276.9744396541191, 272.2873153121092, 67.0142497118279, 257.2526780698628, 266.5025358051749, 262.4000984806981, 234.55031391176163, 283.65913019450045, 32.14312649073416, 242.1738212547913, 219.5700961286306, 23.11024856294818, 261.77691066923944, 237.37938118648168, 37.921573809257566, 195.17830321846867, 202.09032254116926, 53.77461533571717, 208.64814829765137, 239.49225273248004, 207.6043053775052, 110.87220840884086, 209.8806379110117, 257.77971323153736, 197.59113312094584, 138.61090621751939, 204.8033711610817, 237.04975184848982, 179.3220832456513, 145.9869129853554, 206.68473397992102, 139.64285691679345, 156.0411409642275, 158.87628786193235, 157.11192572241248, 190.56520227362483, 130.1765944032149, 163.36371576522671, 206.18890133854583, 160.97512956876398, 174.3792327076289, 154.61979671641626, 221.38991119074686, 162.04690241864063, 135.71486785492806, 146.1523469710103, 218.114024396373, 173.20907833359908, 134.094665631232, 161.81475070531343, 160.41637610761722, 207.45010861362613, 148.15144928149707, 132.2471896747687, 204.71015174336205, 189.46376753938026, 109.51768229751593, 209.73080800981714, 121.05768108728181, 192.2543868133595, 210.80752097725366, 99.74210707776805, 244.47495474880225, 139.82384847057253, 261.55715554984755, 118.07073323699056, 248.8341712682708, 144.91817589312893, 274.5692784491518, 233.40153374353036, 101.37707001778456, 134.5012539061801, 294.5855458113904, 251.56762615835316, 142.10892611093522, 129.1812348572083, 246.5183450506627, 104.52425269397047, 268.8197698014582, 143.06489181763976, 204.84232279947076, 108.8628357696793, 267.78248644055105, 38.773493527577514, 153.4182334737437, 147.83059900803565, 283.55691577023407, 198.89090925359145, 86.89428711456951, 280.2414085730103, 129.24937839380596, 79.7062028988159, 111.10670151494175, 150.98102181527736, 268.67252504150855, 117.46068991240055, 82.78862305003607, 119.38523861980136, 55.58719982305949, 136.55628084866382, 290.78129866397205, 132.17850681089072, 165.46246469142255, 54.581661342987736, 282.05919498282844, 172.88329942252474, 82.1382321739642, 149.29312709163713, 153.28725087679962, 259.0031690067607, 194.86338479860635, 104.6963004802207, 164.4645938627631, 119.10882508628264, 174.31075680478656, 284.71404245716724, 144.27620538531707, 311.79130392674716, 192.17789922197468, 154.2264893974499, 175.1836439384336, 209.45004671557726, 280.20324025767474, 259.6643872560205, 185.9379259936724, 139.31496125654755, 185.773080350395, 115.0564392368848, 297.21183558998416, 193.56018017797163, 149.62438652504628, 289.9214556375184, 214.6788450378336, 147.29712544589947, 206.21789919264242, 261.10112956180427, 213.9625988622219, 240.73965895020163, 246.3746077511399, 225.4850318890578, 247.92903524094493, 236.67679458044483, 220.00409008307236, 203.2764953605676, 221.92119113470312, 253.02994241923196, 212.73766689211496, 185.29825093760132, 218.7600311382243, 254.68635217055322, 176.33683532631738, 205.3218937106992, 216.76825887580884, 174.14780033294508, 233.60265723464, 99.24904985963053, 154.71861484816844, 173.84501704776136, 98.35176791839145, 160.69303543842753, 232.1345075253296, 115.85943327979705, 140.46045590443111, 260.3723390406766, 82.01114457705701, 117.07472453045801, 261.5152836067052, 94.91458123838632, 102.40185771603433, 95.9945135483101, 270.31976363386366, 71.90789669703081, 134.18172327163745, 231.8944955958825, 164.25033429334957, 58.712925325111264, 213.4352176687634, 213.516325224593, 39.8468864251653, 167.24440645065292, 71.95630219527875, 189.410405185962, 177.28008917643152, 168.79454804087746, 88.4432092368901, 213.72706082786164, 73.57271612472472, 164.098672486671, 245.45597648964497, 69.2131073133898, 169.7605217309571, 285.4007126496156, 31.970416533536362, 175.74460209745993, 300.5392029710007, 118.52801911230588, 73.74698107362366, 277.5893213207155, 17.05855112229867, 128.79740676862562, 289.188697363591, 48.67630122963474, 161.63876338670002, 285.1518224614396, 72.76233346914283, 251.57510033341563, 69.16436550022058, 222.28424992703455, 237.68462180657733, 230.07012817124857, 201.97326130136366, 55.24504193190072, 241.66329559992926, 80.78807130732477, 147.9316671010302, 197.50372037000744, 84.72654345744529, 129.9166870069693, 247.53575315279778, 68.0766772737896, 131.7865898771342, 273.5550948642436, 89.10619505642171, 154.6733428085657, 296.344322679948, 89.91367470484118, 100.78168229129713, 294.39056993993484, 116.63883619062449, 270.18353389042795, 69.6740858563978, 144.93478237536587, 277.1865783027162, 153.72185631440428, 169.4888728178225, 256.88582825167, 190.0800123390336, 100.43160551929657, 74.77080861861461, 168.5021324306906, 219.44154176528332, 165.1730329248274, 36.775128571142254, 244.26314277125815, 233.74193905708717, 74.8162067027407, 194.8314432688509, 256.73461464480806, 187.4502697364552, 66.62251991537825, 206.52234487485313, 268.8003050757655, 245.32204480490606, 100.06904494725873, 231.26393188091882, 271.19523132801936, 214.11106681811629, 259.4387352856408, 79.79732681073585, 245.5120451032863, 264.46620648355525, 133.23663737265238, 257.5476465959444, 248.86479872287535, 244.99166234429993, 143.68119524275596, 275.1587155332194, 253.41650381823135, 206.19891991938763, 151.90509022550415, 274.3502891200454, 237.94614887185708, 195.20595512232384, 247.81653110862322, 178.53187097383818, 239.54264688048397, 159.38892766915737, 239.01583930731582, 244.05247963846588, 144.76283202577693, 129.38510542364142, 213.83169252541788, 162.55175131037942, 211.28608036264572, 194.57746311281517, 100.56670149312191, 212.40776850715562, 136.58429827204463, 170.27605235001474, 135.15844486953702, 178.64189418057234, 129.16398681249595, 127.81970768567582, 161.64232554900755, 114.06281170553969, 188.55123684333316, 148.10386633135286, 198.37997908754, 161.84932608308952, 119.47946955845076, 175.23363979150113, 179.9010722015994, 167.79722530351043, 103.86659077204011, 160.7053376411553, 196.21921681852498, 158.76918556396913, 169.47741896592572, 207.37359047006052, 185.17371265663581, 77.12892966216026, 201.3108888334047, 200.05776691450603, 195.59998239004634, 113.23795523328369, 198.20794924628836, 224.40815693271753, 172.23921062573544, 203.02301089725097, 126.39624619137986, 231.49689036486546, 209.6262284038059, 103.04117079440041, 240.9185692890078, 227.59442768573606, 194.51789606473014, 113.22470802738972, 257.0560423192872, 240.49914426566713, 234.47072096469356, 90.333152980883, 242.88650183723905, 263.1025354110045, 263.09558156974236, 123.11066211669929, 222.48507598733775, 261.96929683755405, 250.24755007662142, 272.4865493516806, 123.31228542514734, 251.89975607405495, 278.9258438505505, 277.0746870898085, 265.6864746797103, 102.65781399579991, 294.77717523697333, 270.39747179034987, 86.24644168224006, 241.03630514010263, 254.90609151346862, 294.1655234735984, 56.37646242043071, 218.98436338062353, 317.17797245172693, 229.6917783768139, 205.06523481163822, 188.78280713169997, 104.7472022191758, 319.569952735615, 270.51435602293066, 80.19566630046377, 208.7736782822043, 324.32375981239863 ], "coloraxis": "coloraxis", "pattern": { "shape": "" } }, "name": "", "offsetgroup": "", "orientation": "v", "showlegend": false, "textposition": "auto", "type": "bar", "x": [ 401, 34, 153, 278, 402, 279, 35, 154, 403, 280, 36, 155, 281, 404, 37, 156, 405, 282, 38, 406, 157, 407, 283, 39, 158, 408, 284, 159, 409, 285, 40, 160, 410, 41, 286, 161, 411, 42, 162, 412, 287, 43, 163, 413, 44, 288, 164, 414, 45, 289, 415, 165, 46, 290, 166, 47, 291, 416, 167, 48, 292, 168, 49, 417, 293, 50, 294, 169, 418, 419, 51, 420, 170, 295, 421, 52, 171, 296, 422, 53, 297, 172, 423, 54, 173, 298, 424, 174, 55, 299, 425, 56, 175, 300, 426, 176, 301, 57, 427, 177, 58, 302, 303, 59, 178, 428, 60, 429, 304, 179, 61, 430, 305, 180, 62, 181, 306, 431, 63, 182, 183, 307, 432, 184, 64, 308, 433, 65, 185, 309, 186, 66, 434, 187, 310, 67, 435, 188, 436, 311, 68, 437, 189, 69, 312, 190, 70, 438, 313, 314, 191, 71, 439, 315, 192, 72, 440, 316, 73, 193, 441, 317, 74, 442, 194, 318, 443, 75, 195, 319, 444, 76, 445, 196, 197, 77, 320, 446, 78, 198, 447, 199, 321, 79, 322, 200, 448, 201, 323, 80, 449, 324, 202, 81, 325, 203, 450, 326, 82, 327, 204, 328, 205, 451, 83, 206, 84, 329, 452, 207, 330, 85, 86, 208, 331, 209, 332, 87, 210, 333, 88, 211, 334, 212, 89, 335, 90, 213, 336, 91, 214, 337, 92, 338, 215, 339, 340, 93, 216, 341, 94, 217, 95, 218, 342, 219, 96, 343, 97, 220, 344, 98, 221, 345, 99, 222, 346, 100, 347, 223, 101, 348, 224, 349, 102, 225, 226, 103, 350, 104, 227, 351, 228, 105, 352, 106, 229, 353, 107, 230, 354, 108, 231, 355, 232, 109, 356, 110, 233, 357, 111, 234, 358, 112, 359, 113, 235, 360, 236, 361, 114, 237, 115, 362, 238, 116, 363, 239, 117, 364, 240, 118, 365, 241, 366, 119, 242, 120, 243, 367, 121, 244, 368, 122, 245, 123, 369, 1, 246, 124, 370, 2, 247, 125, 3, 371, 126, 248, 4, 372, 127, 249, 5, 373, 128, 250, 374, 6, 251, 129, 7, 252, 375, 130, 8, 253, 376, 131, 9, 254, 377, 132, 255, 10, 378, 133, 256, 379, 11, 12, 257, 134, 380, 258, 13, 381, 135, 259, 14, 382, 136, 15, 260, 137, 383, 261, 384, 16, 138, 262, 385, 17, 139, 263, 386, 18, 264, 387, 19, 140, 265, 20, 388, 141, 389, 21, 266, 390, 142, 22, 267, 143, 391, 23, 268, 144, 24, 269, 392, 145, 25, 393, 26, 146, 270, 394, 27, 395, 147, 271, 28, 272, 396, 148, 29, 273, 149, 397, 274, 30, 150, 398, 31, 275, 399, 276, 151, 32, 400, 152, 277, 33 ], "xaxis": "x2", "y": [ 249.98337284296557, 333.7435322533687, 134.14962514836324, 167.02552933030782, 270.7237623690465, 144.6709561036967, 307.27658315552526, 145.10790169247875, 286.82454865578416, 143.3430750254618, 314.5460810598224, 145.17042159923528, 131.56332358116535, 235.8068762130024, 319.4567996440746, 174.95222341578662, 279.25582320363833, 164.5990275402984, 273.3471848555327, 264.197715073926, 174.0340028985413, 270.5644133675877, 147.40392189202822, 268.3057311057932, 177.85135916727742, 286.89793421905637, 142.9423227720739, 196.63903803978292, 292.1608115943697, 109.60125875356208, 313.2539056316024, 210.1297318567409, 290.6177228054545, 305.3711079420291, 148.12617890889427, 218.7314001943508, 304.79803657073955, 333.9595855154342, 202.80911894590724, 289.092984371663, 129.70586682457886, 307.72546227000174, 226.76415454659036, 282.8059024812954, 280.1810849488289, 151.740311716165, 215.78130285931795, 208.40333387110155, 260.00241188983546, 176.42279279682634, 188.9569879695094, 227.82710539164373, 259.82845808738324, 119.16868625006876, 253.2587072864348, 232.6199198936844, 221.48796920399246, 175.51140883747897, 246.04506372680706, 209.08214325247408, 244.6538077458252, 276.2989375446628, 220.29688839335455, 151.09401590837723, 267.5932289161872, 192.00940869495483, 253.14521435668738, 269.107258230938, 247.75852639311734, 256.3799727611312, 177.20231854230076, 252.86773363526603, 269.08745657509974, 290.14176278298845, 282.2211120561945, 148.95158914956042, 246.2533174998319, 286.76909377123326, 268.2823539193619, 126.21817597916652, 268.6529038086404, 273.7643245509414, 286.40464734930407, 105.06288351724135, 280.5791020820802, 288.71030571694087, 271.2123845399555, 283.428487643475, 74.09734984212098, 276.9744396541191, 272.2873153121092, 67.0142497118279, 257.2526780698628, 266.5025358051749, 262.4000984806981, 234.55031391176163, 283.65913019450045, 32.14312649073416, 242.1738212547913, 219.5700961286306, 23.11024856294818, 261.77691066923944, 237.37938118648168, 37.921573809257566, 195.17830321846867, 202.09032254116926, 53.77461533571717, 208.64814829765137, 239.49225273248004, 207.6043053775052, 110.87220840884086, 209.8806379110117, 257.77971323153736, 197.59113312094584, 138.61090621751939, 204.8033711610817, 237.04975184848982, 179.3220832456513, 145.9869129853554, 206.68473397992102, 139.64285691679345, 156.0411409642275, 158.87628786193235, 157.11192572241248, 190.56520227362483, 130.1765944032149, 163.36371576522671, 206.18890133854583, 160.97512956876398, 174.3792327076289, 154.61979671641626, 221.38991119074686, 162.04690241864063, 135.71486785492806, 146.1523469710103, 218.114024396373, 173.20907833359908, 134.094665631232, 161.81475070531343, 160.41637610761722, 207.45010861362613, 148.15144928149707, 132.2471896747687, 204.71015174336205, 189.46376753938026, 109.51768229751593, 209.73080800981714, 121.05768108728181, 192.2543868133595, 210.80752097725366, 99.74210707776805, 244.47495474880225, 139.82384847057253, 261.55715554984755, 118.07073323699056, 248.8341712682708, 144.91817589312893, 274.5692784491518, 233.40153374353036, 101.37707001778456, 134.5012539061801, 294.5855458113904, 251.56762615835316, 142.10892611093522, 129.1812348572083, 246.5183450506627, 104.52425269397047, 268.8197698014582, 143.06489181763976, 204.84232279947076, 108.8628357696793, 267.78248644055105, 38.773493527577514, 153.4182334737437, 147.83059900803565, 283.55691577023407, 198.89090925359145, 86.89428711456951, 280.2414085730103, 129.24937839380596, 79.7062028988159, 111.10670151494175, 150.98102181527736, 268.67252504150855, 117.46068991240055, 82.78862305003607, 119.38523861980136, 55.58719982305949, 136.55628084866382, 290.78129866397205, 132.17850681089072, 165.46246469142255, 54.581661342987736, 282.05919498282844, 172.88329942252474, 82.1382321739642, 149.29312709163713, 153.28725087679962, 259.0031690067607, 194.86338479860635, 104.6963004802207, 164.4645938627631, 119.10882508628264, 174.31075680478656, 284.71404245716724, 144.27620538531707, 311.79130392674716, 192.17789922197468, 154.2264893974499, 175.1836439384336, 209.45004671557726, 280.20324025767474, 259.6643872560205, 185.9379259936724, 139.31496125654755, 185.773080350395, 115.0564392368848, 297.21183558998416, 193.56018017797163, 149.62438652504628, 289.9214556375184, 214.6788450378336, 147.29712544589947, 206.21789919264242, 261.10112956180427, 213.9625988622219, 240.73965895020163, 246.3746077511399, 225.4850318890578, 247.92903524094493, 236.67679458044483, 220.00409008307236, 203.2764953605676, 221.92119113470312, 253.02994241923196, 212.73766689211496, 185.29825093760132, 218.7600311382243, 254.68635217055322, 176.33683532631738, 205.3218937106992, 216.76825887580884, 174.14780033294508, 233.60265723464, 99.24904985963053, 154.71861484816844, 173.84501704776136, 98.35176791839145, 160.69303543842753, 232.1345075253296, 115.85943327979705, 140.46045590443111, 260.3723390406766, 82.01114457705701, 117.07472453045801, 261.5152836067052, 94.91458123838632, 102.40185771603433, 95.9945135483101, 270.31976363386366, 71.90789669703081, 134.18172327163745, 231.8944955958825, 164.25033429334957, 58.712925325111264, 213.4352176687634, 213.516325224593, 39.8468864251653, 167.24440645065292, 71.95630219527875, 189.410405185962, 177.28008917643152, 168.79454804087746, 88.4432092368901, 213.72706082786164, 73.57271612472472, 164.098672486671, 245.45597648964497, 69.2131073133898, 169.7605217309571, 285.4007126496156, 31.970416533536362, 175.74460209745993, 300.5392029710007, 118.52801911230588, 73.74698107362366, 277.5893213207155, 17.05855112229867, 128.79740676862562, 289.188697363591, 48.67630122963474, 161.63876338670002, 285.1518224614396, 72.76233346914283, 251.57510033341563, 69.16436550022058, 222.28424992703455, 237.68462180657733, 230.07012817124857, 201.97326130136366, 55.24504193190072, 241.66329559992926, 80.78807130732477, 147.9316671010302, 197.50372037000744, 84.72654345744529, 129.9166870069693, 247.53575315279778, 68.0766772737896, 131.7865898771342, 273.5550948642436, 89.10619505642171, 154.6733428085657, 296.344322679948, 89.91367470484118, 100.78168229129713, 294.39056993993484, 116.63883619062449, 270.18353389042795, 69.6740858563978, 144.93478237536587, 277.1865783027162, 153.72185631440428, 169.4888728178225, 256.88582825167, 190.0800123390336, 100.43160551929657, 74.77080861861461, 168.5021324306906, 219.44154176528332, 165.1730329248274, 36.775128571142254, 244.26314277125815, 233.74193905708717, 74.8162067027407, 194.8314432688509, 256.73461464480806, 187.4502697364552, 66.62251991537825, 206.52234487485313, 268.8003050757655, 245.32204480490606, 100.06904494725873, 231.26393188091882, 271.19523132801936, 214.11106681811629, 259.4387352856408, 79.79732681073585, 245.5120451032863, 264.46620648355525, 133.23663737265238, 257.5476465959444, 248.86479872287535, 244.99166234429993, 143.68119524275596, 275.1587155332194, 253.41650381823135, 206.19891991938763, 151.90509022550415, 274.3502891200454, 237.94614887185708, 195.20595512232384, 247.81653110862322, 178.53187097383818, 239.54264688048397, 159.38892766915737, 239.01583930731582, 244.05247963846588, 144.76283202577693, 129.38510542364142, 213.83169252541788, 162.55175131037942, 211.28608036264572, 194.57746311281517, 100.56670149312191, 212.40776850715562, 136.58429827204463, 170.27605235001474, 135.15844486953702, 178.64189418057234, 129.16398681249595, 127.81970768567582, 161.64232554900755, 114.06281170553969, 188.55123684333316, 148.10386633135286, 198.37997908754, 161.84932608308952, 119.47946955845076, 175.23363979150113, 179.9010722015994, 167.79722530351043, 103.86659077204011, 160.7053376411553, 196.21921681852498, 158.76918556396913, 169.47741896592572, 207.37359047006052, 185.17371265663581, 77.12892966216026, 201.3108888334047, 200.05776691450603, 195.59998239004634, 113.23795523328369, 198.20794924628836, 224.40815693271753, 172.23921062573544, 203.02301089725097, 126.39624619137986, 231.49689036486546, 209.6262284038059, 103.04117079440041, 240.9185692890078, 227.59442768573606, 194.51789606473014, 113.22470802738972, 257.0560423192872, 240.49914426566713, 234.47072096469356, 90.333152980883, 242.88650183723905, 263.1025354110045, 263.09558156974236, 123.11066211669929, 222.48507598733775, 261.96929683755405, 250.24755007662142, 272.4865493516806, 123.31228542514734, 251.89975607405495, 278.9258438505505, 277.0746870898085, 265.6864746797103, 102.65781399579991, 294.77717523697333, 270.39747179034987, 86.24644168224006, 241.03630514010263, 254.90609151346862, 294.1655234735984, 56.37646242043071, 218.98436338062353, 317.17797245172693, 229.6917783768139, 205.06523481163822, 188.78280713169997, 104.7472022191758, 319.569952735615, 270.51435602293066, 80.19566630046377, 208.7736782822043, 324.32375981239863 ], "yaxis": "y2" }, { "alignmentgroup": "True", "hovertemplate": "chain=B
serial=%{x}
exposure=%{marker.color}", "legendgroup": "", "marker": { "color": [ 177.94747892437638, 162.70537227497647, 223.3872209009729, 174.52256010866896, 121.70932290279215, 205.6832418098829, 190.2710651269681, 137.22738758429023, 126.69649097851045, 146.0187654549898, 116.36485130079993, 158.7088221380362, 149.28447300874583, 98.65284256784301, 82.91574868097136, 139.22727441469223, 155.22934859163817, 177.4152381809, 187.439560393372, 199.5733667908418, 174.21696064511872, 173.683115779507, 158.67064217573318, 149.4862725736282, 124.19690191989531, 85.70839473482104, 180.8845854595257, 73.35573650606872, 68.72559672153768, 46.10250880064338, 26.152512716034703, 54.89751723223401, 39.73832827060767, 21.40922409319592, 89.03867363184354, 73.51234988859576, 77.1144267508634, 14.010748077472462, 53.15278266490379, 59.04726530386344, 52.054678631955845, 63.39990141923355, 75.03130520834249, 43.738873783664296, 26.41646202318957, 73.44220803814639, 51.965840699419424, 115.77588627938272, 105.9483997165674, 92.33288182512143, 119.87880035730413, 139.44990155285095, 144.34686351523217, 116.68690494121773, 97.32091737248143, 111.79267564125745, 91.42070528099917, 59.268752148212045, 90.1548888628184, 79.75911664615796, 47.60239686915486, 34.31097183252387, 81.13935996613453, 40.02213700962791, 41.509421124277424, 33.924736492461356, 67.54685258855372, 48.20495311700437, 49.52621755259635, 278.46436845192727, 64.12551719367632, 118.85143570337007, 80.23487936276626, 81.38545220077044, 90.71041282137881, 141.71704708492442, 134.76729901983836, 132.0347349708616, 169.68541923059328, 174.8308386464048, 152.9247518283229, 167.54930668446087, 95.58586357592492, 116.11861890465799, 206.24742683308745, 211.6738761638137, 78.71364825542051, 218.37559387761985, 106.39287092724592, 129.8415249870129, 108.97089310059222, 73.52873426057822, 58.14180459810166, 16.355754677496805, 14.375348745557371, 19.30754019526204, 32.23216430144604, 80.70155923970965, 83.07585480658025, 65.97843113075145, 91.25629776217947, 113.3644506446653, 108.21778166893004, 106.88995890778016, 135.8185359722736, 151.65440785924773, 134.4421618758156, 132.5868567790122, 168.7118454044891, 167.41719845824036, 166.5967923508145, 184.17069737920332, 217.8715585426577, 209.0969614314556, 235.80001505031754, 341.61145357506064, 322.7303021442573, 297.27575786733536, 300.7966139490458, 293.78546037230456, 268.93213198939026, 273.11712644690056, 229.18609747607, 224.99615731570825, 261.3910899621157, 241.7433156991833 ], "coloraxis": "coloraxis", "pattern": { "shape": "" } }, "name": "", "offsetgroup": "", "orientation": "v", "showlegend": false, "textposition": "auto", "type": "bar", "x": [ 495, 496, 497, 498, 499, 500, 501, 502, 503, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 504, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 490, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 453, 454, 576, 577, 455, 578, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 491, 492, 493, 494 ], "xaxis": "x", "y": [ 177.94747892437638, 162.70537227497647, 223.3872209009729, 174.52256010866896, 121.70932290279215, 205.6832418098829, 190.2710651269681, 137.22738758429023, 126.69649097851045, 146.0187654549898, 116.36485130079993, 158.7088221380362, 149.28447300874583, 98.65284256784301, 82.91574868097136, 139.22727441469223, 155.22934859163817, 177.4152381809, 187.439560393372, 199.5733667908418, 174.21696064511872, 173.683115779507, 158.67064217573318, 149.4862725736282, 124.19690191989531, 85.70839473482104, 180.8845854595257, 73.35573650606872, 68.72559672153768, 46.10250880064338, 26.152512716034703, 54.89751723223401, 39.73832827060767, 21.40922409319592, 89.03867363184354, 73.51234988859576, 77.1144267508634, 14.010748077472462, 53.15278266490379, 59.04726530386344, 52.054678631955845, 63.39990141923355, 75.03130520834249, 43.738873783664296, 26.41646202318957, 73.44220803814639, 51.965840699419424, 115.77588627938272, 105.9483997165674, 92.33288182512143, 119.87880035730413, 139.44990155285095, 144.34686351523217, 116.68690494121773, 97.32091737248143, 111.79267564125745, 91.42070528099917, 59.268752148212045, 90.1548888628184, 79.75911664615796, 47.60239686915486, 34.31097183252387, 81.13935996613453, 40.02213700962791, 41.509421124277424, 33.924736492461356, 67.54685258855372, 48.20495311700437, 49.52621755259635, 278.46436845192727, 64.12551719367632, 118.85143570337007, 80.23487936276626, 81.38545220077044, 90.71041282137881, 141.71704708492442, 134.76729901983836, 132.0347349708616, 169.68541923059328, 174.8308386464048, 152.9247518283229, 167.54930668446087, 95.58586357592492, 116.11861890465799, 206.24742683308745, 211.6738761638137, 78.71364825542051, 218.37559387761985, 106.39287092724592, 129.8415249870129, 108.97089310059222, 73.52873426057822, 58.14180459810166, 16.355754677496805, 14.375348745557371, 19.30754019526204, 32.23216430144604, 80.70155923970965, 83.07585480658025, 65.97843113075145, 91.25629776217947, 113.3644506446653, 108.21778166893004, 106.88995890778016, 135.8185359722736, 151.65440785924773, 134.4421618758156, 132.5868567790122, 168.7118454044891, 167.41719845824036, 166.5967923508145, 184.17069737920332, 217.8715585426577, 209.0969614314556, 235.80001505031754, 341.61145357506064, 322.7303021442573, 297.27575786733536, 300.7966139490458, 293.78546037230456, 268.93213198939026, 273.11712644690056, 229.18609747607, 224.99615731570825, 261.3910899621157, 241.7433156991833 ], "yaxis": "y" } ], "layout": { "annotations": [ { "font": {}, "showarrow": false, "text": "chain=B", "textangle": 90, "x": 0.98, "xanchor": "left", "xref": "paper", "y": 0.2425, "yanchor": "middle", "yref": "paper" }, { "font": {}, "showarrow": false, "text": "chain=A", "textangle": 90, "x": 0.98, "xanchor": "left", "xref": "paper", "y": 0.7575000000000001, "yanchor": "middle", "yref": "paper" } ], "barmode": "relative", "coloraxis": { "colorbar": { "title": { "text": "exposure" } }, "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" ] ] }, "legend": { "tracegroupgap": 0 }, "margin": { "t": 60 }, "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "xaxis": { "anchor": "y", "domain": [ 0, 0.98 ], "title": { "text": "serial" } }, "xaxis2": { "anchor": "y2", "domain": [ 0, 0.98 ], "matches": "x", "showticklabels": false }, "yaxis": { "anchor": "x", "domain": [ 0, 0.485 ], "title": { "text": "exposure" } }, "yaxis2": { "anchor": "x2", "domain": [ 0.515, 1 ], "matches": "y", "title": { "text": "exposure" } } } } }, "metadata": {}, "output_type": "display_data" } ], "source": [ "shield.exposure.plotly().show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can actually visualize the \"exposure\" of the scaffold residues also as a heat map in the Py3DMol visualization like so:" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "application/3dmoljs_load.v0": "
\n

You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
\n jupyter labextension install jupyterlab_3dmol

\n
\n", "text/html": [ "
\n", "

You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
\n", " jupyter labextension install jupyterlab_3dmol

\n", "
\n", "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# show the results\n", "shield.py3dmol().show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "And to obtain the actual data we can use the `df` attribute:" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
chainresnameserialexposure
0ALEU401249.983373
1AGLU34333.743532
2AARG153134.149625
3AALA278167.025529
4BLEU495177.947479
...............
573AILE400270.514356
574ATYR15280.195666
575ATYR277208.773678
576ATHR33324.323760
577BVAL494241.743316
\n", "

578 rows × 4 columns

\n", "
" ], "text/plain": [ " chain resname serial exposure\n", "0 A LEU 401 249.983373\n", "1 A GLU 34 333.743532\n", "2 A ARG 153 134.149625\n", "3 A ALA 278 167.025529\n", "4 B LEU 495 177.947479\n", ".. ... ... ... ...\n", "573 A ILE 400 270.514356\n", "574 A TYR 152 80.195666\n", "575 A TYR 277 208.773678\n", "576 A THR 33 324.323760\n", "577 B VAL 494 241.743316\n", "\n", "[578 rows x 4 columns]" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "shield.exposure.df" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Using the `GlycoShield` directly\n", "\n", "The `quickshield` function is, well, quick... but it lacks some customizability. Let's say we want to sample more edges for each glycan (the default is 3 edges per simulation) we will need to use the `GlycoShield` class directly. We can set it up by simply passing the scaffold to it as only argument and then use its `simulate` method to perform the shielding simulation like so:" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "|████████████████████████████████████████| 52/52 [100%] in 1:42.1 (0.51/s) \n" ] } ], "source": [ "# setup the shield simulator\n", "shield = gl.GlycoShield(protein)\n", "\n", "# now run the simulation\n", "out = shield.simulate(angle_step=50, repeats=3, edge_samples=5, save_conformations_to=\"./files/glycoshield\", visualize_conformations=False)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "When providing `visualize_conformations=True` then `out` will be a tuple of the dataframe and a `Py3DmolViewer`. The visuals of the sampled (and accepted; ones with clashes are ignored) conformations are also stored by the GlycoShield so when we call `py3dmol` we can create a \"full\" view with the heatmap and conformations using:\n", "\n", "```python\n", "shield.py3dmol().show()\n", "```\n", "\n", "Keep in mind though that depending on the size of the system this can be very, very, very..... memory intensive and thus slow down the code. It is usually better (and more likely useful anyway) to save the conformations into PDB files and then visualize them externally. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Anyways, this is what the glycoshield looks like when we assemble the exported PDB files:\n", "\n", "![](../_static/_resources/glycoshield.gif)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "And with that we have reached the end of this tutorial. We have seen how we can use the `GlycoShield` class to perform sampling of glycan conformations on a scaffold such as a protein and obtain data on how covered or exposed certain residues are. Thanks for checking out this tutorial and good luck in your project using Glycosylator!" ] } ], "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 }