Including volume programmatically with unknown kinetic laws:
Latest activity Reply by Jeremy Huard
on 21 Aug 2023
Hi all,
I've translated a model from another piece of software (monolix) into simbio programmatically to make use of your very easy global sensitivity analysis system.
It looks a little something like this, for a 'single' line example:
r1 = addreaction(model,'InsI -> InsP');
r1.ReactionRate = 'InsI*kip/vi'; %- is + panc
k1 = addkineticlaw(r1, 'Unknown');
Multiplied about 20 fold, as you can see I have included my volumes within the reaction rates myself (vi). The model functions perfectly and I have corrected the outputs at the end:
[time, x, names] = sbiosimulate(model,csObj,dObj1);
x(:,1) = x(:,1)/vi;
So that they are in concentration, as needed. However, when it comes to sensitivity analysis because I have corrected them post-model it is technically incorrect, it is analysing the absolute quantities. This is quite noticible in the sensitivity to the volumes.
Is there an easy fix to this, I've had to fight dimensionality with units in the past using simbio and I'd be great if there was some way of dividing a compartment output by a volume, for example. It is a functionality that exists in monolix, so I was hopeful it might here!
Thank you for your time.
EDIT:
I think I've worked it out, I had to refactor my model to operate in concentrations, just refitting it now. Now I should just be able to use unitless compartments.
3 Comments
Time DescendingIt is fine in SimBiology to have species in units of concentration and others in units of amount.
SimBiology will take care of volume scaling whenever needed and will give you back the results in the units you have chosen.
So, in your case you can use a MassAction kinetic law without issue:
r1 = addreaction(model,'InsI -> InsP');
k1 = r1.addkineticlaw('MassAction');
k1.ParameterVariableNames = {'kip'};
model.getequations() % to visualize the ODEs with volume scaling
csObj.CompileOptions.UnitConversion = true;
Please note that turning on Unit Coinversion will automatically activate Dimensional Analysis.
Finally, in cases where you need an output in a different unit as the one used in the model, you can define an Observable with the requested unit. Observables are parts of the model and can be used as outputs of a Global Sensitivity Analysis.
Best,
Jérémy
Sign in to participate