RuleWorld / bionetgen

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

Deleting a dangling bond should throw exception #180

Closed cihankayacihan closed 2 years ago

cihankayacihan commented 7 years ago

This should not be allowed: A(a!1).B(a!1,c!+,c!+) -> A(a) + B(a,c!+,c) + C(b)

It is not changing state of B and creating a molecule C.

lh64 commented 7 years ago

This isn't a dangling bond, but BNG doesn't seem to be processing the rule correctly. When I run 'writeNetwork({overwrite=>1, include_model=>1})', I get the following in the 'reaction rules' block of the NET file (see attached):

_R1: A(a!1).B(a!1,c!+,c!+) -> A(a) + B(a,c!+,c) + C(b) _rateLaw1

Add Species C(b)

Unbind(0.0.0,0.1.0)

BNG is creating C(b) and breaking the A(a!1).B(a!1) bond but is ignoring the bond wildcard in the B molecule that isn't repeated from reactants to products. I believe that unspecified bonds (i.e., ones using the !+ wildcard) cannot be broken in BNG. So this should throw an error.

break_unspecified_bond.net.txt