Step 1: Sign in to Google Drive.
Step 2: Make a new folder called “PyRosetta” in your top level directory on Google Drive.
from IPython.display import Image
Image('./Media/PyRosetta-folder.png',width='600')
Step 3: Get your PyRosetta license.
Step 4: Download the Linux PyRosetta package that is called "Python-3.7.MinSizeRel".
Image('./Media/linux-download.png',width='400')
Step 5: Upload the Linux PyRosetta package (.tar.bz2 file) to the PyRosetta folder in your Google Drive.
Step 6: Upload the PyRosetta notebooks folder to the top-level directory of your Google Drive.
Image('./Media/google-drive.png',width='600')
Step 7: Open up “01.01-PyRosetta-Google-Drive-Setup.ipynb” in Google Colab by right-clicking, going under “Open With…” and clicking Google Colaboratory. If you have never used Google Colab before, you may need to first install the Google Colab app.
Step 8: Follow steps to install PyRosetta. Note: You only need to do this once since this installation will be associated with your Google Drive account.
Step 9: In “01.01-PyRosetta-Google-Drive-Setup.ipynb”, follow the steps to install third-party external packages, using pip
:
pip install biopython blosc dask dask-jobqueue distributed graphviz jupyter matplotlib numpy pandas py3Dmol scipy seaborn traitlets --user
Step 9.1:
For Chapter 16, Running PyRosetta in Parallel (and a few other notebooks), 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.
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.
You will need to pass the username and password of PyRosetta to conda.
In order to do this, we will create a file in your home directory called .condarc
. If you already have this file, please edit it instead of overriding it below.
Here, instead of USERNAME and PASSWORD, enter the USERNAME and PASSWORD you were given while gaining access to PyRosetta.
echo "channels:" >> $HOME/.condarc
echo " - https://USERNAME:PASSWORD@conda.graylab.jhu.edu" >> $HOME/.condarc
echo " - defaults" >> $HOME/.condarc
conda env create -f environment.yml
conda activate PyRosetta.notebooks
Each time you wish to run this environment, use conda activate PyRosetta.notebooks
to create the local virtual environment BEFORE running the jupyter notebook. You may wish to put this in your system configuration on startup. It is recommended to activate conda before you run the notebooks in general. The correct kernel is set for them.
NOTE: When using a notebook with this environment - the python Kernel must be set to this env. In Chapter 16 and other parellel notebooks, this is done for you, but if you wish to use this environment in other notebooks, make sure to run conda 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.
Step 10: Open up “01.02-PyRosetta-Google-Drive-Usage-Example.ipynb” in Colab to make sure that PyRosetta was installed properly. You are now ready to move on to the other notebooks!
Known Limitations:
AttributeError: module 'pyrosetta.rosetta' has no attribute '__path__'
or TypeError: int returned non-int (type str)
then serialized functions need to locally import libraries (specifically, add import pyrosetta
, import pyrosetta.distributed
and other pyrosetta
imports to the serialized functions, i.e. any functions passed to client.submit
or dask.delayed
).Example:
def my_function(packed_pose):
import pyrosetta
pyrosetta.MoveMap()
return packed_pose
client.submit(my_function, packed_pose)
If running dask's LocalCluster(n_workers=2, threads_per_worker=2)
, you may need to adjust to n_workers=1
and threads_per_worker=1
if you encounter errors on some systems.
If running dask's LocalCluster(n_workers=2, threads_per_worker=2)
in a standalone python script, the LocalCluster
instance must be called within the if __name__ == "__main__"
block.
If using Jupyter Lab
, the pyrosetta.distributed.viewer
visualizer with py3Dmol
bindings may not function correctly (i.e. the interactive scrollbar widget may not work or the visualizer doesn't appear). To fix this, you may have to install the following Jupyter Lab extensions:
jupyter labextension install jupyterlab_3dmol
jupyter labextension install @jupyter-widgets/jupyterlab-manager
Step 1: Please install extensions nbgrader and nbpages.
Step 2: Make any changes to the workshops in the "notebooks" folder. (You can follow the directions for students and edit them in Google Colab or on your own computer using a Jupyter Notebooks browser.)
Step 3: When you are done making changes, run make-student-nb.bash to automatically generate the student notebooks in a separate folder, the table of contents, and the keyword index. The student notebooks are copies of the instructor's version that have omitted solutions.
Chapter contributors: