cg2all / app.py
huhlim's picture
Update app.py
5dfe5a9
raw
history blame
613 Bytes
import gradio as gr
import cg2all
import os
def runner(in_pdb, model_type):
out_fn = in_pdb.name[:-4] + "-all.pdb"
cg2all.convert_cg2all(in_pdb.name, out_fn, model_type=model_type)
return out_fn
demo = gr.Interface(fn=runner,
inputs=["file", gr.Radio(["CalphaBasedModel", "ResidueBasedModel", "Martini"])],
outputs=["file"],
examples=[["1ab1_A.calpha.pdb", "CalphaBasedModel"],
["1ab1_A.residue.pdb", "ResidueBasedModel"],
["1ab1_A.martini.pdb", "Martini"]])
demo.launch()