{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "*This notebook contains material from [PyRosetta](https://RosettaCommons.github.io/PyRosetta);\n", "content is available [on Github](https://github.com/RosettaCommons/PyRosetta.notebooks.git).*" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "< [RosettaScripts in PyRosetta](http://nbviewer.jupyter.org/github/RosettaCommons/PyRosetta.notebooks/blob/master/notebooks/02.07-RosettaScripts-in-PyRosetta.ipynb) | [Contents](toc.ipynb) | [Index](index.ipynb) | [Rosetta Energy Score Functions](http://nbviewer.jupyter.org/github/RosettaCommons/PyRosetta.notebooks/blob/master/notebooks/03.00-Rosetta-Energy-Score-Functions.ipynb) >

\"Open" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Visualization and `pyrosetta.distributed.viewer`" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "*Warning*: This notebook uses `pyrosetta.distributed.viewer` code, which runs in `jupyter notebook` and might not run if you're using `jupyterlab`." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The `pyrosetta.distributed` Viewer quickly renders `.pdb` files, dynamically instantiating `Pose` objects if required for certain visualization modules (matching the name `viewer.set*`). So when adding\n", "visualization modules to the Viewer or using presets, passing `Pose` or `PackedPose` objects to the Viewer is suggested for quicker rendering. If a `Pose` object or `list`, `tuple`, or `set` of `Pose`\n", "objects are provided to the Viewer, the Viewer will dynamically update upon `Pose` conformational changes by calling the `view.show()` method or equivalently `view()`. The Viewer applies visualization modules in the same order they are added (from left to right), so layering different styles (and `ResidueSelectors`) on top of one another becomes possible. The user must have already initialized PyRosetta providing `.params` files for any ligands and non-canonical residues in the input `Pose`(s)/`PackedPose`(s)/`.pdb` file(s), otherwise `pyrosetta.distributed` automatically initializes PyRosetta with default command line options.\n", "\n", "Throughout this notebook, different syntaxes for constructing visualizations are demonstrated to show the flexibility of the `pyrosetta.distributed.viewer` API, with hopes you find your favorite." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**If you are using Google Colab:** Currently, `pyrosetta.distributed.viewer` does **not** require the local machine's PyMOL. You can always dump any `Pose` object into a `.pdb` file and open that in PyMOL on your own computer.\n", "```\n", "pose.dump_pdb(\"output_file.pdb\")\n", "```" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Note:** If you are having trouble using this notebook, please use the `PyRosetta.notebooks` conda environment. Please see chapter 1.0 for instructions on how to setup and use this environment. " ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import glob\n", "import logging\n", "logging.basicConfig(level=logging.INFO)\n", "import os\n", "import pyrosetta\n", "import pyrosetta.distributed\n", "import pyrosetta.distributed.io as io\n", "import pyrosetta.distributed.viewer as viewer\n", "import sys\n", "\n", "if 'google.colab' in sys.modules:\n", " !pip install pyrosettacolabsetup\n", " import pyrosettacolabsetup\n", " pyrosettacolabsetup.setup()\n", " print (\"Notebook is set for PyRosetta use in Colab. Have fun!\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Available `viewer` objects:" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['expand_notebook',\n", " 'init',\n", " 'presets',\n", " 'setBackgroundColor',\n", " 'setDisulfides',\n", " 'setHydrogenBonds',\n", " 'setHydrogens',\n", " 'setStyle',\n", " 'setSurface',\n", " 'setZoom',\n", " 'setZoomTo']" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "viewer.__all__" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "For example: `viewer.init()`" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Available `viewer.presets` objects:" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "['coreBoundarySurface', 'ligandsAndMetals']" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "viewer.presets.__all__" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "For example: `viewer.presets.coreBoundarySurface()`" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### `viewer` objects contain docstrings as user documentation:" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Help on function init in module pyrosetta.distributed.viewer.core:\n", "\n", "init(packed_and_poses_and_pdbs=None, window_size=None, modules=None, delay=None, continuous_update=None, *args, **kwargs)\n", " Initialize the Viewer object.\n", " \n", " Parameters\n", " ----------\n", " first : required\n", " `packed_and_poses_and_pdbs`\n", " \n", " `PackedPose`, `Pose`, or `str` of a valid path to a .pdb file, or a `list`, `set`, or `tuple` of these objects.\n", " \n", " second : optional\n", " `window_size`\n", " \n", " `list` or `tuple` of `int` or `float` values for the (width, height) dimensions of the displayed window screen size.\n", " Default: (1200, 800)\n", " \n", " third : optional\n", " `modules`\n", " \n", " `list` of instantiated visualization modules to run upon changing amongst `packed_and_poses_and_pdbs` objects\n", " with the slider, matching the namespace pyrosetta.distributed.viewer.set*\n", " Default: []\n", " \n", " fourth : optional\n", " `delay`\n", " \n", " `float` time delay in seconds before rendering the Viewer in a Jupyter notebook, which is useful to prevent\n", " overburdening the Jupyter notebook client if `for` looping over quick modifications to a `Pose`.\n", " Default: 0.25\n", " \n", " fifth : optional\n", " `continuous_update`\n", " \n", " `True` or `False`. When using the interactive slider widget, `False` restricts rendering to mouse release events.\n", " Default: False\n", " \n", " Returns\n", " -------\n", " A Viewer instance.\n", "\n" ] } ], "source": [ "help(viewer.init)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### `viewer.presets` objects contain docstrings as brief descriptions of each preset visualization" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Help on function coreBoundarySurface in module pyrosetta.distributed.viewer.presets:\n", "\n", "coreBoundarySurface(packed_and_poses_and_pdbs=None, *args, **kwargs)\n", " Display core residues as 'blackCarbon' sticks, boundary residues as 'greyCarbon' sticks, and surface residues\n", " as 'whiteCarbon' sticks, with 'spectrum' cartoon representation, using the default arguments in\n", " pyrosetta.rosetta.core.select.residue_selector.LayerSelector() to select layers.\n", " \n", " @klimaj\n", "\n" ] } ], "source": [ "help(viewer.presets.coreBoundarySurface)" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Help on function ligandsAndMetals in module pyrosetta.distributed.viewer.presets:\n", "\n", "ligandsAndMetals(packed_and_poses_and_pdbs=None, *args, **kwargs)\n", " Display residues with ResidueProperty.LIGAND as 'brownCarbon' sticks with opaque surface,\n", " and ResidueProperty.METAL as 'chainHetatm' spheres, with 'spectrum' cartoon representation,\n", " disulfide bonds, polar hydrogens, and dashed hydrogen bonds.\n", " \n", " @klimaj\n", "\n" ] } ], "source": [ "help(viewer.presets.ligandsAndMetals)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**From previous section:**\n", "Make sure you are in the right directory for accessing the `.pdb` files:\n", "\n", "`cd google_drive/My\\ Drive/student-notebooks/`" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Note**: `import pyrosetta.distributed.viewer` expands the Jupyter notebook cell width to fit your internet browser, and can be called anytime using `pyrosetta.distributed.viewer.expand_notebook()`" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "INFO:pyrosetta.distributed:maybe_init performing pyrosetta initialization: {'extra_options': '-auto_setup_metals 1 -detect_disulf 1', 'silent': True}\n", "INFO:pyrosetta.rosetta:Found rosetta database at: /Users/jadolfbr/Library/Python/3.6/lib/python/site-packages/pyrosetta-2019.39+release.93456a567a8-py3.6-macosx-10.6-intel.egg/pyrosetta/database; using it....\n", "INFO:pyrosetta.rosetta:PyRosetta-4 2019 [Rosetta PyRosetta4.Release.python36.mac 2019.39+release.93456a567a8125cafdf7f8cb44400bc20b570d81 2019-09-26T14:24:44] retrieved from: http://www.pyrosetta.org\n", "(C) Copyright Rosetta Commons Member Institutions. Created in JHU by Sergey Lyskov and PyRosetta Team.\n", "INFO:rosetta:\u001b[0mcore.init: \u001b[0mChecking for fconfig files in pwd and ./rosetta/flags\n", "INFO:rosetta:\u001b[0mcore.init: \u001b[0mReading fconfig.../Users/jadolfbr/.rosetta/flags/common\n", "INFO:rosetta:\u001b[0mcore.init: \u001b[0m\n", "INFO:rosetta:\u001b[0mcore.init: \u001b[0m\n", "INFO:rosetta:\u001b[0mcore.init: \u001b[0mRosetta version: PyRosetta4.Release.python36.mac r233 2019.39+release.93456a567a8 93456a567a8125cafdf7f8cb44400bc20b570d81 http://www.pyrosetta.org 2019-09-26T14:24:44\n", "INFO:rosetta:\u001b[0mcore.init: \u001b[0mcommand: PyRosetta -ex1 -ex2aro -auto_setup_metals 1 -detect_disulf 1 -database /Users/jadolfbr/Library/Python/3.6/lib/python/site-packages/pyrosetta-2019.39+release.93456a567a8-py3.6-macosx-10.6-intel.egg/pyrosetta/database\n", "INFO:rosetta:\u001b[0mbasic.random.init_random_generator: \u001b[0m'RNG device' seed mode, using '/dev/urandom', seed=1917621120 seed_offset=0 real_seed=1917621120\n", "INFO:rosetta:\u001b[0mbasic.random.init_random_generator: \u001b[0mRandomGenerator:init: Normal mode, seed=1917621120 RG_type=mt19937\n" ] } ], "source": [ "flags = \"\"\"\n", "-auto_setup_metals 1\n", "-detect_disulf 1\n", "\"\"\"\n", "pyrosetta.distributed.init(flags)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Show basic line representation of `.pdb` file on disk:\n", "\n", ">```\n", "view = viewer.init(\"path/to/my.pdb\")\n", "view.show()\n", "```" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Change the `window_size` option of `viewer.init()` to fit your screen size, which should prevent the need to scroll to view your macromolecular objects.\n", "\n", "Show basic line representation of `Pose` or `PackedPose` objects in memory:" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "INFO:rosetta:\u001b[0mcore.chemical.GlobalResidueTypeSet: \u001b[0mFinished initializing fa_standard residue type set. Created 980 residue types\n", "INFO:rosetta:\u001b[0mcore.chemical.GlobalResidueTypeSet: \u001b[0mTotal time to initialize 0.90577 seconds.\n", "INFO:rosetta:\u001b[0mcore.import_pose.import_pose: \u001b[0mFile 'inputs/3EK4.pdb' automatically determined to be of type PDB\n", "INFO:rosetta:\u001b[0mcore.io.pdb.pdb_reader: \u001b[0mParsing 86 .pdb records with unknown format to search for Rosetta-specific comments.\n", "INFO:rosetta:\u001b[0mcore.io.pose_from_sfr.PoseFromSFRBuilder: \u001b[0mCA 350 was added by a jump, with base residue 257\n", "INFO:rosetta:\u001b[0mcore.io.pose_from_sfr.PoseFromSFRBuilder: \u001b[0mCA 351 was added by a jump, with base residue 299\n", "INFO:rosetta:\u001b[0mcore.io.pose_from_sfr.PoseFromSFRBuilder: \u001b[0mCA 352 was added by a jump, with base residue 337\n", "INFO:rosetta:\u001b[0mcore.chemical.AtomICoor: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m IcoorAtomID::atom_id(): Cannot get atom_id for POLYMER_LOWER of residue VAL 164. Returning BOGUS ID instead.\n", "INFO:rosetta:\u001b[0mcore.conformation.Residue: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing an atom: 164 H that depends on a nonexistent polymer connection!\n", "INFO:rosetta:\u001b[0mcore.conformation.Residue: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m --> generating it using idealized coordinates.\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: OXT on residue ASN:CtermProteinFull 348\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Failed to find a residue connection for residue 163 with connection point 2\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Failed to find a residue connection for residue 164 with connection point 1\n", "INFO:rosetta:\u001b[0mcore.util.metalloproteins_util: \u001b[0mAutomatically setting covalent bonds between metal ions and metal-binding residues.\n", "INFO:rosetta:\u001b[0mcore.util.metalloproteins_util: \u001b[0mAdding covalent linkage between residue 257's OD1 atom and residue 349's CA atom.\n", "INFO:rosetta:\u001b[0mcore.util.metalloproteins_util: \u001b[0mAdding covalent linkage between residue 261's OD1 atom and residue 349's CA atom.\n", "INFO:rosetta:\u001b[0mcore.util.metalloproteins_util: \u001b[0mAdding covalent linkage between residue 263's O atom and residue 349's CA atom.\n", "INFO:rosetta:\u001b[0mcore.util.metalloproteins_util: \u001b[0mAdding covalent linkage between residue 268's OE1 atom and residue 349's CA atom.\n", "INFO:rosetta:\u001b[0mcore.util.metalloproteins_util: \u001b[0mAdding covalent linkage between residue 268's OE2 atom and residue 349's CA atom.\n", "INFO:rosetta:\u001b[0mcore.conformation.Residue: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Residue connection id changed when creating a new residue at seqpos 268\n", "INFO:rosetta:\u001b[0mcore.conformation.Residue: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m ResConnID info stored on the connected residue (residue 349) is now out of date!\n", "INFO:rosetta:\u001b[0mcore.conformation.Residue: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Connection atom name (in src): OE1\n", "INFO:rosetta:\u001b[0mcore.util.metalloproteins_util: \u001b[0mAdding covalent linkage between residue 293's OD2 atom and residue 350's CA atom.\n", "INFO:rosetta:\u001b[0mcore.util.metalloproteins_util: \u001b[0mAdding covalent linkage between residue 295's OD1 atom and residue 350's CA atom.\n", "INFO:rosetta:\u001b[0mcore.util.metalloproteins_util: \u001b[0mAdding covalent linkage between residue 297's OD1 atom and residue 350's CA atom.\n", "INFO:rosetta:\u001b[0mcore.util.metalloproteins_util: \u001b[0mAdding covalent linkage between residue 299's O atom and residue 350's CA atom.\n", "INFO:rosetta:\u001b[0mcore.util.metalloproteins_util: \u001b[0mAdding covalent linkage between residue 304's OE1 atom and residue 350's CA atom.\n", "INFO:rosetta:\u001b[0mcore.util.metalloproteins_util: \u001b[0mAdding covalent linkage between residue 304's OE2 atom and residue 350's CA atom.\n", "INFO:rosetta:\u001b[0mcore.conformation.Residue: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Residue connection id changed when creating a new residue at seqpos 304\n", "INFO:rosetta:\u001b[0mcore.conformation.Residue: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m ResConnID info stored on the connected residue (residue 350) is now out of date!\n", "INFO:rosetta:\u001b[0mcore.conformation.Residue: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Connection atom name (in src): OE1\n", "INFO:rosetta:\u001b[0mcore.util.metalloproteins_util: \u001b[0mAdding covalent linkage between residue 332's OD2 atom and residue 351's CA atom.\n", "INFO:rosetta:\u001b[0mcore.util.metalloproteins_util: \u001b[0mAdding covalent linkage between residue 334's OD1 atom and residue 351's CA atom.\n", "INFO:rosetta:\u001b[0mcore.util.metalloproteins_util: \u001b[0mAdding covalent linkage between residue 336's O atom and residue 351's CA atom.\n", "INFO:rosetta:\u001b[0mcore.util.metalloproteins_util: \u001b[0mAdding covalent linkage between residue 341's OE2 atom and residue 351's CA atom.\n", "INFO:rosetta:\u001b[0mcore.util.metalloproteins_util: \u001b[0mAutomatically setting up constraints between metal ions and metal-binding residues.\n" ] } ], "source": [ "pose = pyrosetta.io.pose_from_file(\"inputs/3EK4.pdb\")" ] }, { "cell_type": "code", "execution_count": 9, "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": [ "view = viewer.init(pose, window_size=(800, 600))\n", "view()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "To show basic cartoon representation, add `viewer.setStyle()`:" ] }, { "cell_type": "code", "execution_count": 10, "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": [ "view = viewer.init(pose, window_size=(800, 600)) + viewer.setStyle()\n", "view()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "To visualize ligands, non-conanical residues, metals, etc., `viewer.setStyle()` (and several other `viewer.set*` objects) optionally accept PyRosetta `ResidueSelector` objects. In the case of `inputs/3EK4.pdb` which is a $Ca^{2+}$-saturated GCaMP2 monomer, a ligand is a $Ca^{2+}$ ion and a non-canonical residue is the chromophore \"CRO\", both of which are aleady parameterized and available in the PyRosetta residue type set database. Therefore, we do not need to initialize PyRosetta with custom \"CA\" or \"CRO\" `.params` files. However, if one wishes to visualize ligands and non-canonical residues for which `.params` files are not available in the PyRosetta residue type set database, one must first initialize PyRosetta providing `.params` files for any ligands and non-canonical residues in the input `Pose`(s) or `PackedPose`(s):\n", "\n", "> pyrosetta.init(\"-extra_res_fa /path/to/LIG.fa.params\")\n", "\n", "`pyrosetta.distributed.viewer` passes the `Pose`'s PDB numbering of selected residues to `py3dmol` for macromolecular rendering. Also, one may layer any visualization modules with any `ResidueSelectors` in the order they are summed (from left to right). In this case:" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "metals_selector = pyrosetta.rosetta.core.select.residue_selector.ResiduePropertySelector(\n", " pyrosetta.rosetta.core.chemical.ResidueProperty.METAL\n", ")\n", "ligands_selector = pyrosetta.rosetta.core.select.residue_selector.ResiduePropertySelector(\n", " pyrosetta.rosetta.core.chemical.ResidueProperty.LIGAND\n", ")\n", "\n", "view = viewer.init(pose, window_size=(800, 600)) \\\n", " + viewer.setStyle() \\\n", " + viewer.setStyle(residue_selector=ligands_selector, style=\"stick\", colorscheme=\"magentaCarbon\", radius=0.5) \\\n", " + viewer.setStyle(residue_selector=metals_selector, style=\"sphere\", colorscheme=\"chainHetatm\", radius=1.5)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ " 1. `viewer.setStyle()` layers the cartoon backbone and stick side-chain representation by default\n", " 2. `viewer.setStyle(residue_selector=ligands_selector, style=\"stick\", colorscheme=\"magentaCarbon\", radius=0.5)` layers any residue with the `LIGAND` property a 0.5 radius stick with magenta carbon atoms.\n", " 3. `viewer.setStyle(residue_selector=metals_selector, style=\"sphere\", colorscheme=\"chainHetatm\", radius=1.5)` layers any residue with the `METAL` property a 1.5 radius sphere with the `py3dmol` color scheme \"chainHetatm\". " ] }, { "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": [ "view()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Show many `Pose`s in memory using the interactive slider widget:" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [], "source": [ "poses = [pyrosetta.io.pose_from_sequence(\"TESTVIEWER\" * i) for i in range(1, 10)]" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "45be2dff7ddf4a4fa63c7edabda07373", "version_major": 2, "version_minor": 0 }, "text/plain": [ "interactive(children=(IntSlider(value=0, description='Decoys', max=8), Output()), _dom_classes=('widget-intera…" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ ".view(i=0)>" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "view = viewer.init(poses, continuous_update=True)\n", "view.add(viewer.setStyle(colorscheme=\"lightgreyCarbon\"))\n", "view.add(viewer.setHydrogenBonds(radius=0.1, dashed=False))\n", "view()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Below, layer a `ResidueSelector` of residues with `ResidueProperty.POLAR`, then hydrogen atoms, hydrogen bonds, and disulfide bonds:" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [], "source": [ "#NOTE: PackedPose requires the serialization build of PyRosetta. \n", "#packed_pose = io.to_packed(pose) # Test the Viewer with a PackedPose object" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'\\npolar_residue_selector = pyrosetta.rosetta.core.select.residue_selector.ResiduePropertySelector(\\n pyrosetta.rosetta.core.chemical.ResidueProperty.POLAR\\n)\\nview = viewer.init(packed_pose)\\nview.add(viewer.setStyle(radius=0.1))\\nview.add(viewer.setStyle(residue_selector=polar_residue_selector, colorscheme=\"whiteCarbon\", radius=0.25, label=False))\\nview.add(viewer.setHydrogens(color=\"white\", polar_only=True, radius=0.1))\\nview.add(viewer.setHydrogenBonds(color=\"black\"))\\nview.add(viewer.setDisulfides(radius=0.1))\\nview()\\n'" ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "'''\n", "polar_residue_selector = pyrosetta.rosetta.core.select.residue_selector.ResiduePropertySelector(\n", " pyrosetta.rosetta.core.chemical.ResidueProperty.POLAR\n", ")\n", "view = viewer.init(packed_pose)\n", "view.add(viewer.setStyle(radius=0.1))\n", "view.add(viewer.setStyle(residue_selector=polar_residue_selector, colorscheme=\"whiteCarbon\", radius=0.25, label=False))\n", "view.add(viewer.setHydrogens(color=\"white\", polar_only=True, radius=0.1))\n", "view.add(viewer.setHydrogenBonds(color=\"black\"))\n", "view.add(viewer.setDisulfides(radius=0.1))\n", "view()\n", "'''" ] }, { "cell_type": "code", "execution_count": 18, "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": [ "view = sum(\n", " [\n", " viewer.init(pose),\n", " viewer.setStyle(cartoon=False, style=\"sphere\", radius=1.5, colorscheme=\"darkgreyCarbon\"),\n", " viewer.setZoom(factor=0.95)\n", " ]\n", ")\n", "view()" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "INFO:rosetta:\u001b[0mcore.import_pose.import_pose: \u001b[0mFile 'inputs/6MSR.pdb' automatically determined to be of type PDB\n", "INFO:rosetta:\u001b[0mcore.io.pdb.pdb_reader: \u001b[0mParsing 1778 .pdb records with unknown format to search for Rosetta-specific comments.\n", "INFO:rosetta:\u001b[0mcore.io.pose_from_sfr.PoseFromSFRBuilder: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m discarding 3 atoms at position 1 in file inputs/6MSR.pdb. Best match rsd_type: GLY:NtermProteinFull\n", "INFO:rosetta:\u001b[0mcore.io.pose_from_sfr.PoseFromSFRBuilder: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m discarding 3 atoms at position 134 in file inputs/6MSR.pdb. Best match rsd_type: GLY:NtermProteinFull\n", "INFO:rosetta:\u001b[0mcore.io.pose_from_sfr.PoseFromSFRBuilder: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m discarding 3 atoms at position 257 in file inputs/6MSR.pdb. Best match rsd_type: GLY:NtermProteinFull\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CD on residue GLU 3\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: OE1 on residue GLU 3\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: OE2 on residue GLU 3\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NE on residue ARG 7\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CZ on residue ARG 7\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NH1 on residue ARG 7\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NH2 on residue ARG 7\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CG on residue LYS 21\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CD on residue LYS 21\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CE on residue LYS 21\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NZ on residue LYS 21\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CG on residue ARG 22\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CD on residue ARG 22\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NE on residue ARG 22\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CZ on residue ARG 22\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NH1 on residue ARG 22\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NH2 on residue ARG 22\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CD on residue GLU 32\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: OE1 on residue GLU 32\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: OE2 on residue GLU 32\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CG on residue GLU 33\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CD on residue GLU 33\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: OE1 on residue GLU 33\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: OE2 on residue GLU 33\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CG on residue LYS 35\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CD on residue LYS 35\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CE on residue LYS 35\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NZ on residue LYS 35\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CG on residue LYS 36\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CD on residue LYS 36\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CE on residue LYS 36\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NZ on residue LYS 36\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CD on residue ARG 48\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NE on residue ARG 48\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CZ on residue ARG 48\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NH1 on residue ARG 48\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NH2 on residue ARG 48\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NZ on residue LYS:CtermProteinFull 76\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CD on residue ARG 83\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NE on residue ARG 83\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CZ on residue ARG 83\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NH1 on residue ARG 83\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NH2 on residue ARG 83\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CD on residue LYS 84\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CE on residue LYS 84\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NZ on residue LYS 84\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NZ on residue LYS 90\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CG on residue LYS 97\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CD on residue LYS 97\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CE on residue LYS 97\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NZ on residue LYS 97\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CD on residue ARG 98\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NE on residue ARG 98\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CZ on residue ARG 98\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NH1 on residue ARG 98\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NH2 on residue ARG 98\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: OG on residue SER 102\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: OG on residue SER 106\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CG on residue GLU 108\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CD on residue GLU 108\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: OE1 on residue GLU 108\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: OE2 on residue GLU 108\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CD on residue GLU 109\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: OE1 on residue GLU 109\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: OE2 on residue GLU 109\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CE on residue LYS 111\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NZ on residue LYS 111\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CE on residue LYS 112\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NZ on residue LYS 112\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CG on residue ASN 113\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: OD1 on residue ASN 113\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: ND2 on residue ASN 113\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CD on residue LYS:CtermProteinFull 152\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CE on residue LYS:CtermProteinFull 152\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NZ on residue LYS:CtermProteinFull 152\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CD on residue ARG 159\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NE on residue ARG 159\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CZ on residue ARG 159\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NH1 on residue ARG 159\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NH2 on residue ARG 159\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CD on residue LYS 160\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CE on residue LYS 160\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NZ on residue LYS 160\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CE on residue LYS 166\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NZ on residue LYS 166\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CD on residue ARG 174\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NE on residue ARG 174\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CZ on residue ARG 174\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NH1 on residue ARG 174\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NH2 on residue ARG 174\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CG on residue ARG 180\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CD on residue ARG 180\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NE on residue ARG 180\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CZ on residue ARG 180\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NH1 on residue ARG 180\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NH2 on residue ARG 180\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: OG on residue SER 182\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CG on residue GLU 184\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CD on residue GLU 184\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: OE1 on residue GLU 184\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: OE2 on residue GLU 184\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CG on residue GLU 185\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CD on residue GLU 185\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: OE1 on residue GLU 185\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: OE2 on residue GLU 185\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CD on residue LYS 187\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CE on residue LYS 187\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NZ on residue LYS 187\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CG on residue LYS 188\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CD on residue LYS 188\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CE on residue LYS 188\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NZ on residue LYS 188\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CG on residue ASN 189\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: OD1 on residue ASN 189\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: ND2 on residue ASN 189\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CD on residue LYS:CtermProteinFull 228\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CE on residue LYS:CtermProteinFull 228\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NZ on residue LYS:CtermProteinFull 228\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 3 because of missing atom number 7 atom name CD\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 7 because of missing atom number 8 atom name NE\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 21 because of missing atom number 6 atom name CG\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 22 because of missing atom number 6 atom name CG\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 32 because of missing atom number 7 atom name CD\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 33 because of missing atom number 6 atom name CG\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 35 because of missing atom number 6 atom name CG\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 36 because of missing atom number 6 atom name CG\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 48 because of missing atom number 7 atom name CD\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 76 because of missing atom number 10 atom name NZ\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 83 because of missing atom number 7 atom name CD\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 84 because of missing atom number 7 atom name CD\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 90 because of missing atom number 9 atom name NZ\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 97 because of missing atom number 6 atom name CG\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 98 because of missing atom number 7 atom name CD\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 102 because of missing atom number 6 atom name OG\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 106 because of missing atom number 6 atom name OG\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 108 because of missing atom number 6 atom name CG\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 109 because of missing atom number 7 atom name CD\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 111 because of missing atom number 8 atom name CE\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 112 because of missing atom number 8 atom name CE\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 113 because of missing atom number 6 atom name CG\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 152 because of missing atom number 8 atom name CD\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 159 because of missing atom number 7 atom name CD\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 160 because of missing atom number 7 atom name CD\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 166 because of missing atom number 8 atom name CE\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 174 because of missing atom number 7 atom name CD\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 180 because of missing atom number 6 atom name CG\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 182 because of missing atom number 6 atom name OG\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 184 because of missing atom number 6 atom name CG\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 185 because of missing atom number 6 atom name CG\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 187 because of missing atom number 7 atom name CD\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 188 because of missing atom number 6 atom name CG\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 189 because of missing atom number 6 atom name CG\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 228 because of missing atom number 8 atom name CD\n", "INFO:rosetta:\u001b[0mcore.pack.task: \u001b[0mPacker task: initialize from command line()\n", "INFO:rosetta:\u001b[0mcore.scoring.ScoreFunctionFactory: \u001b[0mSCOREFUNCTION: \u001b[32mref2015\u001b[0m\n", "INFO:rosetta:\u001b[0mcore.scoring.etable: \u001b[0mStarting energy table calculation\n", "INFO:rosetta:\u001b[0mcore.scoring.etable: \u001b[0msmooth_etable: changing atr/rep split to bottom of energy well\n", "INFO:rosetta:\u001b[0mcore.scoring.etable: \u001b[0msmooth_etable: spline smoothing lj etables (maxdis = 6)\n", "INFO:rosetta:\u001b[0mcore.scoring.etable: \u001b[0msmooth_etable: spline smoothing solvation etables (max_dis = 6)\n", "INFO:rosetta:\u001b[0mcore.scoring.etable: \u001b[0mFinished calculating energy tables.\n", "INFO:rosetta:\u001b[0mbasic.io.database: \u001b[0mDatabase file opened: scoring/score_functions/rama/fd/all.ramaProb\n", "INFO:rosetta:\u001b[0mbasic.io.database: \u001b[0mDatabase file opened: scoring/score_functions/rama/fd/prepro.ramaProb\n", "INFO:rosetta:\u001b[0mbasic.io.database: \u001b[0mDatabase file opened: scoring/score_functions/omega/omega_ppdep.all.txt\n", "INFO:rosetta:\u001b[0mbasic.io.database: \u001b[0mDatabase file opened: scoring/score_functions/omega/omega_ppdep.gly.txt\n", "INFO:rosetta:\u001b[0mbasic.io.database: \u001b[0mDatabase file opened: scoring/score_functions/omega/omega_ppdep.pro.txt\n", "INFO:rosetta:\u001b[0mbasic.io.database: \u001b[0mDatabase file opened: scoring/score_functions/omega/omega_ppdep.valile.txt\n", "INFO:rosetta:\u001b[0mbasic.io.database: \u001b[0mDatabase file opened: scoring/score_functions/P_AA_pp/P_AA\n", "INFO:rosetta:\u001b[0mbasic.io.database: \u001b[0mDatabase file opened: scoring/score_functions/P_AA_pp/P_AA_n\n", "INFO:rosetta:\u001b[0mcore.scoring.P_AA: \u001b[0mshapovalov_lib::shap_p_aa_pp_smooth_level of 1( aka low_smooth ) got activated.\n", "INFO:rosetta:\u001b[0mbasic.io.database: \u001b[0mDatabase file opened: scoring/score_functions/P_AA_pp/shapovalov/10deg/kappa131/a20.prop\n", "INFO:rosetta:\u001b[0mcore.scoring.ScoreFunctionFactory: \u001b[0mThe -auto_setup_metals flag was used with no metalbinding_constraint weight set in the weights file. Setting to 1.0.\n", "INFO:rosetta:\u001b[0mbasic.io.database: \u001b[0mDatabase file opened: scoring/score_functions/elec_cp_reps.dat\n", "INFO:rosetta:\u001b[0mcore.scoring.elec.util: \u001b[0mRead 40 countpair representative atoms\n", "INFO:rosetta:\u001b[0mcore.pack.dunbrack.RotamerLibrary: \u001b[0mshapovalov_lib_fixes_enable option is true.\n", "INFO:rosetta:\u001b[0mcore.pack.dunbrack.RotamerLibrary: \u001b[0mshapovalov_lib::shap_dun10_smooth_level of 1( aka lowest_smooth ) got activated.\n", "INFO:rosetta:\u001b[0mcore.pack.dunbrack.RotamerLibrary: \u001b[0mBinary rotamer library selected: /Users/jadolfbr/Library/Python/3.6/lib/python/site-packages/pyrosetta-2019.39+release.93456a567a8-py3.6-macosx-10.6-intel.egg/pyrosetta/database/rotamer/shapovalov/StpDwn_0-0-0/Dunbrack10.lib.bin\n", "INFO:rosetta:\u001b[0mcore.pack.dunbrack.RotamerLibrary: \u001b[0mUsing Dunbrack library binary file '/Users/jadolfbr/Library/Python/3.6/lib/python/site-packages/pyrosetta-2019.39+release.93456a567a8-py3.6-macosx-10.6-intel.egg/pyrosetta/database/rotamer/shapovalov/StpDwn_0-0-0/Dunbrack10.lib.bin'.\n", "INFO:rosetta:\u001b[0mcore.pack.dunbrack.RotamerLibrary: \u001b[0mDunbrack 2010 library took 0.240326 seconds to load from binary\n", "INFO:rosetta:\u001b[0mcore.pack.pack_rotamers: \u001b[0mbuilt 1177 rotamers at 35 positions.\n", "INFO:rosetta:\u001b[0mcore.pack.interaction_graph.interaction_graph_factory: \u001b[0mInstantiating DensePDInteractionGraph\n", "INFO:rosetta:\u001b[0mcore.util.metalloproteins_util: \u001b[0mAutomatically setting covalent bonds between metal ions and metal-binding residues.\n", "INFO:rosetta:\u001b[0mcore.util.metalloproteins_util: \u001b[0mAutomatically setting up constraints between metal ions and metal-binding residues.\n" ] } ], "source": [ "pose = pyrosetta.io.pose_from_file(\"inputs/6MSR.pdb\")" ] }, { "cell_type": "code", "execution_count": 21, "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": [ "chA = pyrosetta.rosetta.core.select.residue_selector.ChainSelector(\"A\")\n", "chB = pyrosetta.rosetta.core.select.residue_selector.ChainSelector(\"B\")\n", "view = sum(\n", " [\n", " viewer.init(pose),\n", " viewer.setStyle(cartoon_color=\"lightgrey\", radius=0.25),\n", " viewer.setSurface(residue_selector=chA, colorscheme=\"greenCarbon\", opacity=0.65, surface_type=\"VDW\"),\n", " viewer.setSurface(residue_selector=chB, color=\"blue\", opacity=0.75, surface_type=\"SAS\"),\n", " viewer.setDisulfides(radius=0.25),\n", " viewer.setZoom(factor=1.5)\n", " ]\n", ")\n", "view()" ] }, { "cell_type": "code", "execution_count": 22, "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": [ "view.reinit() # Subtract all visualization modules previously added to the Viewer\n", "view()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "`viewer.setZoomTo()` can zoom into a PyRosetta `ResidueSelector`:" ] }, { "cell_type": "code", "execution_count": 23, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "INFO:rosetta:\u001b[0mcore.import_pose.import_pose: \u001b[0mFile 'inputs/1QCQ.pdb' automatically determined to be of type PDB\n", "INFO:rosetta:\u001b[0mcore.io.pdb.pdb_reader: \u001b[0mParsing 23 .pdb records with unknown format to search for Rosetta-specific comments.\n", "INFO:rosetta:\u001b[0mcore.util.metalloproteins_util: \u001b[0mAutomatically setting covalent bonds between metal ions and metal-binding residues.\n", "INFO:rosetta:\u001b[0mcore.util.metalloproteins_util: \u001b[0mAutomatically setting up constraints between metal ions and metal-binding residues.\n" ] } ], "source": [ "pose = pyrosetta.io.pose_from_file(\"inputs/1QCQ.pdb\")" ] }, { "cell_type": "code", "execution_count": 24, "metadata": {}, "outputs": [], "source": [ "helix_selector = pyrosetta.rosetta.core.select.residue_selector.SecondaryStructureSelector(\"H\")\n", "sheet_selector = pyrosetta.rosetta.core.select.residue_selector.SecondaryStructureSelector(\"E\")\n", "loop_selector = pyrosetta.rosetta.core.select.residue_selector.SecondaryStructureSelector(\"L\")\n", "\n", "modules = [\n", " viewer.setBackgroundColor(color=\"black\"),\n", " viewer.setStyle(residue_selector=helix_selector, cartoon_color=\"blue\", label=False, radius=0),\n", " viewer.setStyle(residue_selector=sheet_selector, cartoon_color=\"red\", label=False, radius=0),\n", " viewer.setStyle(residue_selector=loop_selector, cartoon_color=\"white\", label=False, radius=0),\n", " viewer.setZoomTo(residue_selector=sheet_selector)\n", "]" ] }, { "cell_type": "code", "execution_count": 25, "metadata": { "scrolled": false }, "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": [ "viewer.init(pose, window_size=(1200, 600), modules=modules).show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "View live trajectory:" ] }, { "cell_type": "code", "execution_count": 26, "metadata": { "scrolled": true }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "INFO:rosetta:\u001b[0mcore.import_pose.import_pose: \u001b[0mFile 'inputs/2FD7.pdb' automatically determined to be of type PDB\n", "INFO:rosetta:\u001b[0mcore.io.pdb.pdb_reader: \u001b[0mParsing 30 .pdb records with unknown format to search for Rosetta-specific comments.\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CG1 on residue VAL 15\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CG2 on residue VAL 15\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0mFound disulfide between residues 3 40\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0mcurrent variant for 3 CYS\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0mcurrent variant for 40 CYS\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0mcurrent variant for 3 CYD\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0mcurrent variant for 40 CYD\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0mFound disulfide between residues 4 32\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0mcurrent variant for 4 CYS\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0mcurrent variant for 32 CYS\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0mcurrent variant for 4 CYD\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0mcurrent variant for 32 CYD\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0mFound disulfide between residues 16 26\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0mcurrent variant for 16 CYS\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0mcurrent variant for 26 CYS\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0mcurrent variant for 16 CYD\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0mcurrent variant for 26 CYD\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 15 because of missing atom number 6 atom name CG1\n", "INFO:rosetta:\u001b[0mcore.pack.task: \u001b[0mPacker task: initialize from command line()\n", "INFO:rosetta:\u001b[0mcore.scoring.ScoreFunctionFactory: \u001b[0mSCOREFUNCTION: \u001b[32mref2015\u001b[0m\n", "INFO:rosetta:\u001b[0mcore.scoring.ScoreFunctionFactory: \u001b[0mThe -auto_setup_metals flag was used with no metalbinding_constraint weight set in the weights file. Setting to 1.0.\n", "INFO:rosetta:\u001b[0mcore.pack.pack_rotamers: \u001b[0mbuilt 2 rotamers at 1 positions.\n", "INFO:rosetta:\u001b[0mcore.pack.interaction_graph.interaction_graph_factory: \u001b[0mInstantiating DensePDInteractionGraph\n", "INFO:rosetta:\u001b[0mcore.util.metalloproteins_util: \u001b[0mAutomatically setting covalent bonds between metal ions and metal-binding residues.\n", "INFO:rosetta:\u001b[0mcore.util.metalloproteins_util: \u001b[0mAutomatically setting up constraints between metal ions and metal-binding residues.\n" ] } ], "source": [ "pose = pyrosetta.io.pose_from_file(\"inputs/2FD7.pdb\")" ] }, { "cell_type": "code", "execution_count": 27, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "WARNING:pyrosetta.distributed.viewer:Input argument 'delay' should be an instance of float. Setting 'delay' to default.\n" ] }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stderr", "output_type": "stream", "text": [ "INFO:rosetta:\u001b[0mcore.mm.MMBondAngleLibrary: \u001b[0mMM bond angle sets added fully assigned: 603; wildcard: 0 and 1 virtual parameter.\n" ] } ], "source": [ "view = viewer.init(pose, delay=0.15) \\\n", " + viewer.setStyle(radius=0.1) \\\n", " + viewer.setDisulfides(radius=0.1)\n", "backrub = pyrosetta.rosetta.protocols.backrub.BackrubMover()\n", "minimize = pyrosetta.rosetta.protocols.minimization_packing.MinMover()" ] }, { "cell_type": "code", "execution_count": 28, "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": [ "for _ in range(100):\n", " backrub.apply(pose)\n", " minimize.apply(pose)\n", " view.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Display preset custom viewers for routine visualizations:" ] }, { "cell_type": "code", "execution_count": 29, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "INFO:rosetta:\u001b[0mcore.import_pose.import_pose: \u001b[0mFile 'inputs/3EK4.pdb' automatically determined to be of type PDB\n", "INFO:rosetta:\u001b[0mcore.io.pdb.pdb_reader: \u001b[0mParsing 86 .pdb records with unknown format to search for Rosetta-specific comments.\n", "INFO:rosetta:\u001b[0mcore.io.pose_from_sfr.PoseFromSFRBuilder: \u001b[0mCA 350 was added by a jump, with base residue 257\n", "INFO:rosetta:\u001b[0mcore.io.pose_from_sfr.PoseFromSFRBuilder: \u001b[0mCA 351 was added by a jump, with base residue 299\n", "INFO:rosetta:\u001b[0mcore.io.pose_from_sfr.PoseFromSFRBuilder: \u001b[0mCA 352 was added by a jump, with base residue 337\n", "INFO:rosetta:\u001b[0mcore.chemical.AtomICoor: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m IcoorAtomID::atom_id(): Cannot get atom_id for POLYMER_LOWER of residue VAL 164. Returning BOGUS ID instead.\n", "INFO:rosetta:\u001b[0mcore.conformation.Residue: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing an atom: 164 H that depends on a nonexistent polymer connection!\n", "INFO:rosetta:\u001b[0mcore.conformation.Residue: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m --> generating it using idealized coordinates.\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: OXT on residue ASN:CtermProteinFull 348\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Failed to find a residue connection for residue 163 with connection point 2\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Failed to find a residue connection for residue 164 with connection point 1\n", "INFO:rosetta:\u001b[0mcore.util.metalloproteins_util: \u001b[0mAutomatically setting covalent bonds between metal ions and metal-binding residues.\n", "INFO:rosetta:\u001b[0mcore.util.metalloproteins_util: \u001b[0mAdding covalent linkage between residue 257's OD1 atom and residue 349's CA atom.\n", "INFO:rosetta:\u001b[0mcore.util.metalloproteins_util: \u001b[0mAdding covalent linkage between residue 261's OD1 atom and residue 349's CA atom.\n", "INFO:rosetta:\u001b[0mcore.util.metalloproteins_util: \u001b[0mAdding covalent linkage between residue 263's O atom and residue 349's CA atom.\n", "INFO:rosetta:\u001b[0mcore.util.metalloproteins_util: \u001b[0mAdding covalent linkage between residue 268's OE1 atom and residue 349's CA atom.\n", "INFO:rosetta:\u001b[0mcore.util.metalloproteins_util: \u001b[0mAdding covalent linkage between residue 268's OE2 atom and residue 349's CA atom.\n", "INFO:rosetta:\u001b[0mcore.conformation.Residue: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Residue connection id changed when creating a new residue at seqpos 268\n", "INFO:rosetta:\u001b[0mcore.conformation.Residue: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m ResConnID info stored on the connected residue (residue 349) is now out of date!\n", "INFO:rosetta:\u001b[0mcore.conformation.Residue: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Connection atom name (in src): OE1\n", "INFO:rosetta:\u001b[0mcore.util.metalloproteins_util: \u001b[0mAdding covalent linkage between residue 293's OD2 atom and residue 350's CA atom.\n", "INFO:rosetta:\u001b[0mcore.util.metalloproteins_util: \u001b[0mAdding covalent linkage between residue 295's OD1 atom and residue 350's CA atom.\n", "INFO:rosetta:\u001b[0mcore.util.metalloproteins_util: \u001b[0mAdding covalent linkage between residue 297's OD1 atom and residue 350's CA atom.\n", "INFO:rosetta:\u001b[0mcore.util.metalloproteins_util: \u001b[0mAdding covalent linkage between residue 299's O atom and residue 350's CA atom.\n", "INFO:rosetta:\u001b[0mcore.util.metalloproteins_util: \u001b[0mAdding covalent linkage between residue 304's OE1 atom and residue 350's CA atom.\n", "INFO:rosetta:\u001b[0mcore.util.metalloproteins_util: \u001b[0mAdding covalent linkage between residue 304's OE2 atom and residue 350's CA atom.\n", "INFO:rosetta:\u001b[0mcore.conformation.Residue: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Residue connection id changed when creating a new residue at seqpos 304\n", "INFO:rosetta:\u001b[0mcore.conformation.Residue: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m ResConnID info stored on the connected residue (residue 350) is now out of date!\n", "INFO:rosetta:\u001b[0mcore.conformation.Residue: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Connection atom name (in src): OE1\n", "INFO:rosetta:\u001b[0mcore.util.metalloproteins_util: \u001b[0mAdding covalent linkage between residue 332's OD2 atom and residue 351's CA atom.\n", "INFO:rosetta:\u001b[0mcore.util.metalloproteins_util: \u001b[0mAdding covalent linkage between residue 334's OD1 atom and residue 351's CA atom.\n", "INFO:rosetta:\u001b[0mcore.util.metalloproteins_util: \u001b[0mAdding covalent linkage between residue 336's O atom and residue 351's CA atom.\n", "INFO:rosetta:\u001b[0mcore.util.metalloproteins_util: \u001b[0mAdding covalent linkage between residue 341's OE2 atom and residue 351's CA atom.\n", "INFO:rosetta:\u001b[0mcore.util.metalloproteins_util: \u001b[0mAutomatically setting up constraints between metal ions and metal-binding residues.\n", "INFO:rosetta:\u001b[0mcore.import_pose.import_pose: \u001b[0mFile 'inputs/6MSR.pdb' automatically determined to be of type PDB\n", "INFO:rosetta:\u001b[0mcore.io.pdb.pdb_reader: \u001b[0mParsing 1778 .pdb records with unknown format to search for Rosetta-specific comments.\n", "INFO:rosetta:\u001b[0mcore.io.pose_from_sfr.PoseFromSFRBuilder: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m discarding 3 atoms at position 1 in file inputs/6MSR.pdb. Best match rsd_type: GLY:NtermProteinFull\n", "INFO:rosetta:\u001b[0mcore.io.pose_from_sfr.PoseFromSFRBuilder: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m discarding 3 atoms at position 134 in file inputs/6MSR.pdb. Best match rsd_type: GLY:NtermProteinFull\n", "INFO:rosetta:\u001b[0mcore.io.pose_from_sfr.PoseFromSFRBuilder: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m discarding 3 atoms at position 257 in file inputs/6MSR.pdb. Best match rsd_type: GLY:NtermProteinFull\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CD on residue GLU 3\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: OE1 on residue GLU 3\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: OE2 on residue GLU 3\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NE on residue ARG 7\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CZ on residue ARG 7\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NH1 on residue ARG 7\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NH2 on residue ARG 7\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CG on residue LYS 21\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CD on residue LYS 21\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CE on residue LYS 21\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NZ on residue LYS 21\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CG on residue ARG 22\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CD on residue ARG 22\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NE on residue ARG 22\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CZ on residue ARG 22\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NH1 on residue ARG 22\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NH2 on residue ARG 22\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CD on residue GLU 32\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: OE1 on residue GLU 32\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: OE2 on residue GLU 32\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CG on residue GLU 33\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CD on residue GLU 33\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: OE1 on residue GLU 33\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: OE2 on residue GLU 33\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CG on residue LYS 35\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CD on residue LYS 35\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CE on residue LYS 35\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NZ on residue LYS 35\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CG on residue LYS 36\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CD on residue LYS 36\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CE on residue LYS 36\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NZ on residue LYS 36\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CD on residue ARG 48\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NE on residue ARG 48\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CZ on residue ARG 48\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NH1 on residue ARG 48\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NH2 on residue ARG 48\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NZ on residue LYS:CtermProteinFull 76\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CD on residue ARG 83\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NE on residue ARG 83\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CZ on residue ARG 83\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NH1 on residue ARG 83\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NH2 on residue ARG 83\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CD on residue LYS 84\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CE on residue LYS 84\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NZ on residue LYS 84\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NZ on residue LYS 90\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CG on residue LYS 97\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CD on residue LYS 97\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CE on residue LYS 97\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NZ on residue LYS 97\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CD on residue ARG 98\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NE on residue ARG 98\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CZ on residue ARG 98\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NH1 on residue ARG 98\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NH2 on residue ARG 98\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: OG on residue SER 102\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: OG on residue SER 106\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CG on residue GLU 108\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CD on residue GLU 108\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: OE1 on residue GLU 108\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: OE2 on residue GLU 108\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CD on residue GLU 109\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: OE1 on residue GLU 109\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: OE2 on residue GLU 109\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CE on residue LYS 111\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NZ on residue LYS 111\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CE on residue LYS 112\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NZ on residue LYS 112\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CG on residue ASN 113\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: OD1 on residue ASN 113\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: ND2 on residue ASN 113\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CD on residue LYS:CtermProteinFull 152\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CE on residue LYS:CtermProteinFull 152\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NZ on residue LYS:CtermProteinFull 152\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CD on residue ARG 159\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NE on residue ARG 159\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CZ on residue ARG 159\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NH1 on residue ARG 159\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NH2 on residue ARG 159\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CD on residue LYS 160\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CE on residue LYS 160\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NZ on residue LYS 160\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CE on residue LYS 166\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NZ on residue LYS 166\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CD on residue ARG 174\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NE on residue ARG 174\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CZ on residue ARG 174\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NH1 on residue ARG 174\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NH2 on residue ARG 174\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CG on residue ARG 180\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CD on residue ARG 180\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NE on residue ARG 180\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CZ on residue ARG 180\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NH1 on residue ARG 180\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NH2 on residue ARG 180\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: OG on residue SER 182\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CG on residue GLU 184\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CD on residue GLU 184\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: OE1 on residue GLU 184\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: OE2 on residue GLU 184\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CG on residue GLU 185\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CD on residue GLU 185\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: OE1 on residue GLU 185\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: OE2 on residue GLU 185\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CD on residue LYS 187\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CE on residue LYS 187\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NZ on residue LYS 187\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CG on residue LYS 188\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CD on residue LYS 188\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CE on residue LYS 188\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NZ on residue LYS 188\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CG on residue ASN 189\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: OD1 on residue ASN 189\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: ND2 on residue ASN 189\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CD on residue LYS:CtermProteinFull 228\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CE on residue LYS:CtermProteinFull 228\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: NZ on residue LYS:CtermProteinFull 228\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 3 because of missing atom number 7 atom name CD\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 7 because of missing atom number 8 atom name NE\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 21 because of missing atom number 6 atom name CG\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 22 because of missing atom number 6 atom name CG\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 32 because of missing atom number 7 atom name CD\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 33 because of missing atom number 6 atom name CG\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 35 because of missing atom number 6 atom name CG\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 36 because of missing atom number 6 atom name CG\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 48 because of missing atom number 7 atom name CD\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 76 because of missing atom number 10 atom name NZ\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 83 because of missing atom number 7 atom name CD\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 84 because of missing atom number 7 atom name CD\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 90 because of missing atom number 9 atom name NZ\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 97 because of missing atom number 6 atom name CG\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 98 because of missing atom number 7 atom name CD\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 102 because of missing atom number 6 atom name OG\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 106 because of missing atom number 6 atom name OG\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 108 because of missing atom number 6 atom name CG\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 109 because of missing atom number 7 atom name CD\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 111 because of missing atom number 8 atom name CE\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 112 because of missing atom number 8 atom name CE\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 113 because of missing atom number 6 atom name CG\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 152 because of missing atom number 8 atom name CD\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 159 because of missing atom number 7 atom name CD\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 160 because of missing atom number 7 atom name CD\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 166 because of missing atom number 8 atom name CE\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 174 because of missing atom number 7 atom name CD\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 180 because of missing atom number 6 atom name CG\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 182 because of missing atom number 6 atom name OG\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 184 because of missing atom number 6 atom name CG\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 185 because of missing atom number 6 atom name CG\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 187 because of missing atom number 7 atom name CD\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 188 because of missing atom number 6 atom name CG\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 189 because of missing atom number 6 atom name CG\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 228 because of missing atom number 8 atom name CD\n", "INFO:rosetta:\u001b[0mcore.pack.task: \u001b[0mPacker task: initialize from command line()\n", "INFO:rosetta:\u001b[0mcore.scoring.ScoreFunctionFactory: \u001b[0mSCOREFUNCTION: \u001b[32mref2015\u001b[0m\n", "INFO:rosetta:\u001b[0mcore.scoring.ScoreFunctionFactory: \u001b[0mThe -auto_setup_metals flag was used with no metalbinding_constraint weight set in the weights file. Setting to 1.0.\n", "INFO:rosetta:\u001b[0mcore.pack.pack_rotamers: \u001b[0mbuilt 1177 rotamers at 35 positions.\n", "INFO:rosetta:\u001b[0mcore.pack.interaction_graph.interaction_graph_factory: \u001b[0mInstantiating DensePDInteractionGraph\n", "INFO:rosetta:\u001b[0mcore.util.metalloproteins_util: \u001b[0mAutomatically setting covalent bonds between metal ions and metal-binding residues.\n", "INFO:rosetta:\u001b[0mcore.util.metalloproteins_util: \u001b[0mAutomatically setting up constraints between metal ions and metal-binding residues.\n", "INFO:rosetta:\u001b[0mcore.import_pose.import_pose: \u001b[0mFile 'inputs/1QCQ.pdb' automatically determined to be of type PDB\n", "INFO:rosetta:\u001b[0mcore.io.pdb.pdb_reader: \u001b[0mParsing 23 .pdb records with unknown format to search for Rosetta-specific comments.\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "INFO:rosetta:\u001b[0mcore.util.metalloproteins_util: \u001b[0mAutomatically setting covalent bonds between metal ions and metal-binding residues.\n", "INFO:rosetta:\u001b[0mcore.util.metalloproteins_util: \u001b[0mAutomatically setting up constraints between metal ions and metal-binding residues.\n", "INFO:rosetta:\u001b[0mcore.import_pose.import_pose: \u001b[0mFile 'inputs/2FD7.pdb' automatically determined to be of type PDB\n", "INFO:rosetta:\u001b[0mcore.io.pdb.pdb_reader: \u001b[0mParsing 30 .pdb records with unknown format to search for Rosetta-specific comments.\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CG1 on residue VAL 15\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing heavyatom: CG2 on residue VAL 15\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0mFound disulfide between residues 3 40\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0mcurrent variant for 3 CYS\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0mcurrent variant for 40 CYS\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0mcurrent variant for 3 CYD\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0mcurrent variant for 40 CYD\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0mFound disulfide between residues 4 32\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0mcurrent variant for 4 CYS\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0mcurrent variant for 32 CYS\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0mcurrent variant for 4 CYD\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0mcurrent variant for 32 CYD\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0mFound disulfide between residues 16 26\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0mcurrent variant for 16 CYS\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0mcurrent variant for 26 CYS\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0mcurrent variant for 16 CYD\n", "INFO:rosetta:\u001b[0mcore.conformation.Conformation: \u001b[0mcurrent variant for 26 CYD\n", "INFO:rosetta:\u001b[0mcore.pack.pack_missing_sidechains: \u001b[0mpacking residue number 15 because of missing atom number 6 atom name CG1\n", "INFO:rosetta:\u001b[0mcore.pack.task: \u001b[0mPacker task: initialize from command line()\n", "INFO:rosetta:\u001b[0mcore.scoring.ScoreFunctionFactory: \u001b[0mSCOREFUNCTION: \u001b[32mref2015\u001b[0m\n", "INFO:rosetta:\u001b[0mcore.scoring.ScoreFunctionFactory: \u001b[0mThe -auto_setup_metals flag was used with no metalbinding_constraint weight set in the weights file. Setting to 1.0.\n", "INFO:rosetta:\u001b[0mcore.pack.pack_rotamers: \u001b[0mbuilt 2 rotamers at 1 positions.\n", "INFO:rosetta:\u001b[0mcore.pack.interaction_graph.interaction_graph_factory: \u001b[0mInstantiating DensePDInteractionGraph\n", "INFO:rosetta:\u001b[0mcore.util.metalloproteins_util: \u001b[0mAutomatically setting covalent bonds between metal ions and metal-binding residues.\n", "INFO:rosetta:\u001b[0mcore.util.metalloproteins_util: \u001b[0mAutomatically setting up constraints between metal ions and metal-binding residues.\n" ] } ], "source": [ "pdbfiles = [os.path.join(\"inputs\", f) for f in [\"3EK4.pdb\", \"6MSR.pdb\", \"1QCQ.pdb\", \"2FD7.pdb\"]]\n", "poses = [pyrosetta.io.pose_from_file(p) for p in pdbfiles]" ] }, { "cell_type": "code", "execution_count": 30, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "INFO:rosetta:\u001b[0mcore.select.residue_selector.LayerSelector: \u001b[0mSetting LayerSelector to use sidechain neighbors to determine burial.\n", "INFO:rosetta:\u001b[0mcore.select.residue_selector.LayerSelector: \u001b[0mSet cutoffs for core and surface to 5.2 and 2, respectively, in LayerSelector.\n", "INFO:rosetta:\u001b[0mcore.select.residue_selector.LayerSelector: \u001b[0mSetting core=true boundary=false surface=false in LayerSelector.\n", "INFO:rosetta:\u001b[0mcore.select.residue_selector.LayerSelector: \u001b[0mSetting LayerSelector to use sidechain neighbors to determine burial.\n", "INFO:rosetta:\u001b[0mcore.select.residue_selector.LayerSelector: \u001b[0mSet cutoffs for core and surface to 5.2 and 2, respectively, in LayerSelector.\n", "INFO:rosetta:\u001b[0mcore.select.residue_selector.LayerSelector: \u001b[0mSetting core=false boundary=true surface=false in LayerSelector.\n", "INFO:rosetta:\u001b[0mcore.select.residue_selector.LayerSelector: \u001b[0mSetting LayerSelector to use sidechain neighbors to determine burial.\n", "INFO:rosetta:\u001b[0mcore.select.residue_selector.LayerSelector: \u001b[0mSet cutoffs for core and surface to 5.2 and 2, respectively, in LayerSelector.\n", "INFO:rosetta:\u001b[0mcore.select.residue_selector.LayerSelector: \u001b[0mSetting core=false boundary=false surface=true in LayerSelector.\n" ] }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "c0769c22f0554e87aaaf2cf8aae36535", "version_major": 2, "version_minor": 0 }, "text/plain": [ "interactive(children=(IntSlider(value=0, description='Decoys', max=3), Output()), _dom_classes=('widget-intera…" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ ".view(i=0)>" ] }, "execution_count": 30, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Display preset custom viewers for routine visualizations:\n", "viewer.presets.coreBoundarySurface(poses, window_size=(800, 600), continuous_update=True)" ] }, { "cell_type": "code", "execution_count": 37, "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "2be8b7782e9541c08b4ecf1cb2259b5e", "version_major": 2, "version_minor": 0 }, "text/plain": [ "interactive(children=(IntSlider(value=0, continuous_update=False, description='Decoys', max=3), Output()), _do…" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ ".view(i=0)>" ] }, "execution_count": 37, "metadata": {}, "output_type": "execute_result" } ], "source": [ "viewer.presets.ligandsAndMetals(poses, window_size=(800, 600), continuous_update=False)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**For Developers**: contribute your custom preset visualizations to PyRosetta:\n", "\n", " 1. Edit `~Rosetta/main/source/src/python/PyRosetta/src/pyrosetta/distributed/viewer/presets/\\_\\_init\\_\\_.py`\n", " 2. Copy and modify the `templatePreset` function, renaming it to the name of your new preset Viewer (e.g. `myCustomPreset` in step #5).\n", " 3. Add the name of your new preset Viewer to the `__all__` list.\n", " 4. Merge Github pull request into `RosettaCommons/main`\n", " 5. Example using it:\n", " ```\n", " import pyrosetta.distributed.viewer as viewer\n", " viewer.presets.myCustomPreset(poses)\n", " ```" ] }, { "cell_type": "code", "execution_count": 31, "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": [ "def myCustomPreset(packed_and_poses_and_pdbs=None, *args, **kwargs):\n", " \"\"\"\n", " Add a description of the preset Viewer here\n", " \"\"\"\n", " # Add custrom ResidueSelectors\n", " metals_selector = pyrosetta.rosetta.core.select.residue_selector.ResiduePropertySelector(\n", " pyrosetta.rosetta.core.chemical.ResidueProperty.METAL\n", " )\n", " ligands_selector = pyrosetta.rosetta.core.select.residue_selector.ResiduePropertySelector(\n", " pyrosetta.rosetta.core.chemical.ResidueProperty.LIGAND\n", " )\n", " \n", " # Add custom Viewer commands\n", " view = viewer.init(packed_and_poses_and_pdbs=packed_and_poses_and_pdbs, *args, **kwargs) \\\n", " + viewer.setBackgroundColor(\"white\") \\\n", " + viewer.setStyle(style=\"stick\", colorscheme=\"lightgreyCarbon\", radius=0.15) \\\n", " + viewer.setStyle(residue_selector=ligands_selector, style=\"stick\", colorscheme=\"brownCarbon\", radius=0.5, label=True) \\\n", " + viewer.setStyle(residue_selector=metals_selector, style=\"sphere\", colorscheme=\"chainHetatm\", radius=1.5, label=True) \\\n", " + viewer.setHydrogenBonds() \\\n", " + viewer.setDisulfides(radius=0.15) \\\n", " + viewer.setHydrogens(color=\"white\", radius=0.033, polar_only=True) \\\n", " + viewer.setSurface(residue_selector=ligands_selector, surface_type=\"VDW\", opacity=0.5, color=\"magenta\") \\\n", " + viewer.setSurface(residue_selector=metals_selector, surface_type=\"VDW\", opacity=0.5, color=\"magenta\") \\\n", " + viewer.setZoomTo(residue_selector=ligands_selector)\n", "\n", " return view()\n", "\n", "myCustomPreset(poses[0])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Documentation for `pyrosetta.distributed.viewer` visualization modules" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Help on class setBackgroundColor in module pyrosetta.distributed.viewer.modules:\n", "\n", "class setBackgroundColor(builtins.object)\n", " | Set Viewer background color with either Hexcode or standard colors.\n", " | \n", " | Parameters\n", " | ----------\n", " | first : optional\n", " | `color`\n", " | \n", " | Hexcode literal (e.g. 0xffffffff) or `str` indicating a standard color (e.g. \"black\").\n", " | Default: 0xffffffff\n", " | \n", " | Returns\n", " | -------\n", " | A Viewer instance.\n", " | \n", " | Methods defined here:\n", " | \n", " | __init__(self, color=4294967295)\n", " | Initialize self. See help(type(self)) for accurate signature.\n", " | \n", " | apply(self, viewer, pose, pdbstring)\n", " | \n", " | ----------------------------------------------------------------------\n", " | Data descriptors defined here:\n", " | \n", " | __dict__\n", " | dictionary for instance variables (if defined)\n", " | \n", " | __weakref__\n", " | list of weak references to the object (if defined)\n", "\n" ] } ], "source": [ "help(viewer.setBackgroundColor)" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Help on class setDisulfides in module pyrosetta.distributed.viewer.modules:\n", "\n", "class setDisulfides(builtins.object)\n", " | Display disulfide bonds according to `pyrosetta.rosetta.core.conformation.is_disulfide_bond()`\n", " | for all combinations of cysteine residues in each initialized `.pdb` file, `Pose` or `PackedPose` object.\n", " | \n", " | Parameters\n", " | ----------\n", " | first : optional\n", " | `color`\n", " | \n", " | `str` indicating a standard color (e.g. \"black\").\n", " | Default: \"gold\"\n", " | \n", " | second : optional\n", " | `radius`\n", " | \n", " | `float` or `int` indicating the radius of the stick connecting the atoms participating in each disulfide bond.\n", " | Default: 0.5\n", " | \n", " | Returns\n", " | -------\n", " | A Viewer instance.\n", " | \n", " | Methods defined here:\n", " | \n", " | __init__(self, color='gold', radius=0.5)\n", " | Initialize self. See help(type(self)) for accurate signature.\n", " | \n", " | apply(self, viewer, pose, pdbstring)\n", " | \n", " | ----------------------------------------------------------------------\n", " | Data descriptors defined here:\n", " | \n", " | __dict__\n", " | dictionary for instance variables (if defined)\n", " | \n", " | __weakref__\n", " | list of weak references to the object (if defined)\n", "\n" ] } ], "source": [ "help(viewer.setDisulfides)" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Help on class setHydrogenBonds in module pyrosetta.distributed.viewer.modules:\n", "\n", "class setHydrogenBonds(builtins.object)\n", " | Display hydrogen bonds according to `pyrosetta.rosetta.core.pose.Pose.get_hbonds()`\n", " | in each initialized `.pdb` file, `Pose` or `PackedPose` object.\n", " | \n", " | Parameters\n", " | ----------\n", " | first : optional\n", " | `color`\n", " | \n", " | `str` indicating a standard color (e.g. \"yellow\").\n", " | Default: \"black\"\n", " | \n", " | second : optional\n", " | `dashed`\n", " | \n", " | `True` or `False` to show hydrogen bonds as dashed lines.\n", " | If `True`, then option `radius` must be `None`.\n", " | If `False`, then option `radius` must be specified.\n", " | Default: True\n", " | \n", " | third : optional\n", " | `radius`\n", " | \n", " | `float` or `int` indicating the radius of the solid (non-dashed) stick connecting the atoms participating\n", " | in each hydrogen bond. If set, this automatically sets the option `dashed` to `False`.\n", " | Default: None\n", " | \n", " | Returns\n", " | -------\n", " | A Viewer instance.\n", " | \n", " | Methods defined here:\n", " | \n", " | __init__(self, color='black', dashed=True, radius=None)\n", " | Initialize self. See help(type(self)) for accurate signature.\n", " | \n", " | apply(self, viewer, pose, pdbstring)\n", " | \n", " | ----------------------------------------------------------------------\n", " | Data descriptors defined here:\n", " | \n", " | __dict__\n", " | dictionary for instance variables (if defined)\n", " | \n", " | __weakref__\n", " | list of weak references to the object (if defined)\n", "\n" ] } ], "source": [ "help(viewer.setHydrogenBonds)" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Help on class setHydrogens in module pyrosetta.distributed.viewer.modules:\n", "\n", "class setHydrogens(builtins.object)\n", " | Show all or only polar hydrogen atoms in each initialized `.pdb` file, `Pose` or `PackedPose` object.\n", " | \n", " | Parameters\n", " | ----------\n", " | first : optional\n", " | `color`\n", " | \n", " | `str` indicating a standard color (e.g. \"grey\").\n", " | Default: \"white\"\n", " | \n", " | second : optional\n", " | `radius`\n", " | \n", " | `float` or `int` indicating the radius of the hydrogen atom stick represnetations.\n", " | Default: 0.05\n", " | \n", " | third : optional\n", " | `polar_only`\n", " | \n", " | `True` or `False`. `True` to show only polar hydrogen atoms, and `False` to show all hydrogen atoms.\n", " | Default: False\n", " | \n", " | Returns\n", " | -------\n", " | A Viewer instance.\n", " | \n", " | Methods defined here:\n", " | \n", " | __init__(self, color='white', radius=0.05, polar_only=False)\n", " | Initialize self. See help(type(self)) for accurate signature.\n", " | \n", " | apply(self, viewer, pose, pdbstring)\n", " | \n", " | ----------------------------------------------------------------------\n", " | Data descriptors defined here:\n", " | \n", " | __dict__\n", " | dictionary for instance variables (if defined)\n", " | \n", " | __weakref__\n", " | list of weak references to the object (if defined)\n", "\n" ] } ], "source": [ "help(viewer.setHydrogens)" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "scrolled": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Help on class setStyle in module pyrosetta.distributed.viewer.modules:\n", "\n", "class setStyle(builtins.object)\n", " | Show and color cartoon, and/or show heavy atoms with provided style, color and radius for each initialized\n", " | `.pdb` file, `Pose` or `PackedPose` object. If the `residue_selector` argument is provided, apply styles\n", " | only to the selected residues. If the `command` argument is provided, override all other arguments and pass\n", " | `py3Dmol.view.setStyle()` commands to the Viewer.\n", " | \n", " | Parameters\n", " | ----------\n", " | first : optional\n", " | `residue_selector`\n", " | \n", " | An instance of `pyrosetta.rosetta.core.select.residue_selector.ResidueSelector` on which to apply the style(s).\n", " | Default: None\n", " | \n", " | second : optional\n", " | `cartoon`\n", " | \n", " | `True` or `False` to show cartoon representation.\n", " | Default: True\n", " | \n", " | third : optional\n", " | `cartoon_color`\n", " | \n", " | Hexcode literal (e.g. 0xAF10AB) or `str` indicating a standard color (e.g. \"grey\") for the cartoon representation.\n", " | If \"spectrum\", apply reversed color gradient based on residue numbers. The option `cartoon` must also be set to `True`.\n", " | Default: \"spectrum\"\n", " | Reference: https://3dmol.csb.pitt.edu/doc/types.html#ColorSpec\n", " | \n", " | fourth : optional\n", " | `style`\n", " | \n", " | `str` indicating a representation style of heavy atoms, choosing from either \"line\", \"cross\", \"stick\", or \"sphere\".\n", " | Default: \"stick\"\n", " | \n", " | fifth : optional\n", " | `colorscheme`\n", " | \n", " | `str` indicating the color scheme for heavy atoms represented by the `style` option. Options include:\n", " | A lower-case standard color followed by \"Carbon\" (e.g. \"orangeCarbon\")\n", " | \"ssPyMOL\": PyMol secondary colorscheme\n", " | \"ssJmol\": Jmol secondary colorscheme\n", " | \"Jmol\": Jmol primary colorscheme\n", " | \"default\": default colorscheme\n", " | \"amino\": amino acid colorscheme\n", " | \"shapely\": shapely protien colorscheme\n", " | \"nucleic\": nucleic acid colorscheme\n", " | \"chain\": standard chain colorscheme\n", " | \"chainHetatm\": chain Hetatm colorscheme\n", " | Default: \"blackCarbon\"\n", " | Reference: https://3dmol.csb.pitt.edu/doc/types.html#ColorschemeSpec\n", " | \n", " | sixth : optional\n", " | `radius`\n", " | \n", " | `float` or `int` indicating the radius of the heavy atoms represented by the `style` option.\n", " | Default: 0.1\n", " | \n", " | seventh : optional\n", " | `label`\n", " | \n", " | `True` or `False` to show labels next to residues selected by the `residue_selector` option. \n", " | Default: True\n", " | \n", " | eighth : optional\n", " | `label_fontsize`\n", " | \n", " | `int` or `float` indicating the font size of labels next to residues selected by the `residue_selector` option,\n", " | only if `label` is `True`.\n", " | Default: 12\n", " | \n", " | ninth : optional\n", " | `label_background`\n", " | \n", " | `True` or `False` to show the background of labels next to residues selected by the `residue_selector` option,\n", " | only if `label` is `True`.\n", " | Default: False\n", " | \n", " | tenth : optional\n", " | `label_fontcolor`\n", " | \n", " | `str` indicating a standard font color (e.g. \"grey\") for label text next to residues selected by the `residue_selector` option,\n", " | only if `label` is `True`.\n", " | Default: \"black\"\n", " | \n", " | eleventh : optional\n", " | `command`\n", " | \n", " | `dict` or `tuple` of `dict`s of `py3Dmol.view.setStyle()` commands. If specified, this option overrides all other options.\n", " | Default: None\n", " | Example:\n", " | command = {\"hetflag\": True}, {\"stick\": {\"singleBond\": False, \"colorscheme\": \"greyCarbon\", \"radius\": 0.15}}\n", " | view = viewer.init(poses) + viewer.setStyle(command=command)\n", " | view.show()\n", " | \n", " | Returns\n", " | -------\n", " | A Viewer instance.\n", " | \n", " | Methods defined here:\n", " | \n", " | __init__(self, residue_selector=None, cartoon=True, cartoon_color='spectrum', style='stick', colorscheme='blackCarbon', radius='0.1', label=True, label_fontsize=12, label_background=False, label_fontcolor='black', command=None)\n", " | Initialize self. See help(type(self)) for accurate signature.\n", " | \n", " | apply(self, viewer, pose, pdbstring)\n", " | \n", " | ----------------------------------------------------------------------\n", " | Data descriptors defined here:\n", " | \n", " | __dict__\n", " | dictionary for instance variables (if defined)\n", " | \n", " | __weakref__\n", " | list of weak references to the object (if defined)\n", "\n" ] } ], "source": [ "help(viewer.setStyle)" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Help on class setSurface in module pyrosetta.distributed.viewer.modules:\n", "\n", "class setSurface(builtins.object)\n", " | Show the specified surface for each initialized `.pdb` file, `Pose` or `PackedPose` object.\n", " | \n", " | Parameters\n", " | ----------\n", " | first : optional\n", " | `residue_selector`\n", " | \n", " | An instance of `pyrosetta.rosetta.core.select.residue_selector.ResidueSelector` to select residues\n", " | on which to apply the surface.\n", " | Default: None\n", " | \n", " | second : optional\n", " | `surface_type`\n", " | \n", " | `str` indicating surface type to be displayed. py3Dmol supports the following options:\n", " | \"VDW\": Van der Waals surface\n", " | \"MS\": Molecular surface\n", " | \"SES\": Solvent excluded surface\n", " | \"SAS\": Solvent accessible surface\n", " | Default: \"VDW\"\n", " | \n", " | third : optional\n", " | `opacity`\n", " | \n", " | `float` or `int` between 0 and 1 for opacity of the displayed surface.\n", " | Default: 0.5\n", " | \n", " | fourth : optional\n", " | `color`\n", " | \n", " | `str` indicating a standard color (e.g. \"grey\") of the surface to be displayed. \n", " | Either `color` or `colorscheme` may be specified, where `colorscheme` overrides `color`.\n", " | Default: None\n", " | \n", " | fifth : optional\n", " | `colorscheme`\n", " | \n", " | `str` indicating the color scheme of the surface to be displayed.\n", " | Either `color` or `colorscheme` may be specified, where `colorscheme` overrides `color`.\n", " | Options include:\n", " | A lower-case standard color followed by \"Carbon\" (e.g. \"yellowCarbon\")\n", " | \"ssPyMOL\": PyMol secondary colorscheme\n", " | \"ssJmol\": Jmol secondary colorscheme\n", " | \"Jmol\": Jmol primary colorscheme\n", " | \"default\": default colorscheme\n", " | \"amino\": amino acid colorscheme\n", " | \"shapely\": shapely protien colorscheme\n", " | \"nucleic\": nucleic acid colorscheme\n", " | \"chain\": standard chain colorscheme\n", " | \"chainHetatm\": chain Hetatm colorscheme\n", " | Default: None\n", " | Reference: https://3dmol.csb.pitt.edu/doc/types.html#ColorschemeSpec\n", " | \n", " | Returns\n", " | -------\n", " | A Viewer instance.\n", " | \n", " | Methods defined here:\n", " | \n", " | __init__(self, residue_selector=None, surface_type='VDW', opacity=0.5, color=None, colorscheme=None)\n", " | Initialize self. See help(type(self)) for accurate signature.\n", " | \n", " | apply(self, viewer, pose, pdbstring)\n", " | \n", " | ----------------------------------------------------------------------\n", " | Data descriptors defined here:\n", " | \n", " | __dict__\n", " | dictionary for instance variables (if defined)\n", " | \n", " | __weakref__\n", " | list of weak references to the object (if defined)\n", "\n" ] } ], "source": [ "help(viewer.setSurface)" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Help on class setZoom in module pyrosetta.distributed.viewer.modules:\n", "\n", "class setZoom(builtins.object)\n", " | Set the zoom magnification factor of each initialized `.pdb` file, `Pose` or `PackedPose` object.\n", " | Values >1 zoom in, and values <1 zoom out.\n", " | \n", " | Parameters\n", " | ----------\n", " | first : optional\n", " | `factor`\n", " | \n", " | `float` or `int` indicating the zoom magnification factor.\n", " | Default: 2\n", " | \n", " | Returns\n", " | -------\n", " | A Viewer instance.\n", " | \n", " | Methods defined here:\n", " | \n", " | __init__(self, factor=2)\n", " | Initialize self. See help(type(self)) for accurate signature.\n", " | \n", " | apply(self, viewer, pose, pdbstring)\n", " | \n", " | ----------------------------------------------------------------------\n", " | Data descriptors defined here:\n", " | \n", " | __dict__\n", " | dictionary for instance variables (if defined)\n", " | \n", " | __weakref__\n", " | list of weak references to the object (if defined)\n", "\n" ] } ], "source": [ "help(viewer.setZoom)" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Help on class setZoomTo in module pyrosetta.distributed.viewer.modules:\n", "\n", "class setZoomTo(builtins.object)\n", " | Zoom to a `ResidueSelector` in each initialized `.pdb` file, `Pose` or `PackedPose` object.\n", " | \n", " | Parameters\n", " | ----------\n", " | first : optional\n", " | `residue_selector`\n", " | \n", " | An instance of `pyrosetta.rosetta.core.select.residue_selector.ResidueSelector` into which to zoom.\n", " | Default: None\n", " | \n", " | Returns\n", " | -------\n", " | A Viewer instance.\n", " | \n", " | Methods defined here:\n", " | \n", " | __init__(self, residue_selector=None)\n", " | Initialize self. See help(type(self)) for accurate signature.\n", " | \n", " | apply(self, viewer, pose, pdbstring)\n", " | \n", " | ----------------------------------------------------------------------\n", " | Data descriptors defined here:\n", " | \n", " | __dict__\n", " | dictionary for instance variables (if defined)\n", " | \n", " | __weakref__\n", " | list of weak references to the object (if defined)\n", "\n" ] } ], "source": [ "help(viewer.setZoomTo)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "< [RosettaScripts in PyRosetta](http://nbviewer.jupyter.org/github/RosettaCommons/PyRosetta.notebooks/blob/master/notebooks/02.07-RosettaScripts-in-PyRosetta.ipynb) | [Contents](toc.ipynb) | [Index](index.ipynb) | [Rosetta Energy Score Functions](http://nbviewer.jupyter.org/github/RosettaCommons/PyRosetta.notebooks/blob/master/notebooks/03.00-Rosetta-Energy-Score-Functions.ipynb) >

\"Open" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "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.6.1" }, "toc": { "base_numbering": 1, "nav_menu": {}, "number_sections": true, "sideBar": true, "skip_h1_title": false, "title_cell": "Table of Contents", "title_sidebar": "Contents", "toc_cell": false, "toc_position": {}, "toc_section_display": true, "toc_window_display": false } }, "nbformat": 4, "nbformat_minor": 2 }