From 1ff6d415664facb8a07173aefbe96f43e08eda70 Mon Sep 17 00:00:00 2001 From: jinyuan sun <33344948+JinyuanSun@users.noreply.github.com> Date: Wed, 31 May 2023 11:54:18 +0800 Subject: [PATCH] Created using Colaboratory --- cloudmol_demo.ipynb | 173 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 173 insertions(+) create mode 100644 cloudmol_demo.ipynb diff --git a/cloudmol_demo.ipynb b/cloudmol_demo.ipynb new file mode 100644 index 0000000..81da50f --- /dev/null +++ b/cloudmol_demo.ipynb @@ -0,0 +1,173 @@ +{ + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "colab": { + "provenance": [], + "authorship_tag": "ABX9TyP3hM2vE4uupz+QGJQ6Q5KK", + "include_colab_link": true + }, + "kernelspec": { + "name": "python3", + "display_name": "Python 3" + }, + "language_info": { + "name": "python" + } + }, + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "view-in-github", + "colab_type": "text" + }, + "source": [ + "\"Open" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "SPmqZRs37eVm", + "outputId": "8eb887b1-fd64-4e0a-cfea-08eb337e5c25" + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + " Preparing metadata (setup.py) ... \u001b[?25l\u001b[?25hdone\n" + ] + } + ], + "source": [ + "%pip install -q git+https://github.com/JinyuanSun/PymolFold.git\n", + "%pip install -q py3Dmol\n", + "import py3Dmol" + ] + }, + { + "cell_type": "code", + "source": [ + "from cloudmol.cloudmol import PymolFold\n", + "pf = PymolFold() \n", + "pf.query_esmfold(\"MTYKLILNGKTLKGETTTEAVDAATAEKVFKQYANDNGVDGEWTYDDATKTFTVTE\", '1pga')" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "3-rYiXFx7fms", + "outputId": "8f701f6a-d3d2-4464-db42-8be6d7447d82" + }, + "execution_count": 2, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Results will be saved to /root/PymolFold_workdir\n", + "Results saved to /root/PymolFold_workdir/1pga.pdb\n", + "Guessing the scale is [0,1], we scale it to [0, 100]\n", + "====================\n", + " pLDDT: 88.36\n", + "====================\n" + ] + } + ] + }, + { + "cell_type": "code", + "source": [ + "view = py3Dmol.view()\n", + "view.addModel(open('/root/PymolFold_workdir/1pga.pdb', 'r').read(),'pdb')\n", + "view.setBackgroundColor('white')\n", + "view.setStyle({'chain':'A'}, {'cartoon': {'color':'purple'}})\n", + "view.zoomTo()\n", + "view.show()" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 497 + }, + "id": "6278FRTI7lfW", + "outputId": "8e63d4e9-8276-4ffa-debf-bc78f7f40f1e" + }, + "execution_count": 4, + "outputs": [ + { + "output_type": "display_data", + "data": { + "application/3dmoljs_load.v0": "
\n

You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
\n jupyter labextension install jupyterlab_3dmol

\n
\n", + "text/html": [ + "
\n", + "

You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
\n", + " jupyter labextension install jupyterlab_3dmol

\n", + "
\n", + "" + ] + }, + "metadata": {} + } + ] + }, + { + "cell_type": "code", + "source": [], + "metadata": { + "id": "WeyDnykt8Aj1" + }, + "execution_count": null, + "outputs": [] + } + ] +} \ No newline at end of file