Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed import conflict from deprecated biotite function needed by ESM #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
118 changes: 59 additions & 59 deletions stab_ESM_IF.ipynb
Original file line number Diff line number Diff line change
@@ -1,23 +1,10 @@
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"provenance": [],
"gpuType": "T4"
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"name": "python"
},
"accelerator": "GPU"
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "AcjxZ9mXikrK"
},
"source": [
"# <b><font color='#009e74'>Absolute folding stabiity prediction via generative models</font></b>\n",
"Colaboratory implementation of : **Cagiada M., Ovchinnikov S. & Lindorff-Larsen K.** - [Predicting absolute protein folding stability using generative models\n",
Expand All @@ -31,13 +18,13 @@
"\n",
"where $\\mathscr{L}_i^{WT}$ is the amino acid likelihood extracted from ESM-IF for the wild-type amino acid at position i, to evaluate the absolute stability ($\\Delta G_{f-u}$) for a specific protein folding.\n",
"\n"
],
"metadata": {
"id": "AcjxZ9mXikrK"
}
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "a4dANSUAinaS"
},
"source": [
"Additional notes:\n",
"\n",
Expand All @@ -60,10 +47,7 @@
"\n",
"- An **alternative sequence** can be used in the input instead of the sequence extracted from the PDB file, **HOWEVER** it must be the same length as the original sequence.\n",
"****"
],
"metadata": {
"id": "a4dANSUAinaS"
}
]
},
{
"cell_type": "code",
Expand Down Expand Up @@ -117,7 +101,7 @@
" os.system(f\"pip install torch-spline-conv -f https://data.pyg.org/whl/torch-{TORCH}+{CUDA}.html\")\n",
" os.system(f\"pip install torch-geometric\")\n",
" os.system(f\"pip install biopython\")\n",
" os.system(f\"pip install biotite\")\n",
" os.system(f\"pip install biotite==0.41\")\n",
"\n",
" print(\"installing esmfold...\")\n",
" # install esmfold\n",
Expand Down Expand Up @@ -150,6 +134,12 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"cellView": "form",
"id": "lWXN38psLY3u"
},
"outputs": [],
"source": [
"#@title <b><font color='#f0e422'>PRELIMINARY OPERATIONS:</font> Load EXTRA functions\n",
"#@markdown Run the cell to load the required functions\n",
Expand Down Expand Up @@ -201,16 +191,16 @@
"\n",
" score = token_probs[0,idx, mt_encoded]\n",
" return score.item()"
],
"metadata": {
"id": "lWXN38psLY3u",
"cellView": "form"
},
"execution_count": null,
"outputs": []
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"cellView": "form",
"id": "fbmpNhrvbKil"
},
"outputs": [],
"source": [
"#@title <b><font color='#56b4e9'> DATA UPLOADING</font>\n",
"#@markdown Fill in the fields and run the cell to set up the job name, import the structure, select the chain and upload an alternative sequence (not mandatory).\n",
Expand Down Expand Up @@ -264,16 +254,16 @@
"\n",
"print('... Target sequence:', sequence_structure)\n",
"#@markdown ****"
],
"metadata": {
"id": "fbmpNhrvbKil",
"cellView": "form"
},
"execution_count": null,
"outputs": []
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"cellView": "form",
"id": "ocOnty1TP9Ec"
},
"outputs": [],
"source": [
"#@title <b><font color='#56b4e9'> MODEL RUN</font>\n",
"#@markdown Run this cell to evaluate the ΔG for the selected structure and sequence\n",
Expand Down Expand Up @@ -303,31 +293,28 @@
" os.rename(f\"inputs/query_protein.pdb\",f\"outputs/{output_name_pdb}\")\n",
"except:\n",
" print('!!!! Data not saved, please re-upload the structure by running the uploading cell')\n"
],
"metadata": {
"id": "ocOnty1TP9Ec",
"cellView": "form"
},
"execution_count": null,
"outputs": []
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"cellView": "form",
"id": "HdIPxqSE6zWi"
},
"outputs": [],
"source": [
"#@title <b><font color='#56b4e9'>DOWNLOAD RESULTS </font></b>\n",
"#@markdown **N.B:** This will download **ALL** the predictions produced during the current session as zip file\n",
"os.system( \"zip -r {} {}\".format( f\"dG_runs.zip\" , f\"outputs\" ) )\n",
"files.download(f\"dG_runs.zip\")\n"
],
"metadata": {
"id": "HdIPxqSE6zWi",
"cellView": "form"
},
"execution_count": null,
"outputs": []
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "0NULd4ycW4dw"
},
"source": [
"<b><font color='#56b4e9'>EXTRA </font></b>\n",
"\n",
Expand Down Expand Up @@ -396,10 +383,23 @@
"citation here\n",
"\n",
"```\n"
],
"metadata": {
"id": "0NULd4ycW4dw"
}
]
}
],
"metadata": {
"accelerator": "GPU",
"colab": {
"gpuType": "T4",
"provenance": []
},
"kernelspec": {
"display_name": "Python 3",
"name": "python3"
},
"language_info": {
"name": "python"
}
]
}
},
"nbformat": 4,
"nbformat_minor": 0
}