sagawa commited on
Commit
4d6e83e
1 Parent(s): f4d9b4d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -3
app.py CHANGED
@@ -6,8 +6,20 @@ 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
  try:
@@ -50,7 +62,6 @@ with gr.Blocks() as demo:
50
  with gr.TabItem("Upload PDB File"):
51
  gr.Markdown("### Upload your PDB file:")
52
  pdb_file = gr.File(label="Upload PDB File")
53
- output = get_foldseek_seq(pdb_file)
54
 
55
  predict_button = gr.Button("Predict Stability")
56
  prediction_output = gr.Textbox(label=str(output), interactive=False)
 
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
+ # Check if pdb_file is provided
10
+ if pdb_file:
11
+ pdb_path = pdb_file.name # Get the path of the uploaded PDB file
12
+ sequence = get_foldseek_seq(pdb_path)
13
+ if not sequence:
14
+ return "Failed to extract sequence from the PDB file."
15
+
16
+ # If sequence is provided directly
17
+ if sequence:
18
+ # Add logic to predict stability using the sequence
19
+ return f"Predicted Stability using {model_choice} for {organism_choice}: Example Output with sequence {sequence[:10]}..."
20
+ else:
21
+ return "No valid input provided."
22
+
23
 
24
  def get_foldseek_seq(pdb_path):
25
  try:
 
62
  with gr.TabItem("Upload PDB File"):
63
  gr.Markdown("### Upload your PDB file:")
64
  pdb_file = gr.File(label="Upload PDB File")
 
65
 
66
  predict_button = gr.Button("Predict Stability")
67
  prediction_output = gr.Textbox(label=str(output), interactive=False)