Skip to content

Commit

Permalink
Merge pull request #102 from churnikov/101-fix-colab-notebook
Browse files Browse the repository at this point in the history
Made jupyter notebook always pull latest version of AiZynthFinder
  • Loading branch information
SGenheden committed Mar 27, 2023
2 parents 9e44989 + bdafde6 commit 4723c23
Showing 1 changed file with 93 additions and 63 deletions.
156 changes: 93 additions & 63 deletions contrib/notebook.ipynb
Original file line number Diff line number Diff line change
@@ -1,66 +1,96 @@
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "AiZynthFinder.ipynb",
"private_outputs": true,
"provenance": [],
"collapsed_sections": [],
"toc_visible": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"accelerator": "GPU"
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "ObD2YL7nM2_X"
},
"source": [
"# AiZynthFinder\n",
"\n",
"Click the ▶ play button at the left of the **Installation** text below to install the application. The initial installation process may take a few minutes. After installation is done, jupyter notebooks kernel will automatically restart. Then run **Start application cell**. \n",
"\n",
"1. Enter the target compound [SMILES][1] code.\n",
"3. Click the **Run Search** button to start the algorithm.\n",
"4. Once it stops serching, click the **Show Reactions** button.\n",
"\n",
"[1]: https://en.wikipedia.org/wiki/Simplified_molecular-input_line-entry_system"
]
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "ObD2YL7nM2_X"
},
"source": [
"# AiZynthFinder\n",
"\n",
"Click the ▶ play button at the left of the **Start** text below to run the application. The initial installation process may take a few minutes.\n",
"\n",
"1. Enter the target compound [SMILES][1] code.\n",
"3. Click the **Run Search** button to start the algorithm.\n",
"4. Once it stops serching, click the **Show Reactions** button.\n",
"\n",
"[1]: https://en.wikipedia.org/wiki/Simplified_molecular-input_line-entry_system"
]
},
{
"cell_type": "code",
"metadata": {
"id": "beDP-CSNM429"
},
"source": [
"#@title Start {display-mode: \"form\"}\n",
"!curl --location --silent bit.ly/rdkit-colab | tar xz -C /\n",
"!pip install --quiet graphviz\n",
"!pip install --quiet https://github.com/MolecularAI/aizynthfinder/archive/v2.2.1.tar.gz\n",
"!mkdir --parents data && download_public_data data\n",
"from rdkit.Chem.Draw import IPythonConsole\n",
"from aizynthfinder.interfaces import AiZynthApp\n",
"application = AiZynthApp(\"./data/config.yml\")\n"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "markdown",
"metadata": {
"id": "bwxusoogwlI9"
},
"source": [
"# Bibliography\n",
"\n",
"_Genheden S, Thakkar A, Chadimova V, et al (2020) AiZynthFinder: a fast, robust and flexible open-source software for retrosynthetic planning. J. Cheminf. https://doi.org/10.1186/s13321-020-00472-1 ([GitHub](https://github.com/MolecularAI/aizynthfinder) & [Documentation](https://molecularai.github.io/aizynthfinder/html/index.html))_"
]
}
]
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#@title Installation -- Run this cell to install AiZynthFinder\n",
"\n",
"!pip install --quiet graphviz rdkit-pypi\n",
"!(AIZ_LATEST_TAG=$(git -c 'versionsort.suffix=-' \\\n",
" ls-remote --exit-code --refs --sort='version:refname' --tags https://github.com/MolecularAI/aizynthfinder '*.*.*' \\\n",
" | tail --lines=1 \\\n",
" | cut -f 3 -d /) \\\n",
" && pip install --quiet https://github.com/MolecularAI/aizynthfinder/archive/${AIZ_LATEST_TAG}.tar.gz)\n",
"print(\"Restarting kernel\")\n",
"import os\n",
"os._exit(00)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "beDP-CSNM429"
},
"outputs": [],
"source": [
"#@title Start application. Run this cell after kernel restart {display-mode: \"form\"}\n",
"\n",
"!mkdir --parents data && download_public_data data\n",
"from rdkit.Chem.Draw import IPythonConsole\n",
"from aizynthfinder.interfaces import AiZynthApp\n",
"application = AiZynthApp(\"./data/config.yml\")"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "bwxusoogwlI9"
},
"source": [
"# Bibliography\n",
"\n",
"_Genheden S, Thakkar A, Chadimova V, et al (2020) AiZynthFinder: a fast, robust and flexible open-source software for retrosynthetic planning. J. Cheminf. https://doi.org/10.1186/s13321-020-00472-1 ([GitHub](https://github.com/MolecularAI/aizynthfinder) & [Documentation](https://molecularai.github.io/aizynthfinder/html/index.html))_"
]
}
],
"metadata": {
"accelerator": "GPU",
"colab": {
"collapsed_sections": [],
"name": "AiZynthFinder.ipynb",
"private_outputs": true,
"provenance": [],
"toc_visible": true
},
"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.9"
}
},
"nbformat": 4,
"nbformat_minor": 1
}

0 comments on commit 4723c23

Please sign in to comment.