sagawa commited on
Commit
178b187
1 Parent(s): 4321e7e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -1
app.py CHANGED
@@ -1,10 +1,25 @@
1
  import gradio as gr
 
 
 
 
2
 
3
  # Assuming 'predict_stability' is your function that predicts protein stability
4
  def predict_stability(model_choice, organism_choice, pdb_file=None, sequence=None):
5
  # Dummy return for illustration; replace with your actual prediction logic
6
  return f"Predicted Stability using {model_choice} for {organism_choice}: Example Output"
7
 
 
 
 
 
 
 
 
 
 
 
 
8
  # Gradio Interface
9
  with gr.Blocks() as demo:
10
  gr.Markdown(
@@ -33,8 +48,10 @@ with gr.Blocks() as demo:
33
  with gr.TabItem("Upload PDB File"):
34
  gr.Markdown("### Upload your PDB file:")
35
  pdb_file = gr.File(label="Upload PDB File")
 
 
36
  predict_button = gr.Button("Predict Stability")
37
- prediction_output = gr.Textbox(label="Stability Prediction", interactive=False)
38
 
39
  predict_button.click(fn=predict_stability, inputs=[model_choice, organism_choice, pdb_file], outputs=prediction_output)
40
 
 
1
  import gradio as gr
2
+ import sys
3
+ import random
4
+ sys.path.append("scripts/")
5
+ from foldseek_util import get_struc_seq
6
 
7
  # Assuming 'predict_stability' is your function that predicts protein stability
8
  def predict_stability(model_choice, organism_choice, pdb_file=None, sequence=None):
9
  # Dummy return for illustration; replace with your actual prediction logic
10
  return f"Predicted Stability using {model_choice} for {organism_choice}: Example Output"
11
 
12
+ def get_foldseek_seq(pdb_path):
13
+ parsed_seqs = get_struc_seq(
14
+ "bin/foldseek",
15
+ pdb_path,
16
+ ["A"],
17
+ process_id=random.randint(0, 10000000),
18
+ )["A"]
19
+ return parsed_seqs
20
+
21
+
22
+
23
  # Gradio Interface
24
  with gr.Blocks() as demo:
25
  gr.Markdown(
 
48
  with gr.TabItem("Upload PDB File"):
49
  gr.Markdown("### Upload your PDB file:")
50
  pdb_file = gr.File(label="Upload PDB File")
51
+ output = get_foldseek_seq(pdb_file)
52
+
53
  predict_button = gr.Button("Predict Stability")
54
+ prediction_output = gr.Textbox(label=str(output), interactive=False)
55
 
56
  predict_button.click(fn=predict_stability, inputs=[model_choice, organism_choice, pdb_file], outputs=prediction_output)
57