Skip to content
Preview.sbml@modelscript/sbml 10 diagnostic rules
Parser WASM GLR
Diagnostics 10 rules
DAE Arena Lowering
Simulation Native Solvers
Projections Modelica
Live ExampleEnzymeFeedbackPathway.sbml

SBML Level 3 Enzymatic Cascade & Allosteric Feedback

Systems Biology Markup Language model defining cytosolic species (Glucose, G6P, Pyruvate, ATP) and reversible Michaelis-Menten reactions.

Playground
Source (28 lines)
1<?xml version="1.0" encoding="UTF-8"?>
2<sbml xmlns="http://www.sbml.org/sbml/level3/version2/core" level="3" version="2">
3  <model id="GlycolyticCascade" name="Glycolytic Pathway Cascade">
4    <listOfCompartments>
5      <compartment id="cytosol" name="Cytosol" size="1.0" constant="true" />
6    </listOfCompartments>
7    <listOfSpecies>
8      <species id="GLC" name="Glucose" compartment="cytosol" initialConcentration="8.0" />
9      <species id="G6P" name="Glucose-6-P" compartment="cytosol" initialConcentration="1.2" />
10      <species id="FBP" name="Fructose-1,6-BP" compartment="cytosol" initialConcentration="0.6" />
11      <species id="PYR" name="Pyruvate" compartment="cytosol" initialConcentration="0.4" />
12    </listOfSpecies>
13    <listOfReactions>
14      <reaction id="R_HK" name="Hexokinase" reversible="false">
15        <listOfReactants><speciesReference species="GLC" stoichiometry="1" /></listOfReactants>
16        <listOfProducts><speciesReference species="G6P" stoichiometry="1" /></listOfProducts>
17      </reaction>
18      <reaction id="R_PFK" name="Phosphofructokinase" reversible="false">
19        <listOfReactants><speciesReference species="G6P" stoichiometry="1" /></listOfReactants>
20        <listOfProducts><speciesReference species="FBP" stoichiometry="1" /></listOfProducts>
21      </reaction>
22      <reaction id="R_PK" name="PyruvateKinase" reversible="false">
23        <listOfReactants><speciesReference species="FBP" stoichiometry="1" /></listOfReactants>
24        <listOfProducts><speciesReference species="PYR" stoichiometry="2" /></listOfProducts>
25      </reaction>
26    </listOfReactions>
27  </model>
28</sbml>
SBML Biochemical Reaction Network
Glycolytic Pathway Cascade SBGN Process Description: Compartments, Macromolecules & Stoichiometry Cytosol (Volume: 1 L) → R_HK → R_PFK → R_PK Glucose [8 mM] Glucose-6-P [1.2 mM] Fructose-1,6-BP [0.6 mM] Pyruvate [0.4 mM] Legend: Species Reaction Product Flow
Drag to pan · Click % to reset

SBML Systems Biology & Biochemical Kinetics (.sbml, .xml) ​

@modelscript/sbml (languages/sbml) provides zero-regex streaming XML parsing, biochemical reaction network kinetics solving, 4th-order Runge-Kutta ODE simulation, linear DAE lowering, and Modelica 3.x projection for Systems Biology Markup Language (SBML Level 2 & 3 Core) cellular, metabolic, and signaling network models.


Supported Extensions & Standards ​

ExtensionFormatDescription
.sbmlSBML Model FileStandard biochemical XML schema encoding compartments, species, parameters, and reactions
.xmlSBML XML DocumentGeneral XML format containing standard SBML Level 2/3 definitions

Key Capabilities ​

1. Biochemical Reaction Networks & Stoichiometry ​

  • Parses hierarchical multi-compartment biochemical reaction networks:
    • Compartments: Cellular volumes (cytosol, mitochondria, extracellular space) with spatial dimensions (0D, 2D membrane, 3D volume).
    • Species: Chemical and protein concentrations or particle amounts ([Si]≥0).
    • Parameters: Kinetic rate constants (kfwd,krev), Michaelis constants (Km), and Hill coefficients (n).
    • Reactions: Reversible and irreversible reaction fluxes (vj) with stoichiometric coefficient matrices N=[νij]:∑isijSi→vj∑kpkjPk

2. Kinetic Law Formulations & ODE Solver ​

  • Evaluates dynamic reaction velocities across standard enzyme kinetics:
    • Mass-Action Kinetics:v=kfwd∏[Ri]si−krev∏[Pj]pj
    • Michaelis-Menten Enzymatic Saturation:v=Vmax[S]Km+[S]
    • Hill Cooperativity:v=Vmax[S]nK0.5n+[S]n
  • Solves the resulting non-linear ordinary differential equations (ODEs):d[Si]dt=1Vcomp∑j=1Rνij⋅vj([S],p)using embedded 4th-order Runge-Kutta (RK4) integration or stiff SUNDIALS CVODE solvers.

3. Direct DAE Lowering ​

  • Lowers reaction stoichiometric matrices and flux equations into @modelscript/runtime's DAEBuilder linear memory arena.
  • Enables co-simulation between cellular metabolic networks and pharmacokinetics / drug delivery fluid pipelines (@modelscript/aspen).

4. Bidirectional Modelica 3.x Projection ​

  • Projects SBML reaction systems into Modelica biochemical components and acausal substance substance-flow models.

Pre-Flight Diagnostics ​

The SBML analyzer validates stoichiometric consistency, undefined references, and physical rate bounds:

10 rules7 error2 warning1 info Run with msx sbml lint

CodeRuleSeverityMessage
M8801missing-model-iderrorSBML <model> element is missing required 'id' attribute.
M8802undefined-compartment-referenceerrorSpecies '<speciesId>' references undefined compartment '<compartmentId>'.
M8803undefined-species-referenceerrorReaction '<reactionId>' references undefined <role> species '<speciesId>'.
M8804negative-compartment-sizeerrorCompartment '<compartmentId>' defines non-positive size (<size>).
M8805negative-initial-amount-concentrationerrorSpecies '<speciesId>' specifies negative initial amount/concentration (<val>).
M8806empty-reactionerrorReaction '<reactionId>' must define at least one reactant or product.
M8807missing-kinetic-lawwarningReaction '<reactionId>' does not define a kineticLaw rate law equation.
M8808negative-stoichiometryerrorSpecies reference for '<speciesId>' in reaction '<reactionId>' specifies non-positive stoichiometry (<stoich>).
M8809undefined-kinetic-parameterwarningKinetic law formula in reaction '<reactionId>' references identifier '<id>' not found in parameters or species.
M8810circular-species-assignmentinfoReaction '<reactionId>' lists '<speciesId>' as both reactant and product with identical stoichiometry; consider defining as modifier.

Generated from languages/sbml/src/errors.ts. All languages →


CLI Usage ​

bash
# Inspect compartments, species, parameters, and reactions
msx sbml inspect GlycolyticPathway.sbml

# Run pre-flight linting and stoichiometric validation
msx sbml lint GlycolyticPathway.sbml

# Simulate biochemical reaction kinetics ODEs with RK4
msx sbml simulate GlycolyticPathway.sbml --duration=20.0

# Lower biochemical reaction network to ModelScript linear DAE arena
msx sbml to-dae GlycolyticPathway.sbml

# Project into Modelica 3.x biochemical network model
msx sbml to-modelica GlycolyticPathway.sbml -o GlycolysisModel.mo

Open-Core under the GNU AGPL v3 License; Enterprise Edition (ee/) under the ModelScript Enterprise License. • Trademark Policy