Spaces:
Runtime error
Runtime error
Update inference_app.py
Browse files- inference_app.py +5 -3
inference_app.py
CHANGED
|
@@ -94,6 +94,8 @@ def run_smina(
|
|
| 94 |
def predict (input_sequence, input_ligand, input_protein):
|
| 95 |
start_time = time.time()
|
| 96 |
|
|
|
|
|
|
|
| 97 |
m=Chem.MolFromSmiles(input_ligand)
|
| 98 |
|
| 99 |
m2=Chem.AddHs(m)
|
|
@@ -153,16 +155,16 @@ def predict (input_sequence, input_ligand, input_protein):
|
|
| 153 |
[10,10,10],
|
| 154 |
)
|
| 155 |
os.system("pdb_rplresname -UNL:LIG /usr/src/app/docking_pose.pdb")
|
| 156 |
-
os.system("pdb_merge
|
| 157 |
end_time = time.time()
|
| 158 |
run_time = end_time - start_time
|
| 159 |
return "/usr/src/app/output.pdb", run_time
|
| 160 |
|
| 161 |
with gr.Blocks() as app:
|
| 162 |
|
| 163 |
-
gr.Markdown("#
|
| 164 |
|
| 165 |
-
gr.Markdown("
|
| 166 |
with gr.Row():
|
| 167 |
input_sequence = gr.Textbox(lines=3, label="Input Protein sequence (FASTA)")
|
| 168 |
input_ligand = gr.Textbox(lines=3, label="Input ligand SMILES")
|
|
|
|
| 94 |
def predict (input_sequence, input_ligand, input_protein):
|
| 95 |
start_time = time.time()
|
| 96 |
|
| 97 |
+
if input_protein==None:
|
| 98 |
+
raise gr.Error("need pdb input")
|
| 99 |
m=Chem.MolFromSmiles(input_ligand)
|
| 100 |
|
| 101 |
m2=Chem.AddHs(m)
|
|
|
|
| 155 |
[10,10,10],
|
| 156 |
)
|
| 157 |
os.system("pdb_rplresname -UNL:LIG /usr/src/app/docking_pose.pdb")
|
| 158 |
+
os.system(f"pdb_merge {input_protein.name} /usr/src/app/docking_pose.pdb > /usr/src/app/output.pdb")
|
| 159 |
end_time = time.time()
|
| 160 |
run_time = end_time - start_time
|
| 161 |
return "/usr/src/app/output.pdb", run_time
|
| 162 |
|
| 163 |
with gr.Blocks() as app:
|
| 164 |
|
| 165 |
+
gr.Markdown("# LigSite + Smina")
|
| 166 |
|
| 167 |
+
gr.Markdown("Example model using LigSite and DBScan to find a binding pocket in the protein and then SMINA to dock the ligand in the found pocket.")
|
| 168 |
with gr.Row():
|
| 169 |
input_sequence = gr.Textbox(lines=3, label="Input Protein sequence (FASTA)")
|
| 170 |
input_ligand = gr.Textbox(lines=3, label="Input ligand SMILES")
|