{ "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", "< [Global Ligand Docking using `XMLObjects` Using the `ref2015.wts` Scorefunction](http://nbviewer.jupyter.org/github/RosettaCommons/PyRosetta.notebooks/blob/master/notebooks/08.01-Ligand-Docking-XMLObjects.ipynb) | [Contents](toc.ipynb) | [Index](index.ipynb) | [Loop Modeling](http://nbviewer.jupyter.org/github/RosettaCommons/PyRosetta.notebooks/blob/master/notebooks/09.00-Loop-Modeling.ipynb) >
"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# `GALigandDock` Protocol with `pyrosetta.distributed` Using the `beta_cart.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\n",
"import pyrosetta.distributed.io as io\n",
"import pyrosetta.distributed.viewer as viewer\n",
"import pyrosetta.distributed.packed_pose as packed_pose\n",
"import pyrosetta.distributed.tasks.rosetta_scripts as rosetta_scripts\n",
"import seaborn\n",
"seaborn.set()\n",
"import sys\n",
"\n",
"!pip install pyrosettacolabsetup\n",
"import pyrosettacolabsetup; pyrosettacolabsetup.install_pyrosetta()\n",
"import pyrosetta\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Load the `TPA.am1-bcc.gp.params` file when using the `-beta_cart` flag, which has `gen_potential` atom typing and AM1-BCC partial charges:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"pdb_filename = \"inputs/test_lig.pdb\"\n",
"ligand_params = \"inputs/TPA.am1-bcc.gp.params\"\n",
"flags = f\"\"\"\n",
"-ignore_unrecognized_res 1\n",
"-extra_res_fa {ligand_params}\n",
"-beta_cart\n",
"-out:level 200\n",
"\"\"\"\n",
"pyrosetta.distributed.init(flags)\n",
"pose_obj = io.pose_from_file(filename=pdb_filename)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Now we change the scorefunction in our RosettaScripts script to `beta_cart.wts`, the weights of which were optimized on protein-ligand complexes using ligands with AM1-BCC partial charges generated with Amber's `antechamber`."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"`GALigandDock` within RosettaScripts normally outputs multiple `.pdb` files to disk if run by the command line. However, when using the `MultioutputRosettaScriptsTask` function in `pyrosetta.distributed`, the outputs will be captured in memory within this Jupyter session!"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"xml = f\"\"\"\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
}