Commit 274f8ffe authored by zhuww's avatar zhuww
Browse files

add amber minimize

parent b6f5ac33
...@@ -94,8 +94,8 @@ def _openmm_minimize( ...@@ -94,8 +94,8 @@ def _openmm_minimize(
_add_restraints(system, pdb, stiffness, restraint_set, exclude_residues) _add_restraints(system, pdb, stiffness, restraint_set, exclude_residues)
integrator = openmm.LangevinIntegrator(0, 0.01, 0.0) integrator = openmm.LangevinIntegrator(0, 0.01, 0.0)
platform = openmm.Platform.getPlatformByName("CUDA" if use_gpu else "CPU") # platform = openmm.Platform.getPlatformByName("CUDA" if use_gpu else "CPU")
simulation = openmm_app.Simulation(pdb.topology, system, integrator, platform) simulation = openmm_app.Simulation(pdb.topology, system, integrator)
simulation.context.setPositions(pdb.positions) simulation.context.setPositions(pdb.positions)
ret = {} ret = {}
...@@ -536,7 +536,6 @@ def get_initial_energies( ...@@ -536,7 +536,6 @@ def get_initial_energies(
openmm_pdbs[0].topology, openmm_pdbs[0].topology,
system, system,
openmm.LangevinIntegrator(0, 0.01, 0.0), openmm.LangevinIntegrator(0, 0.01, 0.0),
openmm.Platform.getPlatformByName("CPU"),
) )
energies = [] energies = []
for pdb in openmm_pdbs: for pdb in openmm_pdbs:
......
...@@ -454,21 +454,21 @@ def inference_monomer_model(args): ...@@ -454,21 +454,21 @@ def inference_monomer_model(args):
with open(unrelaxed_output_path, 'w') as f: with open(unrelaxed_output_path, 'w') as f:
f.write(protein.to_pdb(unrelaxed_protein)) f.write(protein.to_pdb(unrelaxed_protein))
# amber_relaxer = relax.AmberRelaxation( amber_relaxer = relax.AmberRelaxation(
# use_gpu=True, use_gpu=True,
# **config.relax, **config.relax,
# ) )
# # Relax the prediction. # Relax the prediction.
# t = time.perf_counter() t = time.perf_counter()
# relaxed_pdb_str, _, _ = amber_relaxer.process(prot=unrelaxed_protein) relaxed_pdb_str, _, _ = amber_relaxer.process(prot=unrelaxed_protein)
# print(f"Relaxation time: {time.perf_counter() - t}") print(f"Relaxation time: {time.perf_counter() - t}")
# # Save the relaxed PDB. # Save the relaxed PDB.
# relaxed_output_path = os.path.join(args.output_dir, relaxed_output_path = os.path.join(args.output_dir,
# f'{tag}_{args.model_name}_relaxed.pdb') f'{tag}_{args.model_name}_relaxed.pdb')
# with open(relaxed_output_path, 'w') as f: with open(relaxed_output_path, 'w') as f:
# f.write(relaxed_pdb_str) f.write(relaxed_pdb_str)
if(args.save_outputs): if(args.save_outputs):
output_dict_path = os.path.join( output_dict_path = os.path.join(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment