PhDFlo commited on
Commit
124827b
·
1 Parent(s): e8373ce

Link to last molecule computed

Browse files
Files changed (1) hide show
  1. app.py +16 -8
app.py CHANGED
@@ -56,16 +56,24 @@ def compute_Chai1(
56
  for ii, (scores, cif) in enumerate(results):
57
  (Path(output_dir) / f"{run_id}-scores.model_idx_{ii}.npz").write_bytes(scores)
58
  (Path(output_dir) / f"{run_id}-preds.model_idx_{ii}.cif").write_text(cif)
 
 
 
 
 
 
 
 
 
 
59
 
 
60
 
61
- # Create a standard Gradio interface
62
- demo = gr.Interface(
63
- fn=compute_Chai1,
64
- inputs=gr.Number(label="Enter a number"),
65
- outputs=gr.Number(label="Square of the number"),
66
- title="Compute Square using Modal",
67
- description="Enter a number to compute its square using a remote Modal function."
68
- )
69
 
70
  # Launch both the Gradio web interface and the MCP server
71
  if __name__ == "__main__":
 
56
  for ii, (scores, cif) in enumerate(results):
57
  (Path(output_dir) / f"{run_id}-scores.model_idx_{ii}.npz").write_bytes(scores)
58
  (Path(output_dir) / f"{run_id}-preds.model_idx_{ii}.cif").write_text(cif)
59
+
60
+ cif_name = Path(output_dir) / f"{run_id}-preds.model_idx_{ii}.cif"
61
+ pdb_name = cif_name.split('.cif')[0] + '.pdb'
62
+ st = gemmi.read_structure(cif_name)
63
+ st.write_minimal_pdb(pdb_name)
64
+
65
+ return pdb_name
66
+
67
+
68
+ # Create the Gradio interface
69
 
70
+ reps = [{"model": 0,"style": "cartoon","color": "whiteCarbon"}]
71
 
72
+ with gr.Blocks() as demo:
73
+ inp = gr.Textbox(placeholder="Sequence file", label="Input Fasta file")
74
+ btn = gr.Button("Run")
75
+ out = Molecule3D(label="Molecule3D", reps=reps)
76
+ btn.click(fn=compute_Chai1, inputs=[inp], outputs=[out])
 
 
 
77
 
78
  # Launch both the Gradio web interface and the MCP server
79
  if __name__ == "__main__":