sagawa commited on
Commit
c1a4221
1 Parent(s): 6c8bfd8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -20
app.py CHANGED
@@ -32,26 +32,27 @@ def predict_stability(cfg, model_choice, organism_choice, pdb_file=None, sequenc
32
  pdb_path = pdb_file.name # Get the path of the uploaded PDB file
33
  os.system("chmod 777 bin/foldseek")
34
  sequences = get_foldseek_seq(pdb_path)
35
- if not sequences:
36
- return "Failed to extract sequence from the PDB file."
37
- if model_choice == "SaProt":
38
- sequence = sequences[2]
39
- else:
40
- sequence = sequences[0]
41
-
42
- if organism_choice == "Human":
43
- cell_line = "HeLa"
44
- else:
45
- cell_line = "NIH3T3"
46
- # If sequence is provided directly
47
- if sequence:
48
- cfg.model = f"sagawa/PLTNUM-{model_choice}-{cell_line}"
49
- cfg.architecture = model_choice
50
- cfg.model_path = f"sagawa/PLTNUM-{model_choice}-{cell_line}"
51
- output = predict(cfg, sequence)
52
- return f"Predicted Stability using {model_choice} for {organism_choice}: Example Output with sequence {output}..."
53
- else:
54
- return "No valid input provided."
 
55
 
56
 
57
  def get_foldseek_seq(pdb_path):
 
32
  pdb_path = pdb_file.name # Get the path of the uploaded PDB file
33
  os.system("chmod 777 bin/foldseek")
34
  sequences = get_foldseek_seq(pdb_path)
35
+ return str(sequences)
36
+ # if not sequences:
37
+ # return "Failed to extract sequence from the PDB file."
38
+ # if model_choice == "SaProt":
39
+ # sequence = sequences[2]
40
+ # else:
41
+ # sequence = sequences[0]
42
+
43
+ # if organism_choice == "Human":
44
+ # cell_line = "HeLa"
45
+ # else:
46
+ # cell_line = "NIH3T3"
47
+ # # If sequence is provided directly
48
+ # if sequence:
49
+ # cfg.model = f"sagawa/PLTNUM-{model_choice}-{cell_line}"
50
+ # cfg.architecture = model_choice
51
+ # cfg.model_path = f"sagawa/PLTNUM-{model_choice}-{cell_line}"
52
+ # output = predict(cfg, sequence)
53
+ # return f"Predicted Stability using {model_choice} for {organism_choice}: Example Output with sequence {output}..."
54
+ # else:
55
+ # return "No valid input provided."
56
 
57
 
58
  def get_foldseek_seq(pdb_path):