{ "nbformat": 4, "nbformat_minor": 0, "metadata": { "colab": { "name": "01.01-PyRosetta-Google-Drive-Setup.a.wheel.ipynb", "provenance": [], "collapsed_sections": [] }, "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.0" }, "kernelspec": { "name": "python3", "display_name": "Python 3" } }, "cells": [ { "cell_type": "code", "metadata": { "id": "_eZ7te8jVOor" }, "source": [ "# Mounting Google Drive and add it to Python sys path \n", "\n", "google_drive_mount_point = '/content/google_drive'\n", "\n", "import os, sys, time\n", "\n", "if 'google.colab' in sys.modules:\n", " from google.colab import drive\n", " drive.mount(google_drive_mount_point)\n", "\n", "if not os.getenv(\"DEBUG\"):\n", " google_drive = google_drive_mount_point + '/My Drive' " ], "execution_count": null, "outputs": [] }, { "cell_type": "code", "metadata": { "id": "2QzBwpIDV8be" }, "source": [ "%%time\n", "if not os.getenv(\"DEBUG\"):\n", " # installing PyRosetta\n", " if sys.version_info.major != 3 or sys.version_info.minor != 7:\n", " print('Need Python-3.7 to run!')\n", " sys.exit(1)\n", "\n", " # upload PyRosetta Linux WHEEL package into your google drive and put it into /PyRosetta dir\n", " # or alternatively you can download PyRosetta directly from GrayLab web site (but this might take some time!)\n", " #!mkdir $notebook_path/PyRosetta\n", " #!cd $notebook_path/PyRosetta && wget --user USERNAME --password PASSWORD https://graylab.jhu.edu/download/PyRosetta4/archive/release/PyRosetta4.Release.python37.ubuntu.wheel/latest.html \n", "\n", " pyrosetta_distr_path = google_drive + '/PyRosetta' \n", " \n", " # finding path to wheel package, if multiple packages is found take first one\n", " # replace this with `wheel_path = pyrosetta_distr_path + /.whl` if you want to use particular whl file\n", " wheel_path = pyrosetta_distr_path + '/' + [ f for f in os.listdir(pyrosetta_distr_path) if f.endswith('.whl')][0]\n", " \n", " print(f'Using PyRosetta wheel package: {wheel_path}')\n", "\n", " !pip3 install '{wheel_path}' " ], "execution_count": null, "outputs": [] }, { "cell_type": "code", "metadata": { "id": "VTAcelKGbS3y" }, "source": [ "from pyrosetta import *\n", "pyrosetta.init()" ], "execution_count": null, "outputs": [] } ] }