Skip to content

Commit

Permalink
Use .gro file from previous step
Browse files Browse the repository at this point in the history
  • Loading branch information
hannahbaumann committed Sep 23, 2024
1 parent b0236ea commit 557c453
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions openfe_gromacs/protocols/gromacs_md/md_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -1111,7 +1111,6 @@ def _execute(
]
tpr = pathlib.Path(ctx.shared / output_settings_em.tpr_file)
assert len(mdp) == 1
# ToDo: If no traj should be written out, don't write empty file?
self._run_gromacs(
mdp[0],
input_gro,
Expand All @@ -1138,11 +1137,14 @@ def _execute(
]
tpr = pathlib.Path(ctx.shared / output_settings_nvt.tpr_file)
assert len(mdp) == 1
# ToDo: Change .gro to output from EM if we do EM first,
# else original .gro file
# If EM was run, use the output from that to run NVT MD
if sim_settings_em.nsteps > 0:
gro = pathlib.Path(ctx.shared / output_settings_em.gro_file)
else:
gro = input_gro
self._run_gromacs(
mdp[0],
input_gro,
gro,
input_top,
tpr,
output_settings_nvt.gro_file,
Expand All @@ -1165,9 +1167,20 @@ def _execute(
]
tpr = pathlib.Path(ctx.shared / output_settings_npt.tpr_file)
assert len(mdp) == 1
# If EM and/or NVT MD was run, use the output coordinate file
# from that to run NPT MD
if sim_settings_em.nsteps > 0:
if sim_settings_nvt.nsteps > 0:
gro = pathlib.Path(
ctx.shared / output_settings_nvt.gro_file)
else:
gro = pathlib.Path(
ctx.shared / output_settings_em.gro_file)
else:
gro = input_gro
self._run_gromacs(
mdp[0],
input_gro,
gro,
input_top,
tpr,
output_settings_npt.gro_file,
Expand Down

0 comments on commit 557c453

Please sign in to comment.