use of cbit.vcell.model.Model.ModelParameter in project vcell by virtualcell.
the class SBPAXHMMRevLawBuilder method addKinetics.
public void addKinetics(KineticContext context) {
try {
ReactionStep reaction = context.getReaction();
HMM_REVKinetics kinetics = new HMM_REVKinetics((SimpleReaction) reaction);
NameScope modelScope = reaction.getModel().getNameScope();
ModelParameter kMichaelisFwd = context.getParameter(SBOList.MICHAELIS_CONST_FORW);
if (kMichaelisFwd != null) {
KineticsParameter kmfParameter = kinetics.getKmFwdParameter();
kmfParameter.setExpression(new Expression(kMichaelisFwd, modelScope));
kmfParameter.setUnitDefinition(kMichaelisFwd.getUnitDefinition());
}
ModelParameter kcatf = context.getParameter(SBOList.CATALYTIC_RATE_CONST_FORW);
if (kcatf != null && context.getCatalysts().size() == 1) {
KineticsParameter vmaxfParameter = kinetics.getVmaxFwdParameter();
Catalyst catalyst = context.getCatalysts().iterator().next();
vmaxfParameter.setExpression(Expression.mult(new Expression(kcatf, modelScope), new Expression(catalyst.getSpeciesContext(), modelScope)));
// vmaxParameter.setUnitDefinition(vMax.getUnitDefinition());
} else {
ModelParameter vMaxf = context.getParameter(SBOList.MAXIMAL_VELOCITY_FORW);
if (vMaxf != null) {
KineticsParameter vmaxfParameter = kinetics.getVmaxFwdParameter();
vmaxfParameter.setExpression(new Expression(vMaxf, modelScope));
vmaxfParameter.setUnitDefinition(vMaxf.getUnitDefinition());
}
}
ModelParameter kMichaelisRev = context.getParameter(SBOList.MICHAELIS_CONST_REV);
if (kMichaelisRev != null) {
KineticsParameter kmrParameter = kinetics.getKmRevParameter();
kmrParameter.setExpression(new Expression(kMichaelisRev, modelScope));
kmrParameter.setUnitDefinition(kMichaelisRev.getUnitDefinition());
}
ModelParameter kcatr = context.getParameter(SBOList.CATALYTIC_RATE_CONST_FORW);
if (kcatr != null && context.getCatalysts().size() == 1) {
KineticsParameter vmaxrParameter = kinetics.getVmaxRevParameter();
Catalyst catalyst = context.getCatalysts().iterator().next();
vmaxrParameter.setExpression(Expression.mult(new Expression(kcatr, modelScope), new Expression(catalyst.getSpeciesContext(), modelScope)));
// vmaxParameter.setUnitDefinition(vMax.getUnitDefinition());
} else {
ModelParameter vMaxr = context.getParameter(SBOList.MAXIMAL_VELOCITY_REV);
if (vMaxr != null) {
KineticsParameter vmaxrParameter = kinetics.getVmaxRevParameter();
vmaxrParameter.setExpression(new Expression(vMaxr, modelScope));
vmaxrParameter.setUnitDefinition(vMaxr.getUnitDefinition());
}
}
} catch (ExpressionException e) {
e.printStackTrace();
}
}
Aggregations