{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "Before you turn this problem in, make sure everything runs as expected. First, **restart the kernel** (in the menubar, select Kernel$\\rightarrow$Restart) and then **run all cells** (in the menubar, select Cell$\\rightarrow$Run All).\n", "\n", "Make sure you fill in any place that says `YOUR CODE HERE` or \"YOUR ANSWER HERE\", as well as your name and collaborators below:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "NAME = \"\"\n", "COLLABORATORS = \"\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "---" ] }, { "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", "< [Ligand Refinement in PyRosetta (a.k.a. High-Resolution Local Docking) Using the `ligand.wts` Scorefunction](http://nbviewer.jupyter.org/github/RosettaCommons/PyRosetta.notebooks/blob/master/notebooks/07.03-Ligand-Docking-PyRosetta.ipynb) | [Contents](toc.ipynb) | [Index](index.ipynb) | [`GALigandDock` Protocol with `pyrosetta.distributed` Using the `beta_cart.wts` Scorefunction](http://nbviewer.jupyter.org/github/RosettaCommons/PyRosetta.notebooks/blob/master/notebooks/07.05-Ligand-Docking-pyrosetta.distributed.ipynb) >
"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Global Ligand Docking using `XMLObjects` Using the `ref2015.wts` Scorefunction"
]
},
{
"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": [
"*Note:* This Jupyter notebook requires the PyRosetta distributed layer. Please make sure to activate the `PyRosetta.notebooks` conda environment before running this notebook. The kernel is set to use this environment. "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import logging\n",
"logging.basicConfig(level=logging.INFO)\n",
"import matplotlib\n",
"%matplotlib inline\n",
"import os\n",
"import pandas as pd\n",
"import pyrosetta\n",
"import pyrosetta.distributed.viewer as viewer\n",
"import seaborn\n",
"seaborn.set()\n",
"import sys\n",
"\n",
"# Notebook setup\n",
"import sys\n",
"if 'google.colab' in sys.modules:\n",
" print(\"This Jupyter notebook uses parallelization and is therefore not set up for the Google Colab environment.\")\n",
" sys.exit(0)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Now we change the scorefunction to `ref2015.wts`, the weights of which were optimized on ligands with AM1-BCC partial charges generated with Amber's `antechamber`. Therefore, the Rosetta `.params` file should ideally also have AM1-BCC partial charges generated with `antechamber`."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"ligand_params = \"inputs/TPA.am1-bcc.fa.params\"\n",
"flags = f\"\"\"\n",
"-ignore_unrecognized_res 1\n",
"-extra_res_fa {ligand_params}\n",
"\"\"\"\n",
"pyrosetta.distributed.init(flags)\n",
"pose = pyrosetta.io.pose_from_file(filename=\"inputs/test_lig.pdb\")\n",
"scorefxn = pyrosetta.create_score_function(\"ref2015\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Ligand docking using `XmlObjects`:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"xml = pyrosetta.rosetta.protocols.rosetta_scripts.XmlObjects.create_from_string(\"\"\"\n",
"
" ] } ], "metadata": { "kernelspec": { "display_name": "Python [conda env:PyRosetta.notebooks] *", "language": "python", "name": "conda-env-PyRosetta.notebooks-py" }, "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.7.6" }, "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 }