tonigi commited on
Commit
9b875e2
·
1 Parent(s): 36776c5
Files changed (1) hide show
  1. app.py +12 -7
app.py CHANGED
@@ -241,13 +241,18 @@ def process_uniprot_id(uniprot_id):
241
 
242
 
243
  # Gradio Interface
244
- demo = gr.Interface(
245
- fn=process_uniprot_id,
246
- inputs=gr.Textbox(label="UniProt ID", placeholder="e.g., P04637"),
247
- outputs=gr.Dataframe(label="Protein Sequence and Annotations"),
248
- title="UniProt Protein Sequence and Annotation Viewer",
249
- description="Enter a UniProt ID to view the protein sequence and its annotations in a DataFrame."
250
- )
 
 
 
 
 
251
 
252
  if __name__ == "__main__":
253
  demo.launch()
 
241
 
242
 
243
  # Gradio Interface
244
+ with gr.Blocks() as demo:
245
+ with gr.Column():
246
+ gr.Markdown("# Protein Sequence Analysis")
247
+ input_text = gr.Textbox(label="UniProt ID", placeholder="Enter UniProt ID (e.g., P53_HUMAN)")
248
+ submit_btn = gr.Button("Submit")
249
+ output_df = gr.Dataframe()
250
+
251
+ submit_btn.click(
252
+ fn=process_uniprot_id,
253
+ inputs=input_text,
254
+ outputs=output_df
255
+ )
256
 
257
  if __name__ == "__main__":
258
  demo.launch()