{ "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", "< [Working With Symmetry](http://nbviewer.jupyter.org/github/RosettaCommons/PyRosetta.notebooks/blob/master/notebooks/10.00-Working-With-Symmetry.ipynb) | [Contents](toc.ipynb) | [Index](index.ipynb) | [Working With Antibodies](http://nbviewer.jupyter.org/github/RosettaCommons/PyRosetta.notebooks/blob/master/notebooks/12.00-Working-With-Antibodies.ipynb) >

\"Open" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Working With Density\n", "Keywords: crystal, density, refinement, LoadDensityMapMover, map, EM, X-ray\n", "\n", "## Overview\n", "\n", "Density can be a useful tool in Rosetta and can be used to refine a PDB structure, test Rosetta structure prediction methods, and build de-novo models guided by density of different resolutions. It can also be used as an experimentally-determined guide/constraint for custom methods. \n", "\n", "Rosetta understands X-ray or electron density through scoring. In this tutorial, we will first walk through how to create a density file that Rosetta understands, and then load it, score it, and refine a structure using it. We will also cover some common tools used while working with density. \n", "\n", "More complicated protocols exist through the use of `RosettaScripts` in PyRosetta, and even more protocols through applications built using main Rosetta. We will not cover these in this introductory tutorial, but please refer to the original references listed below (such as De novo protein structure determination...) for how to run these applications. \n", "\n", "Note that symmetry and density can be used together!\n", "\n", "## Documentation\n", "More information on Density Scoring and relavent applications can be found here:\n", "\n", "- https://www.rosettacommons.org/docs/latest/application_documentation/analysis/density-map-scoring\n", "- https://www.rosettacommons.org/docs/latest/application_documentation/structure_prediction/mr-protocols\n", "\n", "\n", "## References\n", "\n", "- _Atomic-accuracy models from 4.5-Å cryo-electron microscopy data with density-guided iterative local refinement._\n", " - https://www.ncbi.nlm.nih.gov/pubmed/25707030\n", " \n", " \n", "- _De novo protein structure determination from near-atomic-resolution cryo-EM maps._\n", " - https://www.ncbi.nlm.nih.gov/pubmed/25707029\n", " \n", " \n", "- _Tools for Model Building and Optimization into Near-Atomic Resolution Electron Cryo-Microscopy Density Maps._\n", " - https://www.ncbi.nlm.nih.gov/pubmed/27572730\n", " \n", " \n", "- _Automated structure refinement of macromolecular assemblies from cryo-EM maps using Rosetta._\n", " - https://www.ncbi.nlm.nih.gov/pubmed/27669148\n", " \n", " \n", "- _Rosetta Structure Prediction as a Tool for Solving Difficult Molecular Replacement Problems._\n", " - https://www.ncbi.nlm.nih.gov/pubmed/28573585\n", " \n", " \n", "- _RosettaES: a sampling strategy enabling automated interpretation of difficult cryo-EM maps._\n", " - https://www.ncbi.nlm.nih.gov/pubmed/28628127\n", " \n", " \n", "- _Automatically Fixing Errors in Glycoprotein Structures with Rosetta_\n", " - https://www.ncbi.nlm.nih.gov/pubmed/30344107\n", "\n" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [], "source": [ "!pip install pyrosettacolabsetup\n", "import pyrosettacolabsetup; pyrosettacolabsetup.install_pyrosetta()\n", "import pyrosetta; pyrosetta.init()\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Creating a Density Map\n", "\n", "We won't actually do this in the tutorial as it requires a third-party application, but the (.ccp4) density map you will be using was created this way. \n", "\n", "1) Download and install phenix.maps: https://www.phenix-online.org/documentation/reference/maps.html \n", "\n", " - Make sure phenix.maps is in your path.\n", "\n", "2) Download the CIF file from the Protein Data Bank for the structure you are interested in.\n", "\n", "3) Use this command to create a map: `phenix.maps pdb_path cif_path` \n", "\n", " - Note that depending on the cif file and structure, you may need to rarely edit the defaults to get it work properly, especially for glycan structures. Please refer to the phenix documentation for this. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Setup for Density Scoring\n", "\n", "Here, we will make a scorefunction and set `fast_elec_dens` to a proper value and use the `LoadDensityMapMover` to actually load the density map. Note that (currently) the density map is GLOBAL data within Rosetta - so only a single structure can be modeled/refined at a time. \n", "\n", "### From the docs:\n", "\n", "Several scoring functions have been added to Rosetta which describe how well a structure agrees to experimental density data. Density map data is read in CCP4/MRC format (the density has to minimally cover the asymmetric unit). The various scoring functions trade off speed versus accuracy, and their use should be primarily determined by the resolution of the density map data:\n", "\n", "- **elec\\_dens\\_fast** is recommended for most cases.\n", "\n", "Additionally, a slower but more precise scoring function is available. This is only recommended if **elec\\_dens\\_fast** performs poorly (for example, if map quality varies significantly throughout the map):\n", "- **elec\\_dens\\_window** - Uses the sum of correlations of a sliding window of residues versus the experimental data; structure density only uses all heavy atoms.\n", "\n", "The weights to use vary depending on resolution of data but the following give reasonable ranges:\n", "\n", "- **elec\\_dens\\_fast**: ~25 is generally good, higher for high-resolution (<3Å) and lower for low-resolution (>6Å)\n", "- **elec\\_dens\\_window**: ~0.2 is generally good, higher for high-resolution (<3Å) and lower for low-resolution (>6Å)\n", "\n", "\n" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "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", "\u001b[0mcore.init: \u001b[0mChecking for fconfig files in pwd and ./rosetta/flags\n", "\u001b[0mcore.init: \u001b[0mReading fconfig.../Users/jadolfbr/.rosetta/flags/common\n", "\u001b[0mcore.init: \u001b[0m\n", "\u001b[0mcore.init: \u001b[0m\n", "\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", "\u001b[0mcore.init: \u001b[0mcommand: PyRosetta -ignore_unrecognized_res -load_PDB_components false -ignore_zero_occupancy false @inputs/glycan_flags -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", "\u001b[0mbasic.random.init_random_generator: \u001b[0m'RNG device' seed mode, using '/dev/urandom', seed=-370139418 seed_offset=0 real_seed=-370139418\n", "\u001b[0mbasic.random.init_random_generator: \u001b[0mRandomGenerator:init: Normal mode, seed=-370139418 RG_type=mt19937\n" ] } ], "source": [ "from pyrosetta import *\n", "from pyrosetta.rosetta import *\n", "from pyrosetta.teaching import *\n", "import os\n", "\n", "init('-ignore_unrecognized_res -load_PDB_components false -ignore_zero_occupancy false @inputs/glycan_flags')" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[0mcore.import_pose.import_pose: \u001b[0mFile 'inputs/1jnd.pdb' automatically determined to be of type PDB\n", "\u001b[0mcore.io.pdb.pdb_reader: \u001b[0mParsing 82 .pdb records with unknown format to search for Rosetta-specific comments.\n", "\u001b[0mcore.io.util: \u001b[0mAutomatic glycan connection is activated.\n", "\u001b[0mcore.io.util: \u001b[0mStart reordering residues.\n", "\u001b[0mcore.io.util: \u001b[0mCorrected glycan residue order (internal numbering): [401, 402, 403, 404]\n", "\u001b[0mcore.io.util: \u001b[0m\n", "\u001b[0mcore.io.pose_from_sfr.PoseFromSFRBuilder: \u001b[0mSetting chain termination for 404\n", "\u001b[0mcore.io.pose_from_sfr.PoseFromSFRBuilder: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Glc401 has an unfavorable ring conformation; the coordinates for this input structure may have been poorly assigned.\n", "\u001b[0mcore.io.pose_from_sfr.PoseFromSFRBuilder: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Glc402 has an unfavorable ring conformation; the coordinates for this input structure may have been poorly assigned.\n", "\u001b[0mcore.io.pose_from_sfr.PoseFromSFRBuilder: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Man403 has an unfavorable ring conformation; the coordinates for this input structure may have been poorly assigned.\n", "\u001b[0mcore.io.pose_from_sfr.PoseFromSFRBuilder: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Man404 has an unfavorable ring conformation; the coordinates for this input structure may have been poorly assigned.\n", "\u001b[0mcore.chemical.AtomICoor: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m IcoorAtomID::atom_id(): Cannot get atom_id for POLYMER_LOWER of residue ->4)-beta-D-Glcp:2-AcNH 401. Returning BOGUS ID instead.\n", "\u001b[0mcore.conformation.Residue: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m missing an atom: 401 H1 that depends on a nonexistent polymer connection!\n", "\u001b[0mcore.conformation.Residue: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m --> generating it using idealized coordinates.\n", "\u001b[0mcore.chemical.AtomICoor: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m IcoorAtomID::atom_id(): Cannot get atom_id for POLYMER_LOWER of residue ->4)-beta-D-Glcp:2-AcNH 401. Returning BOGUS ID instead.\n", "\u001b[0mcore.conformation.Conformation: \u001b[0mFound disulfide between residues 5 32\n", "\u001b[0mcore.conformation.Conformation: \u001b[0mcurrent variant for 5 CYS\n", "\u001b[0mcore.conformation.Conformation: \u001b[0mcurrent variant for 32 CYS\n", "\u001b[0mcore.conformation.Conformation: \u001b[0mcurrent variant for 5 CYD\n", "\u001b[0mcore.conformation.Conformation: \u001b[0mcurrent variant for 32 CYD\n", "\u001b[0mcore.conformation.Conformation: \u001b[0mFound disulfide between residues 302 385\n", "\u001b[0mcore.conformation.Conformation: \u001b[0mcurrent variant for 302 CYS\n", "\u001b[0mcore.conformation.Conformation: \u001b[0mcurrent variant for 385 CYS\n", "\u001b[0mcore.conformation.Conformation: \u001b[0mcurrent variant for 302 CYD\n", "\u001b[0mcore.conformation.Conformation: \u001b[0mcurrent variant for 385 CYD\n", "\u001b[0mcore.conformation.carbohydrates.GlycanTreeSet: \u001b[0mSetting up Glycan Trees\n", "\u001b[0mcore.conformation.carbohydrates.GlycanTreeSet: \u001b[0mFound 1 glycan trees.\n", "\u001b[0mprotocols.rosetta_scripts.RosettaScriptsParser: \u001b[0mGenerating XML Schema for rosetta_scripts...\n", "\u001b[0mprotocols.rosetta_scripts.RosettaScriptsParser: \u001b[0m...done\n", "\u001b[0mprotocols.rosetta_scripts.RosettaScriptsParser: \u001b[0mInitializing schema validator...\n", "\u001b[0mprotocols.rosetta_scripts.RosettaScriptsParser: \u001b[0m...done\n", "\u001b[0mprotocols.rosetta_scripts.RosettaScriptsParser: \u001b[0mValidating input script...\n", "\u001b[0mprotocols.rosetta_scripts.RosettaScriptsParser: \u001b[0m...done\n", "\u001b[0mprotocols.rosetta_scripts.RosettaScriptsParser: \u001b[0mParsed script:\n", "\n", "\t\n", "\t\t\n", "\t\n", "\t\n", "\n", "\u001b[0mcore.scoring.ScoreFunctionFactory: \u001b[0mSCOREFUNCTION: \u001b[32mref2015\u001b[0m\n", "\u001b[0mcore.scoring.ScoreFunctionFactory: \u001b[0mThe -include_sugars flag was used with no sugar_bb weight set in the weights file. Setting sugar_bb weight to 1.0 by default.\n", "\u001b[0mprotocols.rosetta_scripts.RosettaScriptsParser: \u001b[0mDefined mover named \"loaddens\" of type LoadDensityMap\n", "\u001b[0mprotocols.rosetta_scripts.ParsedProtocol: \u001b[0mParsedProtocol mover with the following movers and filters\n", "\u001b[0mcore.scoring.electron_density.ElectronDensity: \u001b[0mLoading Density Map\n", "\u001b[0mcore.scoring.electron_density.ElectronDensity: \u001b[0mLoading density mapinputs/1jnd_2mFo-DFc_map.ccp4\n", "\u001b[0mcore.scoring.electron_density.ElectronDensity: \u001b[0m Setting resolution to AUTO\n", "\u001b[0mcore.scoring.electron_density.ElectronDensity: \u001b[0m atom mask to 3.2A\n", "\u001b[0mcore.scoring.electron_density.ElectronDensity: \u001b[0m CA mask to 6A\n", "\u001b[0mcore.scoring.electron_density.ElectronDensity: \u001b[0m Read density map'inputs/1jnd_2mFo-DFc_map.ccp4'\n", "\u001b[0mcore.scoring.electron_density.ElectronDensity: \u001b[0m extent: 218 x 229 x 265\n", "\u001b[0mcore.scoring.electron_density.ElectronDensity: \u001b[0m origin: -66 x 82 x 209\n", "\u001b[0mcore.scoring.electron_density.ElectronDensity: \u001b[0m altorigin: 0 x 0 x 0\n", "\u001b[0mcore.scoring.electron_density.ElectronDensity: \u001b[0m grid: 360 x 360 x 288\n", "\u001b[0mcore.scoring.electron_density.ElectronDensity: \u001b[0m celldim: 106.345 x 106.345 x 89.987\n", "\u001b[0mcore.scoring.electron_density.ElectronDensity: \u001b[0m cellangles: 90 x 90 x 120\n", "\u001b[0mcore.scoring.electron_density.ElectronDensity: \u001b[0m voxel vol.: 0.0236128\n", "\u001b[0mcore.scoring.electron_density.ElectronDensity: \u001b[0mEffective resolution = 0.937365\n" ] } ], "source": [ "from rosetta.protocols.cryst import *\n", "from rosetta.protocols.rosetta_scripts import *\n", "\n", "p = pose_from_pdb('inputs/1jnd.pdb')\n", "\n", "original = p.clone()\n", "\n", "#The LoadDensityMapMover unfortunately does not have getters and setters yet. \n", "# This has been updated in the Rosetta C++ code, but for now, we have to use the XML interface. \n", "\n", "#setup_dens = LoadDensityMapMover(\"inputs/1jnd_2mFo-DFc_map.ccp4\")\n", "setup_dens = XmlObjects.static_get_mover('')\n", "setup_dens.apply(p)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now, we need to set the pose up for density scoring. The `SetupForDensityScoring` mover sets a specific foldtree to the pose to allow scoring properly. We will then load a scorefunction with our density scoreterm, and load a pre-refined pose that was refined into the density using the pareto-optimal protocol with density. " ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[0mcore.import_pose.import_pose: \u001b[0mFile 'inputs/1jnd_refined.pdb.gz' automatically determined to be of type PDB\n", "\u001b[0mcore.io.pdb.pdb_reader: \u001b[0mParsing 411 .pdb records with unknown format to search for Rosetta-specific comments.\n", "\u001b[0mcore.io.util: \u001b[0mAutomatic glycan connection is activated.\n", "\u001b[0mcore.io.util: \u001b[0mStart reordering residues.\n", "\u001b[0mcore.io.util: \u001b[0mCorrected glycan residue order (internal numbering): [401, 402, 403, 404]\n", "\u001b[0mcore.io.util: \u001b[0m\n", "\u001b[0mcore.io.pose_from_sfr.PoseFromSFRBuilder: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Glc401 has an unfavorable ring conformation; the coordinates for this input structure may have been poorly assigned.\n", "\u001b[0mcore.io.pose_from_sfr.PoseFromSFRBuilder: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Glc402 has an unfavorable ring conformation; the coordinates for this input structure may have been poorly assigned.\n", "\u001b[0mcore.io.pose_from_sfr.PoseFromSFRBuilder: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Man403 has an unfavorable ring conformation; the coordinates for this input structure may have been poorly assigned.\n", "\u001b[0mcore.io.pose_from_sfr.PoseFromSFRBuilder: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Man404 has an unfavorable ring conformation; the coordinates for this input structure may have been poorly assigned.\n", "\u001b[0mcore.chemical.AtomICoor: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m IcoorAtomID::atom_id(): Cannot get atom_id for POLYMER_LOWER of residue ->4)-beta-D-Glcp:2-AcNH 401. Returning BOGUS ID instead.\n", "\u001b[0mcore.conformation.Conformation: \u001b[0mFound disulfide between residues 5 32\n", "\u001b[0mcore.conformation.Conformation: \u001b[0mcurrent variant for 5 CYS\n", "\u001b[0mcore.conformation.Conformation: \u001b[0mcurrent variant for 32 CYS\n", "\u001b[0mcore.conformation.Conformation: \u001b[0mcurrent variant for 5 CYD\n", "\u001b[0mcore.conformation.Conformation: \u001b[0mcurrent variant for 32 CYD\n", "\u001b[0mcore.conformation.Conformation: \u001b[0mFound disulfide between residues 302 385\n", "\u001b[0mcore.conformation.Conformation: \u001b[0mcurrent variant for 302 CYS\n", "\u001b[0mcore.conformation.Conformation: \u001b[0mcurrent variant for 385 CYS\n", "\u001b[0mcore.conformation.Conformation: \u001b[0mcurrent variant for 302 CYD\n", "\u001b[0mcore.conformation.Conformation: \u001b[0mcurrent variant for 385 CYD\n", "\u001b[0mcore.conformation.carbohydrates.GlycanTreeSet: \u001b[0mSetting up Glycan Trees\n", "\u001b[0mcore.conformation.carbohydrates.GlycanTreeSet: \u001b[0mFound 1 glycan trees.\n", "\u001b[0mcore.scoring.ScoreFunctionFactory: \u001b[0mSCOREFUNCTION: \u001b[32mref2015\u001b[0m\n", "\u001b[0mcore.scoring.ScoreFunctionFactory: \u001b[0mThe -include_sugars flag was used with no sugar_bb weight set in the weights file. Setting sugar_bb weight to 1.0 by default.\n", "\u001b[0mcore.scoring.ScoreFunctionFactory: \u001b[0mSCOREFUNCTION: \u001b[32mref2015\u001b[0m\n", "\u001b[0mcore.scoring.ScoreFunctionFactory: \u001b[0mThe -include_sugars flag was used with no sugar_bb weight set in the weights file. Setting sugar_bb weight to 1.0 by default.\n", "\u001b[0mcore.scoring.electron_density.ElectronDensity: \u001b[0mSetting [kmin_,kmax_] to [0.0637226,3.25267]\n", "\u001b[0mcore.scoring.electron_density.ElectronDensity: \u001b[0mBin 1: B(C/N/O/S)=0 / 0 / 0 / 8.60156 sum=(0,0)\n", "crystal -6968.769963053168\n", "refined -7770.2095688851\n" ] } ], "source": [ "setup_dens_pose = rosetta.protocols.electron_density.SetupForDensityScoringMover()\n", "\n", "ref = pose_from_pdb('inputs/1jnd_refined.pdb.gz')\n", "\n", "setup_dens_pose.apply(p)\n", "setup_dens_pose.apply(ref)\n", "\n", "score = get_score_function()\n", "score_dens = get_score_function()\n", "score_dens.set_weight(rosetta.core.scoring.elec_dens_fast, 25)\n", "\n", "print(\"crystal\", score_dens(p))\n", "print(\"refined\", score_dens(ref))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now lets minimize our pose. " ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[0mcore.scoring.ScoreFunctionFactory: \u001b[0mSCOREFUNCTION: \u001b[32mref2015\u001b[0m\n", "\u001b[0mcore.scoring.ScoreFunctionFactory: \u001b[0mThe -include_sugars flag was used with no sugar_bb weight set in the weights file. Setting sugar_bb weight to 1.0 by default.\n", "-6954.982255900806\n" ] } ], "source": [ "minmover = MinMover()\n", "mm = MoveMap()\n", "mm.set_bb(True)\n", "mm.set_chi(True)\n", "minmover.set_movemap(mm)\n", "\n", "if not os.getenv(\"DEBUG\"):\n", " for i in range(1, 5):\n", " minmover.apply(p)\n", " \n", "print(score_dens.score(p))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Why has the score gotten worse here?? Because we are minimizing in dihedral space instead of cartesian space - so we make certain energies better, but crystal refinement works best in cartesian space. Lets now minimize in cartesian and see what happens. " ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[0mcore.scoring.CartesianBondedEnergy: \u001b[0mCreating new peptide-bonded energy container (405)\n", "\u001b[0mcore.pose.util: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Unable to find atom_tree atom for this Rosetta branch connection angle: residue 5 BRANCH 1\n", "\u001b[0mcore.pose.util: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Unable to find atom_tree atom for this Rosetta branch connection angle: residue 32 BRANCH 1\n", "\u001b[0mcore.pose.util: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Unable to find atom_tree atom for this Rosetta branch connection angle: residue 302 BRANCH 1\n", "\u001b[0mcore.pose.util: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Unable to find atom_tree atom for this Rosetta branch connection angle: residue 385 BRANCH 1\n", "\u001b[0mcore.pose.util: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Unable to find atom_tree atom for this Rosetta branch connection angle: residue 5 BRANCH 1\n", "\u001b[0mcore.pose.util: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Unable to find atom_tree atom for this Rosetta branch connection angle: residue 32 BRANCH 1\n", "\u001b[0mcore.pose.util: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Unable to find atom_tree atom for this Rosetta branch connection angle: residue 302 BRANCH 1\n", "\u001b[0mcore.pose.util: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Unable to find atom_tree atom for this Rosetta branch connection angle: residue 385 BRANCH 1\n", "\u001b[0mcore.pose.util: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Unable to find atom_tree atom for this Rosetta branch connection angle: residue 5 BRANCH 1\n", "\u001b[0mcore.pose.util: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Unable to find atom_tree atom for this Rosetta branch connection angle: residue 32 BRANCH 1\n", "\u001b[0mcore.pose.util: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Unable to find atom_tree atom for this Rosetta branch connection angle: residue 302 BRANCH 1\n", "\u001b[0mcore.pose.util: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Unable to find atom_tree atom for this Rosetta branch connection angle: residue 385 BRANCH 1\n", "\u001b[0mcore.pose.util: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Unable to find atom_tree atom for this Rosetta branch connection angle: residue 5 BRANCH 1\n", "\u001b[0mcore.pose.util: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Unable to find atom_tree atom for this Rosetta branch connection angle: residue 32 BRANCH 1\n", "\u001b[0mcore.pose.util: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Unable to find atom_tree atom for this Rosetta branch connection angle: residue 302 BRANCH 1\n", "\u001b[0mcore.pose.util: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Unable to find atom_tree atom for this Rosetta branch connection angle: residue 385 BRANCH 1\n", "\u001b[0mcore.pose.util: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Unable to find atom_tree atom for this Rosetta branch connection angle: residue 5 BRANCH 1\n", "\u001b[0mcore.pose.util: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Unable to find atom_tree atom for this Rosetta branch connection angle: residue 32 BRANCH 1\n", "\u001b[0mcore.pose.util: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Unable to find atom_tree atom for this Rosetta branch connection angle: residue 302 BRANCH 1\n", "\u001b[0mcore.pose.util: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Unable to find atom_tree atom for this Rosetta branch connection angle: residue 385 BRANCH 1\n", "\u001b[0mcore.pose.util: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Unable to find atom_tree atom for this Rosetta branch connection angle: residue 5 BRANCH 1\n", "\u001b[0mcore.pose.util: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Unable to find atom_tree atom for this Rosetta branch connection angle: residue 32 BRANCH 1\n", "\u001b[0mcore.pose.util: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Unable to find atom_tree atom for this Rosetta branch connection angle: residue 302 BRANCH 1\n", "\u001b[0mcore.pose.util: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Unable to find atom_tree atom for this Rosetta branch connection angle: residue 385 BRANCH 1\n", "\u001b[0mcore.pose.util: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Unable to find atom_tree atom for this Rosetta branch connection angle: residue 5 BRANCH 1\n", "\u001b[0mcore.pose.util: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Unable to find atom_tree atom for this Rosetta branch connection angle: residue 32 BRANCH 1\n", "\u001b[0mcore.pose.util: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Unable to find atom_tree atom for this Rosetta branch connection angle: residue 302 BRANCH 1\n", "\u001b[0mcore.pose.util: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Unable to find atom_tree atom for this Rosetta branch connection angle: residue 385 BRANCH 1\n", "\u001b[0mcore.pose.util: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Unable to find atom_tree atom for this Rosetta branch connection angle: residue 5 BRANCH 1\n", "\u001b[0mcore.pose.util: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Unable to find atom_tree atom for this Rosetta branch connection angle: residue 32 BRANCH 1\n", "\u001b[0mcore.pose.util: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Unable to find atom_tree atom for this Rosetta branch connection angle: residue 302 BRANCH 1\n", "\u001b[0mcore.pose.util: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Unable to find atom_tree atom for this Rosetta branch connection angle: residue 385 BRANCH 1\n", "\u001b[0mcore.pose.util: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Unable to find atom_tree atom for this Rosetta branch connection angle: residue 5 BRANCH 1\n", "\u001b[0mcore.pose.util: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Unable to find atom_tree atom for this Rosetta branch connection angle: residue 32 BRANCH 1\n", "\u001b[0mcore.pose.util: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Unable to find atom_tree atom for this Rosetta branch connection angle: residue 302 BRANCH 1\n", "\u001b[0mcore.pose.util: \u001b[0m\u001b[1m[ WARNING ]\u001b[0m Unable to find atom_tree atom for this Rosetta branch connection angle: residue 385 BRANCH 1\n", "-7166.488303021679\n" ] } ], "source": [ "p = original.clone()\n", "setup_dens_pose.apply(p)\n", "\n", "score_dens_cart = create_score_function(\"ref2015_cart\")\n", "score_dens_cart.set_weight(rosetta.core.scoring.elec_dens_fast, 25)\n", "\n", "#Set Bondlengths and angles to true. This is easier and more straightforward to do if using a MoveMapFactory.\n", "mm.set(rosetta.core.id.THETA, True)\n", "\n", "minmover.cartesian(True)\n", "minmover.score_function(score_dens_cart)\n", "minmover.set_movemap(mm)\n", "\n", "if not os.getenv(\"DEBUG\"):\n", " for i in range(1, 5):\n", " minmover.apply(p)\n", "\n", "(print(score_dens.score(p)))\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Is this closer to the pre-refined model (which was pre-refined in Relax)? Do they fit the density better? Are they much more within the density? How does the glycan density compare to the full protein density?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Conclusion\n", "\n", "That should get you started using density with typical Rosetta modeling tasks! See the references for more complex protocols. " ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Chapter contributors:**\n", "\n", "- Jared Adolf-Bryfogle (Scripps; Institute for Protein Innovation)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "< [Working With Symmetry](http://nbviewer.jupyter.org/github/RosettaCommons/PyRosetta.notebooks/blob/master/notebooks/10.00-Working-With-Symmetry.ipynb) | [Contents](toc.ipynb) | [Index](index.ipynb) | [Working With Antibodies](http://nbviewer.jupyter.org/github/RosettaCommons/PyRosetta.notebooks/blob/master/notebooks/12.00-Working-With-Antibodies.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": 1 }