sagawa commited on
Commit
7cee862
·
verified ·
1 Parent(s): 946fcbf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -35,7 +35,7 @@ def predict_stability_with_pdb(model_choice, organism_choice, pdb_files, cfg=Con
35
  "binary prediction value": []
36
  }
37
  file_names = []
38
- sequences = []
39
 
40
  for pdb_file in pdb_files:
41
  pdb_path = pdb_file.name
@@ -49,9 +49,9 @@ def predict_stability_with_pdb(model_choice, organism_choice, pdb_files, cfg=Con
49
 
50
  sequence = sequences[2] if model_choice == "SaProt" else sequences[0]
51
  file_names.append(pdb_file.name.split("/")[-1])
52
- sequences.append(sequence)
53
 
54
- raw_prediction, binary_prediction = predict_stability_core(model_choice, organism_choice, sequences, cfg)
55
  results["file_name"] = results["file_name"] + file_names
56
  results["raw prediction value"] = results["raw prediction value"] + raw_prediction
57
  results["binary prediction value"] = results["binary prediction value"] + binary_prediction
@@ -66,7 +66,7 @@ def predict_stability_with_sequence(model_choice, organism_choice, sequence, cfg
66
  try:
67
  if not sequence:
68
  return "No valid sequence provided."
69
- raw_prediction, binary_prediction = predict_stability_core(model_choice, organism_choice, sequence, cfg)
70
  df = pd.DataFrame({"sequence": sequence, "raw prediction value": raw_prediction, "binary prediction value": binary_prediction})
71
  output_csv = "/tmp/predictions.csv"
72
  df.to_csv(output_csv, index=False)
 
35
  "binary prediction value": []
36
  }
37
  file_names = []
38
+ input_sequences = []
39
 
40
  for pdb_file in pdb_files:
41
  pdb_path = pdb_file.name
 
49
 
50
  sequence = sequences[2] if model_choice == "SaProt" else sequences[0]
51
  file_names.append(pdb_file.name.split("/")[-1])
52
+ input_sequences.append(sequence)
53
 
54
+ raw_prediction, binary_prediction = predict_stability_core(model_choice, organism_choice, input_sequences, cfg)
55
  results["file_name"] = results["file_name"] + file_names
56
  results["raw prediction value"] = results["raw prediction value"] + raw_prediction
57
  results["binary prediction value"] = results["binary prediction value"] + binary_prediction
 
66
  try:
67
  if not sequence:
68
  return "No valid sequence provided."
69
+ raw_prediction, binary_prediction = predict_stability_core(model_choice, organism_choice, [sequence], cfg)
70
  df = pd.DataFrame({"sequence": sequence, "raw prediction value": raw_prediction, "binary prediction value": binary_prediction})
71
  output_csv = "/tmp/predictions.csv"
72
  df.to_csv(output_csv, index=False)