{ "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", "< [Basic Folding Algorithm](http://nbviewer.jupyter.org/github/RosettaCommons/PyRosetta.notebooks/blob/master/notebooks/04.01-Basic-Folding-Algorithm.ipynb) | [Contents](toc.ipynb) | [Index](index.ipynb) | [Structure Refinement](http://nbviewer.jupyter.org/github/RosettaCommons/PyRosetta.notebooks/blob/master/notebooks/05.00-Structure-Refinement.ipynb) >

\"Open" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Low-Res Scoring and Fragments\n", "Keywords: centroid, SwitchResidueTypeSetMover(), create_score_function(), score3, fa_standard, ScoreFunction(), set_weight(), read_fragment_file(), ClassicFragmentMover()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "!pip install pyrosettacolabsetup\n", "import pyrosettacolabsetup; pyrosettacolabsetup.install_pyrosetta()\n", "import pyrosetta; pyrosetta.init()\n", "from pyrosetta import *\n", "from pyrosetta.teaching import *\n", "init()" ] }, { "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": "markdown", "metadata": {}, "source": [ "## Low-Resolution (Centroid) Scoring\n", "\n", "\n", "Following the treatment of Simons *et al.* (1999), Rosetta can score a protein conformation using a low-resolution representation. This will make the energy calculation faster.\n", "\n", "Load chain A of Ras, a protein from a the previous workshop 3. Also calculate the full-atom energy of the pose.\n", "\n", "```\n", "pose = pyrosetta.pose_from_pdb(\"6Q21_A.pdb\")\n", "sfxn = pyrosetta.get_score_function()\n", "sfxn(pose)\n", "```" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "nbgrader": { "grade": true, "grade_id": "cell-b39225965c87d2d7", "locked": false, "points": 0, "schema_version": 3, "solution": true } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[0mcore.chemical.GlobalResidueTypeSet: \u001b[0mFinished initializing fa_standard residue type set. Created 696 residue types\n", "\u001b[0mcore.chemical.GlobalResidueTypeSet: \u001b[0mTotal time to initialize 1.19396 seconds.\n", "\u001b[0mcore.import_pose.import_pose: \u001b[0mFile '6Q21_A.pdb' automatically determined to be of type PDB\n", "\u001b[0mcore.scoring.ScoreFunctionFactory: \u001b[0mSCOREFUNCTION: \u001b[32mref2015\u001b[0m\n", "\u001b[0mcore.scoring.etable: \u001b[0mStarting energy table calculation\n", "\u001b[0mcore.scoring.etable: \u001b[0msmooth_etable: changing atr/rep split to bottom of energy well\n", "\u001b[0mcore.scoring.etable: \u001b[0msmooth_etable: spline smoothing lj etables (maxdis = 6)\n", "\u001b[0mcore.scoring.etable: \u001b[0msmooth_etable: spline smoothing solvation etables (max_dis = 6)\n", "\u001b[0mcore.scoring.etable: \u001b[0mFinished calculating energy tables.\n", "\u001b[0mbasic.io.database: \u001b[0mDatabase file opened: scoring/score_functions/hbonds/ref2015_params/HBPoly1D.csv\n", "\u001b[0mbasic.io.database: \u001b[0mDatabase file opened: scoring/score_functions/hbonds/ref2015_params/HBFadeIntervals.csv\n", "\u001b[0mbasic.io.database: \u001b[0mDatabase file opened: scoring/score_functions/hbonds/ref2015_params/HBEval.csv\n", "\u001b[0mbasic.io.database: \u001b[0mDatabase file opened: scoring/score_functions/hbonds/ref2015_params/DonStrength.csv\n", "\u001b[0mbasic.io.database: \u001b[0mDatabase file opened: scoring/score_functions/hbonds/ref2015_params/AccStrength.csv\n", "\u001b[0mbasic.io.database: \u001b[0mDatabase file opened: scoring/score_functions/rama/fd/all.ramaProb\n", "\u001b[0mbasic.io.database: \u001b[0mDatabase file opened: scoring/score_functions/rama/fd/prepro.ramaProb\n", "\u001b[0mbasic.io.database: \u001b[0mDatabase file opened: scoring/score_functions/omega/omega_ppdep.all.txt\n", "\u001b[0mbasic.io.database: \u001b[0mDatabase file opened: scoring/score_functions/omega/omega_ppdep.gly.txt\n", "\u001b[0mbasic.io.database: \u001b[0mDatabase file opened: scoring/score_functions/omega/omega_ppdep.pro.txt\n", "\u001b[0mbasic.io.database: \u001b[0mDatabase file opened: scoring/score_functions/omega/omega_ppdep.valile.txt\n", "\u001b[0mbasic.io.database: \u001b[0mDatabase file opened: scoring/score_functions/P_AA_pp/P_AA\n", "\u001b[0mbasic.io.database: \u001b[0mDatabase file opened: scoring/score_functions/P_AA_pp/P_AA_n\n", "\u001b[0mcore.scoring.P_AA: \u001b[0mshapovalov_lib::shap_p_aa_pp_smooth_level of 1( aka low_smooth ) got activated.\n", "\u001b[0mbasic.io.database: \u001b[0mDatabase file opened: scoring/score_functions/P_AA_pp/shapovalov/10deg/kappa131/a20.prop\n", "\u001b[0mbasic.io.database: \u001b[0mDatabase file opened: scoring/score_functions/elec_cp_reps.dat\n", "\u001b[0mcore.scoring.elec.util: \u001b[0mRead 40 countpair representative atoms\n", "\u001b[0mcore.pack.dunbrack.RotamerLibrary: \u001b[0mshapovalov_lib_fixes_enable option is true.\n", "\u001b[0mcore.pack.dunbrack.RotamerLibrary: \u001b[0mshapovalov_lib::shap_dun10_smooth_level of 1( aka lowest_smooth ) got activated.\n", "\u001b[0mcore.pack.dunbrack.RotamerLibrary: \u001b[0mBinary rotamer library selected: /Users/kathyle/Computational Protein Prediction and Design/PyRosetta4.Release.python36.mac.release-208/pyrosetta/database/rotamer/shapovalov/StpDwn_0-0-0/Dunbrack10.lib.bin\n", "\u001b[0mcore.pack.dunbrack.RotamerLibrary: \u001b[0mUsing Dunbrack library binary file '/Users/kathyle/Computational Protein Prediction and Design/PyRosetta4.Release.python36.mac.release-208/pyrosetta/database/rotamer/shapovalov/StpDwn_0-0-0/Dunbrack10.lib.bin'.\n", "\u001b[0mcore.pack.dunbrack.RotamerLibrary: \u001b[0mDunbrack 2010 library took 0.456743 seconds to load from binary\n" ] }, { "data": { "text/plain": [ "1215.729069796814" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "### BEGIN SOLUTION\n", "pose = pyrosetta.pose_from_pdb(\"inputs/6Q21_A.pdb\")\n", "sfxn = pyrosetta.get_score_function()\n", "sfxn(pose)\n", "### END SOLUTION" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Question:** Print residue 5. Note the number of atoms and coordinates of residue 5.\n", "\n", "```\n", "print(pose.residue(5))\n", "```" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "nbgrader": { "grade": true, "grade_id": "cell-903370d16427d6c6", "locked": false, "points": 0, "schema_version": 3, "solution": true } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Residue 5: LYS (LYS, K):\n", "Base: LYS\n", " Properties: POLYMER PROTEIN CANONICAL_AA POLAR CHARGED POSITIVE_CHARGE METALBINDING SIDECHAIN_AMINE ALPHA_AA L_AA\n", " Variant types:\n", " Main-chain atoms: N CA C \n", " Backbone atoms: N CA C O H HA \n", " Side-chain atoms: CB CG CD CE NZ 1HB 2HB 1HG 2HG 1HD 2HD 1HE 2HE 1HZ 2HZ 3HZ \n", "Atom Coordinates:\n", " N : 20.315, 43.835, 78.015\n", " CA : 20.418, 42.863, 79.118\n", " C : 19.697, 43.46, 80.329\n", " O : 20.096, 44.486, 80.897\n", " CB : 21.858, 42.487, 79.491\n", " CG : 22.791, 42.176, 78.316\n", " CD : 22.406, 40.943, 77.485\n", " CE : 23.009, 40.932, 76.075\n", " NZ : 22.748, 42.169, 75.307\n", " H : 21.0493, 44.5172, 77.8902\n", " HA : 19.9193, 41.9417, 78.815\n", " 1HB : 22.3125, 43.3019, 80.0551\n", " 2HB : 21.8492, 41.6078, 80.1356\n", " 1HG : 22.8124, 43.0262, 77.6332\n", " 2HG : 23.8008, 42.0064, 78.6884\n", " 1HD : 22.7418, 40.0399, 77.9965\n", " 2HD : 21.3219, 40.8985, 77.3807\n", " 1HE : 24.088, 40.801, 76.1421\n", " 2HE : 22.5982, 40.0953, 75.5101\n", " 1HZ : 23.1708, 42.0938, 74.3926\n", " 2HZ : 21.751, 42.2999, 75.2069\n", " 3HZ : 23.1434, 42.9592, 75.7961\n", "Mirrored relative to coordinates in ResidueType: FALSE\n", "\n" ] } ], "source": [ "### BEGIN SOLUTION\n", "print(pose.residue(5))\n", "### END SOLUTION" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### SwitchResidueTypeSetMover" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now, convert the `pose` to the centroid form by using a `SwitchResidueTypeSetMover` object and the apply method:\n", "\n", "```\n", "switch = SwitchResidueTypeSetMover(\"centroid\")\n", "switch.apply(pose)\n", "print(pose.residue(5))\n", "```\n", "\n", "**Question:** How many atoms are now in residue 5? How is this different than before switching it into centroid mode?" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "nbgrader": { "grade": true, "grade_id": "cell-ca60733d94d98aa0", "locked": false, "points": 0, "schema_version": 3, "solution": true } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[0mcore.chemical.GlobalResidueTypeSet: \u001b[0mFinished initializing centroid residue type set. Created 62 residue types\n", "\u001b[0mcore.chemical.GlobalResidueTypeSet: \u001b[0mTotal time to initialize 0.058948 seconds.\n", "Residue 5: LYS (LYS, K):\n", "Base: LYS\n", " Properties: POLYMER PROTEIN CANONICAL_AA POLAR CHARGED POSITIVE_CHARGE SIDECHAIN_AMINE ALPHA_AA L_AA\n", " Variant types:\n", " Main-chain atoms: N CA C \n", " Backbone atoms: N CA C O H \n", " Side-chain atoms: CB CEN\n", "Atom Coordinates:\n", " N : 20.315, 43.835, 78.015\n", " CA : 20.418, 42.863, 79.118\n", " C : 19.697, 43.46, 80.329\n", " O : 20.096, 44.486, 80.897\n", " CB : 21.8754, 42.543, 79.454\n", " CEN: 23.4957, 41.1851, 79.3707\n", " H : 21.0493, 44.5172, 77.8902\n", "Mirrored relative to coordinates in ResidueType: FALSE\n", "\n" ] } ], "source": [ "### BEGIN SOLUTION\n", "switch = SwitchResidueTypeSetMover(\"centroid\")\n", "switch.apply(pose)\n", "print(pose.residue(5))\n", "### END SOLUTION" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Score the new, centroid-based pose by creating and using the standard centroid score function \"score3\".\n", "\n", "```\n", "cen_sfxn = pyrosetta.create_score_function(\"score3\")\n", "cen_sfxn(pose)\n", "```\n", "\n", "**Question:** What is the new total score? What scoring terms are included in \"score3\" (`print` the `cen_sfxn`)? Do these match Simons?" ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "nbgrader": { "grade": true, "grade_id": "cell-496c9997552c88c9", "locked": false, "points": 0, "schema_version": 3, "solution": true } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[0mbasic.io.database: \u001b[0mDatabase file opened: scoring/score_functions/EnvPairPotential/env_log.txt\n", "\u001b[0mbasic.io.database: \u001b[0mDatabase file opened: scoring/score_functions/EnvPairPotential/cbeta_den.txt\n", "\u001b[0mbasic.io.database: \u001b[0mDatabase file opened: scoring/score_functions/EnvPairPotential/pair_log.txt\n", "\u001b[0mbasic.io.database: \u001b[0mDatabase file opened: scoring/score_functions/EnvPairPotential/cenpack_log.txt\n", "\u001b[0mbasic.io.database: \u001b[0mDatabase file opened: scoring/score_functions/SecondaryStructurePotential/phi.theta.36.HS.resmooth\n", "\u001b[0mbasic.io.database: \u001b[0mDatabase file opened: scoring/score_functions/SecondaryStructurePotential/phi.theta.36.SS.resmooth\n" ] }, { "data": { "text/plain": [ "-4.509358254597608" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "### BEGIN SOLUTION\n", "cen_sfxn = pyrosetta.create_score_function(\"score3\")\n", "cen_sfxn(pose)\n", "### END SOLUTION" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Convert the `pose` back to all-atom form by using another switch object, `SwitchResidueTypeSetMover(\"fa_standard\")`.\n", "\n", "```\n", "fa_switch = SwitchResidueTypeSetMover(\"fa_standard\")\n", "fa_switch.apply(pose)\n", "print(pose.residue(5))\n", "```\n", "\n", "**Question:** Confirm that you have all the atoms back. Are the atoms in the same coordinate position as before?" ] }, { "cell_type": "code", "execution_count": 11, "metadata": { "nbgrader": { "grade": true, "grade_id": "cell-e103613761d9f291", "locked": false, "points": 0, "schema_version": 3, "solution": true } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Residue 5: LYS (LYS, K):\n", "Base: LYS\n", " Properties: POLYMER PROTEIN CANONICAL_AA POLAR CHARGED POSITIVE_CHARGE METALBINDING SIDECHAIN_AMINE ALPHA_AA L_AA\n", " Variant types:\n", " Main-chain atoms: N CA C \n", " Backbone atoms: N CA C O H HA \n", " Side-chain atoms: CB CG CD CE NZ 1HB 2HB 1HG 2HG 1HD 2HD 1HE 2HE 1HZ 2HZ 3HZ \n", "Atom Coordinates:\n", " N : 20.315, 43.835, 78.015\n", " CA : 20.418, 42.863, 79.118\n", " C : 19.697, 43.46, 80.329\n", " O : 20.096, 44.486, 80.897\n", " CB : 21.8754, 42.5429, 79.4539\n", " CG : 22.8944, 43.244, 78.5655\n", " CD : 22.2113, 44.1202, 77.5262\n", " CE : 20.6967, 44.0574, 77.6573\n", " NZ : 20.2706, 43.1587, 78.7642\n", " H : 21.0493, 44.5172, 77.8902\n", " HA : 19.9306, 41.9373, 78.8101\n", " 1HB : 22.0814, 42.8255, 80.4867\n", " 2HB : 22.0409, 41.4686, 79.3693\n", " 1HG : 23.5468, 43.8654, 79.1801\n", " 2HG : 23.5056, 42.4999, 78.0558\n", " 1HD : 22.5361, 45.154, 77.6512\n", " 2HD : 22.4937, 43.7874, 76.5274\n", " 1HE : 20.3065, 45.0564, 77.8461\n", " 2HE : 20.2655, 43.6934, 76.7248\n", " 1HZ : 19.2619, 43.1443, 78.8176\n", " 2HZ : 20.6116, 42.2236, 78.5898\n", " 3HZ : 20.6485, 43.497, 79.6375\n", "Mirrored relative to coordinates in ResidueType: FALSE\n", "\n" ] } ], "source": [ "### BEGIN SOLUTION\n", "fa_switch = SwitchResidueTypeSetMover(\"fa_standard\")\n", "fa_switch.apply(pose)\n", "print(pose.residue(5))\n", "### END SOLUTION" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Exercise 1: Centroid Folding Algorithm\n", "Go back and adjust your folding algorithm to use centroid mode. Create a `ScoreFunction` that uses only van der Waals (`fa_atr` and `fa_rep`) and `hbond_sr_bb` energy score terms. \n", "\n", "**Question:** How much faster does your program run?" ] }, { "cell_type": "code", "execution_count": 12, "metadata": { "nbgrader": { "grade": true, "grade_id": "cell-30c20d85d421e056", "locked": false, "points": 0, "schema_version": 3, "solution": true } }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/Users/kathyle/Computational Protein Prediction and Design/PyRosetta4.Release.python36.mac.release-208/pyrosetta/teaching.py:13: UserWarning: Import of 'rosetta' as a top-level module is deprecated and may be removed in 2018, import via 'pyrosetta.rosetta'.\n", " from rosetta.core.scoring import *\n" ] } ], "source": [ "polyA = pyrosetta.pose_from_sequence('A' * 10)\n", "polyA.pdb_info().name(\"polyA\")\n", "\n", "# Apply the SwitchResidueTypeSetMover to the pose polyA\n", "### BEGIN SOLUTION\n", "switch = SwitchResidueTypeSetMover(\"centroid\")\n", "switch.apply(polyA)\n", "### END SOLUTION" ] }, { "cell_type": "code", "execution_count": 13, "metadata": { "nbgrader": { "grade": true, "grade_id": "cell-65965651a693f886", "locked": false, "points": 0, "schema_version": 3, "solution": true } }, "outputs": [], "source": [ "# Create new score function with only VDW and hbond_sr_bb energy score terms.\n", "### BEGIN SOLUTION\n", "cen_sfxn = ScoreFunction()\n", "cen_sfxn.set_weight(fa_atr, 1.0)\n", "cen_sfxn.set_weight(fa_rep, 1.0)\n", "cen_sfxn.set_weight(hbond_sr_bb, 1.0)\n", "### END SOLUTION" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [], "source": [ "# Use the basic_folding function in the previous chapter,\n", "# overwrite your scoring subroutine, and run the program.\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Note about `Movers`\n", "\n", "Not counting the `PyMOLMover`, which is a special case, `SwitchResidueTypeSetMover` is the first example we have seen of a `Mover` class in PyRosetta. Every `Mover` object in PyRosetta has been designed to apply specific and complex changes (or “moves”) to a `pose`. Every `Mover` must be “constructed” and have any options set before being applied to a `pose` with the `apply()` method. `SwitchResidueTypeSetMover` has a relatively simple construction with only the single option `\"centroid\"`. (Some `Movers`, as we shall see, require no options and are programmed to operate with default values)." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Protein Fragments\n", "\n", "\n", "Look at the provided `3mer.frags` fragments. These fragments are generated from the Robetta server (http://robetta.bakerlab.org/fragmentsubmit.jsp) for a given sequence. You should see sets of three-lines describing each fragment.\n", "\n", "**Questions:** For the first fragment, which PDB file does it come from? Is this fragment helical, sheet, in a loop, or a combination? What are the φ, ψ, and ω angles of the middle residue of the first fragment window?" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Create a new subroutine in your folding code for an alternate random move based upon a “fragment insertion”. A fragment insertion is the replacement of the torsion angles for a set of consecutive residues with new torsion angles pulled at random from a fragment library file. Prior to calling the subroutine, load the set of fragments from the fragment file:\n", "\n", "```\n", "from pyrosetta.rosetta.core.fragment import *\n", "fragset = ConstantLengthFragSet(3)\n", "fragset.read_fragment_file(\"3mer.frags\")\n", "```" ] }, { "cell_type": "code", "execution_count": 15, "metadata": { "nbgrader": { "grade": true, "grade_id": "cell-25717d95e497ae8e", "locked": false, "points": 0, "schema_version": 3, "solution": true } }, "outputs": [], "source": [ "### BEGIN SOLUTION\n", "from pyrosetta.rosetta.core.fragment import *\n", "fragset = ConstantLengthFragSet(3)\n", "fragset.read_fragment_file(\"inputs/3mer.frags\")\n", "### END SOLUTION" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Using FragmentMover and MoveMap" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Next, we will construct another `Mover` object — this time a `FragmentMover` — using the above fragment set and a `MoveMap` object as options. A `MoveMap` specifies which degrees of freedom are allowed to change in the `pose` when the `Mover` is applied (in this case, all backbone torsion angles):\n", "\n", "```\n", "from pyrosetta.rosetta.protocols.simple_moves import ClassicFragmentMover\n", "movemap = MoveMap()\n", "movemap.set_bb(True)\n", "mover_3mer = ClassicFragmentMover(fragset, movemap)\n", "```" ] }, { "cell_type": "code", "execution_count": 17, "metadata": { "nbgrader": { "grade": true, "grade_id": "cell-539c69ec2a2a274b", "locked": false, "points": 0, "schema_version": 3, "solution": true } }, "outputs": [], "source": [ "### BEGIN SOLUTION\n", "from pyrosetta.rosetta.protocols.simple_moves import ClassicFragmentMover\n", "movemap = MoveMap()\n", "movemap.set_bb(True)\n", "mover_3mer = ClassicFragmentMover(fragset, movemap)\n", "### END SOLUTION" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Note that when a MoveMap is constructed, all degrees of freedom are set to False initially. If you still have a *PyMOL_Mover* instantiated, you can quickly visualize which degrees of freedom will be allowed by sending your move map to PyMOL with \n", "\n", "```\n", "test_pose = pyrosetta.pose_from_sequence(\"RFPMMSTFKVLLCGAVLSRIDAG\")\n", "pmm.apply(test_pose)\n", "pmm.send_movemap(test_pose, movemap)\n", "```" ] }, { "cell_type": "code", "execution_count": 20, "metadata": { "nbgrader": { "grade": true, "grade_id": "cell-d4ee7c3e65ce8c73", "locked": false, "points": 0, "schema_version": 3, "solution": true } }, "outputs": [], "source": [ "### BEGIN SOLUTION\n", "test_pose = pyrosetta.pose_from_sequence(\"RFPMMSTFKVLLCGAVLSRIDAG\")\n", "pmm = PyMOLMover()\n", "pmm.apply(test_pose)\n", "pmm.send_movemap(test_pose, movemap)\n", "### END SOLUTION" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Each time this mover is applied, it will select a random 3-mer window and insert only the backbone torsion angles from a random matching fragment in the fragment set. Here is an example using the above `test_pose`:\n", "\n", "```\n", "mover_3mer.apply(test_pose)\n", "pmm.apply(test_pose)\n", "```" ] }, { "cell_type": "code", "execution_count": 21, "metadata": { "nbgrader": { "grade": true, "grade_id": "cell-f819d81a506cf042", "locked": false, "points": 0, "schema_version": 3, "solution": true } }, "outputs": [], "source": [ "### BEGIN SOLUTION\n", "mover_3mer.apply(test_pose)\n", "pmm.apply(test_pose)\n", "### END SOLUTION" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Exercise 2: Fragment Folding Algorithm\n", "**Question:** When you change your random move in your poly-alanine folding algorithm to a fragment insertion, how much faster is your protocol? Does it converge to a protein-like conformation more quickly?" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Programming Exercises\n", "\n", "- Fold a 10-mer poly-alanine using 100 independent trajectories, using any variant of the folding algorithm that you like. (A trajectory is a path through the conformation space traveled during the calculation. The end result of each independent trajectory is called a “decoy”. Given enough sampling, the lowest energy decoy may correspond to the global minimum.) Create a Ramachandran plot using the lowest-scoring conformations (decoys) from all 100 independent trajectories. Repeat this for a 10-mer poly-glycine. How do the plots differ? Compare with the plots in Richardson’s article.\n", "\n", "\n", "- Test your folding program’s ability to predict a real fold from scratch. Choose a small protein to keep the computation time down, such as Hox-B1 homeobox protein (1B72) or RecA (2REB). How many iterations and how many independent trajectories do you need to run to find a good structure?\n", "\n", "\n", "- Modify your folding program to include a simulated annealing temperature schedule, decaying exponentially from kT = 100 to kT = 0.1 over the course of the search. Again, fold a test protein. Does this approach work better?\n", "Modify your folding program to remove the Metropolis criterion and instead accept trial moves only when the energy decreases. Plot energy vs. iteration and examine the final output structures from multiple runs. How is the convergence and performance affected? Why?\n", "\n", "\n", "### Thought Questions\n", "\n", "- **[Introductory]** What are the limitations of these types of folding algorithms?\n", "\n", "\n", "- **[Advanced]** How might you design an intermediate-resolution representation of side chains that has more detail than the centroid approach yet is faster than the full-atom approach? Which types of residues would most benefit from this type of representation?" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "< [Basic Folding Algorithm](http://nbviewer.jupyter.org/github/RosettaCommons/PyRosetta.notebooks/blob/master/notebooks/04.01-Basic-Folding-Algorithm.ipynb) | [Contents](toc.ipynb) | [Index](index.ipynb) | [Structure Refinement](http://nbviewer.jupyter.org/github/RosettaCommons/PyRosetta.notebooks/blob/master/notebooks/05.00-Structure-Refinement.ipynb) >

\"Open" ] } ], "metadata": { "anaconda-cloud": {}, "celltoolbar": "Create Assignment", "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": { "height": "calc(100% - 180px)", "left": "10px", "top": "150px", "width": "257.188px" }, "toc_section_display": true, "toc_window_display": true } }, "nbformat": 4, "nbformat_minor": 1 }