diff --git a/notebooks/pka_prediction.ipynb b/notebooks/pka_prediction.ipynb index 2548099..983c362 100644 --- a/notebooks/pka_prediction.ipynb +++ b/notebooks/pka_prediction.ipynb @@ -3,8 +3,8 @@ { "cell_type": "markdown", "metadata": { - "id": "view-in-github", - "colab_type": "text" + "colab_type": "text", + "id": "view-in-github" }, "source": [ "\"Open" @@ -26,17 +26,17 @@ "cell_type": "code", "execution_count": null, "metadata": { + "cellView": "form", "colab": { "base_uri": "https://localhost:8080/" }, "id": "BrnGvVB1lZ6Y", - "outputId": "8fcc5491-5389-4053-edcd-90a60aae86c0", - "cellView": "form" + "outputId": "8fcc5491-5389-4053-edcd-90a60aae86c0" }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "⏬ Downloading https://github.com/jaimergp/miniforge/releases/latest/download/Mambaforge-colab-Linux-x86_64.sh...\n", "📦 Installing...\n", @@ -58,17 +58,17 @@ "cell_type": "code", "execution_count": null, "metadata": { - "id": "cg5NTzCefRRX", "cellView": "form", "colab": { "base_uri": "https://localhost:8080/" }, + "id": "cg5NTzCefRRX", "outputId": "ba7174e7-28a7-444f-eb22-39459e3970fd" }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "✨🍰✨ Everything looks OK!\n" ] @@ -83,34 +83,19 @@ }, { "cell_type": "code", - "source": [ - "# @title Installing dependencies and pkasolver package (this might take up to 5 minutes)\n", - "\n", - "print('📦 Installing dependencies ...')\n", - "!mamba install -c conda-forge rdkit > /dev/null\n", - "print('🔥 Installing PyTorch and PyG ...')\n", - "!pip install torch==1.9.1+cpu -f https://download.pytorch.org/whl/cpu/torch_stable.html > /dev/null\n", - "!pip install torch-scatter -f https://data.pyg.org/whl/torch-1.9.1+cpu.html > /dev/null\n", - "!pip install torch-sparse -f https://data.pyg.org/whl/torch-1.9.1+cpu.html > /dev/null\n", - "!pip install torch-spline-conv torch-geometric==2.0.1 -f https://data.pyg.org/whl/torch-1.9.1+cpu.html > /dev/null\n", - "!pip install cairosvg svgutils molvs > /dev/null\n", - "print('✔️ Installing pkasolver package ...')\n", - "!pip install -q git+https://github.com/mayrf/pkasolver.git > /dev/null\n", - "print(\"🎉 Done!\")" - ], + "execution_count": null, "metadata": { + "cellView": "form", "colab": { "base_uri": "https://localhost:8080/" }, "id": "4TZCXZ_IJXCz", - "outputId": "bd23921a-e1d6-4fd7-faf5-ba85214e69cd", - "cellView": "form" + "outputId": "bd23921a-e1d6-4fd7-faf5-ba85214e69cd" }, - "execution_count": null, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "📦 Installing dependencies ...\n", "🔥 Installing PyTorch and PyG ...\n", @@ -118,52 +103,67 @@ "🎉 Done!\n" ] } + ], + "source": [ + "# @title Installing dependencies and pkasolver package (this might take up to 5 minutes)\n", + "\n", + "print('📦 Installing dependencies ...')\n", + "!mamba install -c conda-forge rdkit > /dev/null\n", + "print('🔥 Installing PyTorch and PyG ...')\n", + "!pip install torch==1.13.1+cpu -f https://download.pytorch.org/whl/cpu/torch_stable.html > /dev/null\n", + "!pip install torch-scatter -f https://data.pyg.org/whl/torch-1.13.1+cpu.html > /dev/null\n", + "!pip install torch-sparse -f https://data.pyg.org/whl/torch-1.13.1+cpu.html > /dev/null\n", + "!pip install torch-spline-conv torch-geometric==2.0.1 -f https://data.pyg.org/whl/torch-1.13.1+cpu.html > /dev/null\n", + "!pip install cairosvg svgutils molvs > /dev/null\n", + "print('✔️ Installing pkasolver package ...')\n", + "!pip install -q git+https://github.com/mayrf/pkasolver.git > /dev/null\n", + "print(\"🎉 Done!\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": { - "id": "aw-6bqsym4hX", "cellView": "form", "colab": { "base_uri": "https://localhost:8080/", "height": 1000 }, + "id": "aw-6bqsym4hX", "outputId": "0cf8e792-7e9c-4fbf-9e01-1665c9da94dc" }, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "🔮 Predicting...\n" ] }, { - "output_type": "stream", "name": "stderr", + "output_type": "stream", "text": [ "[query.py:297 - calculate_microstate_pka_values()] Using dimorphite-dl to identify protonation sites.\n" ] }, { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "Proposed mol at pH 7.4: CC(Cc1ccccc1)NC(=O)C([NH3+])CCCC[NH3+]\n", "📸 Visualizing ...\n" ] }, { - "output_type": "display_data", "data": { + "image/svg+xml": "\n\n \n \n \n \n \n \n \n \n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\npka_0 = 2.46 (stddev: 1.42)pka_1 = 7.80 (stddev: 0.23)pka_2 = 10.21 (stddev: 0.10)pka_3 = 13.23 (stddev: 0.46)", "text/plain": [ "" - ], - "image/svg+xml": "\n\n \n \n \n \n \n \n \n \n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\npka_0 = 2.46 (stddev: 1.42)pka_1 = 7.80 (stddev: 0.23)pka_2 = 10.21 (stddev: 0.10)pka_3 = 13.23 (stddev: 0.46)" + ] }, - "metadata": {} + "metadata": {}, + "output_type": "display_data" } ], "source": [ @@ -198,32 +198,19 @@ }, { "cell_type": "code", - "source": [ - "# @title Report SMILE list with pKa values\n", - "\n", - "print(\"😀################################😀\")\n", - "for i in range(len(protonation_states)):\n", - " state = protonation_states[i]\n", - " print(\n", - " Chem.MolToSmiles(state.protonated_mol),\n", - " Chem.MolToSmiles(state.deprotonated_mol),\n", - " )\n", - " print(state.pka)\n", - "print(\"😀################################😀\")\n" - ], + "execution_count": null, "metadata": { "cellView": "form", - "id": "BehVZ0to5AKU", "colab": { "base_uri": "https://localhost:8080/" }, + "id": "BehVZ0to5AKU", "outputId": "0962d2d7-434b-454a-da1c-3ef37e604d1f" }, - "execution_count": null, "outputs": [ { - "output_type": "stream", "name": "stdout", + "output_type": "stream", "text": [ "😀################################😀\n", "CC(Cc1ccccc1)[NH2+]C(=O)C([NH3+])CCCC[NH3+] CC(Cc1ccccc1)NC(=O)C([NH3+])CCCC[NH3+]\n", @@ -237,15 +224,28 @@ "😀################################😀\n" ] } + ], + "source": [ + "# @title Report SMILE list with pKa values\n", + "\n", + "print(\"😀################################😀\")\n", + "for i in range(len(protonation_states)):\n", + " state = protonation_states[i]\n", + " print(\n", + " Chem.MolToSmiles(state.protonated_mol),\n", + " Chem.MolToSmiles(state.deprotonated_mol),\n", + " )\n", + " print(state.pka)\n", + "print(\"😀################################😀\")\n" ] } ], "metadata": { "colab": { "collapsed_sections": [], + "include_colab_link": true, "name": "pka_prediction.ipynb", - "provenance": [], - "include_colab_link": true + "provenance": [] }, "kernelspec": { "display_name": "Python 3", @@ -257,4 +257,4 @@ }, "nbformat": 4, "nbformat_minor": 0 -} \ No newline at end of file +}