Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
[![full_tests](https://github.com/OpenFreeEnergy/ExampleNotebooks/actions/workflows/CI.yml/badge.svg)](https://github.com/OpenFreeEnergy/ExampleNotebooks/actions/workflows/CI.yml)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/OpenFreeEnergy/ExampleNotebooks/master.svg)](https://results.pre-commit.ci/latest/github/OpenFreeEnergy/ExampleNotebooks/main)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/OpenFreeEnergy/ExampleNotebooks/HEAD)
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/OpenFreeEnergy/ExampleNotebooks/blob/switch_to_colab/openmm-rbfe/OpenFE_showcase_1_RBFE_of_T4lysozyme.ipynb)

# OpenFE Notebooks

Expand Down
110 changes: 110 additions & 0 deletions easyCampaign/Cli Demo.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "785f29f9-889f-43ea-93ed-824de546993b",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"# NBVAL_SKIP\n",
"!pip install -q condacolab\n",
"import condacolab\n",
"condacolab.install_from_url(\"https://github.com/OpenFreeEnergy/ExampleNotebooks/releases/download/april-2023/OpenFEforge-0.7.4-Linux-x86_64.sh\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "c23f5c0d-a36e-43f5-9f1e-1e3f3fba80ea",
"metadata": {},
"outputs": [],
"source": [
"# NBVAL_SKIP\n",
"# If this check fails, re-run\n",
"import condacolab\n",
"condacolab.check()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "4a9a49bd-4520-4ca6-96e1-378559248ac4",
"metadata": {},
"outputs": [],
"source": [
"# NBVAL_SKIP\n",
"from IPython.display import JSON\n",
"from google.colab import output\n",
"from subprocess import getoutput\n",
"import os\n",
"\n",
"def shell(command):\n",
" if command.startswith('cd'):\n",
" path = command.strip().split(maxsplit=1)[1]\n",
" os.chdir(path)\n",
" return JSON([''])\n",
" return JSON([getoutput(command)])\n",
"output.register_callback('shell', shell)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "cc0b6da8-b400-4795-8f31-10d00e941449",
"metadata": {},
"outputs": [],
"source": [
"# NBVAL_SKIP\n",
"#@title Colab Shell\n",
"%%html\n",
"<div id=term_demo></div>\n",
"<script src=\"https://code.jquery.com/jquery-latest.js\"></script>\n",
"<script src=\"https://cdn.jsdelivr.net/npm/jquery.terminal/js/jquery.terminal.min.js\"></script>\n",
"<link href=\"https://cdn.jsdelivr.net/npm/jquery.terminal/css/jquery.terminal.min.css\" rel=\"stylesheet\"/>\n",
"<script>\n",
" $('#term_demo').terminal(async function(command) {\n",
" if (command !== '') {\n",
" try {\n",
" let res = await google.colab.kernel.invokeFunction('shell', [command])\n",
" let out = res.data['application/json'][0]\n",
" this.echo(new String(out))\n",
" } catch(e) {\n",
" this.error(new String(e));\n",
" }\n",
" } else {\n",
" this.echo('');\n",
" }\n",
" }, {\n",
" greetings: 'Welcome to Colab Shell',\n",
" name: 'colab_demo',\n",
" height: 500,\n",
" prompt: 'colab > '\n",
" });"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"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.10.10"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
2 changes: 2 additions & 0 deletions easyCampaign/cli-tutorial.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Relative Free Energies with the OpenFE CLI

[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/OpenFreeEnergy/ExampleNotebooks/blob/switch_to_colab/easyCampaign/Cli%20Demo.ipynb)

This tutorial will show how to use the OpenFE command line interface to get
free energies -- with no Python at all! This will work for simple setups, you
may need to use the Python interface for more complicated setups.
Expand Down
72 changes: 50 additions & 22 deletions openmm-rbfe/OpenFE_showcase_1_RBFE_of_T4lysozyme.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,34 @@
"T4-lysozyme L99A."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "cd224909-3596-4800-9154-0f04e43c50cf",
"metadata": {},
"outputs": [],
"source": [
"# NBVAL_SKIP\n",
"# Only run this cell if on google colab\n",
"!pip install -q condacolab\n",
"import condacolab\n",
"condacolab.install_from_url(\"https://github.com/OpenFreeEnergy/ExampleNotebooks/releases/download/april-2023/OpenFEforge-0.7.4-Linux-x86_64.sh\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "5ecffc3a-1b2a-4e8e-b3aa-74c145089ef8",
"metadata": {},
"outputs": [],
"source": [
"# NBVAL_SKIP\n",
"# Only run this cell if on google colab\n",
"# If this check fails, re-run\n",
"import condacolab\n",
"condacolab.check()"
]
},
{
"cell_type": "code",
"execution_count": 1,
Expand Down Expand Up @@ -854,27 +882,27 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Usage: openfe [OPTIONS] COMMAND [ARGS]...\r\n",
"\r\n",
" This is the command line tool to provide easy access to functionality from\r\n",
" the OpenFE Python library.\r\n",
"\r\n",
"Options:\r\n",
" --version Show the version and exit.\r\n",
" --log PATH logging configuration file\r\n",
" -h, --help Show this message and exit.\r\n",
"\r\n",
"Setup Commands:\r\n",
" atommapping Check the atom mapping of a given pair of ligands\r\n",
" plan-rhfe-network Plan a relative hydration free energy network, saved in a\r\n",
" dir with multiple JSON files\r\n",
" plan-rbfe-network Plan a relative binding free energy network, saved in a\r\n",
" dir with multiple JSON files.\r\n",
"\r\n",
"Simulation Commands:\r\n",
" gather Gather DAG result jsons for network of RFE results into single TSV\r\n",
" file\r\n",
" quickrun Run a given transformation, saved as a JSON file\r\n"
"Usage: openfe [OPTIONS] COMMAND [ARGS]...\n",
"\n",
" This is the command line tool to provide easy access to functionality from\n",
" the OpenFE Python library.\n",
"\n",
"Options:\n",
" --version Show the version and exit.\n",
" --log PATH logging configuration file\n",
" -h, --help Show this message and exit.\n",
"\n",
"Setup Commands:\n",
" atommapping Check the atom mapping of a given pair of ligands\n",
" plan-rhfe-network Plan a relative hydration free energy network, saved in a\n",
" dir with multiple JSON files\n",
" plan-rbfe-network Plan a relative binding free energy network, saved in a\n",
" dir with multiple JSON files.\n",
"\n",
"Simulation Commands:\n",
" gather Gather DAG result jsons for network of RFE results into single TSV\n",
" file\n",
" quickrun Run a given transformation, saved as a JSON file\n"
]
}
],
Expand All @@ -893,7 +921,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"{0: 5, 1: 6, 2: 7, 3: 8, 4: 9, 5: 10, 6: 11, 7: 12, 8: 13, 9: 14, 10: 4, 11: 15}\r\n"
"{0: 5, 1: 6, 2: 7, 3: 8, 4: 9, 5: 10, 6: 11, 7: 12, 8: 13, 9: 14, 10: 4, 11: 15}\n"
]
}
],
Expand Down