wangjin2000 commited on
Commit
f3b8a62
·
verified ·
1 Parent(s): 9526b25

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -218,15 +218,15 @@ def predict_peptide(base_model_path, finetuned_model_path, input_seqs, peptide_l
218
 
219
  if isinstance(input_seqs, str): # Single sequence
220
  binders = generate_peptide_for_single_sequence(loaded_model, tokenizer, input_seqs, peptide_length, top_k, num_binders)
221
- results_df = pd.DataFrame(binders, columns=['Binder', 'Pseudo Perplexity'])
222
 
223
  elif isinstance(input_seqs, list): # List of sequences
224
  results = []
225
  for seq in input_seqs:
226
  binders = generate_peptide_for_single_sequence(loaded_model, tokenizer, seq, peptide_length, top_k, num_binders)
227
- for binder, ppl in binders:
228
- results.append([seq, binder, ppl])
229
- results_df = pd.DataFrame(results, columns=['Input Sequence', 'Binder', 'Pseudo Perplexity'])
230
  print(results_df)
231
 
232
  #combine target protein and predicted peptide with 20 G amino acids.
@@ -254,9 +254,9 @@ def predict_peptide_from_file(base_model_path, finetuned_model_path, file_obj, p
254
  seq = row['Receptor Sequence']
255
  binders = generate_peptide_for_single_sequence(loaded_model, tokenizer, seq, peptide_length, top_k, num_binders)
256
  for binder, ppl in binders:
257
- results.append([seq, binder, ppl])
258
  print("Predicted sample: binder, ppl", i, binder, ppl )
259
- results_df = pd.DataFrame(results, columns=['Input Sequence', 'Binder', 'Pseudo Perplexity'])
260
 
261
  outpath = (
262
  Path.cwd() / "predicted_peptides.csv"
 
218
 
219
  if isinstance(input_seqs, str): # Single sequence
220
  binders = generate_peptide_for_single_sequence(loaded_model, tokenizer, input_seqs, peptide_length, top_k, num_binders)
221
+ results_df = pd.DataFrame(binders, columns=['Binder', 'Pseudo Perplexity', 'pLDDT'])
222
 
223
  elif isinstance(input_seqs, list): # List of sequences
224
  results = []
225
  for seq in input_seqs:
226
  binders = generate_peptide_for_single_sequence(loaded_model, tokenizer, seq, peptide_length, top_k, num_binders)
227
+ for binder, ppl, plddt in binders:
228
+ results.append([seq, binder, ppl, plddt])
229
+ results_df = pd.DataFrame(results, columns=['Input Sequence', 'Binder', 'Pseudo Perplexity', 'pLDDT'])
230
  print(results_df)
231
 
232
  #combine target protein and predicted peptide with 20 G amino acids.
 
254
  seq = row['Receptor Sequence']
255
  binders = generate_peptide_for_single_sequence(loaded_model, tokenizer, seq, peptide_length, top_k, num_binders)
256
  for binder, ppl in binders:
257
+ results.append([seq, binder, ppl, plddt])
258
  print("Predicted sample: binder, ppl", i, binder, ppl )
259
+ results_df = pd.DataFrame(results, columns=['Input Sequence', 'Binder', 'Pseudo Perplexity', 'pLDDT'])
260
 
261
  outpath = (
262
  Path.cwd() / "predicted_peptides.csv"