Repository navigation
Rule-based applications: use the stored math in vcml_to_ode_input (0.0.21) - #28
Merged
Merged
Conversation
vcml_to_ode_input regenerated every application's math (BioModel.updateAll),
which fails for a rule-based application: VCell expands its reaction rules
into a network with BioNetGen (BNG2.pl from a VCell installation), which
libvcell does not have ("required System property vcell.installDir not
defined"). It also made any rule-based application in a document break the
input of every other simulation in it.
Now only the simulation's own application is regenerated, and for a
rule-based one (VCell's NetworkTransformer applies: enabled reaction rules)
the math stored in the document is used, with a warning: the network VCell
generated when the model was saved, which is what the VCell server runs for
a saved simulation. In a 2,730-model VCell corpus, 109 of the 1,411 models
with ODE simulations (8%) have reaction rules, and every one stores math.
Checked against BioNetGen 2.9.3 (PyPI bionetgen, as a stand-in VCell
installation) on 25 of them: the regenerated networks are the same (same
equations and expressions) in all 25; 8 give identical solver input and the
others differ only by Avogadro's number, which VCell has since changed from
6.02e23 to 6.02214179e23 (a 0.036% change in rates that sensitive models
amplify). The stored math reproduces the model as VCell computed it then.
Tests: a Java and a Python test (the Python one solves the input) on public
BioModel 100992568 ("CompartmentTransport", one reaction rule), downloaded
anonymously from the VCell API; MainRecorder exercises the path.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rsion 0.0.21
SolverUtils.vcmlToOdeInput returns an OdeInput record (the input file, and
whether the document's stored math was used); the entry point's success
message is the input file's name, followed by "; stored math (rule-based
application: BioNetGen ... is not available in libvcell)" when it was.
Input file names have no ";", so message.split(";")[0] is the name; a
regenerated simulation's message is just the name, as in 0.0.20.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
vcml_to_ode_inputcouldn't convert a simulation in a rule-based application. VCell expands reaction rules into a reaction network with BioNetGen, and BioNetGen runsBNG2.plfrom a VCell installation, which libvcell doesn't have. The failure surfaced asrequired System property "vcell.installDir" not defined.It also regenerated every application's math (
BioModel.updateAll), so a single rule-based application broke the input of every other simulation in the same document.Change
NetworkTransformerapplies, i.e. the application has enabled reaction rules. The stored math is the network VCell generated when the model was saved, and it's what the VCell server runs for a saved simulation."<input file>; stored math (rule-based application: BioNetGen, which would regenerate its reaction network, is not available in libvcell)". Input file names have no;, somessage.split(";")[0]is the name. A regenerated simulation's message is just the name, as in 0.0.20. In Java,SolverUtils.vcmlToOdeInputreturns anOdeInput(inputFile, usedStoredMath)record.How much it matters, and whether the stored math is right
Scale: in a 2,730-model VCell corpus, 109 of the 1,411 models with ODE simulations (8%) have reaction rules, and every one stores math. Before this change, all of them failed.
Checked against BioNetGen 2.9.3 (PyPI
bionetgen, as a stand-in VCell installation) by regenerating 25 of them and comparing solver input:So the stored math reproduces the model as VCell computed it when it was saved. Very sensitive models amplify that 0.036% difference, so a result from stored math is "the model as saved", not "regenerated by today's VCell". That's what the message note is for.
Tests
usedStoredMath.SolverEntrypointsTestgives 23/23.pyvcell-odesolver. 28/28 pass locally on a fresh native build.MainRecorderexercises the path for native-image.make checkis clean.Follow-ups
simulate_ode_vcmlalready takes the name before the;(feat: run non-spatial simulations on VCell's Sundials ODE solver (simulate_ode) pyvcell#65).vcml_to_finite_volume_inputstill regenerates every application. It has the same problem when a rule-based application is in the document; that's for a separate change.pyproject.tomlis at 0.0.21.🤖 Generated with Claude Code