import gradio as gr from Sort_Scores import * from Preinput_Merge import * from Sort_Dlkcat import * from Merge_Dlsc import * from Sort_Sco_Kcat import * from Plt import * with gr.Blocks(css=".gradio-container {background-image: url('file=background.jpeg')}") as demo: gr.Markdown("Welcome using this demo.") with gr.Tab("HelloWorld"): gr.Markdown("Welcome using this demo.") gr.Markdown("This is a succend test") gr.Markdown("I think this demo can do some things") gr.Markdown("在sort里,可以对scores文件,dlkcat文件,以及合并后的scores与dlkcat文件进行排序") gr.Markdown("Pre Merge里,可以将序列文件与smi文件进行合并,合并后可以进行dlkcat值的计算,合并前若序列文件需要处理换行符也可以对其进行处理") gr.Markdown("Merge Dlsc里,可以合并scores值文件和dlkcat文件,主义这两个文件序列需要一致") with gr.Tab("Sort"): file1_input = gr.File(label="输入相关文件") file1_output = gr.File() with gr.Row(): file1_button1 = gr.Button("Sort Scores") file1_button2 = gr.Button("Sort Dlkcat") file1_button3 = gr.Button("Sort Mergekcat") with gr.Tab("Pre Merge"): with gr.Row(): file2_input1 = gr.File(label="strip_file") file2_input2 = gr.File(label="smi_file") file2_input3 = gr.File(label="seq_file") file2_output = gr.File() file2_button1 = gr.Button("Strip") with gr.Row(): file2_button2 = gr.Button("Merge") file2_button3 = gr.Button("Merge All") with gr.Tab("Merge Dlsc"): with gr.Row(): file4_input1 = gr.File(label="sc_file") file4_input2 = gr.File(label="cat_file") file4_output = gr.File() file4_button = gr.Button("Merge") with gr.Tab("Plt Picture"): file5_input = gr.File(label="log_file") file5_output = gr.File() file5_button = gr.Button("Plt") with gr.Accordion("Open for More!"): gr.Markdown("Look at me...") file1_button1.click(Sort_Scores, inputs=file1_input, outputs=file1_output) file1_button2.click(Sort_Dlkcat, inputs=file1_input, outputs=file1_output) file1_button3.click(Sort_Sco_Kcat, inputs=file1_input, outputs=file1_output) file2_button1.click(Strip, inputs=file2_input1, outputs=file2_output) file2_button2.click(Merge, inputs=[file2_input2, file2_input3], outputs=file2_output) file2_button3.click(Merge_All, inputs=[file2_input2, file2_input3], outputs=file2_output) file4_button.click(Merge_Dlsc, inputs=[file4_input1, file4_input2], outputs=file4_output) file5_button.click(Plt, inputs=file5_input, outputs=file5_output) if __name__ == "__main__": demo.launch()