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.csvandmodel_rxnDeltaG.csv, the filescode/missingFields/loadDeltaG.muses to populate the model’smetDeltaG/rxnDeltaGfields. 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]ors_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/andmodel/).met_ids – Metabolite ids in tensor-index order.
rxn_ids – Reaction ids in tensor-index order.
- Returns:
A
ThermoTablealigned tomet_ids/rxn_ids, with coverage masks.