Skip to content

Commit

Permalink
Add deps to colab notebook (#32)
Browse files Browse the repository at this point in the history
* this should work...

* fix colab bug

* add batteries included env file

* update notebook to use new env

* forgot rdkit

* oops made a mistake, rdkit is a dep for karto

* looks like we can't pass in `--no-deps`
  • Loading branch information
mikemhenry authored Jan 10, 2024
1 parent 26b69ef commit cf44f64
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 13 deletions.
8 changes: 8 additions & 0 deletions examples/environment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
channels:
- conda-forge
dependencies:
- kartograf >=1
- openfe >=0.15
- pip
- pip:
- git+https://github.com/OpenFreeEnergy/openfe-benchmarks.git
79 changes: 66 additions & 13 deletions examples/kartograf_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
{
"cell_type": "markdown",
"metadata": {
"collapsed": false
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"source": [
"# Example Notebook: Atom Mappings\n",
Expand All @@ -17,6 +20,25 @@
"with well aligned conformations."
]
},
{
"cell_type": "code",
"execution_count": null,
"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 -U https://github.com/conda-incubator/condacolab/archive/cuda-version-12.tar.gz\n",
" import condacolab\n",
" condacolab.install_mambaforge()\n",
" !wget -q https://raw.githubusercontent.com/OpenFreeEnergy/kartograf/main/examples/environment.yaml\n",
" !mamba env update -q --name=base --file=environment.yaml\n",
" from google.colab import output\n",
" output.enable_custom_widget_manager()"
]
},
{
"cell_type": "code",
"execution_count": 2,
Expand All @@ -36,10 +58,10 @@
" Cloning https://github.com/OpenFreeEnergy/openfe-benchmarks.git to /tmp/pip-req-build-dsih_khc\n",
" Running command git clone --filter=blob:none --quiet https://github.com/OpenFreeEnergy/openfe-benchmarks.git /tmp/pip-req-build-dsih_khc\n",
" Resolved https://github.com/OpenFreeEnergy/openfe-benchmarks.git to commit d81c79273b88f9b3baddd9886097789151e3df39\n",
" Preparing metadata (setup.py) ... \u001B[?25ldone\n",
"\u001B[?25hBuilding wheels for collected packages: openfe-benchmarks\n",
" Building wheel for openfe-benchmarks (setup.py) ... \u001B[?25ldone\n",
"\u001B[?25h Created wheel for openfe-benchmarks: filename=openfe_benchmarks-0.0.0-py2.py3-none-any.whl size=1338664 sha256=156abe05cd092abb61d261190aa89c60dc9084f1ad2bb96e4ecba6eaf90e1c1e\n",
" Preparing metadata (setup.py) ... \u001b[?25ldone\n",
"\u001b[?25hBuilding wheels for collected packages: openfe-benchmarks\n",
" Building wheel for openfe-benchmarks (setup.py) ... \u001b[?25ldone\n",
"\u001b[?25h Created wheel for openfe-benchmarks: filename=openfe_benchmarks-0.0.0-py2.py3-none-any.whl size=1338664 sha256=156abe05cd092abb61d261190aa89c60dc9084f1ad2bb96e4ecba6eaf90e1c1e\n",
" Stored in directory: /tmp/pip-ephem-wheel-cache-jp81fv_5/wheels/3d/2e/0d/a9d202ebefb2df685d9ab7255081f70a7ace5ff45bcdd698d2\n",
"Successfully built openfe-benchmarks\n",
"Installing collected packages: openfe-benchmarks\n",
Expand Down Expand Up @@ -78,10 +100,20 @@
"Chem.Draw.MolsToGridImage([c.to_rdkit() for c in components])\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": false
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"source": [
"## Generate Atom Mappings with Kartograf:\n",
Expand All @@ -98,6 +130,9 @@
"start_time": "2023-11-06T00:01:55.473133240Z"
},
"collapsed": false,
"jupyter": {
"outputs_hidden": false
},
"scrolled": true
},
"outputs": [
Expand Down Expand Up @@ -284,7 +319,10 @@
"end_time": "2023-11-06T00:01:55.817641995Z",
"start_time": "2023-11-06T00:01:55.741239258Z"
},
"collapsed": false
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"outputs": [
{
Expand All @@ -310,7 +348,10 @@
{
"cell_type": "markdown",
"metadata": {
"collapsed": false
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"source": [
"## Scoring Metrics for Atom mappings:\n",
Expand All @@ -327,7 +368,10 @@
"end_time": "2023-11-06T00:01:55.951440479Z",
"start_time": "2023-11-06T00:01:55.813431246Z"
},
"collapsed": false
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"outputs": [
{
Expand Down Expand Up @@ -434,7 +478,10 @@
"end_time": "2023-11-06T00:01:56.139870575Z",
"start_time": "2023-11-06T00:01:55.943210488Z"
},
"collapsed": false
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"outputs": [
{
Expand Down Expand Up @@ -464,7 +511,10 @@
"end_time": "2023-11-06T00:01:59.231030094Z",
"start_time": "2023-11-06T00:01:56.163961283Z"
},
"collapsed": false
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"outputs": [
{
Expand Down Expand Up @@ -522,7 +572,10 @@
"end_time": "2023-11-06T00:01:59.231424281Z",
"start_time": "2023-11-06T00:01:59.224933917Z"
},
"collapsed": false
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"outputs": [],
"source": []
Expand All @@ -544,7 +597,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.7"
"version": "3.12.0"
}
},
"nbformat": 4,
Expand Down

0 comments on commit cf44f64

Please sign in to comment.