pyenzyme.enzymeml.models.kineticmodel module#

pydantic model pyenzyme.enzymeml.models.kineticmodel.KineticModel[source]#

Bases: EnzymeMLBase

Show JSON schema
{
   "title": "KineticModel",
   "type": "object",
   "properties": {
      "name": {
         "title": "Name",
         "description": "Name of the kinetic law.",
         "type": "string"
      },
      "equation": {
         "title": "Equation",
         "description": "Equation for the kinetic law.",
         "type": "string"
      },
      "parameters": {
         "title": "Parameters",
         "description": "List of estimated parameters.",
         "type": "array",
         "items": {
            "$ref": "#/definitions/KineticParameter"
         }
      },
      "ontology": {
         "description": "Type of the estimated parameter.",
         "allOf": [
            {
               "$ref": "#/definitions/SBOTerm"
            }
         ]
      }
   },
   "required": [
      "name",
      "equation"
   ],
   "definitions": {
      "SBOTerm": {
         "title": "SBOTerm",
         "description": "String enumeration used to assign ontologies derived from SBOTerms.",
         "enum": [
            "SBO:0000176",
            "SBO:0000208",
            "SBO:0000181",
            "SBO:0000182",
            "SBO:0000179",
            "SBO:0000180",
            "SBO:0000209",
            "SBO:0000377",
            "SBO:0000177",
            "SBO:0000200",
            "SBO:0000672",
            "SBO:0000252",
            "SBO:0000251",
            "SBO:0000247",
            "SBO:0000327",
            "SBO:0000328",
            "SBO:0000336",
            "SBO:0000015",
            "SBO:0000011",
            "SBO:0000013",
            "SBO:0000020",
            "SBO:0000461",
            "SBO:0000462",
            "SBO:0000021",
            "SBO:0000296",
            "SBO:0000297",
            "SBO:0000607",
            "SBO:0000028",
            "SBO:0000025",
            "SBO:0000027",
            "SBO:0000186"
         ],
         "type": "string"
      },
      "KineticParameter": {
         "title": "KineticParameter",
         "type": "object",
         "properties": {
            "name": {
               "title": "Name",
               "description": "Name of the estimated parameter.",
               "type": "string"
            },
            "value": {
               "title": "Value",
               "description": "Numerical value of the estimated parameter.",
               "type": "number"
            },
            "unit": {
               "title": "Unit",
               "description": "Unit of the estimated parameter.",
               "type": "string"
            },
            "initial_value": {
               "title": "Initial Value",
               "description": "Initial value that was used for the parameter estimation.",
               "type": "number"
            },
            "upper": {
               "title": "Upper",
               "description": "Upper bound of the estimated parameter.",
               "type": "number"
            },
            "lower": {
               "title": "Lower",
               "description": "Lower bound of the estimated parameter.",
               "type": "number"
            },
            "is_global": {
               "title": "Is Global",
               "description": "Specifies if this parameter is a global parameter.",
               "default": false,
               "type": "boolean"
            },
            "stdev": {
               "title": "Stdev",
               "description": "Standard deviation of the estimated parameter.",
               "type": "number"
            },
            "constant": {
               "title": "Constant",
               "description": "Specifies if this parameter is constant",
               "default": false,
               "type": "boolean"
            },
            "ontology": {
               "description": "Type of the estimated parameter.",
               "allOf": [
                  {
                     "$ref": "#/definitions/SBOTerm"
                  }
               ]
            }
         },
         "required": [
            "name"
         ]
      }
   }
}

Config
  • validate_all: bool = True

  • validate_assignment: bool = True

Fields
field equation: str [Required]#

Equation for the kinetic law.

field name: str [Required]#

Name of the kinetic law.

field ontology: Optional[SBOTerm] = None#

Type of the estimated parameter.

field parameters: List[KineticParameter] [Optional]#

List of estimated parameters.

addParameter(name: str, value: Optional[float] = None, unit: Optional[str] = None, initial_value: Optional[float] = None, upper: Optional[float] = None, lower: Optional[float] = None, is_global: bool = False, stdev: Optional[float] = None, constant: bool = False, ontology: Optional[SBOTerm] = None)[source]#

Adds a parameter to the KineticModel object

Parameters
  • name (str) – Name of the estimated parameter.

  • value (Optional[float], optional) – Numerical value of the estimated parameter.. Defaults to None.

  • unit (Optional[str], optional) – Unit of the estimated parameter.. Defaults to None.

  • initial_value (Optional[float], optional) – Initial value that was used for the parameter estimation. Defaults to None.

  • upper (Optional[float], optional) – Upper bound of the estimated parameter.. Defaults to None.

  • lower (Optional[float], optional) – Lower bound of the estimated parameter.. Defaults to None.

  • is_global (bool, optional) – Specifies if this parameter is a global parameter.. Defaults to False.

  • stdev (Optional[float], optional) – Standard deviation of the estimated parameter.. Defaults to None.

  • constant (bool, optional) – Specifies if this parameter is constant. Defaults to False.

  • ontology (Optional[SBOTerm], optional) – Type of the estimated parameter.. Defaults to None.

static createGenerator(name: str, equation: str, **parameters)[source]#

Creates an abstract model generator to generated specific models.

Parameters
  • name (str) – Name of the model.

  • equation (str) – Equation

Returns

[description]

Return type

[type]

evaluate(**kwargs)[source]#

Calculates the the reaction velocity given the internal parameters and variable concentrations handed as keyword arguments.

Examples

model = KineticModel(…) <- Lets assume this is a Menten Model with already estimated parameters print(model.evaluate(protein=10.0, substrate=1.0))

>> 1.002 <- This is the resulting velocity

Returns

Corresponding reaction velocity given the internal parameters and variables.

Return type

float

classmethod fromEquation(name: str, equation: str, enzmldoc: Optional[Any] = None)[source]#

Creates a Kinetic Model instance from an equation

Parameters

equation (str) – Mathematical equation decribing the model.

Returns

Resulting kinetic model

Return type

KineticModel

getEquation()[source]#

Deprecated since version Use: the attribute equation instead.

getName()[source]#

Deprecated since version Use: the attribute name instead.

getParameter(name: str) KineticParameter[source]#

Returns a parameter of choice from the model.

Parameters

name (str) – Name of the parameter.

Raises

KeyError – If the parameter does not exist.

Returns

The desired parameter.

Return type

KineticParameter

getParameters()[source]#

Deprecated since version Use: the attribute parameters instead.

get_id() str[source]#
pydantic model pyenzyme.enzymeml.models.kineticmodel.KineticParameter[source]#

Bases: EnzymeMLBase

Show JSON schema
{
   "title": "KineticParameter",
   "type": "object",
   "properties": {
      "name": {
         "title": "Name",
         "description": "Name of the estimated parameter.",
         "type": "string"
      },
      "value": {
         "title": "Value",
         "description": "Numerical value of the estimated parameter.",
         "type": "number"
      },
      "unit": {
         "title": "Unit",
         "description": "Unit of the estimated parameter.",
         "type": "string"
      },
      "initial_value": {
         "title": "Initial Value",
         "description": "Initial value that was used for the parameter estimation.",
         "type": "number"
      },
      "upper": {
         "title": "Upper",
         "description": "Upper bound of the estimated parameter.",
         "type": "number"
      },
      "lower": {
         "title": "Lower",
         "description": "Lower bound of the estimated parameter.",
         "type": "number"
      },
      "is_global": {
         "title": "Is Global",
         "description": "Specifies if this parameter is a global parameter.",
         "default": false,
         "type": "boolean"
      },
      "stdev": {
         "title": "Stdev",
         "description": "Standard deviation of the estimated parameter.",
         "type": "number"
      },
      "constant": {
         "title": "Constant",
         "description": "Specifies if this parameter is constant",
         "default": false,
         "type": "boolean"
      },
      "ontology": {
         "description": "Type of the estimated parameter.",
         "allOf": [
            {
               "$ref": "#/definitions/SBOTerm"
            }
         ]
      }
   },
   "required": [
      "name"
   ],
   "definitions": {
      "SBOTerm": {
         "title": "SBOTerm",
         "description": "String enumeration used to assign ontologies derived from SBOTerms.",
         "enum": [
            "SBO:0000176",
            "SBO:0000208",
            "SBO:0000181",
            "SBO:0000182",
            "SBO:0000179",
            "SBO:0000180",
            "SBO:0000209",
            "SBO:0000377",
            "SBO:0000177",
            "SBO:0000200",
            "SBO:0000672",
            "SBO:0000252",
            "SBO:0000251",
            "SBO:0000247",
            "SBO:0000327",
            "SBO:0000328",
            "SBO:0000336",
            "SBO:0000015",
            "SBO:0000011",
            "SBO:0000013",
            "SBO:0000020",
            "SBO:0000461",
            "SBO:0000462",
            "SBO:0000021",
            "SBO:0000296",
            "SBO:0000297",
            "SBO:0000607",
            "SBO:0000028",
            "SBO:0000025",
            "SBO:0000027",
            "SBO:0000186"
         ],
         "type": "string"
      }
   }
}

Config
  • validate_all: bool = True

  • validate_assignment: bool = True

Fields
field constant: bool = False#

Specifies if this parameter is constant

field initial_value: Optional[float] = None#

Initial value that was used for the parameter estimation.

field is_global: bool = False#

Specifies if this parameter is a global parameter.

field lower: Optional[float] = None#

Lower bound of the estimated parameter.

field name: str [Required]#

Name of the estimated parameter.

field ontology: Optional[SBOTerm] = None#

Type of the estimated parameter.

field stdev: Optional[float] = None#

Standard deviation of the estimated parameter.

field unit: Optional[str] = None#

Unit of the estimated parameter.

field upper: Optional[float] = None#

Upper bound of the estimated parameter.

field value: Optional[float] = None#

Numerical value of the estimated parameter.

get_id()[source]#

For logging. Dont bother.

unitdef()[source]#

Returns the appropriate unitdef if an enzmldoc is given

update(**kwargs)[source]#

Adds attributes to this parameter based in kwargs

class pyenzyme.enzymeml.models.kineticmodel.ModelFactory(name: str, equation: str, ontology: Optional[SBOTerm] = None, **parameters)[source]#

Bases: object

equation: str#
name: str#
parameters: List[str]#
static parse_equation(equation: str)[source]#