From 6c84048cc12b96caeb08c41786410c0e1510c099 Mon Sep 17 00:00:00 2001 From: Josh Mitchell Date: Tue, 5 Nov 2024 17:42:49 +1100 Subject: [PATCH 1/2] Add a notebook loading a PDB via MDAnalysis --- .gitignore | 2 + mdanalysis_pdb_loader/6anm_fixed.pdb.gz | Bin 0 -> 1663 bytes mdanalysis_pdb_loader/env.yaml | 20 + .../mdanalysis_pdb_loader.ipynb | 1574 +++++++++++++++++ 4 files changed, 1596 insertions(+) create mode 100644 .gitignore create mode 100644 mdanalysis_pdb_loader/6anm_fixed.pdb.gz create mode 100644 mdanalysis_pdb_loader/env.yaml create mode 100644 mdanalysis_pdb_loader/mdanalysis_pdb_loader.ipynb diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..79cd7d8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.ipynb_checkpoints/ +.virtual_documents/ diff --git a/mdanalysis_pdb_loader/6anm_fixed.pdb.gz b/mdanalysis_pdb_loader/6anm_fixed.pdb.gz new file mode 100644 index 0000000000000000000000000000000000000000..bc3da72404fda0e0a442b9b135521250289af855 GIT binary patch literal 1663 zcmV-_27vh=iwFoe94BW2|2AQ6Z7y(RVgQU;S#skx5dHTlcz~FNZlJMz%9JWhWh_rQ zs>*WzgQORThDc}({YdU69(!Nl&&&Ji^UrCTU|K#er`zQ`{r$&noj!hEuJ7+to?*t{ zCUh8H0bZSdSw8>$>jrWFXACGmXeJ8$1LGW%o2KGsxBvP%$(j2HrkC|{JKf&xkLk)^ z=O35pWPj=>&Ey3&&Jg)E5ayf{e=Dd#Zy!G20P@qz=?Iu-%9+230lkV1DLw&Q9sv32 z<*f(kvlzh7g-9jzt_%UPUd!)Cz%qv@zj4l#6)*-r1jw&n&aejrHy7tsLd>9m6vqIg z0Afc%EaDWH6Y^p3bIfBlOiJk3Fp3kVFeeh*aR|{EARFjo>e(>GtbnnI4bzM&X%Fz@ z0gzw6LN5+ONg9VafQC)<^aOBi0f9Ly9sya!95fCSCJSu9AwWi0eNV#VqXEl18PLTs zKz?dH^=wGNG9^MW2}>FRWa-v7?07ju^D<)5ut5#*?*W4V`i{yzlLj^g3+#}>5Fnpg zyQzmUY3hYQ=4A!`9xzVp8IGw3Gl{AKh&7jS%qd9#u>RS!+N6G76%fCgl;ki6wok>X4f&BKg}yea17LL7ybMwYxoOc*#l}zz>;bT# zrCyW(2d<*B-o;Q_I(j6VgV;(86B8Iln9bmM!$zCoRfB6^n@KM54+vouh z#Aec@vN zj8~|YI*zu0Ak$Yj4wDoj1_UuPONeo3au7>Pfqi2sPqq|P8$tqGFKWd`Ka_f+*GC6X z$`x8GAoFr~x>h_CSlJa8=mC~s5_%bpr3JV#34=AMBVd-njK5vB7JvnY0A)|{U6s{_ zQdk8Lctjp5u+q)1eH%JZZlN52e@Pm$~G_tC_ROqO2~UNO0{8?X>25xL3)k7;$Ripv8qm;0%PS% zE);a&JpE9>umNVBzIZftRva?YNMK7T(SdUZ$cvAJi2!D6qXCCfk5V1y9syZZS4`zn zD>js&z?O7ax+*(|w%LO%;N;v8V5t-A5inXVmlW#qI5fdV=6w8fI{Egqc8-@Zq-Z%OKU>1K#_~=X{Bl6HCM%0ZSI)GH1E|IBt1*8~< z07D&?c45OO(NxZ01E<~Jd=E(Vir^53IxGor-RR+$xqQ2P*1GvfQBEohe)T2hDFM62yuHh>G0pM(#BUqmxh(M1A2+mzM*U^&{_S9 zrO)b7uNTdY)Adf1P-45%UO)h4=Igmj*26i|ZlwchK985=E(8f#_O zYRnb1;pYvcXvb?@Sz=`Q?8A009600|0IL Jh1Z=L003t5|7`#O literal 0 HcmV?d00001 diff --git a/mdanalysis_pdb_loader/env.yaml b/mdanalysis_pdb_loader/env.yaml new file mode 100644 index 0000000..9fb0cb8 --- /dev/null +++ b/mdanalysis_pdb_loader/env.yaml @@ -0,0 +1,20 @@ +name: mdanalysis_pdb_loader +channels: + - conda-forge +dependencies: + # Notebook niceties + - jupyterlab>=4 + - ipywidgets>=8 + - jupyterlab_execute_time + - jupyterlab-lsp + - jupyterlab_rise + - jedi-language-server + - jupyterlab_code_formatter + - black + - isort + - snakeviz + # Code deps + - python + - openff-toolkit + - nglview + - mdanalysis diff --git a/mdanalysis_pdb_loader/mdanalysis_pdb_loader.ipynb b/mdanalysis_pdb_loader/mdanalysis_pdb_loader.ipynb new file mode 100644 index 0000000..bae067b --- /dev/null +++ b/mdanalysis_pdb_loader/mdanalysis_pdb_loader.ipynb @@ -0,0 +1,1574 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 62, + "id": "19cc1a2f-1e4a-4f84-9522-f78b4036d89e", + "metadata": { + "execution": { + "iopub.execute_input": "2024-11-05T06:31:18.914429Z", + "iopub.status.busy": "2024-11-05T06:31:18.914247Z", + "iopub.status.idle": "2024-11-05T06:31:18.917398Z", + "shell.execute_reply": "2024-11-05T06:31:18.917142Z", + "shell.execute_reply.started": "2024-11-05T06:31:18.914413Z" + } + }, + "outputs": [], + "source": [ + "import MDAnalysis as mda\n", + "import rdkit.Chem.AllChem\n", + "from openff.toolkit import Molecule, Topology\n", + "from openff.units import unit\n", + "\n", + "\n", + "def topology_from_pdb(\n", + " pdbfile: str,\n", + " vdwradii: dict[str, float] = {},\n", + " overlap_factor: float = 0.55,\n", + " shortest_bond: float = 0.1,\n", + "):\n", + " \"\"\"Use MDAnalysis' PDB loader to load a PDB file.\n", + "\n", + " Bonds not explicitly included in CONECT records are guessed from atom-atom\n", + " distances. The `vdw_radii`, `required_overlap`, and `lower_bound` parameters\n", + " configure this guessing behavior. The PDB file's CRYST1 records are used\n", + " to compute atom-atom distances.\n", + "\n", + " Parameters\n", + " ==========\n", + "\n", + " pdbfile\n", + " Path to the PDB file to load.\n", + " vdwradii\n", + " Additional van der Waals radii used to guess bonds. A dictionary mapping\n", + " elements to radii in Angstroms that augments the table provided at\n", + " `MDAnalysis.topology.tables.vdwradii`.\n", + " overlap_factor\n", + " The maximum proportion of the sum of two atom's van der Waals radii at\n", + " which distance the two atoms are considered bonded. Larger values will\n", + " tend to produce more bonds.\n", + " shortest_bond\n", + " Any bonds found that are shorter than this distance in Angstroms are\n", + " discarded.\n", + "\n", + " \"\"\"\n", + " u = mda.Universe(\n", + " pdbfile,\n", + " guess_bonds=True,\n", + " vdwradii=vdwradii,\n", + " fudge_factor=overlap_factor,\n", + " lower_bound=shortest_bond,\n", + " )\n", + "\n", + " rdmol = u.atoms.convert_to(\"RDKIT\")\n", + " rdmols = rdkit.Chem.AllChem.GetMolFrags(rdmol, asMols=True)\n", + "\n", + " offmols = [Molecule.from_rdkit(rdmol) for rdmol in rdmols]\n", + " offtop = Topology.from_molecules(offmols)\n", + " if u.dimensions is not None:\n", + " offtop.box_vectors = (\n", + " mda.lib.mdamath.triclinic_vectors(u.dimensions) * unit.angstrom\n", + " )\n", + "\n", + " return offtop" + ] + }, + { + "cell_type": "code", + "execution_count": 52, + "id": "edea5c48-5a1e-41f0-a53c-e6a02b51bbf1", + "metadata": { + "execution": { + "iopub.execute_input": "2024-11-05T06:22:07.399676Z", + "iopub.status.busy": "2024-11-05T06:22:07.399502Z", + "iopub.status.idle": "2024-11-05T06:22:07.488180Z", + "shell.execute_reply": "2024-11-05T06:22:07.487951Z", + "shell.execute_reply.started": "2024-11-05T06:22:07.399663Z" + } + }, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "c917c4f6b7554a31a0c93123677e7cd3", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "NGLWidget()" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "offtop = topology_from_pdb(\"6anm_fixed.pdb.gz\")\n", + "\n", + "offtop.visualize()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4f2de3a8-3edf-435f-8255-4246e76d1066", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "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.12.7" + }, + "widgets": { + "application/vnd.jupyter.widget-state+json": { + "state": { + "01055a673b244e1e82a7b89484e9282e": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "2.0.0", + "model_name": "ButtonModel", + "state": { + "icon": "compress", + "layout": "IPY_MODEL_b5345d8a37894563aac1cc0ca47ee3d9", + "style": "IPY_MODEL_28307a760a1346ad8c5d8e35f5f3f96c", + "tooltip": null + } + }, + "168b59de898d403d82988a7558040cec": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "2.0.0", + "model_name": "LinkModel", + "state": { + "source": [ + "IPY_MODEL_f70f42d0af6048678a5441079bcd43ce", + "value" + ], + "target": [ + "IPY_MODEL_55691ee71cf44c0bbef1775ec22741cc", + "value" + ] + } + }, + "2270b7ae73ba4df98c211cf583bca128": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "2.0.0", + "model_name": "HBoxModel", + "state": { + "children": [ + "IPY_MODEL_f70f42d0af6048678a5441079bcd43ce", + "IPY_MODEL_55691ee71cf44c0bbef1775ec22741cc" + ], + "layout": "IPY_MODEL_60bb020a6edf4de1b8d213f8a963a2b6" + } + }, + "23c94ce7c2114eb2afcd7e652667f670": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "2.0.0", + "model_name": "LayoutModel", + "state": {} + }, + "28307a760a1346ad8c5d8e35f5f3f96c": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "2.0.0", + "model_name": "ButtonStyleModel", + "state": { + "font_family": null, + "font_size": null, + "font_style": null, + "font_variant": null, + "font_weight": null, + "text_color": null, + "text_decoration": null + } + }, + "2852b507671f4c62abb3cffb46d24be9": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "2.0.0", + "model_name": "LayoutModel", + "state": {} + }, + "295da27199df45fc847c3f745c95c9be": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "2.0.0", + "model_name": "ButtonModel", + "state": { + "icon": "compress", + "layout": "IPY_MODEL_4d0d0b46db4743229ec1db8857dd567b", + "style": "IPY_MODEL_2a7e00e2d2a645af907edddca5abdc84", + "tooltip": null + } + }, + "29865ed676e04b60951f580c2ac25eaf": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "2.0.0", + "model_name": "LinkModel", + "state": { + "source": [ + "IPY_MODEL_f70f42d0af6048678a5441079bcd43ce", + "max" + ], + "target": [ + "IPY_MODEL_c917c4f6b7554a31a0c93123677e7cd3", + "max_frame" + ] + } + }, + "2a7e00e2d2a645af907edddca5abdc84": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "2.0.0", + "model_name": "ButtonStyleModel", + "state": { + "font_family": null, + "font_size": null, + "font_style": null, + "font_variant": null, + "font_weight": null, + "text_color": null, + "text_decoration": null + } + }, + "4654b89d348e4b80bf032e3081e93659": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "2.0.0", + "model_name": "LayoutModel", + "state": {} + }, + "4d0d0b46db4743229ec1db8857dd567b": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "2.0.0", + "model_name": "LayoutModel", + "state": { + "width": "34px" + } + }, + "4db9b118e9cf4406a7cdfed66c4f7b6f": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "2.0.0", + "model_name": "LayoutModel", + "state": {} + }, + "4e9df2aa8fcc4e06ae47ec91058792a3": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "2.0.0", + "model_name": "LayoutModel", + "state": {} + }, + "50f52f3fc4fb44728d12deb23b8771de": { + "model_module": "nglview-js-widgets", + "model_module_version": "3.0.8", + "model_name": "NGLModel", + "state": { + "_camera_orientation": [ + 0.5545731365751201, + 13.907593510877145, + -22.158500895670265, + 0, + 7.687333340665938, + 21.098419197668516, + 13.434637473334694, + 0, + 25.00650366038155, + -6.794366833389315, + -3.6385745268807033, + 0, + -7.763000130653381, + -5.3285000920295715, + -18.137500286102295, + 1 + ], + "_camera_str": "orthographic", + "_gui_theme": null, + "_ibtn_fullscreen": "IPY_MODEL_295da27199df45fc847c3f745c95c9be", + "_igui": null, + "_iplayer": "IPY_MODEL_ab2a162f9c2047018cd554c69ef8cfb1", + "_ngl_color_dict": {}, + "_ngl_coordinate_resource": {}, + "_ngl_full_stage_parameters": { + "ambientColor": 14540253, + "ambientIntensity": 0.2, + "backgroundColor": "white", + "cameraEyeSep": 0.3, + "cameraFov": 40, + "cameraType": "perspective", + "clipDist": 10, + "clipFar": 100, + "clipMode": "scene", + "clipNear": 0, + "clipScale": "relative", + "fogFar": 100, + "fogNear": 50, + "hoverTimeout": 0, + "impostor": true, + "lightColor": 14540253, + "lightIntensity": 1, + "mousePreset": "default", + "panSpeed": 1, + "quality": "medium", + "rotateSpeed": 2, + "sampleLevel": 0, + "tooltip": true, + "workerDefault": true, + "zoomSpeed": 1.2 + }, + "_ngl_msg_archive": [ + { + "args": [ + { + "binary": false, + "data": "REMARK 1 CREATED WITH OPENMM 8.1.2, 2024-11-05\nCRYST1 12.242 15.554 26.670 90.00 90.00 90.00 P 1 1 \nHETATM 1 N1x DLE A 1 7.534 6.162 14.887 1.00 0.00 N \nHETATM 2 C1x DLE A 1 8.588 5.163 15.176 1.00 0.00 C \nHETATM 3 C2x DLE A 1 8.382 3.955 14.309 1.00 0.00 C \nHETATM 4 C3x DLE A 1 9.461 2.858 14.643 1.00 0.00 C \nHETATM 5 C4x DLE A 1 10.903 3.281 14.563 1.00 0.00 C \nHETATM 6 C5x DLE A 1 9.294 1.720 13.686 1.00 0.00 C \nHETATM 7 C6x DLE A 1 8.676 4.759 16.656 1.00 0.00 C \nHETATM 8 O1x DLE A 1 9.768 4.698 17.220 1.00 0.00 O \nHETATM 9 H1x DLE A 1 7.497 6.841 15.635 1.00 0.00 H \nHETATM 10 H2x DLE A 1 6.684 5.727 14.812 1.00 0.00 H \nHETATM 11 H3x DLE A 1 7.736 6.610 14.062 1.00 0.00 H \nHETATM 12 H4x DLE A 1 9.548 5.619 14.897 1.00 0.00 H \nHETATM 13 H5x DLE A 1 8.466 4.229 13.258 1.00 0.00 H \nHETATM 14 H6x DLE A 1 7.385 3.541 14.474 1.00 0.00 H \nHETATM 15 H7x DLE A 1 9.267 2.445 15.641 1.00 0.00 H \nHETATM 16 H8x DLE A 1 11.529 2.428 14.622 1.00 0.00 H \nHETATM 17 H9x DLE A 1 11.070 3.770 13.639 1.00 0.00 H \nHETATM 18 H10x DLE A 1 11.154 3.938 15.350 1.00 0.00 H \nHETATM 19 H11x DLE A 1 8.269 1.461 13.621 1.00 0.00 H \nHETATM 20 H12x DLE A 1 9.646 2.004 12.728 1.00 0.00 H \nHETATM 21 H13x DLE A 1 9.846 0.884 14.031 1.00 0.00 H \nHETATM 22 N2x DPN A 2 7.527 4.379 17.253 1.00 0.00 N \nHETATM 23 C7x DPN A 2 7.608 3.716 18.553 1.00 0.00 C \nHETATM 24 C8x DPN A 2 7.926 4.667 19.715 1.00 0.00 C \nHETATM 25 O2x DPN A 2 8.337 4.213 20.778 1.00 0.00 O \nHETATM 26 C9x DPN A 2 6.309 2.950 18.812 1.00 0.00 C \nHETATM 27 C10x DPN A 2 6.153 1.789 17.797 1.00 0.00 C \nHETATM 28 C11x DPN A 2 5.030 1.708 16.967 1.00 0.00 C \nHETATM 29 C12x DPN A 2 7.118 0.767 17.722 1.00 0.00 C \nHETATM 30 C13x DPN A 2 4.861 0.645 16.085 1.00 0.00 C \nHETATM 31 C14x DPN A 2 6.987 -0.256 16.789 1.00 0.00 C \nHETATM 32 C15x DPN A 2 5.850 -0.315 15.959 1.00 0.00 C \nHETATM 33 H14x DPN A 2 6.599 4.517 16.879 1.00 0.00 H \nHETATM 34 H15x DPN A 2 8.422 2.991 18.520 1.00 0.00 H \nHETATM 35 H16x DPN A 2 5.425 3.583 18.863 1.00 0.00 H \nHETATM 36 H17x DPN A 2 4.263 2.466 17.041 1.00 0.00 H \nHETATM 37 H18x DPN A 2 8.005 0.813 18.337 1.00 0.00 H \nHETATM 38 H19x DPN A 2 3.997 0.617 15.433 1.00 0.00 H \nHETATM 39 H20x DPN A 2 7.742 -1.031 16.728 1.00 0.00 H \nHETATM 40 H21x DPN A 2 5.726 -1.136 15.264 1.00 0.00 H \nHETATM 41 C16x BE2 A 3 8.171 8.516 18.235 1.00 0.00 C \nHETATM 42 O3x BE2 A 3 7.792 7.656 17.409 1.00 0.00 O \nHETATM 43 C17x BE2 A 3 7.941 8.368 19.705 1.00 0.00 C \nHETATM 44 C18x BE2 A 3 7.814 7.083 20.291 1.00 0.00 C \nHETATM 45 C19x BE2 A 3 7.771 6.963 21.687 1.00 0.00 C \nHETATM 46 N3x BE2 A 3 7.701 5.972 19.444 1.00 0.00 N \nHETATM 47 C20x BE2 A 3 7.745 8.095 22.478 1.00 0.00 C \nHETATM 48 C21x BE2 A 3 7.758 9.361 21.915 1.00 0.00 C \nHETATM 49 C22x BE2 A 3 7.881 9.491 20.533 1.00 0.00 C \nHETATM 50 H22x BE2 A 3 7.580 6.012 22.163 1.00 0.00 H \nHETATM 51 H23x BE2 A 3 7.826 6.210 18.487 1.00 0.00 H \nHETATM 52 H24x BE2 A 3 7.599 7.992 23.547 1.00 0.00 H \nHETATM 53 H25x BE2 A 3 7.826 10.231 22.550 1.00 0.00 H \nHETATM 54 H26x BE2 A 3 8.041 10.480 20.128 1.00 0.00 H \nHETATM 55 N4x DAL A 4 8.837 9.606 17.825 1.00 0.00 N \nHETATM 56 C23x DAL A 4 9.233 9.687 16.427 1.00 0.00 C \nHETATM 57 C24x DAL A 4 10.091 10.931 16.195 1.00 0.00 C \nHETATM 58 C25x DAL A 4 8.002 9.711 15.500 1.00 0.00 C \nHETATM 59 O4x DAL A 4 8.065 8.974 14.478 1.00 0.00 O \nHETATM 60 O5x DAL A 4 7.055 10.476 15.784 1.00 0.00 O \nHETATM 61 H27x DAL A 4 9.283 10.304 18.317 1.00 0.00 H \nHETATM 62 H28x DAL A 4 9.857 8.820 16.155 1.00 0.00 H \nHETATM 63 H29x DAL A 4 9.590 11.793 16.566 1.00 0.00 H \nHETATM 64 H30x DAL A 4 11.023 10.816 16.698 1.00 0.00 H \nHETATM 65 H31x DAL A 4 10.263 11.045 15.150 1.00 0.00 H \nTER 66 DAL A 4\nCONECT 1 2 9 10 11\nCONECT 2 1 3 7 12\nCONECT 3 2 4 13 14\nCONECT 4 3 5 6 15\nCONECT 5 4 16 17 18\nCONECT 6 4 19 20 21\nCONECT 7 2 8 22\nCONECT 8 7\nCONECT 9 1\nCONECT 10 1\nCONECT 11 1\nCONECT 12 2\nCONECT 13 3\nCONECT 14 3\nCONECT 15 4\nCONECT 16 5\nCONECT 17 5\nCONECT 18 5\nCONECT 19 6\nCONECT 20 6\nCONECT 21 6\nCONECT 22 7 23 33\nCONECT 23 22 24 26 34\nCONECT 24 23 25 46\nCONECT 25 24\nCONECT 26 23 27 35\nCONECT 27 26 28 29\nCONECT 28 27 30 36\nCONECT 29 27 31 37\nCONECT 30 28 32 38\nCONECT 31 29 32 39\nCONECT 32 30 31 40\nCONECT 33 22\nCONECT 34 23\nCONECT 35 26\nCONECT 36 28\nCONECT 37 29\nCONECT 38 30\nCONECT 39 31\nCONECT 40 32\nCONECT 41 42 43 55\nCONECT 42 41\nCONECT 43 41 44 49\nCONECT 44 43 45 46\nCONECT 45 44 47 50\nCONECT 46 24 44 51\nCONECT 47 45 48 52\nCONECT 48 47 49 53\nCONECT 49 43 48 54\nCONECT 50 45\nCONECT 51 46\nCONECT 52 47\nCONECT 53 48\nCONECT 54 49\nCONECT 55 41 56 61\nCONECT 56 55 57 58 62\nCONECT 57 56 63 64 65\nCONECT 58 56 59 60\nCONECT 59 58\nCONECT 60 58\nCONECT 61 55\nCONECT 62 56\nCONECT 63 57\nCONECT 64 57\nCONECT 65 57\nEND\n", + "type": "blob" + } + ], + "kwargs": { + "defaultRepresentation": false, + "ext": "pdb" + }, + "methodName": "loadFile", + "reconstruc_color_scheme": false, + "target": "Stage", + "type": "call_method" + }, + { + "args": [], + "component_index": 0, + "kwargs": {}, + "methodName": "removeAllRepresentations", + "reconstruc_color_scheme": false, + "target": "compList", + "type": "call_method" + }, + { + "args": [ + "unitcell" + ], + "component_index": 0, + "kwargs": {}, + "methodName": "addRepresentation", + "reconstruc_color_scheme": false, + "target": "compList", + "type": "call_method" + }, + { + "args": [ + "line" + ], + "component_index": 0, + "kwargs": { + "sele": "water" + }, + "methodName": "addRepresentation", + "reconstruc_color_scheme": false, + "target": "compList", + "type": "call_method" + }, + { + "args": [ + "spacefill" + ], + "component_index": 0, + "kwargs": { + "sele": "ion" + }, + "methodName": "addRepresentation", + "reconstruc_color_scheme": false, + "target": "compList", + "type": "call_method" + }, + { + "args": [ + "cartoon" + ], + "component_index": 0, + "kwargs": { + "sele": "protein" + }, + "methodName": "addRepresentation", + "reconstruc_color_scheme": false, + "target": "compList", + "type": "call_method" + }, + { + "args": [ + "licorice" + ], + "component_index": 0, + "kwargs": { + "multipleBond": false, + "radius": 0.25, + "sele": "not water and not ion and not protein" + }, + "methodName": "addRepresentation", + "reconstruc_color_scheme": false, + "target": "compList", + "type": "call_method" + } + ], + "_ngl_original_stage_parameters": { + "ambientColor": 14540253, + "ambientIntensity": 0.2, + "backgroundColor": "white", + "cameraEyeSep": 0.3, + "cameraFov": 40, + "cameraType": "perspective", + "clipDist": 10, + "clipFar": 100, + "clipMode": "scene", + "clipNear": 0, + "clipScale": "relative", + "fogFar": 100, + "fogNear": 50, + "hoverTimeout": 0, + "impostor": true, + "lightColor": 14540253, + "lightIntensity": 1, + "mousePreset": "default", + "panSpeed": 1, + "quality": "medium", + "rotateSpeed": 2, + "sampleLevel": 0, + "tooltip": true, + "workerDefault": true, + "zoomSpeed": 1.2 + }, + "_ngl_repr_dict": { + "0": { + "0": { + "params": { + "clipCenter": { + "x": 0, + "y": 0, + "z": 0 + }, + "clipNear": 0, + "clipRadius": 0, + "colorMode": "hcl", + "colorReverse": false, + "colorScale": "", + "colorScheme": "element", + "colorValue": "orange", + "defaultAssembly": "", + "depthWrite": true, + "diffuse": 16777215, + "diffuseInterior": false, + "disableImpostor": false, + "disablePicking": false, + "flatShaded": false, + "interiorColor": 2236962, + "interiorDarkening": 0, + "lazy": false, + "matrix": { + "elements": [ + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 1 + ] + }, + "metalness": 0, + "opacity": 1, + "quality": "medium", + "radialSegments": 10, + "radiusData": {}, + "radiusScale": 1, + "radiusSize": 0.08594273039925363, + "radiusType": "vdw", + "roughness": 0.4, + "sele": "", + "side": "double", + "sphereDetail": 1, + "useInteriorColor": true, + "visible": true, + "wireframe": false + }, + "type": "unitcell" + }, + "1": { + "params": { + "assembly": "default", + "bondSpacing": 1, + "clipCenter": { + "x": 0, + "y": 0, + "z": 0 + }, + "clipNear": 0, + "clipRadius": 0, + "colorMode": "hcl", + "colorReverse": false, + "colorScale": "", + "colorScheme": "element", + "colorValue": 9474192, + "crossSize": 0.4, + "crosses": "lone", + "defaultAssembly": "", + "depthWrite": true, + "diffuse": 16777215, + "diffuseInterior": false, + "disablePicking": false, + "interiorColor": 2236962, + "interiorDarkening": 0, + "lazy": false, + "lines": true, + "linewidth": 2, + "matrix": { + "elements": [ + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 1 + ] + }, + "multipleBond": "off", + "opacity": 1, + "quality": "medium", + "radiusData": {}, + "radiusScale": 1, + "radiusSize": 1, + "radiusType": "vdw", + "sele": "water", + "useInteriorColor": false, + "visible": true + }, + "type": "line" + }, + "2": { + "params": { + "assembly": "default", + "clipCenter": { + "x": 0, + "y": 0, + "z": 0 + }, + "clipNear": 0, + "clipRadius": 0, + "colorMode": "hcl", + "colorReverse": false, + "colorScale": "", + "colorScheme": "element", + "colorValue": 9474192, + "defaultAssembly": "", + "depthWrite": true, + "diffuse": 16777215, + "diffuseInterior": false, + "disableImpostor": false, + "disablePicking": false, + "flatShaded": false, + "interiorColor": 2236962, + "interiorDarkening": 0, + "lazy": false, + "matrix": { + "elements": [ + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 1 + ] + }, + "metalness": 0, + "opacity": 1, + "quality": "medium", + "radiusData": {}, + "radiusScale": 1, + "radiusSize": 1, + "radiusType": "vdw", + "roughness": 0.4, + "sele": "ion", + "side": "double", + "sphereDetail": 1, + "useInteriorColor": true, + "visible": true, + "wireframe": false + }, + "type": "spacefill" + }, + "3": { + "params": { + "aspectRatio": 5, + "assembly": "default", + "capped": true, + "clipCenter": { + "x": 0, + "y": 0, + "z": 0 + }, + "clipNear": 0, + "clipRadius": 0, + "colorMode": "hcl", + "colorReverse": false, + "colorScale": "RdYlBu", + "colorScheme": "chainname", + "colorValue": 9474192, + "defaultAssembly": "", + "depthWrite": true, + "diffuse": 16777215, + "diffuseInterior": false, + "disablePicking": false, + "flatShaded": false, + "interiorColor": 2236962, + "interiorDarkening": 0, + "lazy": false, + "matrix": { + "elements": [ + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 1 + ] + }, + "metalness": 0, + "opacity": 1, + "quality": "medium", + "radialSegments": 10, + "radiusData": {}, + "radiusScale": 0.7, + "radiusSize": 1, + "radiusType": "sstruc", + "roughness": 0.4, + "sele": "protein", + "side": "double", + "smoothSheet": false, + "subdiv": 6, + "tension": null, + "useInteriorColor": true, + "visible": true, + "wireframe": false + }, + "type": "cartoon" + }, + "4": { + "params": { + "assembly": "default", + "bondScale": 0.4, + "bondSpacing": 1, + "clipCenter": { + "x": 0, + "y": 0, + "z": 0 + }, + "clipNear": 0, + "clipRadius": 0, + "colorMode": "hcl", + "colorReverse": false, + "colorScale": "", + "colorScheme": "element", + "colorValue": 9474192, + "cylinderOnly": false, + "defaultAssembly": "", + "depthWrite": true, + "diffuse": 16777215, + "diffuseInterior": false, + "disableImpostor": false, + "disablePicking": false, + "flatShaded": false, + "interiorColor": 2236962, + "interiorDarkening": 0, + "lazy": false, + "lineOnly": false, + "linewidth": 2, + "matrix": { + "elements": [ + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 1 + ] + }, + "metalness": 0, + "multipleBond": false, + "opacity": 1, + "openEnded": true, + "quality": "medium", + "radialSegments": 10, + "radiusData": {}, + "radiusScale": 1, + "radiusSize": 0.25, + "radiusType": "size", + "roughness": 0.4, + "sele": "not water and not ion and not protein", + "side": "double", + "sphereDetail": 1, + "useInteriorColor": true, + "visible": true, + "wireframe": false + }, + "type": "licorice" + } + } + }, + "_ngl_serialize": false, + "_ngl_version": "2.0.0-dev.39", + "_ngl_view_id": [ + "E0D2471F-9B50-4619-825D-128694FCB598" + ], + "_player_dict": {}, + "_scene_position": {}, + "_scene_rotation": {}, + "_synced_model_ids": [], + "_synced_repr_model_ids": [], + "_view_height": "", + "_view_width": "", + "background": "white", + "frame": 0, + "gui_style": null, + "layout": "IPY_MODEL_2852b507671f4c62abb3cffb46d24be9", + "max_frame": 0, + "n_components": 1, + "picked": {} + } + }, + "55691ee71cf44c0bbef1775ec22741cc": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "2.0.0", + "model_name": "IntSliderModel", + "state": { + "behavior": "drag-tap", + "layout": "IPY_MODEL_4e9df2aa8fcc4e06ae47ec91058792a3", + "max": 0, + "style": "IPY_MODEL_8ad0f54330fc4386b6df4055245fb48e" + } + }, + "56412f5d881b447bb968ca9a53c16bbc": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "2.0.0", + "model_name": "LinkModel", + "state": { + "source": [ + "IPY_MODEL_ab1b3ae0e381493f89d4f01359d90850", + "value" + ], + "target": [ + "IPY_MODEL_50f52f3fc4fb44728d12deb23b8771de", + "frame" + ] + } + }, + "59ac38c719e34e20a34df32fb5d0b7f8": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "2.0.0", + "model_name": "IntSliderModel", + "state": { + "behavior": "drag-tap", + "layout": "IPY_MODEL_604b69f1d18b4da480027507594187cb", + "max": 0, + "style": "IPY_MODEL_cd6772b351194a4895d3df8c8078e442" + } + }, + "604b69f1d18b4da480027507594187cb": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "2.0.0", + "model_name": "LayoutModel", + "state": {} + }, + "60bb020a6edf4de1b8d213f8a963a2b6": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "2.0.0", + "model_name": "LayoutModel", + "state": {} + }, + "7783d3c5b77f474f93086ff1ba0bed9d": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "2.0.0", + "model_name": "LinkModel", + "state": { + "source": [ + "IPY_MODEL_ab1b3ae0e381493f89d4f01359d90850", + "max" + ], + "target": [ + "IPY_MODEL_50f52f3fc4fb44728d12deb23b8771de", + "max_frame" + ] + } + }, + "877a3e00a2ea4cb7a45910c33207d451": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "2.0.0", + "model_name": "ImageModel", + "state": { + "layout": "IPY_MODEL_ed84808ca6b24532a9bad105f4c700f9", + "width": "900.0" + } + }, + "8ad0f54330fc4386b6df4055245fb48e": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "2.0.0", + "model_name": "SliderStyleModel", + "state": { + "description_width": "" + } + }, + "95169969acf944b3b3cf9d79151a1fd7": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "2.0.0", + "model_name": "LinkModel", + "state": { + "source": [ + "IPY_MODEL_f70f42d0af6048678a5441079bcd43ce", + "value" + ], + "target": [ + "IPY_MODEL_c917c4f6b7554a31a0c93123677e7cd3", + "frame" + ] + } + }, + "ab1b3ae0e381493f89d4f01359d90850": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "2.0.0", + "model_name": "PlayModel", + "state": { + "layout": "IPY_MODEL_d6b13cd9e06c4a63bbd6893d0aa62cea", + "max": 0, + "style": "IPY_MODEL_fbb1ba0b594b46abb3fe19c2aff19123" + } + }, + "ab2a162f9c2047018cd554c69ef8cfb1": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "2.0.0", + "model_name": "HBoxModel", + "state": { + "children": [ + "IPY_MODEL_ab1b3ae0e381493f89d4f01359d90850", + "IPY_MODEL_59ac38c719e34e20a34df32fb5d0b7f8" + ], + "layout": "IPY_MODEL_da4052584a3f4ba2b2c7d1752fcd30d7" + } + }, + "ad9190a9abb34e588f08253abca3cc21": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "2.0.0", + "model_name": "ImageModel", + "state": { + "layout": "IPY_MODEL_4654b89d348e4b80bf032e3081e93659", + "width": "900.0" + } + }, + "ae3c731487b94f78b692501cda0f5c41": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "2.0.0", + "model_name": "LinkModel", + "state": { + "source": [ + "IPY_MODEL_ab1b3ae0e381493f89d4f01359d90850", + "value" + ], + "target": [ + "IPY_MODEL_59ac38c719e34e20a34df32fb5d0b7f8", + "value" + ] + } + }, + "b5345d8a37894563aac1cc0ca47ee3d9": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "2.0.0", + "model_name": "LayoutModel", + "state": { + "width": "34px" + } + }, + "b72270a21d634e2eaee32806d523aa86": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "2.0.0", + "model_name": "LinkModel", + "state": { + "source": [ + "IPY_MODEL_55691ee71cf44c0bbef1775ec22741cc", + "max" + ], + "target": [ + "IPY_MODEL_c917c4f6b7554a31a0c93123677e7cd3", + "max_frame" + ] + } + }, + "c503f1eed4214749a824c8b0702c60aa": { + "model_module": "nglview-js-widgets", + "model_module_version": "3.0.8", + "model_name": "ColormakerRegistryModel", + "state": { + "_msg_ar": [], + "_msg_q": [], + "_ready": true, + "layout": "IPY_MODEL_fbb3c9168c2343549520149d1ff8adce" + } + }, + "c917c4f6b7554a31a0c93123677e7cd3": { + "model_module": "nglview-js-widgets", + "model_module_version": "3.0.8", + "model_name": "NGLModel", + "state": { + "_camera_orientation": [ + 26.413139289445787, + 0, + 0, + 0, + 0, + 26.413139289445787, + 0, + 0, + 0, + 0, + 26.413139289445787, + 0, + -7.763000130653381, + -5.3285000920295715, + -18.137500286102295, + 1 + ], + "_camera_str": "orthographic", + "_gui_theme": null, + "_ibtn_fullscreen": "IPY_MODEL_01055a673b244e1e82a7b89484e9282e", + "_igui": null, + "_iplayer": "IPY_MODEL_2270b7ae73ba4df98c211cf583bca128", + "_ngl_color_dict": {}, + "_ngl_coordinate_resource": {}, + "_ngl_full_stage_parameters": { + "ambientColor": 14540253, + "ambientIntensity": 0.2, + "backgroundColor": "white", + "cameraEyeSep": 0.3, + "cameraFov": 40, + "cameraType": "perspective", + "clipDist": 10, + "clipFar": 100, + "clipMode": "scene", + "clipNear": 0, + "clipScale": "relative", + "fogFar": 100, + "fogNear": 50, + "hoverTimeout": 0, + "impostor": true, + "lightColor": 14540253, + "lightIntensity": 1, + "mousePreset": "default", + "panSpeed": 1, + "quality": "medium", + "rotateSpeed": 2, + "sampleLevel": 0, + "tooltip": true, + "workerDefault": true, + "zoomSpeed": 1.2 + }, + "_ngl_msg_archive": [ + { + "args": [ + { + "binary": false, + "data": "REMARK 1 CREATED WITH OPENMM 8.1.2, 2024-11-05\nCRYST1 12.242 15.554 26.670 90.00 90.00 90.00 P 1 1 \nHETATM 1 N1x DLE A 1 7.534 6.162 14.887 1.00 0.00 N \nHETATM 2 C1x DLE A 1 8.588 5.163 15.176 1.00 0.00 C \nHETATM 3 C2x DLE A 1 8.382 3.955 14.309 1.00 0.00 C \nHETATM 4 C3x DLE A 1 9.461 2.858 14.643 1.00 0.00 C \nHETATM 5 C4x DLE A 1 10.903 3.281 14.563 1.00 0.00 C \nHETATM 6 C5x DLE A 1 9.294 1.720 13.686 1.00 0.00 C \nHETATM 7 C6x DLE A 1 8.676 4.759 16.656 1.00 0.00 C \nHETATM 8 O1x DLE A 1 9.768 4.698 17.220 1.00 0.00 O \nHETATM 9 H1x DLE A 1 7.497 6.841 15.635 1.00 0.00 H \nHETATM 10 H2x DLE A 1 6.684 5.727 14.812 1.00 0.00 H \nHETATM 11 H3x DLE A 1 7.736 6.610 14.062 1.00 0.00 H \nHETATM 12 H4x DLE A 1 9.548 5.619 14.897 1.00 0.00 H \nHETATM 13 H5x DLE A 1 8.466 4.229 13.258 1.00 0.00 H \nHETATM 14 H6x DLE A 1 7.385 3.541 14.474 1.00 0.00 H \nHETATM 15 H7x DLE A 1 9.267 2.445 15.641 1.00 0.00 H \nHETATM 16 H8x DLE A 1 11.529 2.428 14.622 1.00 0.00 H \nHETATM 17 H9x DLE A 1 11.070 3.770 13.639 1.00 0.00 H \nHETATM 18 H10x DLE A 1 11.154 3.938 15.350 1.00 0.00 H \nHETATM 19 H11x DLE A 1 8.269 1.461 13.621 1.00 0.00 H \nHETATM 20 H12x DLE A 1 9.646 2.004 12.728 1.00 0.00 H \nHETATM 21 H13x DLE A 1 9.846 0.884 14.031 1.00 0.00 H \nHETATM 22 N2x DPN A 2 7.527 4.379 17.253 1.00 0.00 N \nHETATM 23 C7x DPN A 2 7.608 3.716 18.553 1.00 0.00 C \nHETATM 24 C8x DPN A 2 7.926 4.667 19.715 1.00 0.00 C \nHETATM 25 O2x DPN A 2 8.337 4.213 20.778 1.00 0.00 O \nHETATM 26 C9x DPN A 2 6.309 2.950 18.812 1.00 0.00 C \nHETATM 27 C10x DPN A 2 6.153 1.789 17.797 1.00 0.00 C \nHETATM 28 C11x DPN A 2 5.030 1.708 16.967 1.00 0.00 C \nHETATM 29 C12x DPN A 2 7.118 0.767 17.722 1.00 0.00 C \nHETATM 30 C13x DPN A 2 4.861 0.645 16.085 1.00 0.00 C \nHETATM 31 C14x DPN A 2 6.987 -0.256 16.789 1.00 0.00 C \nHETATM 32 C15x DPN A 2 5.850 -0.315 15.959 1.00 0.00 C \nHETATM 33 H14x DPN A 2 6.599 4.517 16.879 1.00 0.00 H \nHETATM 34 H15x DPN A 2 8.422 2.991 18.520 1.00 0.00 H \nHETATM 35 H16x DPN A 2 5.425 3.583 18.863 1.00 0.00 H \nHETATM 36 H17x DPN A 2 4.263 2.466 17.041 1.00 0.00 H \nHETATM 37 H18x DPN A 2 8.005 0.813 18.337 1.00 0.00 H \nHETATM 38 H19x DPN A 2 3.997 0.617 15.433 1.00 0.00 H \nHETATM 39 H20x DPN A 2 7.742 -1.031 16.728 1.00 0.00 H \nHETATM 40 H21x DPN A 2 5.726 -1.136 15.264 1.00 0.00 H \nHETATM 41 C16x BE2 A 3 8.171 8.516 18.235 1.00 0.00 C \nHETATM 42 O3x BE2 A 3 7.792 7.656 17.409 1.00 0.00 O \nHETATM 43 C17x BE2 A 3 7.941 8.368 19.705 1.00 0.00 C \nHETATM 44 C18x BE2 A 3 7.814 7.083 20.291 1.00 0.00 C \nHETATM 45 C19x BE2 A 3 7.771 6.963 21.687 1.00 0.00 C \nHETATM 46 N3x BE2 A 3 7.701 5.972 19.444 1.00 0.00 N \nHETATM 47 C20x BE2 A 3 7.745 8.095 22.478 1.00 0.00 C \nHETATM 48 C21x BE2 A 3 7.758 9.361 21.915 1.00 0.00 C \nHETATM 49 C22x BE2 A 3 7.881 9.491 20.533 1.00 0.00 C \nHETATM 50 H22x BE2 A 3 7.580 6.012 22.163 1.00 0.00 H \nHETATM 51 H23x BE2 A 3 7.826 6.210 18.487 1.00 0.00 H \nHETATM 52 H24x BE2 A 3 7.599 7.992 23.547 1.00 0.00 H \nHETATM 53 H25x BE2 A 3 7.826 10.231 22.550 1.00 0.00 H \nHETATM 54 H26x BE2 A 3 8.041 10.480 20.128 1.00 0.00 H \nHETATM 55 N4x DAL A 4 8.837 9.606 17.825 1.00 0.00 N \nHETATM 56 C23x DAL A 4 9.233 9.687 16.427 1.00 0.00 C \nHETATM 57 C24x DAL A 4 10.091 10.931 16.195 1.00 0.00 C \nHETATM 58 C25x DAL A 4 8.002 9.711 15.500 1.00 0.00 C \nHETATM 59 O4x DAL A 4 8.065 8.974 14.478 1.00 0.00 O \nHETATM 60 O5x DAL A 4 7.055 10.476 15.784 1.00 0.00 O \nHETATM 61 H27x DAL A 4 9.283 10.304 18.317 1.00 0.00 H \nHETATM 62 H28x DAL A 4 9.857 8.820 16.155 1.00 0.00 H \nHETATM 63 H29x DAL A 4 9.590 11.793 16.566 1.00 0.00 H \nHETATM 64 H30x DAL A 4 11.023 10.816 16.698 1.00 0.00 H \nHETATM 65 H31x DAL A 4 10.263 11.045 15.150 1.00 0.00 H \nTER 66 DAL A 4\nCONECT 1 2 9 10 11\nCONECT 2 1 3 7 12\nCONECT 3 2 4 13 14\nCONECT 4 3 5 6 15\nCONECT 5 4 16 17 18\nCONECT 6 4 19 20 21\nCONECT 7 2 8 22\nCONECT 8 7\nCONECT 9 1\nCONECT 10 1\nCONECT 11 1\nCONECT 12 2\nCONECT 13 3\nCONECT 14 3\nCONECT 15 4\nCONECT 16 5\nCONECT 17 5\nCONECT 18 5\nCONECT 19 6\nCONECT 20 6\nCONECT 21 6\nCONECT 22 7 23 33\nCONECT 23 22 24 26 34\nCONECT 24 23 25 46\nCONECT 25 24\nCONECT 26 23 27 35\nCONECT 27 26 28 29\nCONECT 28 27 30 36\nCONECT 29 27 31 37\nCONECT 30 28 32 38\nCONECT 31 29 32 39\nCONECT 32 30 31 40\nCONECT 33 22\nCONECT 34 23\nCONECT 35 26\nCONECT 36 28\nCONECT 37 29\nCONECT 38 30\nCONECT 39 31\nCONECT 40 32\nCONECT 41 42 43 55\nCONECT 42 41\nCONECT 43 41 44 49\nCONECT 44 43 45 46\nCONECT 45 44 47 50\nCONECT 46 24 44 51\nCONECT 47 45 48 52\nCONECT 48 47 49 53\nCONECT 49 43 48 54\nCONECT 50 45\nCONECT 51 46\nCONECT 52 47\nCONECT 53 48\nCONECT 54 49\nCONECT 55 41 56 61\nCONECT 56 55 57 58 62\nCONECT 57 56 63 64 65\nCONECT 58 56 59 60\nCONECT 59 58\nCONECT 60 58\nCONECT 61 55\nCONECT 62 56\nCONECT 63 57\nCONECT 64 57\nCONECT 65 57\nEND\n", + "type": "blob" + } + ], + "kwargs": { + "defaultRepresentation": false, + "ext": "pdb" + }, + "methodName": "loadFile", + "reconstruc_color_scheme": false, + "target": "Stage", + "type": "call_method" + }, + { + "args": [], + "component_index": 0, + "kwargs": {}, + "methodName": "removeAllRepresentations", + "reconstruc_color_scheme": false, + "target": "compList", + "type": "call_method" + }, + { + "args": [ + "unitcell" + ], + "component_index": 0, + "kwargs": {}, + "methodName": "addRepresentation", + "reconstruc_color_scheme": false, + "target": "compList", + "type": "call_method" + }, + { + "args": [ + "line" + ], + "component_index": 0, + "kwargs": { + "sele": "water" + }, + "methodName": "addRepresentation", + "reconstruc_color_scheme": false, + "target": "compList", + "type": "call_method" + }, + { + "args": [ + "spacefill" + ], + "component_index": 0, + "kwargs": { + "sele": "ion" + }, + "methodName": "addRepresentation", + "reconstruc_color_scheme": false, + "target": "compList", + "type": "call_method" + }, + { + "args": [ + "cartoon" + ], + "component_index": 0, + "kwargs": { + "sele": "protein" + }, + "methodName": "addRepresentation", + "reconstruc_color_scheme": false, + "target": "compList", + "type": "call_method" + }, + { + "args": [ + "licorice" + ], + "component_index": 0, + "kwargs": { + "multipleBond": false, + "radius": 0.25, + "sele": "not water and not ion and not protein" + }, + "methodName": "addRepresentation", + "reconstruc_color_scheme": false, + "target": "compList", + "type": "call_method" + } + ], + "_ngl_original_stage_parameters": { + "ambientColor": 14540253, + "ambientIntensity": 0.2, + "backgroundColor": "white", + "cameraEyeSep": 0.3, + "cameraFov": 40, + "cameraType": "perspective", + "clipDist": 10, + "clipFar": 100, + "clipMode": "scene", + "clipNear": 0, + "clipScale": "relative", + "fogFar": 100, + "fogNear": 50, + "hoverTimeout": 0, + "impostor": true, + "lightColor": 14540253, + "lightIntensity": 1, + "mousePreset": "default", + "panSpeed": 1, + "quality": "medium", + "rotateSpeed": 2, + "sampleLevel": 0, + "tooltip": true, + "workerDefault": true, + "zoomSpeed": 1.2 + }, + "_ngl_repr_dict": { + "0": { + "0": { + "params": { + "clipCenter": { + "x": 0, + "y": 0, + "z": 0 + }, + "clipNear": 0, + "clipRadius": 0, + "colorMode": "hcl", + "colorReverse": false, + "colorScale": "", + "colorScheme": "element", + "colorValue": "orange", + "defaultAssembly": "", + "depthWrite": true, + "diffuse": 16777215, + "diffuseInterior": false, + "disableImpostor": false, + "disablePicking": false, + "flatShaded": false, + "interiorColor": 2236962, + "interiorDarkening": 0, + "lazy": false, + "matrix": { + "elements": [ + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 1 + ] + }, + "metalness": 0, + "opacity": 1, + "quality": "medium", + "radialSegments": 10, + "radiusData": {}, + "radiusScale": 1, + "radiusSize": 0.08594273039925363, + "radiusType": "vdw", + "roughness": 0.4, + "sele": "", + "side": "double", + "sphereDetail": 1, + "useInteriorColor": true, + "visible": true, + "wireframe": false + }, + "type": "unitcell" + }, + "1": { + "params": { + "assembly": "default", + "bondSpacing": 1, + "clipCenter": { + "x": 0, + "y": 0, + "z": 0 + }, + "clipNear": 0, + "clipRadius": 0, + "colorMode": "hcl", + "colorReverse": false, + "colorScale": "", + "colorScheme": "element", + "colorValue": 9474192, + "crossSize": 0.4, + "crosses": "lone", + "defaultAssembly": "", + "depthWrite": true, + "diffuse": 16777215, + "diffuseInterior": false, + "disablePicking": false, + "interiorColor": 2236962, + "interiorDarkening": 0, + "lazy": false, + "lines": true, + "linewidth": 2, + "matrix": { + "elements": [ + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 1 + ] + }, + "multipleBond": "off", + "opacity": 1, + "quality": "medium", + "radiusData": {}, + "radiusScale": 1, + "radiusSize": 1, + "radiusType": "vdw", + "sele": "water", + "useInteriorColor": false, + "visible": true + }, + "type": "line" + }, + "2": { + "params": { + "assembly": "default", + "clipCenter": { + "x": 0, + "y": 0, + "z": 0 + }, + "clipNear": 0, + "clipRadius": 0, + "colorMode": "hcl", + "colorReverse": false, + "colorScale": "", + "colorScheme": "element", + "colorValue": 9474192, + "defaultAssembly": "", + "depthWrite": true, + "diffuse": 16777215, + "diffuseInterior": false, + "disableImpostor": false, + "disablePicking": false, + "flatShaded": false, + "interiorColor": 2236962, + "interiorDarkening": 0, + "lazy": false, + "matrix": { + "elements": [ + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 1 + ] + }, + "metalness": 0, + "opacity": 1, + "quality": "medium", + "radiusData": {}, + "radiusScale": 1, + "radiusSize": 1, + "radiusType": "vdw", + "roughness": 0.4, + "sele": "ion", + "side": "double", + "sphereDetail": 1, + "useInteriorColor": true, + "visible": true, + "wireframe": false + }, + "type": "spacefill" + }, + "3": { + "params": { + "aspectRatio": 5, + "assembly": "default", + "capped": true, + "clipCenter": { + "x": 0, + "y": 0, + "z": 0 + }, + "clipNear": 0, + "clipRadius": 0, + "colorMode": "hcl", + "colorReverse": false, + "colorScale": "RdYlBu", + "colorScheme": "chainname", + "colorValue": 9474192, + "defaultAssembly": "", + "depthWrite": true, + "diffuse": 16777215, + "diffuseInterior": false, + "disablePicking": false, + "flatShaded": false, + "interiorColor": 2236962, + "interiorDarkening": 0, + "lazy": false, + "matrix": { + "elements": [ + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 1 + ] + }, + "metalness": 0, + "opacity": 1, + "quality": "medium", + "radialSegments": 10, + "radiusData": {}, + "radiusScale": 0.7, + "radiusSize": 1, + "radiusType": "sstruc", + "roughness": 0.4, + "sele": "protein", + "side": "double", + "smoothSheet": false, + "subdiv": 6, + "tension": null, + "useInteriorColor": true, + "visible": true, + "wireframe": false + }, + "type": "cartoon" + }, + "4": { + "params": { + "assembly": "default", + "bondScale": 0.4, + "bondSpacing": 1, + "clipCenter": { + "x": 0, + "y": 0, + "z": 0 + }, + "clipNear": 0, + "clipRadius": 0, + "colorMode": "hcl", + "colorReverse": false, + "colorScale": "", + "colorScheme": "element", + "colorValue": 9474192, + "cylinderOnly": false, + "defaultAssembly": "", + "depthWrite": true, + "diffuse": 16777215, + "diffuseInterior": false, + "disableImpostor": false, + "disablePicking": false, + "flatShaded": false, + "interiorColor": 2236962, + "interiorDarkening": 0, + "lazy": false, + "lineOnly": false, + "linewidth": 2, + "matrix": { + "elements": [ + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 1 + ] + }, + "metalness": 0, + "multipleBond": false, + "opacity": 1, + "openEnded": true, + "quality": "medium", + "radialSegments": 10, + "radiusData": {}, + "radiusScale": 1, + "radiusSize": 0.25, + "radiusType": "size", + "roughness": 0.4, + "sele": "not water and not ion and not protein", + "side": "double", + "sphereDetail": 1, + "useInteriorColor": true, + "visible": true, + "wireframe": false + }, + "type": "licorice" + } + } + }, + "_ngl_serialize": false, + "_ngl_version": "2.0.0-dev.39", + "_ngl_view_id": [ + "509887EE-1079-4FF8-9158-4837E23F60EC" + ], + "_player_dict": {}, + "_scene_position": {}, + "_scene_rotation": {}, + "_synced_model_ids": [], + "_synced_repr_model_ids": [], + "_view_height": "", + "_view_width": "", + "background": "white", + "frame": 0, + "gui_style": null, + "layout": "IPY_MODEL_23c94ce7c2114eb2afcd7e652667f670", + "max_frame": 0, + "n_components": 1, + "picked": {} + } + }, + "cd6772b351194a4895d3df8c8078e442": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "2.0.0", + "model_name": "SliderStyleModel", + "state": { + "description_width": "" + } + }, + "d36c038ffd2d4fc28da3fa71ede0a418": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "2.0.0", + "model_name": "LinkModel", + "state": { + "source": [ + "IPY_MODEL_59ac38c719e34e20a34df32fb5d0b7f8", + "max" + ], + "target": [ + "IPY_MODEL_50f52f3fc4fb44728d12deb23b8771de", + "max_frame" + ] + } + }, + "d6b13cd9e06c4a63bbd6893d0aa62cea": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "2.0.0", + "model_name": "LayoutModel", + "state": {} + }, + "da4052584a3f4ba2b2c7d1752fcd30d7": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "2.0.0", + "model_name": "LayoutModel", + "state": {} + }, + "ed84808ca6b24532a9bad105f4c700f9": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "2.0.0", + "model_name": "LayoutModel", + "state": {} + }, + "f70f42d0af6048678a5441079bcd43ce": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "2.0.0", + "model_name": "PlayModel", + "state": { + "layout": "IPY_MODEL_4db9b118e9cf4406a7cdfed66c4f7b6f", + "max": 0, + "style": "IPY_MODEL_fd44e9aae720471dab4d5b59514e801e" + } + }, + "fbb1ba0b594b46abb3fe19c2aff19123": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "2.0.0", + "model_name": "DescriptionStyleModel", + "state": { + "description_width": "" + } + }, + "fbb3c9168c2343549520149d1ff8adce": { + "model_module": "@jupyter-widgets/base", + "model_module_version": "2.0.0", + "model_name": "LayoutModel", + "state": {} + }, + "fd44e9aae720471dab4d5b59514e801e": { + "model_module": "@jupyter-widgets/controls", + "model_module_version": "2.0.0", + "model_name": "DescriptionStyleModel", + "state": { + "description_width": "" + } + } + }, + "version_major": 2, + "version_minor": 0 + } + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} From c3ea9cf45584eb05eb52a2abaa44aa98dfc3812e Mon Sep 17 00:00:00 2001 From: Josh Mitchell Date: Tue, 5 Nov 2024 18:37:58 +1100 Subject: [PATCH 2/2] Support unrealistic bond orders and ignoring the box --- .../mdanalysis_pdb_loader.ipynb | 34 ++++++++++++------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/mdanalysis_pdb_loader/mdanalysis_pdb_loader.ipynb b/mdanalysis_pdb_loader/mdanalysis_pdb_loader.ipynb index bae067b..19e27a4 100644 --- a/mdanalysis_pdb_loader/mdanalysis_pdb_loader.ipynb +++ b/mdanalysis_pdb_loader/mdanalysis_pdb_loader.ipynb @@ -2,37 +2,40 @@ "cells": [ { "cell_type": "code", - "execution_count": 62, + "execution_count": 94, "id": "19cc1a2f-1e4a-4f84-9522-f78b4036d89e", "metadata": { "execution": { - "iopub.execute_input": "2024-11-05T06:31:18.914429Z", - "iopub.status.busy": "2024-11-05T06:31:18.914247Z", - "iopub.status.idle": "2024-11-05T06:31:18.917398Z", - "shell.execute_reply": "2024-11-05T06:31:18.917142Z", - "shell.execute_reply.started": "2024-11-05T06:31:18.914413Z" + "iopub.execute_input": "2024-11-05T07:04:07.823545Z", + "iopub.status.busy": "2024-11-05T07:04:07.823223Z", + "iopub.status.idle": "2024-11-05T07:04:07.826466Z", + "shell.execute_reply": "2024-11-05T07:04:07.826189Z", + "shell.execute_reply.started": "2024-11-05T07:04:07.823530Z" } }, "outputs": [], "source": [ "import MDAnalysis as mda\n", - "import rdkit.Chem.AllChem\n", + "import rdkit.Chem\n", "from openff.toolkit import Molecule, Topology\n", "from openff.units import unit\n", "\n", + "mda.converters.RDKit.RDBONDORDER[4] = rdkit.Chem.BondType.QUADRUPLE\n", + "mda.converters.RDKit.RDBONDORDER[5] = rdkit.Chem.BondType.QUINTUPLE\n", + "\n", "\n", "def topology_from_pdb(\n", " pdbfile: str,\n", " vdwradii: dict[str, float] = {},\n", " overlap_factor: float = 0.55,\n", " shortest_bond: float = 0.1,\n", + " use_box: bool = True,\n", "):\n", " \"\"\"Use MDAnalysis' PDB loader to load a PDB file.\n", "\n", " Bonds not explicitly included in CONECT records are guessed from atom-atom\n", " distances. The `vdw_radii`, `required_overlap`, and `lower_bound` parameters\n", - " configure this guessing behavior. The PDB file's CRYST1 records are used\n", - " to compute atom-atom distances.\n", + " configure this guessing behavior.\n", "\n", " Parameters\n", " ==========\n", @@ -50,11 +53,18 @@ " shortest_bond\n", " Any bonds found that are shorter than this distance in Angstroms are\n", " discarded.\n", + " use_pbcs\n", + " If `True`, the PDB file's CRYST1 records are used to compute atom-atom\n", + " distances and the output `Topology` will have box vectors set accordingly.\n", + " If `False`, the box is ignored.\n", "\n", " \"\"\"\n", - " u = mda.Universe(\n", - " pdbfile,\n", - " guess_bonds=True,\n", + " u = mda.Universe(pdbfile)\n", + "\n", + " if not use_box:\n", + " u.dimensions = None\n", + "\n", + " u.atoms.guess_bonds(\n", " vdwradii=vdwradii,\n", " fudge_factor=overlap_factor,\n", " lower_bound=shortest_bond,\n",