torchcell.metabolism.constraints.compare_reaction_delta_g
- compare_reaction_delta_g(gem: GemTensors) dict[str, Any][source]
Check the recomputed \(\Delta_r G'^\circ\) against the shipped column.
Two independent routes to the same quantity: sum the metabolite table over
S, or read the reaction table. Agreement is evidence the metabolite ids line up and the sentinel was handled; disagreement localizes the problem. This is a sanity check with a number attached, which is the only kind worth running.Returns a dict of counts and the residual distribution over the reactions where both routes have a value.