Spaces:
Runtime error
Runtime error
Update inference_app.py
Browse files- inference_app.py +11 -11
inference_app.py
CHANGED
@@ -94,10 +94,10 @@ def predict (input_sequence, input_ligand, input_protein):
|
|
94 |
AllChem.EmbedMolecule(m2)
|
95 |
AllChem.MMFFOptimizeMolecule(m2)
|
96 |
|
97 |
-
Chem.SDWriter("ligand.sdf").write(m2)
|
98 |
|
99 |
-
os.system(f"obabel {input_protein.name} -xr -O receptor.pdbqt")
|
100 |
-
os.system("obabel -isdf ligand.sdf -O ligand.pdbqt")
|
101 |
#Find pocket
|
102 |
pdb = md.load('receptor.pdb')
|
103 |
# run ligsite
|
@@ -133,24 +133,24 @@ def predict (input_sequence, input_ligand, input_protein):
|
|
133 |
|
134 |
pocket_top = md.Topology.from_dataframe(top_df, np.array([]))
|
135 |
pocket_trj = md.Trajectory(xyz=densest_cluster_points, topology=pocket_top)
|
136 |
-
pocket_trj.save('
|
137 |
|
138 |
parser = PDBParser()
|
139 |
-
struc = parser.get_structure("X", "pockets_dense.pdb")
|
140 |
coords = [x.coord for x in struc.get_atoms()]
|
141 |
pocket_center = np.mean(coords, axis=0)
|
142 |
output_text = run_smina(
|
143 |
-
"ligand.pdbqt",
|
144 |
-
"receptor.pdbqt",
|
145 |
-
"docking_pose.pdb",
|
146 |
pocket_center,
|
147 |
[10,10,10],
|
148 |
)
|
149 |
-
os.system("pdb_rplresname -UNL:LIG
|
150 |
-
os.system("pdb_merge receptor.pdb
|
151 |
end_time = time.time()
|
152 |
run_time = end_time - start_time
|
153 |
-
return "output.pdb", run_time
|
154 |
|
155 |
with gr.Blocks() as app:
|
156 |
|
|
|
94 |
AllChem.EmbedMolecule(m2)
|
95 |
AllChem.MMFFOptimizeMolecule(m2)
|
96 |
|
97 |
+
Chem.SDWriter("/usr/src/app/ligand.sdf").write(m2)
|
98 |
|
99 |
+
os.system(f"obabel {input_protein.name} -xr -O /usr/src/app/receptor.pdbqt")
|
100 |
+
os.system("obabel -isdf /usr/src/app/ligand.sdf -O l/usr/src/app/ligand.pdbqt")
|
101 |
#Find pocket
|
102 |
pdb = md.load('receptor.pdb')
|
103 |
# run ligsite
|
|
|
133 |
|
134 |
pocket_top = md.Topology.from_dataframe(top_df, np.array([]))
|
135 |
pocket_trj = md.Trajectory(xyz=densest_cluster_points, topology=pocket_top)
|
136 |
+
pocket_trj.save('/usr/src/app/pockets_dense.pdb')
|
137 |
|
138 |
parser = PDBParser()
|
139 |
+
struc = parser.get_structure("X", "/usr/src/app/pockets_dense.pdb")
|
140 |
coords = [x.coord for x in struc.get_atoms()]
|
141 |
pocket_center = np.mean(coords, axis=0)
|
142 |
output_text = run_smina(
|
143 |
+
"/usr/src/app/ligand.pdbqt",
|
144 |
+
"/usr/src/app/receptor.pdbqt",
|
145 |
+
"/usr/src/app/docking_pose.pdb",
|
146 |
pocket_center,
|
147 |
[10,10,10],
|
148 |
)
|
149 |
+
os.system("pdb_rplresname -UNL:LIG /usr/src/app/docking_pose.pdb")
|
150 |
+
os.system("pdb_merge /usr/src/app/receptor.pdb /usr/src/app/docking_pose.pdb > /usr/src/app/output.pdb")
|
151 |
end_time = time.time()
|
152 |
run_time = end_time - start_time
|
153 |
+
return "/usr/src/app/output.pdb", run_time
|
154 |
|
155 |
with gr.Blocks() as app:
|
156 |
|