Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with reversible synth/deg rules #10

Open
lh64 opened this issue Jun 19, 2015 · 3 comments
Open

Problems with reversible synth/deg rules #10

lh64 opened this issue Jun 19, 2015 · 3 comments
Assignees
Labels

Comments

@lh64
Copy link

lh64 commented Jun 19, 2015

The reversible synthesis/degradation rule

 Rule('synth_deg', A() <> None, k_deg, k_synth)

should produce the following pair of BNGL rules:

 synth_deg_forward:  A() -> __sink()    k_deg 
 synth_deg_reverse:  __source() -> A() + __source()    k_synth

However, it instead produces the single BNGL rule

 synth_deg:  A() <-> __sink()    k_deg, k_synth

This is obviously a problem since the synthesis rate erroneously depends on the concentration of the dummy species __sink().

Furthermore, reversing the order of the reactant and product in the rule, i.e.,

 Rule('synth_deg', None <> A(), k_synth, k_deg)

leads to the erroneous BNGL rule

 synth_deg:  A() <-> __sink()    k_synth, k_deg

where the reactant and product have been swapped but the rate constants have not.

These problems can be avoided by writing the synthesis and degradation rules as separate unidirectional rules or by using the macro 'synthesize_degrade_table([[A(), k_synth, k_deg]])'. Nevertheless, it makes sense to fix these problems. The best solution is probably to replace the __source() and __sink() species with BNG's null symbol '0'. This would avoid the need for any special handling in cases like this.

@alubbock
Copy link

alubbock commented Dec 2, 2017

@lh64 This has changed with pysb#317. Your synth/deg example above now gives the single BNGL rule:

  synth_deg:  A() <-> 0    k_deg, k_synth

If that's correct, we can close the ticket. One slight issue is that it doesn't get detected as a zero-order synthesis rule, so PySB needs an initial for A(), or it won't generate the network (assuming no other rules in the system). Is that something that needs changing?

@lh64
Copy link
Author

lh64 commented Dec 2, 2017

Is it a PySB issue or a BNG issue? What happens if you write it as two separate rules: 0 >> A() and A() >> 0? Do you need an initial on A() in that case? I think BNG will generate a network in that case but I’m not certain. If it does, I’m not sure why it doesn’t if the rule is reversible.

@alubbock
Copy link

alubbock commented Dec 4, 2017

It's a PySB issue. Rule.is_synth() and Rule.is_deg() weren't working properly for reversible rules. I've submitted a PR to fix it here: pysb#326

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants