Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -204,7 +204,6 @@ def generate_peptide_for_single_sequence(model, tokenizer, protein_seq, peptide_
|
|
| 204 |
|
| 205 |
# Add the generated binder and its PPL to the results list
|
| 206 |
binders_with_ppl_plddt.append([generated_binder, ppl_value, plddt_value, iPTM_value])
|
| 207 |
-
print("207:binders_with_ppl_plddt: ",binders_with_ppl_plddt)
|
| 208 |
|
| 209 |
return binders_with_ppl_plddt
|
| 210 |
|
|
@@ -256,9 +255,12 @@ def predict_peptide_from_file(base_model_path, finetuned_model_path, file_obj, p
|
|
| 256 |
for i, row in input.iterrows():
|
| 257 |
seq = row['Receptor Sequence']
|
| 258 |
binders = generate_peptide_for_single_sequence(loaded_model, tokenizer, seq, peptide_length, top_k, num_binders)
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
|
|
|
|
|
|
|
|
|
| 262 |
#peptide_lp = results_i['Binder'][results_df['PPL'].idxmin()] #Choosing the one with the lowest perplexity
|
| 263 |
|
| 264 |
results_df = pd.DataFrame(results, columns=['Input Sequence', 'Binder', 'PPL', 'pLDDT', 'iPTM'])
|
|
|
|
| 204 |
|
| 205 |
# Add the generated binder and its PPL to the results list
|
| 206 |
binders_with_ppl_plddt.append([generated_binder, ppl_value, plddt_value, iPTM_value])
|
|
|
|
| 207 |
|
| 208 |
return binders_with_ppl_plddt
|
| 209 |
|
|
|
|
| 255 |
for i, row in input.iterrows():
|
| 256 |
seq = row['Receptor Sequence']
|
| 257 |
binders = generate_peptide_for_single_sequence(loaded_model, tokenizer, seq, peptide_length, top_k, num_binders)
|
| 258 |
+
results_idf = pd.DataFrame(binders, columns=['Binder', 'PPL', 'pLDDT', 'iPTM'])
|
| 259 |
+
peptide_lp = results_idf['Binder'][results_idf['PPL'].idxmin()] #Choosing the one with the lowest perplexity
|
| 260 |
+
|
| 261 |
+
#for binder, ppl, plddt, iptm in binders:
|
| 262 |
+
results.append([seq, peptide_lp])
|
| 263 |
+
print("263: results: ", results)
|
| 264 |
#peptide_lp = results_i['Binder'][results_df['PPL'].idxmin()] #Choosing the one with the lowest perplexity
|
| 265 |
|
| 266 |
results_df = pd.DataFrame(results, columns=['Input Sequence', 'Binder', 'PPL', 'pLDDT', 'iPTM'])
|