torchcell.metabolism.constraints.load_thermo_table

load_thermo_table(model_dir: str, met_ids: list[str], rxn_ids: list[str]) → ThermoTable[source]

Load \(\Delta_f G'^\circ\) / \(\Delta_r G'^\circ\) from a GEM checkout.

Reads <model_dir>/data/databases/model_metDeltaG.csv and model_rxnDeltaG.csv, the files code/missingFields/loadDeltaG.m uses to populate the model’s metDeltaG / rxnDeltaG fields. These are absent from the SBML export, which is why loading the GEM through cobra alone yields no thermodynamics.

Metabolite ids in the CSV are bare (s_0001) while a cobra SBML model compartmentizes them (s_0001[c] or s_0001_c); the compartment tag is stripped for matching and the compartment is otherwise ignored, because the shipped table is per-species and carries no compartment-specific transform.

Parameters:
  • model_dir – The GEM checkout root (the directory containing data/ and model/).

  • met_ids – Metabolite ids in tensor-index order.

  • rxn_ids – Reaction ids in tensor-index order.

Returns:

A ThermoTable aligned to met_ids / rxn_ids, with coverage masks.