Skip to content

Modelseed thermo - #63

Open
freiburgermsu wants to merge 3 commits into
EPFL-LCSB:masterfrom
freiburgermsu:modelseed-thermo
Open

freiburgermsu wants to merge 3 commits into
EPFL-LCSB:masterfrom
freiburgermsu:modelseed-thermo

Conversation

@freiburgermsu

Copy link
Copy Markdown

No description provided.

freiburgermsu and others added 3 commits September 17, 2026 15:20
symbol_sum built sympy expressions, but optlang uses symengine when it is
installed, so deepcopy of a model (copy(), relax_dgo) and JSON export
failed. It now uses optlang.symbolics.add.

Also: obj_to_dict read the objective's constant term as if it were a
variable coefficient; relax_dgo concatenated a model name of None; and
print_info read cobra's removed description attribute.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
pytfa.thermo.modelseed reads a local ModelSEEDDatabase clone and returns
a thermo_data dict, so ModelSEED models can be converted without the
bundled Alberty database. modelseedpy, if installed, only locates the
database: its biochemistry loader drops the per-source thermodynamics and
pkas fields that this needs.

The energies are the group contribution estimates, which are in the
convention pytfa's pH transform expects, unlike the eQuilibrator and
dGPredictor values, which are already transformed. Each is paired with
the protonation state the model uses, shifted along the compound's
(acidic) pKas so that its transformed energy is unchanged; using the
group contribution species directly made prepare() add protons to 376
reactions of a ModelSEED E. coli model.

The database has no structural cues, so two changes were needed in the
core: reaction errors combine the compound errors in quadrature, and
multi-compartment reactions are balanced with the c0 proton in ModelSEED
models. Building from the bundled database is unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
A community model has one cytosol per member, 'c1', 'c2', ..., and no 'c'
or 'c0' to balance a transport reaction with. prepare() now leaves the
transport compartment unset for such a model, and each reaction is
assigned the one compartment left once the extracellular ones are set
aside: its own member's cytosol. Its protons are then that member's, and
its membrane potential and pH are read from that member's compartment.

Models with a single cytosol are unaffected.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant