MassimoGregorioTotaro
commited on
Commit
·
8ecc9a8
1
Parent(s):
d911c22
instructions reorganisation
Browse files- LICENSE +1 -1
- README.md +1 -1
- app.py +60 -57
- header.md +5 -0
- instructions.md +1 -12
LICENSE
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
Copyright (c)
|
| 2 |
|
| 3 |
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
| 4 |
|
|
|
|
| 1 |
+
Copyright (c) 2024, Massimo G. Totaro All rights reserved.
|
| 2 |
|
| 3 |
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
| 4 |
|
README.md
CHANGED
|
@@ -7,7 +7,7 @@ sdk: gradio
|
|
| 7 |
sdk_version: 5.5.0
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
-
license: bsd-
|
| 11 |
---
|
| 12 |
|
| 13 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 7 |
sdk_version: 5.5.0
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
+
license: bsd-3-clause
|
| 11 |
---
|
| 12 |
|
| 13 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
app.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
from gradio import Blocks, Button, Checkbox, DataFrame, DownloadButton, Dropdown, Examples,
|
| 2 |
|
| 3 |
from model import get_models
|
| 4 |
from data import Data
|
|
@@ -27,63 +27,66 @@ def app(*argv):
|
|
| 27 |
return *out, DownloadButton(value=data.csv(), visible=True)
|
| 28 |
|
| 29 |
# Create the Gradio interface
|
| 30 |
-
with
|
| 31 |
-
|
| 32 |
# Define the interface components
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
[
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
|
|
|
|
|
|
|
|
|
| 87 |
|
| 88 |
# Launch the Gradio interface
|
| 89 |
if __name__ == "__main__":
|
|
|
|
| 1 |
+
from gradio import Blocks, Button, Checkbox, DataFrame, DownloadButton, Dropdown, Examples, Image, Markdown, Tab, Textbox
|
| 2 |
|
| 3 |
from model import get_models
|
| 4 |
from data import Data
|
|
|
|
| 27 |
return *out, DownloadButton(value=data.csv(), visible=True)
|
| 28 |
|
| 29 |
# Create the Gradio interface
|
| 30 |
+
with Blocks() as esm_scan:
|
| 31 |
+
Markdown("# [ESM-Scan](https://doi.org/10.1002/pro.5221)")
|
| 32 |
# Define the interface components
|
| 33 |
+
with Tab("App"):
|
| 34 |
+
Markdown(open("header.md", "r", encoding="utf-8").read())
|
| 35 |
+
seq = Textbox(
|
| 36 |
+
lines=2,
|
| 37 |
+
label="Sequence",
|
| 38 |
+
placeholder="FASTA sequence here...",
|
| 39 |
+
value=''
|
| 40 |
+
)
|
| 41 |
+
trg = Textbox(
|
| 42 |
+
lines=1,
|
| 43 |
+
label="Substitutions",
|
| 44 |
+
placeholder="Substitutions here...",
|
| 45 |
+
value=""
|
| 46 |
+
)
|
| 47 |
+
model_name = Dropdown(MODELS, label="Model", value="facebook/esm2_t30_150M_UR50D")
|
| 48 |
+
scoring_strategy = Checkbox(value=True, label="Use higher accuracy scoring", interactive=True)
|
| 49 |
+
btn = Button(value="Run", variant="primary")
|
| 50 |
+
dlb = DownloadButton(label="Download raw data", visible=False)
|
| 51 |
+
out = Image(visible=False)
|
| 52 |
+
ouu = DataFrame(visible=False)
|
| 53 |
+
btn.click(
|
| 54 |
+
fn=app,
|
| 55 |
+
inputs=[seq, trg, model_name],
|
| 56 |
+
outputs=[out, ouu, dlb]
|
| 57 |
+
)
|
| 58 |
+
ex = Examples(
|
| 59 |
+
examples=[
|
| 60 |
+
[
|
| 61 |
+
"MVEQYLLEAIVRDARDGITISDCSRPDNPLVFVNDAFTRMTGYDAEEVIGKNCRFLQRGDINLSAVHTIKIAMLTHEPCLVTLKNYRKDGTIFWNELSLTPIINKNGLITHYLGIQKDVSAQVILNQTLHEENHLLKSNKEMLEYLVNIDALTGLHNRRFLEDQLVIQWKLASRHINTITIFMIDIDYFKAFNDTYGHTAGDEALRTIAKTLNNCFMRGSDFVARYGGEEFTILAIGMTELQAHEYSTKLVQKIENLNIHHKGSPLGHLTISLGYSQANPQYHNDQNLVIEQADRALYSAKVEGKNRAVAYREQ",
|
| 62 |
+
"deep mutational scanning",
|
| 63 |
+
"facebook/esm2_t6_8M_UR50D"
|
| 64 |
+
],
|
| 65 |
+
[
|
| 66 |
+
"MVEQYLLEAIVRDARDGITISDCSRPDNPLVFVNDAFTRMTGYDAEEVIGKNCRFLQRGDINLSAVHTIKIAMLTHEPCLVTLKNYRKDGTIFWNELSLTPIINKNGLITHYLGIQKDVSAQVILNQTLHEENHLLKSNKEMLEYLVNIDALTGLHNRRFLEDQLVIQWKLASRHINTITIFMIDIDYFKAFNDTYGHTAGDEALRTIAKTLNNCFMRGSDFVARYGGEEFTILAIGMTELQAHEYSTKLVQKIENLNIHHKGSPLGHLTISLGYSQANPQYHNDQNLVIEQADRALYSAKVEGKNRAVAYREQ",
|
| 67 |
+
"217 218 219",
|
| 68 |
+
"facebook/esm2_t12_35M_UR50D"
|
| 69 |
+
],
|
| 70 |
+
[
|
| 71 |
+
"MVEQYLLEAIVRDARDGITISDCSRPDNPLVFVNDAFTRMTGYDAEEVIGKNCRFLQRGDINLSAVHTIKIAMLTHEPCLVTLKNYRKDGTIFWNELSLTPIINKNGLITHYLGIQKDVSAQVILNQTLHEENHLLKSNKEMLEYLVNIDALTGLHNRRFLEDQLVIQWKLASRHINTITIFMIDIDYFKAFNDTYGHTAGDEALRTIAKTLNNCFMRGSDFVARYGGEEFTILAIGMTELQAHEYSTKLVQKIENLNIHHKGSPLGHLTISLGYSQANPQYHNDQNLVIEQADRALYSAKVEGKNRAVAYREQ",
|
| 72 |
+
"R218K R218S R218N R218A R218V R218D",
|
| 73 |
+
"facebook/esm2_t30_150M_UR50D",
|
| 74 |
+
],
|
| 75 |
+
[
|
| 76 |
+
"MVEQYLLEAIVRDARDGITISDCSRPDNPLVFVNDAFTRMTGYDAEEVIGKNCRFLQRGDINLSAVHTIKIAMLTHEPCLVTLKNYRKDGTIFWNELSLTPIINKNGLITHYLGIQKDVSAQVILNQTLHEENHLLKSNKEMLEYLVNIDALTGLHNRRFLEDQLVIQWKLASRHINTITIFMIDIDYFKAFNDTYGHTAGDEALRTIAKTLNNCFMRGSDFVARYGGEEFTILAIGMTELQAHEYSTKLVQKIENLNIHHKGSPLGHLTISLGYSQANPQYHNDQNLVIEQADRALYSAKVEGKNRAVAYREQ",
|
| 77 |
+
"MVEQYLLEAIVRDARDGITISDCSRPDNPLVFVNDAFTRMTGYDAEEVIGKNCRFLQRGDINLSAVHTIKIAMLTHEPCLVTLKNYRKDGTIFWNELSLTPIINKNGLITHYLGIQKDVSAQVILNQTLHEENHLLKSNKEMLEYLVNIDALTGLHNRRFLEDQLVIQWKLASRHINTITIFMIDIDYFKAFNDTYGHTAGDEALRTIAKTLNNCFMWGSDFVARYGGEEFTILAIGMTELQAHEYSTKLVQKIENLNIHHKGSPLGHLTISLGYSQANPQYHNDQNLVIEQADRALYSAKVEGKNRAVAYREQ",
|
| 78 |
+
"facebook/esm2_t33_650M_UR50D",
|
| 79 |
+
],
|
| 80 |
+
],
|
| 81 |
+
inputs=[seq,
|
| 82 |
+
trg,
|
| 83 |
+
model_name],
|
| 84 |
+
outputs=[out],
|
| 85 |
+
fn=app,
|
| 86 |
+
cache_examples=False
|
| 87 |
+
)
|
| 88 |
+
with Tab("Instructions"):
|
| 89 |
+
Markdown(open("instructions.md", "r", encoding="utf-8").read())
|
| 90 |
|
| 91 |
# Launch the Gradio interface
|
| 92 |
if __name__ == "__main__":
|
header.md
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Calculate the fitness of single amino acid substitutions on proteins, using a [zero-shot](https://doi.org/10.1101/2021.07.09.450648) [language model predictor](https://github.com/facebookresearch/esm)
|
| 2 |
+
|
| 3 |
+
**WARNING:**
|
| 4 |
+
Due to high server traffic, the tool might become slow or unresponsive.
|
| 5 |
+
In this case, it is recommended to duplicate and clone the space in your personal HuggingFace account by clicking the top right menu.
|
instructions.md
CHANGED
|
@@ -1,10 +1,3 @@
|
|
| 1 |
-
# **ESM-Scan**
|
| 2 |
-
|
| 3 |
-
Calculate the <u>fitness of single amino acid substitutions</u> on proteins, using a [zero-shot](https://doi.org/10.1101/2021.07.09.450648) [language model predictor](https://github.com/facebookresearch/esm)
|
| 4 |
-
|
| 5 |
-
<details>
|
| 6 |
-
<summary> <b> USAGE INSTRUCTIONS </b> </summary>
|
| 7 |
-
|
| 8 |
## Setup
|
| 9 |
|
| 10 |
No setup is required. Simply fill in the input boxes with the necessary data and click the **Run** button.
|
|
@@ -54,8 +47,4 @@ The **Download raw data** button lets you download the output in CSV format.
|
|
| 54 |
|
| 55 |
**If you use this tool in your research, please cite**:
|
| 56 |
|
| 57 |
-
|
| 58 |
-
- Meier, J. (2021). “Language Models Enable Zero-Shot Prediction of the Effects of Mutations on Protein Function.” bioRxiv (Cold Spring Harbor Laboratory), July. [doi.org/10.1101/2021.07.09.450648](https://doi.org/10.1101/2021.07.09.450648)
|
| 59 |
-
|
| 60 |
-
</details>
|
| 61 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
## Setup
|
| 2 |
|
| 3 |
No setup is required. Simply fill in the input boxes with the necessary data and click the **Run** button.
|
|
|
|
| 47 |
|
| 48 |
**If you use this tool in your research, please cite**:
|
| 49 |
|
| 50 |
+
Totaro MG, Vide U, Zausinger R, Winkler A, Oberdorfer G. ESM-scan—A tool to guide amino acid substitutions. *Protein Science.* 2024; 33(12):e5221. [doi.org/10.1002/pro.5221](https://doi.org/10.1002/pro.5221)
|
|
|
|
|
|
|
|
|
|
|
|