From f99bec8545cbecbf18570442d532db6f0aabbbb5 Mon Sep 17 00:00:00 2001 From: richard gowers Date: Thu, 9 Nov 2023 08:19:34 +0000 Subject: [PATCH] fixes issue #618 openfe gather will not correctly report DDG hydration values --- openfecli/commands/gather.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/openfecli/commands/gather.py b/openfecli/commands/gather.py index ab6a879e4..1905e971c 100644 --- a/openfecli/commands/gather.py +++ b/openfecli/commands/gather.py @@ -171,16 +171,13 @@ def _get_ddgs(legs, error_on_missing=True): def _write_ddg(legs, writer, allow_partial): DDGs = _get_ddgs(legs, error_on_missing=not allow_partial) writer.writerow(["ligand_i", "ligand_j", "DDG(i->j) (kcal/mol)", - "uncertainty (kcal/mol)"]) + "uncertainty (kcal/mol)"]) for ligA, ligB, DDGbind, bind_unc, DDGhyd, hyd_unc in DDGs: - name = f"{ligB}, {ligA}" if DDGbind is not None: - DDGbind, bind_unc = format_estimate_uncertainty(DDGbind, - bind_unc) + DDGbind, bind_unc = format_estimate_uncertainty(DDGbind, bind_unc) writer.writerow([ligA, ligB, DDGbind, bind_unc]) if DDGhyd is not None: - DDGhyd, hyd_unc = format_estimate_uncertainty(DDGbind, - bind_unc) + DDGhyd, hyd_unc = format_estimate_uncertainty(DDGhyd, hyd_unc) writer.writerow([ligA, ligB, DDGhyd, hyd_unc]) @@ -188,7 +185,6 @@ def _write_dg_raw(legs, writer, allow_partial): writer.writerow(["leg", "ligand_i", "ligand_j", "DG(i->j) (kcal/mol)", "uncertainty (kcal/mol)"]) for ligpair, vals in sorted(legs.items()): - name = ', '.join(ligpair) for simtype, (m, u) in sorted(vals.items()): if m is None: m, u = 'NaN', 'NaN' @@ -255,7 +251,7 @@ def _write_dg_mle(legs, writer, allow_partial): ) @click.argument('rootdir', type=click.Path(dir_okay=True, file_okay=False, - path_type=pathlib.Path), + path_type=pathlib.Path), required=True) @click.option( '--report', @@ -317,7 +313,7 @@ def gather(rootdir, output, report, allow_partial): if result is None: continue elif result['estimate'] is None or result['uncertainty'] is None: - click.echo(f"WARNING: Calculations for {result_fn} did not finish succesfully!", + click.echo(f"WARNING: Calculations for {result_fn} did not finish successfully!", err=True) try: