From fd8a0e37c5952bc1073f245106346fa28a2a499d Mon Sep 17 00:00:00 2001 From: Alyssa Travitz Date: Fri, 2 May 2025 13:59:02 -0700 Subject: [PATCH] adding colab installs to some notebooks --- abfe_tutorial/python_tutorial.ipynb | 51 +++++++++++++++++++ ahfe_tutorial/python_tutorial.ipynb | 51 +++++++++++++++++++ openmm_md/plain_md.ipynb | 51 +++++++++++++++++++ .../PlottingFreeEnergiesUsingCinnabar.ipynb | 51 +++++++++++++++++++ 4 files changed, 204 insertions(+) diff --git a/abfe_tutorial/python_tutorial.ipynb b/abfe_tutorial/python_tutorial.ipynb index 16bdbe8..ace99f5 100644 --- a/abfe_tutorial/python_tutorial.ipynb +++ b/abfe_tutorial/python_tutorial.ipynb @@ -22,6 +22,57 @@ "## \"Drawing\"" ] }, + { + "cell_type": "markdown", + "id": "f9154ba7", + "metadata": {}, + "source": [ + "# 0. Setup for Google Colab\n", + "\n", + "If you are running this example in Google Colab, run the following cells to setup the environment. If you are running this notebook locally, skip down to `1. Overview`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6173dd67", + "metadata": {}, + "outputs": [], + "source": [ + "# NBVAL_SKIP\n", + "# Only run this cell if on google colab\n", + "import os\n", + "if \"COLAB_RELEASE_TAG\" in os.environ:\n", + " !pip install -q condacolab\n", + " import condacolab\n", + " condacolab.install_from_url(\"https://github.com/OpenFreeEnergy/ExampleNotebooks/releases/download/april-2025/OpenFEforge-1.5.0.dev0-Linux-x86_64.sh\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "2e888557", + "metadata": {}, + "outputs": [], + "source": [ + "# NBVAL_SKIP\n", + "# Only run this cell if on google colab\n", + "import os\n", + "if \"COLAB_RELEASE_TAG\" in os.environ:\n", + " import condacolab\n", + " import locale\n", + " locale.getpreferredencoding = lambda: \"UTF-8\"\n", + " !mkdir inputs && cd inputs && openfe fetch rbfe-tutorial\n", + " for _ in range(3):\n", + " # Sometimes we have to re-run the check\n", + " try:\n", + " condacolab.check()\n", + " except:\n", + " pass\n", + " else:\n", + " break" + ] + }, { "cell_type": "code", "execution_count": 1, diff --git a/ahfe_tutorial/python_tutorial.ipynb b/ahfe_tutorial/python_tutorial.ipynb index 5c8477d..08ae8e9 100644 --- a/ahfe_tutorial/python_tutorial.ipynb +++ b/ahfe_tutorial/python_tutorial.ipynb @@ -22,6 +22,57 @@ "## \"Drawing\"" ] }, + { + "cell_type": "markdown", + "id": "e26c8170", + "metadata": {}, + "source": [ + "# 0. Setup for Google Colab\n", + "\n", + "If you are running this example in Google Colab, run the following cells to setup the environment. If you are running this notebook locally, skip down to `1. Overview`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "525ac910", + "metadata": {}, + "outputs": [], + "source": [ + "# NBVAL_SKIP\n", + "# Only run this cell if on google colab\n", + "import os\n", + "if \"COLAB_RELEASE_TAG\" in os.environ:\n", + " !pip install -q condacolab\n", + " import condacolab\n", + " condacolab.install_from_url(\"https://github.com/OpenFreeEnergy/ExampleNotebooks/releases/download/april-2025/OpenFEforge-1.5.0.dev0-Linux-x86_64.sh\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "808ba76a", + "metadata": {}, + "outputs": [], + "source": [ + "# NBVAL_SKIP\n", + "# Only run this cell if on google colab\n", + "import os\n", + "if \"COLAB_RELEASE_TAG\" in os.environ:\n", + " import condacolab\n", + " import locale\n", + " locale.getpreferredencoding = lambda: \"UTF-8\"\n", + " !mkdir inputs && cd inputs && openfe fetch rbfe-tutorial\n", + " for _ in range(3):\n", + " # Sometimes we have to re-run the check\n", + " try:\n", + " condacolab.check()\n", + " except:\n", + " pass\n", + " else:\n", + " break" + ] + }, { "cell_type": "code", "execution_count": 1, diff --git a/openmm_md/plain_md.ipynb b/openmm_md/plain_md.ipynb index 6e4b1eb..c705b22 100644 --- a/openmm_md/plain_md.ipynb +++ b/openmm_md/plain_md.ipynb @@ -64,6 +64,57 @@ "| 7. NPT production (if not gas phase) | OpenFE - OpenMM + OpenMMTools | Simulation trajectory (`simulation.xtc`), Checkpoint file (`checkpoint.chk`), Log output (`simulation.log`) |\n" ] }, + { + "cell_type": "markdown", + "id": "fc27c86c", + "metadata": {}, + "source": [ + "# 0. Setup for Google Colab\n", + "\n", + "If you are running this example in Google Colab, run the following cells to setup the environment. If you are running this notebook locally, skip down to `1. Overview`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6559bc05", + "metadata": {}, + "outputs": [], + "source": [ + "# NBVAL_SKIP\n", + "# Only run this cell if on google colab\n", + "import os\n", + "if \"COLAB_RELEASE_TAG\" in os.environ:\n", + " !pip install -q condacolab\n", + " import condacolab\n", + " condacolab.install_from_url(\"https://github.com/OpenFreeEnergy/ExampleNotebooks/releases/download/april-2025/OpenFEforge-1.5.0.dev0-Linux-x86_64.sh\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "eb1368ca", + "metadata": {}, + "outputs": [], + "source": [ + "# NBVAL_SKIP\n", + "# Only run this cell if on google colab\n", + "import os\n", + "if \"COLAB_RELEASE_TAG\" in os.environ:\n", + " import condacolab\n", + " import locale\n", + " locale.getpreferredencoding = lambda: \"UTF-8\"\n", + " !mkdir inputs && cd inputs && openfe fetch rbfe-tutorial\n", + " for _ in range(3):\n", + " # Sometimes we have to re-run the check\n", + " try:\n", + " condacolab.check()\n", + " except:\n", + " pass\n", + " else:\n", + " break" + ] + }, { "cell_type": "markdown", "id": "0eb8203a-650f-4703-b032-dbafb605061b", diff --git a/plotting_rbfes_with_cinnabar/PlottingFreeEnergiesUsingCinnabar.ipynb b/plotting_rbfes_with_cinnabar/PlottingFreeEnergiesUsingCinnabar.ipynb index abc665e..87bf2c2 100644 --- a/plotting_rbfes_with_cinnabar/PlottingFreeEnergiesUsingCinnabar.ipynb +++ b/plotting_rbfes_with_cinnabar/PlottingFreeEnergiesUsingCinnabar.ipynb @@ -10,6 +10,57 @@ "This notebook shows how one would go about creating a cinnabar plot of OpenFE results against known experimental values." ] }, + { + "cell_type": "markdown", + "id": "6f3d03c2", + "metadata": {}, + "source": [ + "# 0. Setup for Google Colab\n", + "\n", + "If you are running this example in Google Colab, run the following cells to setup the environment. If you are running this notebook locally, skip down to `1. Overview`" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "04aa17bf", + "metadata": {}, + "outputs": [], + "source": [ + "# NBVAL_SKIP\n", + "# Only run this cell if on google colab\n", + "import os\n", + "if \"COLAB_RELEASE_TAG\" in os.environ:\n", + " !pip install -q condacolab\n", + " import condacolab\n", + " condacolab.install_from_url(\"https://github.com/OpenFreeEnergy/ExampleNotebooks/releases/download/april-2025/OpenFEforge-1.5.0.dev0-Linux-x86_64.sh\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6d297968", + "metadata": {}, + "outputs": [], + "source": [ + "# NBVAL_SKIP\n", + "# Only run this cell if on google colab\n", + "import os\n", + "if \"COLAB_RELEASE_TAG\" in os.environ:\n", + " import condacolab\n", + " import locale\n", + " locale.getpreferredencoding = lambda: \"UTF-8\"\n", + " !mkdir inputs && cd inputs && openfe fetch rbfe-tutorial\n", + " for _ in range(3):\n", + " # Sometimes we have to re-run the check\n", + " try:\n", + " condacolab.check()\n", + " except:\n", + " pass\n", + " else:\n", + " break" + ] + }, { "cell_type": "code", "execution_count": 1,