Spaces:
Sleeping
Sleeping
Rocco Meli
commited on
Commit
·
aed59e3
1
Parent(s):
c55f95e
better UI
Browse files
app.py
CHANGED
@@ -210,49 +210,60 @@ if __name__ == "__main__":
|
|
210 |
gr.Markdown("## Protein and Ligand")
|
211 |
gr.Markdown(
|
212 |
"Upload your protein and ligand files in PDB and SDF format, respectively."
|
|
|
|
|
213 |
)
|
214 |
with gr.Row():
|
215 |
with gr.Box():
|
216 |
pfile = gr.File(file_count="single", label="Protein file (PDB)")
|
217 |
-
pbtn = gr.Button("View")
|
218 |
|
219 |
protein = gr.HTML()
|
220 |
pbtn.click(fn=protein_html_from_file, inputs=[pfile], outputs=protein)
|
221 |
|
222 |
with gr.Box():
|
223 |
lfile = gr.File(file_count="single", label="Ligand file (SDF)")
|
224 |
-
lbtn = gr.Button("View")
|
225 |
|
226 |
ligand = gr.HTML()
|
227 |
lbtn.click(fn=ligand_html_from_file, inputs=[lfile], outputs=ligand)
|
228 |
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
|
241 |
gr.Markdown("## Gnina-Torch")
|
|
|
|
|
|
|
|
|
|
|
|
|
242 |
with gr.Row():
|
243 |
-
dd = gr.Dropdown(
|
244 |
-
choices=[
|
245 |
-
"default",
|
246 |
-
"redock_default2018_ensemble",
|
247 |
-
"general_default2018_ensemble",
|
248 |
-
"crossdock_default2018_ensemble",
|
249 |
-
],
|
250 |
-
value="default",
|
251 |
-
label="CNN model",
|
252 |
-
)
|
253 |
-
|
254 |
df = gr.Dataframe()
|
255 |
-
|
256 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
257 |
|
258 |
demo.launch()
|
|
|
210 |
gr.Markdown("## Protein and Ligand")
|
211 |
gr.Markdown(
|
212 |
"Upload your protein and ligand files in PDB and SDF format, respectively."
|
213 |
+
+ "Optionally, you can visualise the protein, the ligand, and the"
|
214 |
+
+ "protein-ligand complex."
|
215 |
)
|
216 |
with gr.Row():
|
217 |
with gr.Box():
|
218 |
pfile = gr.File(file_count="single", label="Protein file (PDB)")
|
219 |
+
pbtn = gr.Button("View Protein")
|
220 |
|
221 |
protein = gr.HTML()
|
222 |
pbtn.click(fn=protein_html_from_file, inputs=[pfile], outputs=protein)
|
223 |
|
224 |
with gr.Box():
|
225 |
lfile = gr.File(file_count="single", label="Ligand file (SDF)")
|
226 |
+
lbtn = gr.Button("View Ligand")
|
227 |
|
228 |
ligand = gr.HTML()
|
229 |
lbtn.click(fn=ligand_html_from_file, inputs=[lfile], outputs=ligand)
|
230 |
|
231 |
+
with gr.Box():
|
232 |
+
with gr.Column():
|
233 |
+
plcomplex = gr.HTML()
|
234 |
|
235 |
+
# TODO: Automatically display complex when both files are uploaded
|
236 |
+
plbtn = gr.Button("View Protein-Ligand Complex")
|
237 |
+
plbtn.click(
|
238 |
+
fn=protein_ligand_html_from_file,
|
239 |
+
inputs=[pfile, lfile],
|
240 |
+
outputs=plcomplex,
|
241 |
+
)
|
242 |
|
243 |
gr.Markdown("## Gnina-Torch")
|
244 |
+
gr.Markdown(
|
245 |
+
"Score your protein-ligand complex with [gnina-torch]"
|
246 |
+
+ "(https://github.com/RMeli/gnina-torch). You can choose between different"
|
247 |
+
+ "pre-trained Gnina models. See [McNutte et al. (2021)]"
|
248 |
+
+ "(https://doi.org/10.1186/s13321-021-00522-2) for more details."
|
249 |
+
)
|
250 |
with gr.Row():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
251 |
df = gr.Dataframe()
|
252 |
+
|
253 |
+
with gr.Column():
|
254 |
+
dd = gr.Dropdown(
|
255 |
+
choices=[
|
256 |
+
"default",
|
257 |
+
"redock_default2018_ensemble",
|
258 |
+
"general_default2018_ensemble",
|
259 |
+
"crossdock_default2018_ensemble",
|
260 |
+
],
|
261 |
+
value="default",
|
262 |
+
label="CNN model",
|
263 |
+
)
|
264 |
+
|
265 |
+
with gr.Row():
|
266 |
+
btn = gr.Button("Score!")
|
267 |
+
btn.click(fn=predict, inputs=[pfile, lfile, dd], outputs=df)
|
268 |
|
269 |
demo.launch()
|