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
| Extension | Format | Description |
|---|---|---|
.sbml | SBML Model File | Standard biochemical XML schema encoding compartments, species, parameters, and reactions |
.xml | SBML XML Document | General 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 (
). - Parameters: Kinetic rate constants (
), Michaelis constants ( ), and Hill coefficients ( ). - Reactions: Reversible and irreversible reaction fluxes (
) with stoichiometric coefficient matrices :
2. Kinetic Law Formulations & ODE Solver
- Evaluates dynamic reaction velocities across standard enzyme kinetics:
- Mass-Action Kinetics:
- Michaelis-Menten Enzymatic Saturation:
- Hill Cooperativity:
- Mass-Action Kinetics:
- Solves the resulting non-linear ordinary differential equations (ODEs):
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'sDAEBuilderlinear 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
| Code | Rule | Severity | Message |
|---|---|---|---|
M8801 | missing-model-id | error | SBML <model> element is missing required 'id' attribute. |
M8802 | undefined-compartment-reference | error | Species '<speciesId>' references undefined compartment '<compartmentId>'. |
M8803 | undefined-species-reference | error | Reaction '<reactionId>' references undefined <role> species '<speciesId>'. |
M8804 | negative-compartment-size | error | Compartment '<compartmentId>' defines non-positive size (<size>). |
M8805 | negative-initial-amount-concentration | error | Species '<speciesId>' specifies negative initial amount/concentration (<val>). |
M8806 | empty-reaction | error | Reaction '<reactionId>' must define at least one reactant or product. |
M8807 | missing-kinetic-law | warning | Reaction '<reactionId>' does not define a kineticLaw rate law equation. |
M8808 | negative-stoichiometry | error | Species reference for '<speciesId>' in reaction '<reactionId>' specifies non-positive stoichiometry (<stoich>). |
M8809 | undefined-kinetic-parameter | warning | Kinetic law formula in reaction '<reactionId>' references identifier '<id>' not found in parameters or species. |
M8810 | circular-species-assignment | info | Reaction '<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
