-
Notifications
You must be signed in to change notification settings - Fork 70
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
Odd behavior when modeling second order reaction with one species #572
Comments
Hi there. This actually has to do with how PySB (or more accurately, BioNetGen) handles symmetry in rules. Basically, for every rule, two symmetry factors are calculated: a "multiplicity factor", The multiplicity factor has to do with the combinatorics of the reactant species. For example, in a rule like The path factor has to do with how many alternate paths exist for converting the reactants in a rule into the products. For example, in a rule like Finally, the reason the two rules BTW, you can see the rate expressions for all reactions, including the multiplicity factors, by printing the reactions to the screen. After the simulation completes, just include in your code:
Each reaction is a dictionary. There should be an entry called I hope this helps. If have any additional questions, just let us know. --Leonard |
Ah, thanks very much for clarifying, I was unaware of the multiplicity and path factors. So hypothetically, if I were to build a model using experimentally determined rate constants, is it possible that the simulation could underestimate the rate by applying an extra multiplicity factor, since experimentally, you're typically limited to measuring the "effective" rate constant with the multiplicity information implicitly accounted for? |
Yes, that’s correct. The rate constants in a PySB model are what we call “instance rates”, i.e., the rate at which one instance of a rule occurs. In this case, the rate at which one A() molecule degrades or the rate at which any particular pair of A() or B() molecules react. Experimentally, it’s not always possible to measure these rates, as you said. So, it’s definitely something to be aware of. |
Hi,
I'm running into a very strange issue when trying to model a second order reaction that contains only one species, wondering if I could get some help. Specifically, I'm comparing the following reactions:
What's odd to me is when I run both reactions and plot concentration over time I get exactly overlapping curves. I used the following code:
I get the following plot:
This obviously seems incorrect to me, since the two reactions are clearly not the same. The rate of change of the first reaction should in theory be half of the second since you're generating A half as fast as you're depleting it based on the stoichiometry.
Curiously though, I did a follow-up sanity check and added in an intermediate species to turn the second reaction into a two-step reaction:
A + A -> A', k=1.3
A' -> A, k=10000
where in this case the A' is being converted infinitely fast back into A, so it's functionally equivalent to A + A -> A, I get different, seemingly correct kinetics.
I'm wondering, am I defining the reaction incorrectly to begin with? Is it not possible to write a reaction like this with one species? Thanks very much for the help!
The text was updated successfully, but these errors were encountered: