ThorbenFroehlking commited on
Commit
ff689ae
·
1 Parent(s): f506fb3
Files changed (2) hide show
  1. .ipynb_checkpoints/app-checkpoint.py +4 -4
  2. app.py +4 -4
.ipynb_checkpoints/app-checkpoint.py CHANGED
@@ -92,10 +92,10 @@ def process_pdb(pdb_id, segment):
92
  scores = expit(outputs[:, 1] - outputs[:, 0])
93
  normalized_scores = normalize_scores(scores)
94
 
95
- result_str = "\n".join(
96
- f"{aa_dict[res.get_resname()]} {res.id[1]} {score:.2f}"
97
- for res, score in zip(sequence, normalized_scores)
98
- )
99
 
100
  # Save the predictions to a file
101
  prediction_file = f"{pdb_id}_predictions.txt"
 
92
  scores = expit(outputs[:, 1] - outputs[:, 0])
93
  normalized_scores = normalize_scores(scores)
94
 
95
+ result_str = "\n".join([
96
+ f"{res.get_resname()} {res.id[1]} {sequence[i]} {normalized_scores[i]:.2f}"
97
+ for i, res in enumerate(chain) if res.get_resname().strip() in aa_dict
98
+ ])
99
 
100
  # Save the predictions to a file
101
  prediction_file = f"{pdb_id}_predictions.txt"
app.py CHANGED
@@ -92,10 +92,10 @@ def process_pdb(pdb_id, segment):
92
  scores = expit(outputs[:, 1] - outputs[:, 0])
93
  normalized_scores = normalize_scores(scores)
94
 
95
- result_str = "\n".join(
96
- f"{aa_dict[res.get_resname()]} {res.id[1]} {score:.2f}"
97
- for res, score in zip(sequence, normalized_scores)
98
- )
99
 
100
  # Save the predictions to a file
101
  prediction_file = f"{pdb_id}_predictions.txt"
 
92
  scores = expit(outputs[:, 1] - outputs[:, 0])
93
  normalized_scores = normalize_scores(scores)
94
 
95
+ result_str = "\n".join([
96
+ f"{res.get_resname()} {res.id[1]} {sequence[i]} {normalized_scores[i]:.2f}"
97
+ for i, res in enumerate(chain) if res.get_resname().strip() in aa_dict
98
+ ])
99
 
100
  # Save the predictions to a file
101
  prediction_file = f"{pdb_id}_predictions.txt"