Spaces:
Running
Running
Commit
·
aad7754
1
Parent(s):
2f6bf76
test
Browse files
app.py
CHANGED
@@ -129,14 +129,33 @@ def test(ligand, protein):
|
|
129 |
return e, e
|
130 |
|
131 |
with gr.Blocks() as demo:
|
132 |
-
|
133 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
IC50 = gr.Textbox(label="Predicted IC50 Value")
|
135 |
K = gr.Textbox(label="Predicted K Value")
|
136 |
|
137 |
submit_btn = gr.Button("Submit")
|
138 |
submit_btn.click(fn=test, inputs=[ligand, protein], outputs=[IC50, K], api_name="MBP_Scoring")
|
139 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
140 |
model_config = get_config(model_dir)
|
141 |
data_example = get_data(model_config, './workdir/gradio/1a0q_ligand.sdf', './workdir/gradio/1a0q_protein.pdb')
|
142 |
model = get_models(model_config, model_dir, checkpoint)
|
|
|
129 |
return e, e
|
130 |
|
131 |
with gr.Blocks() as demo:
|
132 |
+
gr.Markdown(
|
133 |
+
"""
|
134 |
+
# Multi-task Bioassay Pre-training for Protein-Ligand Binding Affinity Prediction
|
135 |
+
## Welcome to the [MBP](https://arxiv.org/abs/2306.04886) demo !
|
136 |
+
- Feel free to upload your own examples. Please upload an individual ligand 3D file and an individual protein 3D file each time.
|
137 |
+
- If you encounter any issues, please reach out to [email protected].
|
138 |
+
""")
|
139 |
+
|
140 |
+
with gr.Row():
|
141 |
+
ligand = gr.File(label="Ligand 3D file. We utilize openbabel to process ligand files, which supports all file types that openbabel can read.")
|
142 |
+
protein = gr.File(label="Protein 3D file. Currently, our system only supports the pdb file type for protein files.")
|
143 |
+
|
144 |
IC50 = gr.Textbox(label="Predicted IC50 Value")
|
145 |
K = gr.Textbox(label="Predicted K Value")
|
146 |
|
147 |
submit_btn = gr.Button("Submit")
|
148 |
submit_btn.click(fn=test, inputs=[ligand, protein], outputs=[IC50, K], api_name="MBP_Scoring")
|
149 |
|
150 |
+
gr.Markdown("## Input Examples")
|
151 |
+
gr.Examples(
|
152 |
+
examples=[['./workdir/gradio/1a0q_ligand.sdf','./workdir/gradio/1a0q_protein.pdb']],
|
153 |
+
inputs=[ligand, protein],
|
154 |
+
# outputs=[IC50, K],
|
155 |
+
fn=test,
|
156 |
+
cache_examples=False,
|
157 |
+
)
|
158 |
+
|
159 |
model_config = get_config(model_dir)
|
160 |
data_example = get_data(model_config, './workdir/gradio/1a0q_ligand.sdf', './workdir/gradio/1a0q_protein.pdb')
|
161 |
model = get_models(model_config, model_dir, checkpoint)
|