SBMLToolkit.jl icon indicating copy to clipboard operation
SBMLToolkit.jl copied to clipboard

Identify mass action rate laws in reactions with reactant stoichiometry of 2 or higher in models with stochastic description

Open paulflang opened this issue 2 years ago • 1 comments

What we currently do to identify mass action kinetics is that we divide the kinetic law by the product of the reactants to the power of their stoichiometries. And if all that is left is an expression of parameters and Real numbers, we say it is a mass action rate law. For mass action rate laws we use_only_rate=false.

But for a stochastic rate law in the form of k*P*(P-1)/2! we would not detect that it is mass action and use_only_rate=true. @isaacsas pointed out that

combinatoric_ratelaws doesn't matter in that case, as it is ignored with only_use_rate=true. Unfortunately, it would also be less performant if the user was trying to simulate a jump model since it means using ConstantRateJumps instead of MassActionJumps to represent the reaction for DiffEqJump.

and suggested to

trying to divide by the stochastic rate law term if dividing by the ODE rate law doesn't give a species-independent expression, and only if both those fail going with only_use_rate=true.

paulflang avatar May 30 '22 14:05 paulflang

Relevant sections from the SBML specs:

One of the purposes of SBO annotations (Section 5 on p. 91) is to enable such interpretation without the need for deduction. However, the interpretation of the model is essentially the same irrespective of whether the model is to be simulated in a deterministic or stochastic manner

Taking the first reaction as an example, the rate law is c1P(P − 1)/2 reaction events per second. In the continuous deterministic case, the interpretation of this is that the extent of the reaction in time dt is [c1P(P − 1)/2]dt (and this leads naturally to the usual ODE formulation of the model). In the stochastic case, the interpretation is that the propensity (or rate, or hazard) of the reaction is c1P(P − 1)/2.

paulflang avatar May 30 '22 14:05 paulflang