Asfe freesolv - #134
Conversation
…hemicalarchive to tags, and improve formatting for ASFEs
There was a problem hiding this comment.
Pull request overview
This PR finalizes an initial ASFE (absolute solvation free energy) submission workflow by extending the metadata-generation pipeline to better distinguish ASFE vs RBFE submissions, standardizing submission tags to reduce manual errors, and adding utilities/examples for plotting ASFE results.
Changes:
- Updated metadata generation to be more robust to missing mapping annotations and to emit a new
calculation_typefield insubmission.yaml. - Automated/enhanced tag generation (calculation mode, network mode, and protocol libraries) and updated default tags usage in example scripts.
- Added ASFE result processing/plotting support (
build_femap_from_absolute_results,_no_test_example_plot_asfe.py) and added/updated committed submission YAMLs.
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| openfe_benchmarks/scripts/prepare_metadata_submission.py | Adds ASFE-aware metadata behavior (calculation_type, tag enrichment) and handles missing trans.mapping. |
| openfe_benchmarks/scripts/_results_utils.py | Adds absolute-results FEMap builder for ASFE-style outputs and experimental-data augmentation. |
| openfe_benchmarks/scripts/_no_test_example_rbfe_asfe_submission.py | Updates example defaults to rely on auto-tagging; notes ASFE compatibility. |
| openfe_benchmarks/scripts/_no_test_example_plot_asfe.py | New example script to plot ASFE DGs vs experiment (requires newer cinnabar). |
| openfe_benchmarks/scripts/_no_test_example_mutlinetwork_rbfe_submission.py | Makes multinetwork example more generic and relies on auto-tagging. |
| openfe_benchmarks/results/2026-08-06-openff-2.3.0-solvation_set_freesolv/submission.yaml | New ASFE submission YAML including calculation_type. |
| openfe_benchmarks/results/2026-08_04-openff3.0.0-alpha1b_opc3-jacs/submission.yaml | Adds calculation_type to an RBFE submission YAML. |
| openfe_benchmarks/results/2026-06-22-tyk2-alchemicalarchive-test/submission.yaml | Adds calculation_type to an RBFE submission YAML. |
| openfe_benchmarks/results/2026-03-18-openmm-840-qa-testing/submission.yaml | Adds calculation_type to an RBFE submission YAML. |
| openfe_benchmarks/results/2026-02-12_sage_230_jacs/submission.yaml | Adds calculation_type to an RBFE submission YAML. |
| devtools/conda-envs/environment.yml | Renames the conda environment and notes cinnabar constraint. |
Suppressed comments (1)
openfe_benchmarks/scripts/prepare_metadata_submission.py:1766
metadata.calculation_modeis a string, so comparing it to a list will always be false. This makessmall_molecule_forcefield_yamlalways blank, even for RBFE/SepTop submissions.
if metadata.calculation_mode == ["rbfe", "septop"]:
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if solutes_no_uncertainty: | ||
| raise ValueError( | ||
| f"Not all solutes have dg_uncertainty for {system_group} {system_name}: {solutes_no_uncertainty}" | ||
| ) |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 16 changed files in this pull request and generated 1 comment.
Suppressed comments (3)
openfe_benchmarks/scripts/_results_utils.py:156
- The experimental data file is opened without a context manager, which can leak file descriptors in long-running workflows. Use a
with open(...)block when loading JSON.
experimental_file = benchmark_data.reference_data[
"experimental_solvation_free_energy_data"
]
experimental_data = json.load(open(experimental_file), cls=JSON_HANDLER.decoder)
n_experimental_points = 0
openfe_benchmarks/scripts/_no_test_example_plot_asfe.py:22
- Compression detection should use the path suffix rather than substring matching ("bz2" can appear elsewhere in the path). This makes loading behavior deterministic.
open_func = bz2.open if "bz2" in results_file else open
openfe_benchmarks/results/2026-08-06-openff-2.3.0-solvation_set_freesolv/submission.yaml:11
- Grammar: the summary says "1 unique solvents" but should be singular when the count is 1.
cofactors. The archive contains 603 edges across 603 unique solutes and 1 unique solvents. Results
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 16 changed files in this pull request and generated no new comments.
Suppressed comments (1)
openfe_benchmarks/scripts/_results_utils.py:145
- This comprehension accesses
result["ligand"]unconditionally, but the surrounding logic in this function is explicitly written to support both the new key layout (ligand+dg/dg_uncertainty) and the legacy layout (solute+estimate/estimate_error): the NaN check falls back toestimate_error, the value extraction below falls back toestimate, and_asfe_result_keyfalls back tosolute. For a legacy-format record (the exact case theestimate_errorbranch is meant to handle),result["ligand"]will raiseKeyErrorbefore that fallback is reached. Use the same solute-resolution helper here so the backward-compatibility handling is consistent.
result["ligand"]
** Do not merge until after #132 **
This PR completes our first ASFE submission. Luckily the
_no_test_example_rbfe_submission.pyworked perfectly, so renamed to_no_test_example_rbfe_asfe_submission.pyChanges include:
_no_test_example_rbfe_submission.pyto_no_test_example_rbfe_asfe_submission.pyprepare_metadata_submission.pyto auto populate "rbfe" vs "asfe", otherwise the only metadata field with this distinction is an optional tag.computational_results.json.bz2for ASFEs now aligns with keys used indgs of RBFEsopenfe_benchmarks/scripts/_no_test_example_plot_asfe.py. This cannot be tested because I cannot installcinnabar==0.6.1withpontibus==0.4.0andopenfe<1.9. I couldn't get this plotting to run withcinnabar==0.5.0. I believe this will be resolved when alchemiscale is updated.