# Solution import gradio as gr def calculate_GC(DNA): n_G = DNA.count('G') n_C = DNA.count('C') n_A = DNA.count('A') n_T = DNA.count('T') GC_content = (n_G+n_C)/(n_G+n_C+n_A+n_T) * 100 total_count = n_G+n_C+n_A+n_T return total_count,n_A, n_T, n_G, n_C, GC_content ## configure inputs/outputs input_module = gr.inputs.Textbox(label = "Enter your DNA sequence in the box:") set_out1 = gr.outputs.Textbox(label = "Total count, all bases:") set_out2 = gr.outputs.Textbox(label = "Adenine (A) count:") set_out3 = gr.outputs.Textbox(label = "Thymine (T) count:") set_out4 = gr.outputs.Textbox(label = "Guanine (G) count:") set_out5 = gr.outputs.Textbox(label = "Cytosine (C) count:") set_out6 = gr.outputs.Textbox(label = "%G~C content:") ### configure gradio, detailed can be found at https://www.gradio.app/docs/#i_slider interface = gr.Interface(fn=calculate_GC, inputs=input_module, outputs=[set_out1,set_out2,set_out3,set_out4,set_out5,set_out6], title="CSCI1020 Demo 1: Web Application for Genomics %G~C Content Calculator", description= "Click examples below for a quick demo", theme = 'huggingface', layout = 'vertical' ) interface.launch()