{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "*This notebook contains material from [PyRosetta](https://RosettaCommons.github.io/PyRosetta.notebooks);\n", "content is available [on Github](https://github.com/RosettaCommons/PyRosetta.notebooks.git).*" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "< [HBNet Before Design](http://nbviewer.jupyter.org/github/RosettaCommons/PyRosetta.notebooks/blob/master/notebooks/06.05-HBNet-Before-Design.ipynb) | [Contents](toc.ipynb) | [Index](index.ipynb) | [*De Novo* Protein Design with PyRosetta](http://nbviewer.jupyter.org/github/RosettaCommons/PyRosetta.notebooks/blob/master/notebooks/06.07-Introduction-to-DeNovo-protein-design.ipynb) >

\"Open" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# *De Novo* Parametric Backbone Design\n", "\n", "Keywords: Parametric, Bundle, BundleGridSampler, MakeBundle\n", "\n", "## Overview\n", "\n", "In this workshop, we will give examples for how to do Parametric Protein Design using the RosettaScripts interface to Rosetta written. The code you will be using from Rosetta was written by Vikram Mulligan. The BundleGridSampler and MakeBundle movers are available through code in PyRosetta, but because of the many number of options to it, it is a bit easier to work with these in XML. We will use this opportunity to do see how easy it is to run XML in PyRosetta, but we will cover the code-level interface as well in this workshop. \n", "\n", "This is some cool stuff. Enjoy. :)\n", "\n", "Please refer to the docs for more info.\n", "\n", "https://www.rosettacommons.org/docs/latest/scripting_documentation/RosettaScripts/Movers/Movers-RosettaScripts\n", "\n", "https://www.rosettacommons.org/docs/latest/scripting_documentation/RosettaScripts/Movers/movers_pages/MakeBundleMover\n", "\n", "https://www.rosettacommons.org/docs/latest/scripting_documentation/RosettaScripts/Movers/movers_pages/BundleGridSamplerMover" ] }, { "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": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "!pip install pyrosettacolabsetup\n", "import pyrosettacolabsetup; pyrosettacolabsetup.install_pyrosetta()\n", "import pyrosetta; pyrosetta.init()\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Make sure you are in the directory with the pdb files:**\n", "\n", "`cd google_drive/MyDrive/student-notebooks/`" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import logging\n", "logging.basicConfig(level=logging.INFO)\n", "import pyrosetta\n", "\n", "from IPython.core.display import display, HTML\n", "display(HTML(\"\"))" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "pyrosetta.init(\"-mute all\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Overview\n", "\n", "Parametric sampling means changing specific angles of groups of bundles (coiled-coils) in order to sample different conformations. The equations that are used for Parametric sampling were originally described by Crick and are called Crick equations. \n", "\n", "These equations were reintroduced to the scientific community through William F Degrado's seminal paper, \"Probing designability via a generalized model of helical bundle geometry\"\n", "\n", "Since the puplication of that paper, researchers have used this method to create bundles of all sorts. Fibers, membrane proteins, and even working antiporters! \n", "\n", "\n", "## Main Rosetta References (in order of use of tools)\n", "\n", "- Dang B, Wu H, Mulligan VK, Mravic M, Wu Y, Lemmin T, Ford A, Silva DA, Baker D, DeGrado WF.\n", "\n", " **\"De novo design of covalently constrained mesosize protein scaffolds with unique tertiary structures.\"**\n", " \n", " *Proc Natl Acad Sci U S A*. 2017 Oct 10;114(41):10852-10857.\n", " https://www.ncbi.nlm.nih.gov/pubmed/28973862\n", " \n", " \n", "- Lu P,Min D, DiMaio F, Wei KY, Vahey MD, Boyken SE, Mulligan, et al.\n", "\n", " **\"Accurate computational design of multipass transmembrane proteins.\"**\n", " \n", " *Science*. 2018 Mar 2;359(6379):1042-1046. \n", " https://www.ncbi.nlm.nih.gov/pubmed/29496880\n", " \n", " \n", "- Chen Z, Boyken SE, Jia M, Busch F, Flores-Solis D, Mulligan, et al.\n", "\n", " **\"Programmable design of orthogonal protein heterodimers.\"**\n", " \n", " *Nature*. 2019 Jan;565(7737):106-111. \n", " https://www.ncbi.nlm.nih.gov/pubmed/30568301\n", " \n", " \n", "- Langan RA Boyken SE, Ng AH, Samson JA, Dods G, Mulligan, et al.\n", "\n", " **\"De novo design of bioactive protein switches.\"**\n", " \n", " *Nature*. 2019 Aug;572(7768):205-210.\n", " https://www.ncbi.nlm.nih.gov/pubmed/31341284\n", " \n", " \n", "## Parameter tips (From Vikram himself)\n", "\n", "- Most bundles would have r0 from 3 to 10 A (depending on the helix count).\n", "- Omega0 should range from about -2.5 degrees to 2.5 degrees.\n", "- Delta_omega1 can be anywhere from 0 to 360. (It's just the roll of the helix about its own axis).\n", "- Delta_z0, delta_z1 or delta_t can be anything (you're just sliding the helix up and down). Typically, you'd just sample around a few Angstroms, though.\n", "- r1, omega1, etc. are all minor helix parameters that are tied to the secondary structure. We don't normally vary them." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ " \n", "## Creating multiple Helices\n", "The Helix lines tell the sampler to create a helix and how to do so. We set them at 90 degree rotations through this line, but we could add additional parameters as well. These parameters are VERY WELL documented on the link above, so make sure to use that:\n", "\n", "**delta_omega0**: Rotation of a helix about the z-axis, stored in radians.\n", "\n", "### Changing r0:\n", "\n", "Here, we will sample on the r0 axis. To make this a bit easier, we will set dump_pdbs to 1. You can also put this code in a loop and sample on that as well, writing each to pymol. You would set r0 instead of r0_max and min.\n", "\n", "**r0**: Major helix radius, in Angstroms." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "pose = pyrosetta.rosetta.core.pose.Pose()\n", "pyrosetta.rosetta.protocols.rosetta_scripts.XmlObjects.create_from_string(\"\"\"\n", "\n", " \n", "\n", "\n", " \n", " \n", " \n", "\n", "\n", "\"\"\").get_mover(\"bgs1\").apply(pose)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Ok, so now lets have a look at this - it is quite fast as we are simply manipulating the backbone and doing doing any sequence design (yet). Which axis changed? Lets try changing some other values!\n", "Note that if we have dump_pdbs on - we will be overwriting them, so make sure to move the current ones to another directory if you " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Changing omega0\n", "\n", "This time, we will change the parameters a bit through code and observe them by directly dumping them or through the PyMolMover.\n", "Instead of the BundleGridSampler, we will use the MakeBundle mover.\n", "\n", "Note the use of Python3's awesome f-strings here, and the speed. Because we need to parse the xml object and create a new mover, pose, etc. each time, this is much slower than the sampler - but it does allow us a bit more flexibility to use python the way it was intended. Once again, the `MakeBundle` mover does not have an adaquite code-level interface to allow us to set variables the traditional way. If you end up writing C++ Rosetta code, make sure to always keep the XML and code-level interfaces feature-complete!\n", "\n", "**omega0**: Major helix twist per residue, stored in radians." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import math\n", "\n", "\n", "for i in range(0, 32, 2):\n", "\n", " i_rad = math.radians(i)\n", " pose = pyrosetta.rosetta.core.pose.Pose()\n", "\n", " sampler_string = f'''\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " '''\n", " print(sampler_string)\n", " pyrosetta.rosetta.protocols.rosetta_scripts.XmlObjects.create_from_string(sampler_string).get_mover(\"bgs1\").apply(pose)\n", " pose.dump_pdb('outputs/omega0_'+str(i)+'.pdb')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "What is the maximum value of omega0? Which PDBs are empty??" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## MakeBundle Mover in PyRosetta\n", "\n", "Ok, we have an idea for how to use code to create some helical backbones. Lets try this through code instead of RosettaScripts.\n", "\n", "Note that the BPC_xx are `ENUMS` as we have seen before and are imported when we import all of the helical bundle namespace. \n", "Also, if you call `mb.set_use_degrees(True)` before creating helices, you won't need the `math.radians()` call." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from pyrosetta.rosetta.protocols.helical_bundle import *\n", "import math\n", "\n", "pose = pyrosetta.rosetta.core.pose.Pose()\n", "mb = MakeBundle()\n", "\n", "mb.add_helix()\n", "mb.add_helix()\n", "mb.helix(2).calculator_op().real_parameter(BPC_delta_omega0).set_value(3.14)\n", "\n", "for i in range(1, 3):\n", " mb.helix(i).set_helix_length(20)\n", " mb.helix(i).calculator_op().real_parameter(BPC_r0).set_value(5)\n", " mb.helix(i).calculator_op().real_parameter(BPC_omega0).set_value(math.radians(12))\n", "\n", "mb.apply(pose)\n", "pose.dump_pdb(\"outputs/manual_make_bundle.pdb\")\n", " \n", " " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Conclusion\n", "\n", "This should give you an overview of how to use the MakeBundle and BundleGridSampler within PyRosetta. Everything else is simply parameters. Read up and you'll be ready to start designing your own helical bundles. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## References:" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "- **Bundle Tools**: Vikram Mulligan\n", "- Grigoryan, Gevorg and William F Degrado. “Probing designability via a generalized model of helical bundle geometry” Journal of molecular biology vol. 405,4 (2010): 1079-100. https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3052747/\n", "- Huang, Po-Ssu et al. “High thermodynamic stability of parametrically designed helical bundles” Science (New York, N.Y.) vol. 346,6208 (2014): 481-485. https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4612401/\n", "- Weitzner, Brian. \"Parametric disasters\" Published September 03, 2018. https://weitzner.github.io/posts/2018/08/parametric-disasters/" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "< [HBNet Before Design](http://nbviewer.jupyter.org/github/RosettaCommons/PyRosetta.notebooks/blob/master/notebooks/06.05-HBNet-Before-Design.ipynb) | [Contents](toc.ipynb) | [Index](index.ipynb) | [*De Novo* Protein Design with PyRosetta](http://nbviewer.jupyter.org/github/RosettaCommons/PyRosetta.notebooks/blob/master/notebooks/06.07-Introduction-to-DeNovo-protein-design.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.0" }, "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 }