{ "cells": [ { "cell_type": "markdown", "metadata": { "id": "2UZUSEe9RzKv" }, "source": [ "Welcome to the EPISOL Colab Playground!\n", "\n" ] }, { "cell_type": "markdown", "metadata": { "id": "JV402f06Qs2I" }, "source": [ "" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## **Placing Waters in Proteins**" ] }, { "cell_type": "markdown", "metadata": { "id": "2JyzyqCTrO2i" }, "source": [ "The 3D reference interaction site model (3DRISM) provides an efficient grid-based solvation model to compute the structural and thermodynamic properties of biomolecules in aqueous solutions, in this notebook we will walk through two examples: a neutral, and charged solute. In this notebook we will walk through a 3DRISM calculation on a larger solute - proteins, nucleic acids, and combininations thereof. T\n", "* goals:\n", " * perform 3DRISM calculations on larger solutes using EPISOL utilizing the python interface\n", " * determine solvent distibutions around ares of interest\n", " * workthrough a calculation that fails to converge within the given number of steps\n", " * place explicit water - oxygens using commands specific to the python interface\n", " * determine high-energy waters and their importance" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "cellView": "form", "id": "e9Zwmfx1MLyE" }, "outputs": [], "source": [ "#@title ##Download and Install Episol\n", "#@markdown ($\\approx 2$min) Stable as of 07/01/25 eprism v1.2.6\n", "%%capture\n", "import subprocess\n", "import pandas as pd\n", "import matplotlib.pyplot as plt\n", "#%cd ../home/\n", "%cd $HOME/\n", "%mkdir episol\n", "%cd episol\n", "!wget https://github.com/EPISOLrelease/EPISOL/raw/refs/heads/main/src/fftw/fftw-3.3.8.tar.gz\n", "!echo \"+++++++++++++++++++\"\n", "!echo \"downloaded fftw files\"\n", "!echo \"+++++++++++++++++++\"\n", "!tar -xzf fftw-3.3.8.tar.gz\n", "%cd fftw-3.3.8/\n", "#!./configure --prefix=/home/fftw-3.3.8\n", "!./configure --prefix=$HOME/episol/fftw-3.3.8\n", "!make\n", "!make install\n", "%cd ../\n", "!wget https://github.com/EPISOLrelease/EPISOL/raw/refs/heads/main/src/kernel/release.tar.gz\n", "!echo \"+++++++++++++++++++\"\n", "!echo \"downloaded Episol files\"\n", "!echo \"+++++++++++++++++++\"\n", "!tar -xzf release.tar.gz\n", "%cd release/\n", "#!./configure --with-fftw=/home/fftw-3.3.8\n", "!./configure --with-fftw=$HOME/episol/fftw-3.3.8\n", "!make\n", "!make install\n", "#%cd /content\n", "########################### WRAPEPR\n", "!pip install episol\n", "import subprocess\n", "import os\n", "import threading\n", "import pandas as pd\n", "import matplotlib.pyplot as plt\n", "from episol import epipy\n" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "cellView": "form", "id": "Pz6E85eEOsUO" }, "outputs": [], "source": [ "%%capture\n", "\n", "#@title Install some python packages for topology generation\n", "#@markdown ($\\approx$4min)\n", "\n", "#@markdown This will prompt a restart in our colab session, this is necessary, just keep moving\n", "\n", "#@markdown (if you are using the notebook offline this wont be necessary, as presumably you'll have your own forcefield to generate topologies)\n", "########################################\n", "# FOR COLAB USERS ONLY #\n", "#---------------------------------------#\n", "# if you are running locally you dont need\n", "# condacolab. Just use your local conda dist\n", "########################################\n", "!pip install -q condacolab\n", "import condacolab\n", "condacolab.install()\n", "########################################\n", "#!conda update conda\n", "#!conda install --yes -c conda-forge python=3.11 numpy=1.26.4 openmm pdbfixer parmed mdanalysis py3dmol rdkit openff-toolkit\n", "#!conda install -y -c conda-forge numpy=1.26.4 openmm=8.3.1 python={PYTHON_VERSION} pdbfixer=1.11 parmed=4.3.0 mdanalysis=2.9.0 py3dmol=2.5.2 rdkit=2025.03.5 openff-toolkit=0.17.0 libgcc\n", "!conda install -y -c conda-forge python=3.12 numpy=1.26.4 openmm=8.3.1 pdbfixer=1.11 parmed=4.3.0 mdanalysis=2.9.0 py3dmol=2.5.2 rdkit=2025.03.5 openff-toolkit=0.17.0 torchvision pymol-open-source\n", "#openmm pdbfixer parmed mdanalysis py3dmol rdkitconda install libgcc" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "cellView": "form", "id": "rjpO1aNMD_89" }, "outputs": [], "source": [ "#@title import our downloaded packages\n", "%%capture\n", "!python -m ensurepip --upgrade # since we are using python 3.12 some pkg utils are now obsolete\n", "!python3.12 -m pip install --upgrade setuptools\n", "# after conda-initiate restart colab resets pip\n", "import matplotlib.pyplot as plt\n", "import openmm as mm\n", "from openmm import app\n", "# fix later\n", "from openmm.app import *\n", "from openmm.unit import *\n", "import py3Dmol# as pymol\n", "import MDAnalysis as md\n", "import parmed as chem\n", "from openff.toolkit.topology import Molecule, Topology\n", "import numpy as np\n", "import MDAnalysis.transformations as mdt\n", "import pdbfixer\n", "from episol import epipy\n", "%cd /content/" ] }, { "cell_type": "markdown", "metadata": { "id": "MgcR5034eDJ8" }, "source": [ "#**Walk Through Calculation:**" ] }, { "cell_type": "markdown", "metadata": { "id": "zHzfYZ4dbftJ" }, "source": [ "First, we will download our desired structure file from the PDB" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "cellView": "form", "colab": { "base_uri": "https://localhost:8080/" }, "id": "r8pyhZzH_g8R", "outputId": "aa22368a-6a62-4e6c-d8de-6ed9cd781b1f" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "--2025-10-29 23:21:42-- https://files.rcsb.org/download/6OUH.pdb\n", "Resolving files.rcsb.org (files.rcsb.org)... 52.84.20.116, 52.84.20.13, 52.84.20.16, ...\n", "Connecting to files.rcsb.org (files.rcsb.org)|52.84.20.116|:443... connected.\n", "HTTP request sent, awaiting response... 504 Gateway Time-out\n", "Retrying.\n", "\n", "--2025-10-29 23:22:13-- (try: 2) https://files.rcsb.org/download/6OUH.pdb\n", "Reusing existing connection to files.rcsb.org:443.\n", "HTTP request sent, awaiting response... 504 Gateway Time-out\n", "Retrying.\n", "\n", "--2025-10-29 23:22:15-- (try: 3) https://files.rcsb.org/download/6OUH.pdb\n", "Reusing existing connection to files.rcsb.org:443.\n", "HTTP request sent, awaiting response... 504 Gateway Time-out\n", "Retrying.\n", "\n", "--2025-10-29 23:22:18-- (try: 4) https://files.rcsb.org/download/6OUH.pdb\n", "Reusing existing connection to files.rcsb.org:443.\n", "HTTP request sent, awaiting response... 504 Gateway Time-out\n", "Retrying.\n", "\n", "--2025-10-29 23:22:22-- (try: 5) https://files.rcsb.org/download/6OUH.pdb\n", "Reusing existing connection to files.rcsb.org:443.\n", "HTTP request sent, awaiting response... 504 Gateway Time-out\n", "Retrying.\n", "\n", "--2025-10-29 23:22:27-- (try: 6) https://files.rcsb.org/download/6OUH.pdb\n", "Reusing existing connection to files.rcsb.org:443.\n", "HTTP request sent, awaiting response... 200 OK\n", "Length: unspecified [text/plain]\n", "Saving to: ‘6OUH.pdb’\n", "\n", "6OUH.pdb [ <=> ] 227.02K 1.22MB/s in 0.2s \n", "\n", "2025-10-29 23:22:28 (1.22 MB/s) - ‘6OUH.pdb’ saved [232470]\n", "\n" ] } ], "source": [ "#@markdown The tutorial will work for essentially any PDB file\n", "\n", "#@markdown We encourage the reader to use this tutorial for your own investigation and copy our commands freely\n", "PDB_ID='6OUH' # @param {type:\"string\", placeholder:\"enter a value\"}\n", "!wget https://files.rcsb.org/download/\"{PDB_ID}.pdb\"" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "cellView": "form", "colab": { "base_uri": "https://localhost:8080/", "height": 497 }, "id": "AWOYdAQ0cUkZ", "outputId": "d398fd43-a8fd-407f-94bb-ef3fcab0eea1" }, "outputs": [ { "data": { "application/3dmoljs_load.v0": "
3Dmol.js failed to load for some reason. Please check your browser console for error messages.
3Dmol.js failed to load for some reason. Please check your browser console for error messages.
3Dmol.js failed to load for some reason. Please check your browser console for error messages.
3Dmol.js failed to load for some reason. Please check your browser console for error messages.
3Dmol.js failed to load for some reason. Please check your browser console for error messages.
3Dmol.js failed to load for some reason. Please check your browser console for error messages.
3Dmol.js failed to load for some reason. Please check your browser console for error messages.
3Dmol.js failed to load for some reason. Please check your browser console for error messages.
3Dmol.js failed to load for some reason. Please check your browser console for error messages.
3Dmol.js failed to load for some reason. Please check your browser console for error messages.