Spaces:
Build error
Build error
Upload app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
from search_file import *
|
| 3 |
+
|
| 4 |
+
from main_pdbtosite import *
|
| 5 |
+
from upload_file import *
|
| 6 |
+
from Show_cst import *
|
| 7 |
+
from show_binding_png import *
|
| 8 |
+
with gr.Blocks(css=".gradio-container {background-image: url('file=background.jpg')}") as demo:
|
| 9 |
+
gr.Markdown("Welcome using this tools.")
|
| 10 |
+
|
| 11 |
+
with gr.Tab("search file"):
|
| 12 |
+
gr.Markdown("Welcome using this tool.")
|
| 13 |
+
gr.Markdown("This is a tool for searching")
|
| 14 |
+
file2_input=gr.Textbox(placeholder="请输入要搜索的文件名。如1a01",label="PDB NAME")
|
| 15 |
+
file2_output=gr.Files(label="OUTPUT FILES")
|
| 16 |
+
# file2_output_image=gr.Image()
|
| 17 |
+
with gr.Row():
|
| 18 |
+
file2_button1=gr.Button("search this file")
|
| 19 |
+
# file2_button2 =gr.Button("show binding site png")
|
| 20 |
+
|
| 21 |
+
with gr.Tab("Generate"):
|
| 22 |
+
gr.Markdown("Welcome using this tool.")
|
| 23 |
+
gr.Markdown("This is a tool for get the '.cst'")
|
| 24 |
+
file1_input = gr.File(label="输入相关文件")
|
| 25 |
+
file1_output = gr.Files()
|
| 26 |
+
file1_output_text=gr.Textbox(label="show cst")
|
| 27 |
+
file1_output_image=gr.Image()
|
| 28 |
+
with gr.Row():
|
| 29 |
+
file1_button1 = gr.Button("upload you pdb file")
|
| 30 |
+
file1_button2 = gr.Button("generate cst")
|
| 31 |
+
file1_button3 = gr.Button("show cst content")
|
| 32 |
+
with gr.Row():
|
| 33 |
+
file1_button4 =gr.Button("show binding site png")
|
| 34 |
+
|
| 35 |
+
file2_button1.click(search_file,inputs=file2_input,outputs=file2_output)
|
| 36 |
+
# file2_button2.click(show_binding_png,inputs=file,outputs=file1_output_image)
|
| 37 |
+
|
| 38 |
+
file1_button1.click(upload_file, inputs=file1_input, outputs=file1_output)
|
| 39 |
+
file1_button2.click(main_pdbtosite, inputs=file1_input, outputs=file1_output)
|
| 40 |
+
file1_button3.click(Show_cst,inputs=file1_output,outputs=file1_output_text)
|
| 41 |
+
file1_button4.click(show_binding_png,inputs=file1_input,outputs=file1_output_image)
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
|
| 47 |
+
if __name__ == "__main__":
|
| 48 |
+
demo.launch(server_port=8080)
|
| 49 |
+
#demo.launch()
|
| 50 |
+
|