{ "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", "< [Predicting the ∆∆G of single point mutations](http://nbviewer.jupyter.org/github/RosettaCommons/PyRosetta.notebooks/blob/master/notebooks/15.02-Membrane-Protein-ddG-of-mutation.ipynb) | [Contents](toc.ipynb) | [Index](index.ipynb) | [Distributed analysis example: exhaustive ddG PSSM](http://nbviewer.jupyter.org/github/RosettaCommons/PyRosetta.notebooks/blob/master/notebooks/16.01-PyData-ddG-pssm.ipynb) >

\"Open" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Running Rosetta in Parallel\n", "\n", "## Notes\n", "\n", "The following notebooks contain examples of how to run Rosetta in parallel either locally on a compute cluster through the `pyrosetta.distributed` package that is now included with PyRosetta. \n", "\n", "The first three notebooks contain two high-level examples of parallel PyRosett through a Rosetta-PyData integration using the pyrosetta.distributed namespace.\n", "\n", "## Setup\n", "\n", "**For Chapter 16, Running PyRosetta in Parallel, you will need to use a specific version of PyRosetta that is built for parallelization.** This is the serialization build. Besides manually building it from the Rosetta C++ source code, the general way to obtain this is through the use of a `conda` environment. \n", "\n", "A `conda` environment is a way to run code that has specific versions of required packages, that instead of being installed globally, will be installed as a local virtual environment that you may run whenever you wish. This is extremely useful when some packages require specific versions of other packages, as is the case for some rosetta distributed code. \n", "\n", "You will need to pass the username and password of PyRosetta to conda. \n", "In order to do this, we will create a file in your home directory called `~/.condarc`. The file should look like:" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "```\n", "channels:\n", " - https://USERNAME:PASSWORD@conda.graylab.jhu.edu\n", " - defaults\n", "```" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Here, instead of USERNAME and PASSWORD, enter the USERNAME and PASSWORD you were given while gaining access to PyRosetta.**\n", "\n", "If you already have this file, please edit it instead of overriding it (below)." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Using python:" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "import os\n", "condarc = os.path.join(os.environ[\"HOME\"], \".condarc\")\n", "if not os.path.exists(condarc):\n", " with open(condarc, \"w\") as f:\n", " f.write(\"channels:\\n\")\n", " f.write(\" - https://{USERNAME}:{PASSWORD}@conda.graylab.jhu.edu\\n\".format(\n", " USERNAME=\"USERNAME\", PASSWORD=\"PASSWORD\")\n", " )\n", " f.write(\" - defaults\\n\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Alternatively, using bash:\n", "```\n", "echo \"channels:\" >> $HOME/.condarc\n", "echo \" - https://USERNAME:PASSWORD@conda.graylab.jhu.edu\" >> $HOME/.condarc\n", "echo \" - defaults\" >> $HOME/.condarc\n", "```" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Create the conda environment with the provided `environment.yml` file:\n", "\n", ">conda env create -f environment.yml\n", "\n", "then activate your environment:\n", "\n", ">conda activate PyRosetta.notebooks\n", "\n", "\n", "Each time you wish to run this environment, use `conda activate PyRosetta.notebooks` to create the local virtual environment. You may wish to put this in your system configuration on startup.\n", "\n", "For your new conda environment to show up as a kernel option in Jupyter, you may have to register your custom kernel with Jupyter:\n", "\n", "> python -m ipykernel install --user --name PyRosetta.notebooks\n", "\n", "Installed kernels are listed with:\n", "\n", "> jupyter kernelspec list\n", "\n", "\n", "\n", "**NOTE:**\n", "When using a notebook with this environment - the python **Kernel** must be set to this env. *In the following notebooks, this is done for you*, but if you wish to use this environment in other notebooks, make sure to manually change this! You can do this by looking at the jupyter menu - `Kernel` is after `Cell` and before `Widgets`. The option is 'Change Kernel`. This is how you would run python2 vs python3 or run a kernal with other conda environments you have installed on your computer. \n", "\n", "## Citation\n", "Citation PyData integration notebooks:\n", "\n", "[Integration of the Rosetta Suite with the Python Software Stack via reproducible packaging and core programming interfaces for distributed simulation](https://doi.org/10.1002/pro.3721)\n", "\n", "Alexander S. Ford, Brian D. Weitzner, Christopher D. Bahl\n", "\n", "## Manual\n", "Documentation for the `pyrosetta.distributed` namespace can be found here: https://nbviewer.jupyter.org/github/proteininnovation/Rosetta-PyData_Integration/blob/master/distributed_overview.ipynb" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Chapter contributors:**\n", "\n", "- Jason C. Klima (University of Washington; Lyell Immunopharma)\n", "- Brian Weitzner (University of Washington; Lyell Immunopharma)\n", "- Jared Adolf-Bryfogle (Scripps; Institute for Protein Innovation)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "< [Predicting the ∆∆G of single point mutations](http://nbviewer.jupyter.org/github/RosettaCommons/PyRosetta.notebooks/blob/master/notebooks/15.02-Membrane-Protein-ddG-of-mutation.ipynb) | [Contents](toc.ipynb) | [Index](index.ipynb) | [Distributed analysis example: exhaustive ddG PSSM](http://nbviewer.jupyter.org/github/RosettaCommons/PyRosetta.notebooks/blob/master/notebooks/16.01-PyData-ddG-pssm.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.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": {}, "toc_section_display": true, "toc_window_display": false } }, "nbformat": 4, "nbformat_minor": 2 }