Add ModelSEED-retrained dGPredictor as an additive reaction-energy source - #264
Merged
samseaver merged 1 commit intoAug 4, 2026
Conversation
…urce Records the dGPredictor group-contribution model retrained on the ModelSEED compound structures as its own per-method entry, "dGPredictor-ModelSEED", in each reaction's `thermodynamics` dict. Purely additive: it sits next to the Group contribution / eQuilibrator / (original KEGG-based) dGPredictor records, and the original "dGPredictor" entry is left untouched. The canonical deltag / deltagerr / reversibility are not changed, and no .tsv or compound files change. - New staged predictions: Biochemistry/Thermodynamics/dGPredictor/ modelseed_retrained_dG.json (31,924 reactions, kJ/mol). - New writer: Scripts/Thermodynamics/Update_Reaction_dGPredictor_ModelSEED_ Energies.py (kJ->kcal /4.184; operator via reversibility_from_energy). - 31,924 reactions gain a dGPredictor-ModelSEED record (incl. ~11,400 the original KEGG-based dGPredictor could not reach); 24,088 reactions unchanged. - Verified: every modified reaction differs from dev ONLY by the added dGPredictor-ModelSEED key; added values equal dG_mean/4.184; the writer is idempotent. - Docs: sources.yaml, Scripts/Thermodynamics/README.md, Rerun_Thermodynamics.sh. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
samseaver
pushed a commit
that referenced
this pull request
Aug 4, 2026
From freiburgermsu:promote-thermodynamics-to-canonical-deltag Two commits: 1. dGPredictor-ModelSEED additive source (already landed via #264; this branch was stacked on it). 2. Promotion: new Scripts/Thermodynamics/Promote_Reaction_Thermodynamics_to_Canonical.py re-aggregates the stored per-source estimates into the canonical top-level deltag/deltagerr/reversibility fields for 14,141 reactions that were missing them (Group contribution 1,474; dGPredictor 8,635; dGPredictor-ModelSEED 4,032). Selection policy: prefer mechanistic tier (eQuilibrator, GC) over ML tier (dGPredictor-ModelSEED, dGPredictor); within tier, lowest uncertainty. Guards reject implausible magnitudes (|dG| > 1000) and useless uncertainties (> 100 kcal/mol). Never overwrites existing canonical values. Notes ~732 reactions have >50 kcal/mol cross-source disagreement worth curator spot-check. Directly relevant to Papers/NAR_Update_2026 §6 (multi-source thermodynamics) -- the 'combined direction ledger' concept in the Methods draft IS this promotion pipeline. Conflict resolution: 34 reaction .tsv files conflicted between dev's regeneration and freiburgermsu's regeneration. Resolved by taking dev's side then regenerating all TSVs from the merged JSONs via Reprint_Biochemistry.py in the next commit. Co-Authored-By: Andrew Freiburger <freiburgermsu@gmail.com>
samseaver
pushed a commit
that referenced
this pull request
Aug 4, 2026
Fixes eQuilibrator retrieval scripts for equilibrator_api 0.6.x (API drift; module-level ccache singleton removed, ComponentContribution no longer takes reaction conditions as constructor kwargs). Re-runs the pipeline against updated ModelSEED structures. Coverage expansion in the pre-computed source tables: - MetaNetX_Compound_Energies.tbl: 20,828 -> 31,219 rows (+10,391 compounds) - MetaNetX_Reaction_Energies.tbl: 22,441 -> 27,022 rows (+4,581 reactions) - 16,412 reactions re-tagged EQP -> EQC / EQC -> EQP in notes to reflect the new per-reagent coverage. Andrew's commit explicitly notes: only the eQuilibrator energy tables and reaction notes change here; canonical deltag/deltagerr/reversibility and the additive thermodynamics dicts are untouched. Propagation into served compound_*.json and reaction_*.json records is a separate step, run in follow-up commits. Directly fills the compound-level coverage gap identified during audit of the post-#264/#265 dev state (30,479 non-R structured compounds, only 22,616 with any deltag before this branch). Conflict resolution: 61 reaction .tsv files conflicted between dev's TSVs and freiburgermsu's TSVs. Resolved by taking dev's side then regenerating all TSVs from the merged JSONs via Reprint_Biochemistry.py in the next commit. Co-Authored-By: Andrew Freiburger <freiburgermsu@aol.com> # Conflicts: # Biochemistry/reaction_00.tsv # Biochemistry/reaction_01.tsv # Biochemistry/reaction_02.tsv # Biochemistry/reaction_03.tsv # Biochemistry/reaction_04.tsv # Biochemistry/reaction_05.tsv # Biochemistry/reaction_06.tsv # Biochemistry/reaction_07.tsv # Biochemistry/reaction_08.tsv # Biochemistry/reaction_09.tsv # Biochemistry/reaction_10.tsv # Biochemistry/reaction_11.tsv # Biochemistry/reaction_12.tsv # Biochemistry/reaction_13.tsv # Biochemistry/reaction_14.tsv # Biochemistry/reaction_15.tsv # Biochemistry/reaction_16.tsv # Biochemistry/reaction_17.tsv # Biochemistry/reaction_18.tsv # Biochemistry/reaction_19.tsv # Biochemistry/reaction_20.tsv # Biochemistry/reaction_21.tsv # Biochemistry/reaction_22.tsv # Biochemistry/reaction_23.tsv # Biochemistry/reaction_24.tsv # Biochemistry/reaction_25.tsv # Biochemistry/reaction_26.tsv # Biochemistry/reaction_27.tsv # Biochemistry/reaction_28.tsv # Biochemistry/reaction_29.tsv # Biochemistry/reaction_30.tsv # Biochemistry/reaction_31.tsv # Biochemistry/reaction_32.tsv # Biochemistry/reaction_33.tsv # Biochemistry/reaction_34.tsv # Biochemistry/reaction_35.tsv # Biochemistry/reaction_36.tsv # Biochemistry/reaction_37.tsv # Biochemistry/reaction_38.tsv # Biochemistry/reaction_39.tsv # Biochemistry/reaction_40.tsv # Biochemistry/reaction_41.tsv # Biochemistry/reaction_42.tsv # Biochemistry/reaction_43.tsv # Biochemistry/reaction_44.tsv # Biochemistry/reaction_45.tsv # Biochemistry/reaction_46.tsv # Biochemistry/reaction_47.tsv # Biochemistry/reaction_48.tsv # Biochemistry/reaction_49.tsv # Biochemistry/reaction_50.tsv # Biochemistry/reaction_51.tsv # Biochemistry/reaction_52.tsv # Biochemistry/reaction_53.tsv # Biochemistry/reaction_54.tsv # Biochemistry/reaction_55.tsv # Biochemistry/reaction_56.tsv # Biochemistry/reaction_57.tsv # Biochemistry/reaction_58.tsv # Biochemistry/reaction_59.tsv # Biochemistry/reaction_60.tsv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the ModelSEED-retrained dGPredictor as its own additive per-method reaction-energy source,
dGPredictor-ModelSEED, alongside the existingGroup contribution/eQuilibrator/dGPredictorrecords. Purely additive — the original KEGG-baseddGPredictorrecord is left untouched, there are no canonicaldeltag/deltagerr/reversibilitychanges, and no.tsvor compound-file changes (thermodynamicsis a JSON-only field). This continues the additive per-source philosophy of #263.What this is
dGPredictor(Wang et al. 2021) as shipped underBiochemistry/Thermodynamics/dGPredictor/was trained on KEGG compound structures.dGPredictor-ModelSEEDis the same model retrained on the ModelSEED compound structures: every ModelSEED compound carrying a complete structure is re-decomposed into atom-centered fragments (radius 1 & 2), expanding the group vocabulary, and the BayesianRidge model is refit on the same 4,001 experimental measurements remapped into ModelSEED ID space. It predicts dG for 31,924 reactions (pH 7, I 0.25 M, 298.15 K), including ~11,400 reactions the original KEGG-based model could not reach (compounds with no KEGG cross-reference).Each reaction now carries both dGPredictor estimates side-by-side, e.g.
rxn00001:New-coverage reactions (e.g.
rxn00013) carry adGPredictor-ModelSEEDrecord where there is no originaldGPredictorone — and their canonicaldeltagis still left untouched.How
Biochemistry/Thermodynamics/dGPredictor/modelseed_retrained_dG.json—{rxn: {dG_mean, dG_uncer}}in kJ/mol, 31,924 reactions.Scripts/Thermodynamics/Update_Reaction_dGPredictor_ModelSEED_Energies.py— storesdGPredictor-ModelSEED [energy, error, operator](kJ→kcal/4.184); the operator is this estimate's own thermodynamic direction via the sharedreversibility_from_energy(). Added toRerun_Thermodynamics.sh.Data changed
dGPredictor-ModelSEEDrecord; 24,088 reactions unchanged.devonly by the addeddGPredictor-ModelSEEDkey (deep per-reaction JSON equality across all 56,012 reactions; 0 other-field changes), every added value equalsdG_mean/4.184, and re-running the writer is idempotent (byte-identical output). Zero changes to canonicaldeltag/deltagerr/reversibility/notes, the originaldGPredictorrecord, any other field, or any.tsv.Docs updated in
Scripts/Thermodynamics/README.mdandBiochemistry/Structures/sources.yaml.🤖 Generated with Claude Code