RuleWorld / bionetgen

Rule-based modeling framework
https://bionetgen.org/
MIT License
56 stars 25 forks source link

SBML export of symbolic rateLaws #272

Closed paulflang closed 5 months ago

paulflang commented 5 months ago

I just came across a model that does something like

begin model
begin parameters

k1 1
k2 2

end parameters

begin molecule types

A()
B()

end molecule types

begin seed species

A() 1
B() 0

end seed species

begin reaction rules

Rule1: A() -> B()  k1*k2  # Causes trouble

end reaction rules

end model

generate_network({overwrite=>1})

writeSBML()

Unfortunately, the SBML export is invalid. While a initialAssignment with id of _rateLaw1 is specified for the expression k1*k2, _rateLaw1 needs to be defined (e.g. as parameter), so that there is something the initial assignment can assign the value k1*k2 to (see attached files; sorry had to change the ending for upload here)

cc @NikosMemmos

model_sbml.txt model_sbml_corrected.txt

jrfaeder commented 5 months ago

Hi @paulflang,

Thanks very much for reporting this. This problem has been reported previously in issue #271, which has been closed. Unfortunately, you are still seeing the problem because the updated code is not yet included in the latest release, which we plan to make in the coming weeks. I would also like to implement a fix for #270 and some other issues we have identified in PyBioNetGen.

jrfaeder commented 5 months ago

Previously reported as #271