Torkel Loman in MATLAB Answers
最後のアクティビティ: 2022 年 8 月 4 日

I have an .sbml model I want to simulate using ssa. It works for small timespans, and when using ode simulations. However, in this example matlab simply crashes. Why is this? is there a way of preventing this? % Load model. model_egfr_net = sbmlimport('egfr_net.xml'); % Prepare model for SSA simulations. clean_ssa_sbml_model(model_egfr_net) cs = getconfigset(model_egfr_net); cs.SolverType = 'ssa'; cs.StopTime = 100.0; % Simulate model. [t, x, names] = sbiosimulate(model_egfr_net); I have attached the model. Also, per https://uk.mathworks.com/matlabcentral/answers/1582584-simbio-running-stochastic-ssa-simulation-of-sbml-imported-model the model has to be modified to enable ssa simulations. The attached function (used in the script) is provided here: function [] = clean_ssa_sbml_model(model) parameters = sbioselect(model, 'Type', 'parameter'); for paramIndex = 1:numel(parameters) parameter = parameters(paramIndex); [~, usageTable] = findUsages(parameter); % Update any reaction that uses this parameter in its rate. if isempty(usageTable) % if check added by Torkel. continue end reactions = usageTable.Component(usageTable.Property == "ReactionRate"); for reactionIndex = 1:numel(reactions) reaction = reactions(reactionIndex); oldRate = reaction.ReactionRate; kineticLaw = reaction.KineticLaw; if isempty(kineticLaw) % Add a kinetic law kineticLaw = addkineticlaw(reaction, 'MassAction'); else % Update the existing kinetic law to mass action kineticLaw.KineticLawName = 'MassAction'; end kineticLaw.ParameterVariableNames = parameter.Name; newRate = reaction.ReactionRate; if ~strcmp(oldRate, newRate) warning("Reaction rate for reaction %s changed from %s to %s.", ... reaction.Name, oldRate, newRate); end end end end
Jpk in MATLAB Answers
最後のアクティビティ: 2019 年 12 月 30 日

Dear all, I am working on some biochemical processes which are characterised by low numbers and are described by a non linear - i.e. non mass action - propensities (excuse me if my language may not be appropriate but I'm an engineer by training and not so familiar with chemistry). I need to use a stochastic solver (SSA) to simulate this process as I'm working with some effects which are visbile only with stochastic similation. Specifically, the processes I'm looking at is the following: 0 -k-> A A -GammaA*A-> 0 0 -R(A)-> B B -GammaB*-> 0 Where: A and B are species, K, GammaA, GammaB are positive constants and R(A) is a non linear (for instance a Hill) function. What I liked about the simbiology implementation of SSA - which would only work if R(A) is a linear funcition (i.e. mass action of first order: R*A) - is the speed at which the code manages to run at. Indeed, altough I have implemented my own version of SSA (Gillespies algorithm) it seems to be less efficient with respect to the simbiology implementation. As R(A) is non linear, from what I understand, it is not possible to simulate such process trough simbiology. Is there some work around for this? Have I understood correclty that the stochastic solver only works if the rates are linear? My version of the ssa solver can solve for non linear rates but not as fast as the simbiology version latough encompassing non linear propensities. Has anyody bee trough similar issues? Thank you al lin advance, G.