Search in sources :

Example 46 with ModelParameter

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();
    }
}
Also used : ModelParameter(cbit.vcell.model.Model.ModelParameter) KineticsParameter(cbit.vcell.model.Kinetics.KineticsParameter) NameScope(cbit.vcell.parser.NameScope) Expression(cbit.vcell.parser.Expression) ReactionStep(cbit.vcell.model.ReactionStep) HMM_REVKinetics(cbit.vcell.model.HMM_REVKinetics) Catalyst(cbit.vcell.model.Catalyst) ExpressionException(cbit.vcell.parser.ExpressionException)

Aggregations

ModelParameter (cbit.vcell.model.Model.ModelParameter)46 Expression (cbit.vcell.parser.Expression)28 SpeciesContext (cbit.vcell.model.SpeciesContext)25 KineticsParameter (cbit.vcell.model.Kinetics.KineticsParameter)24 Model (cbit.vcell.model.Model)19 ReactionStep (cbit.vcell.model.ReactionStep)19 ExpressionException (cbit.vcell.parser.ExpressionException)16 Structure (cbit.vcell.model.Structure)15 PropertyVetoException (java.beans.PropertyVetoException)14 ModelUnitSystem (cbit.vcell.model.ModelUnitSystem)13 Parameter (cbit.vcell.model.Parameter)12 ArrayList (java.util.ArrayList)12 SpeciesContextSpecParameter (cbit.vcell.mapping.SpeciesContextSpec.SpeciesContextSpecParameter)11 VCUnitDefinition (cbit.vcell.units.VCUnitDefinition)11 LocalParameter (cbit.vcell.mapping.ParameterContext.LocalParameter)10 Vector (java.util.Vector)10 SpeciesContextSpec (cbit.vcell.mapping.SpeciesContextSpec)9 BioModel (cbit.vcell.biomodel.BioModel)8 StructureMapping (cbit.vcell.mapping.StructureMapping)8 Kinetics (cbit.vcell.model.Kinetics)8