From 820aeb2e39ec6b05803c862f698bc87ba07787a9 Mon Sep 17 00:00:00 2001 From: DanielYang Date: Sun, 12 Feb 2023 00:06:56 +0800 Subject: [PATCH] test=develop, test=update_app (#5716) --- modelcenter/PP-HelixFold/APP/app.py | 34 ++++++++++++++--------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/modelcenter/PP-HelixFold/APP/app.py b/modelcenter/PP-HelixFold/APP/app.py index 8613d07f..4c75bf9c 100644 --- a/modelcenter/PP-HelixFold/APP/app.py +++ b/modelcenter/PP-HelixFold/APP/app.py @@ -1,12 +1,12 @@ import gradio as gr import os + def molecule(input_pdb): mol = read_mol(input_pdb) - x = ( - """ + x = (""" @@ -24,14 +24,13 @@ def molecule(input_pdb): } +
- """ - ) + """) return f"""""" + def get_pdb(pdb_code="", filepath=""): if pdb_code is None or pdb_code == "": try: @@ -73,23 +72,24 @@ def read_mol(molpath): return mol - -def update(fastaName='',fastaContent=''): - if(fastaName==''): - return None +def update(fastaName='', fastaContent=''): + if (fastaName == ''): + return None else: - return molecule(fastaName+"_pred.pdb") + return molecule(fastaName + "_pred.pdb") demo = gr.Blocks() with demo: - gr.Markdown("# PP-HelixFold Protein Structure Prediction Demo") + gr.Markdown("# PP-HelixFold Demo") with gr.Row(): with gr.Box(): - fastaName = gr.Textbox(interactive=False,label='Fasta label') - fastaContent = gr.Textbox(interactive=False,label='Fasta content') - gr.Examples([["T1026", read_mol( "T1026.fasta")],["T1037", read_mol("T1037.fasta")]], [fastaName,fastaContent]) + fastaName = gr.Textbox(interactive=False, label='Fasta label') + fastaContent = gr.Textbox(interactive=False, label='Fasta content') + gr.Examples([["T1026", read_mol("T1026.fasta")], + ["T1037", read_mol("T1037.fasta")]], + [fastaName, fastaContent]) btn = gr.Button("Predict") mol = gr.HTML() - btn.click(fn=update, inputs=[fastaName,fastaContent], outputs=mol) + btn.click(fn=update, inputs=[fastaName, fastaContent], outputs=mol) demo.launch() -- GitLab