Skip to content

Commit

Permalink
Merge pull request #656 from OpenFreeEnergy/analysis_stdout_mash_fix
Browse files Browse the repository at this point in the history
update to use openfe_analysis 0.2.0+
  • Loading branch information
IAlibay authored Nov 23, 2023
2 parents 34f0bc6 + 86a7ebb commit 5ddaad2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dependencies:
- openff-units==0.2.0
- pint<0.22
- openff-models>=0.0.5
- openfe-analysis>=0.1.2
- openfe-analysis>=0.2.0
- click
- typing-extensions
- lomap2>=2.3.0
Expand Down
8 changes: 6 additions & 2 deletions openfe/protocols/openmm_rfe/equil_rfe_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -991,13 +991,17 @@ def run(self, *, dry=False, verbose=True,
def analyse(where) -> dict:
# don't put energy analysis in here, it uses the open file reporter
# whereas structural stuff requires that the file handle is closed
ret = subprocess.run(['openfe_analysis', str(where)],
analysis_out = where / 'structural_analysis.json'

ret = subprocess.run(['openfe_analysis', 'RFE_analysis',
str(where), str(analysis_out)],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
if ret.returncode:
return {'structural_analysis_error': ret.stderr}

data = json.loads(ret.stdout)
with open(analysis_out, 'rb') as f:
data = json.load(f)

savedir = pathlib.Path(where)
if d := data['protein_2D_RMSD']:
Expand Down
1 change: 1 addition & 0 deletions openfe/tests/protocols/test_openmm_rfe_slow.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ def test_openmm_run_engine(benzene_vacuum_system, platform,
nc = pur.outputs['nc']
assert nc == unit_shared / "simulation.nc"
assert nc.exists()
assert (unit_shared / "structural_analysis.json").exists()

# Test results methods that need files present
results = p.gather([r])
Expand Down

0 comments on commit 5ddaad2

Please sign in to comment.