{ "cells": [ { "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", "< [RosettaScripts in PyRosetta](http://nbviewer.jupyter.org/github/RosettaCommons/PyRosetta.notebooks/blob/master/notebooks/02.07-RosettaScripts-in-PyRosetta.ipynb) | [Contents](toc.ipynb) | [Index](index.ipynb) | [Rosetta Energy Score Functions](http://nbviewer.jupyter.org/github/RosettaCommons/PyRosetta.notebooks/blob/master/notebooks/03.00-Rosetta-Energy-Score-Functions.ipynb) >
"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Visualization and `pyrosetta.distributed.viewer`"
]
},
{
"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": [
"The `pyrosetta.distributed` Viewer quickly renders `.pdb` files, dynamically instantiating `Pose` objects if required for certain visualization modules (matching the name `viewer.set*`). So when adding\n",
"visualization modules to the Viewer or using presets, passing `Pose` or `PackedPose` objects to the Viewer is suggested for quicker rendering. If a `Pose` object or `list`, `tuple`, or `set` of `Pose`\n",
"objects are provided to the Viewer, the Viewer will dynamically update upon `Pose` conformational changes by calling the `view.show()` method or equivalently `view()`. The Viewer applies visualization modules in the same order they are added (from left to right), so layering different styles (and `ResidueSelectors`) on top of one another becomes possible. The user must have already initialized PyRosetta providing `.params` files for any ligands and non-canonical residues in the input `Pose`(s)/`PackedPose`(s)/`.pdb` file(s), otherwise `pyrosetta.distributed` automatically initializes PyRosetta with default command line options.\n",
"\n",
"Throughout this notebook, different syntaxes for constructing visualizations are demonstrated to show the flexibility of the `pyrosetta.distributed.viewer` API, with hopes you find your favorite."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**If you are using Google Colab:** Currently, `pyrosetta.distributed.viewer` does **not** require the local machine's PyMOL. You can always dump any `Pose` object into a `.pdb` file and open that in PyMOL on your own computer.\n",
"```\n",
"pose.dump_pdb(\"output_file.pdb\")\n",
"```"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**Note:** If you are having trouble using this notebook, please use the `PyRosetta.notebooks` conda environment. Please see chapter 1.0 for instructions on how to setup and use this environment. "
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
""
],
"text/plain": [
" You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension: You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension: You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension: You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension: You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension: You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension: You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension: You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension: You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension: You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension: You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension: You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension: You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension: You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension: You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension: You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension: You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension: You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension: "
]
}
],
"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": 2
}
\n jupyter labextension install jupyterlab_3dmol
\n",
" jupyter labextension install jupyterlab_3dmol
\n jupyter labextension install jupyterlab_3dmol
\n",
" jupyter labextension install jupyterlab_3dmol
\n jupyter labextension install jupyterlab_3dmol
\n",
" jupyter labextension install jupyterlab_3dmol
\n jupyter labextension install jupyterlab_3dmol
\n",
" jupyter labextension install jupyterlab_3dmol
\n jupyter labextension install jupyterlab_3dmol
\n",
" jupyter labextension install jupyterlab_3dmol
\n jupyter labextension install jupyterlab_3dmol
\n",
" jupyter labextension install jupyterlab_3dmol
\n jupyter labextension install jupyterlab_3dmol
\n",
" jupyter labextension install jupyterlab_3dmol
\n jupyter labextension install jupyterlab_3dmol
\n",
" jupyter labextension install jupyterlab_3dmol
\n jupyter labextension install jupyterlab_3dmol
\n",
" jupyter labextension install jupyterlab_3dmol