Update app.py
Browse files
app.py
CHANGED
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from file.Sort_Scores import *
|
3 |
+
from file.Preinput_Merge import *
|
4 |
+
from file.Sort_Dlkcat import *
|
5 |
+
from file.Merge_Dlsc import *
|
6 |
+
from file.Sort_Sco_Kcat import *
|
7 |
+
from file.Plt import *
|
8 |
+
import sys
|
9 |
+
sys.path.append('../DLKcat/DeeplearningApproach/Code/example/')
|
10 |
+
from model import *
|
11 |
+
from prediction_for_input import *
|
12 |
+
|
13 |
+
with gr.Blocks(css=".gradio-container {background-image: url('file=background.jpeg')}") as demo:
|
14 |
+
gr.Markdown("Welcome using this demo.")
|
15 |
+
with gr.Tab("HelloWorld"):
|
16 |
+
gr.Markdown("Welcome using this demo.")
|
17 |
+
gr.Markdown("This is a succend test")
|
18 |
+
gr.Markdown("I think this demo can do some things")
|
19 |
+
gr.Markdown("在sort里,可以对scores文件,dlkcat文件,以及合并后的scores与dlkcat文件进行排序")
|
20 |
+
gr.Markdown("Pre Merge里,可以将序列文件与smi文件进行合并,合并后可以进行dlkcat值的计算,合并前若序列文件需要处理换行符也可以对其进行处理")
|
21 |
+
gr.Markdown("Merge Dlsc里,可以合并scores值文件和dlkcat文件,主义这两个文件序列需要一致")
|
22 |
+
with gr.Tab("Sort"):
|
23 |
+
file1_input = gr.File(label="输入相关文件")
|
24 |
+
file1_output = gr.File()
|
25 |
+
with gr.Row():
|
26 |
+
file1_button1 = gr.Button("Sort Scores")
|
27 |
+
file1_button2 = gr.Button("Sort Dlkcat")
|
28 |
+
file1_button3 = gr.Button("Sort Mergekcat")
|
29 |
+
|
30 |
+
with gr.Tab("Pre Merge"):
|
31 |
+
with gr.Row():
|
32 |
+
file2_input1 = gr.File(label="strip_file")
|
33 |
+
file2_input2 = gr.File(label="smi_file")
|
34 |
+
file2_input3 = gr.File(label="seq_file")
|
35 |
+
file2_output = gr.File()
|
36 |
+
file2_button1 = gr.Button("Strip")
|
37 |
+
with gr.Row():
|
38 |
+
file2_button2 = gr.Button("Merge")
|
39 |
+
file2_button3 = gr.Button("Merge All")
|
40 |
+
|
41 |
+
with gr.Tab("Merge Dlsc"):
|
42 |
+
with gr.Row():
|
43 |
+
file4_input1 = gr.File(label="sc_file")
|
44 |
+
file4_input2 = gr.File(label="cat_file")
|
45 |
+
file4_output = gr.File()
|
46 |
+
file4_button = gr.Button("Merge")
|
47 |
+
|
48 |
+
with gr.Tab("Plt Picture"):
|
49 |
+
file5_input = gr.File(label="log_file")
|
50 |
+
file5_output = gr.File()
|
51 |
+
file5_button = gr.Button("Plt")
|
52 |
+
|
53 |
+
with gr.Tab("Test"):
|
54 |
+
file6_input = gr.File(label="输入相关文件")
|
55 |
+
file6_output = gr.File()
|
56 |
+
file6_button = gr.Button("test")
|
57 |
+
|
58 |
+
with gr.Accordion("Open for More!"):
|
59 |
+
gr.Markdown("Look at me...")
|
60 |
+
|
61 |
+
file1_button1.click(Sort_Scores, inputs=file1_input, outputs=file1_output)
|
62 |
+
file1_button2.click(Sort_Dlkcat, inputs=file1_input, outputs=file1_output)
|
63 |
+
file1_button3.click(Sort_Sco_Kcat, inputs=file1_input, outputs=file1_output)
|
64 |
+
|
65 |
+
file2_button1.click(Strip, inputs=file2_input1, outputs=file2_output)
|
66 |
+
file2_button2.click(Merge, inputs=[file2_input2, file2_input3], outputs=file2_output)
|
67 |
+
file2_button3.click(Merge_All, inputs=[file2_input2, file2_input3], outputs=file2_output)
|
68 |
+
|
69 |
+
file4_button.click(Merge_Dlsc, inputs=[file4_input1, file4_input2], outputs=file4_output)
|
70 |
+
|
71 |
+
file5_button.click(Plt, inputs=file5_input, outputs=file5_output)
|
72 |
+
|
73 |
+
file6_button.click(test, inputs=file6_input, outputs=file6_output)
|
74 |
+
|
75 |
+
if __name__ == "__main__":
|
76 |
+
demo.launch()
|