Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -157,16 +157,15 @@ def compute_plddt_iptm(protein_seq, binder_seq):
|
|
| 157 |
outputs = model(**inputs)
|
| 158 |
plddt = outputs.plddt
|
| 159 |
|
| 160 |
-
ptm = outputs.ptm
|
| 161 |
print(f'161: ptm: {ptm:.4f}')
|
| 162 |
-
|
| 163 |
-
print("163: ptm2:",ptm2)
|
| 164 |
|
| 165 |
avg_plddt = plddt[0,:,1].mean()
|
| 166 |
print("166: avg_plddt:",avg_plddt)
|
| 167 |
plddt2 = outputs["plddt"][0,:,1].mean()
|
| 168 |
print("169: plddt2:",plddt2)
|
| 169 |
-
iPTM = ptm.mean()
|
| 170 |
print("170: iPTM:",iPTM)
|
| 171 |
|
| 172 |
return avg_plddt, iPTM
|
|
@@ -225,7 +224,7 @@ def predict_peptide(base_model_path, finetuned_model_path, input_seqs, peptide_l
|
|
| 225 |
|
| 226 |
if isinstance(input_seqs, str): # Single sequence
|
| 227 |
binders = generate_peptide_for_single_sequence(loaded_model, tokenizer, input_seqs, peptide_length, top_k, num_binders)
|
| 228 |
-
results_df = pd.DataFrame(binders, columns=['Binder', '
|
| 229 |
|
| 230 |
elif isinstance(input_seqs, list): # List of sequences
|
| 231 |
results = []
|
|
|
|
| 157 |
outputs = model(**inputs)
|
| 158 |
plddt = outputs.plddt
|
| 159 |
|
| 160 |
+
ptm = outputs.ptm.item()
|
| 161 |
print(f'161: ptm: {ptm:.4f}')
|
| 162 |
+
|
|
|
|
| 163 |
|
| 164 |
avg_plddt = plddt[0,:,1].mean()
|
| 165 |
print("166: avg_plddt:",avg_plddt)
|
| 166 |
plddt2 = outputs["plddt"][0,:,1].mean()
|
| 167 |
print("169: plddt2:",plddt2)
|
| 168 |
+
iPTM = {ptm.mean():%.4f}
|
| 169 |
print("170: iPTM:",iPTM)
|
| 170 |
|
| 171 |
return avg_plddt, iPTM
|
|
|
|
| 224 |
|
| 225 |
if isinstance(input_seqs, str): # Single sequence
|
| 226 |
binders = generate_peptide_for_single_sequence(loaded_model, tokenizer, input_seqs, peptide_length, top_k, num_binders)
|
| 227 |
+
results_df = pd.DataFrame(binders, columns=['Binder', 'PPL', 'pLDDT', 'iPTM'])
|
| 228 |
|
| 229 |
elif isinstance(input_seqs, list): # List of sequences
|
| 230 |
results = []
|