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

BioNetGen Rule-Based EGFR Dimerization & Phosphorylation

Rule-based signaling model tracking ligand binding, receptor dimerization, trans-autophosphorylation, and Grb2 recruitment.

Playground
Source (22 lines)
1begin model
2begin parameters
3  kp1  1.0e-3
4  km1  0.10
5  kp2  5.0e-3
6  km2  0.05
7  k_p  1.20
8end parameters
9begin molecule types
10  EGF(r)
11  EGFR(l,d,Y1068~U~P)
12end molecule types
13begin seed species
14  EGF(r)               1200.0
15  EGFR(l,d,Y1068~U)    1000.0
16end seed species
17begin reaction rules
18  R_Bind:  EGF(r) + EGFR(l,d) <-> EGF(r!1).EGFR(l!1,d) kp1, km1
19  R_Dimer: EGFR(l!+,d) + EGFR(l!+,d) <-> EGFR(l!+,d!2).EGFR(l!+,d!2) kp2, km2
20  R_Phos:  EGFR(d!+,Y1068~U) -> EGFR(d!+,Y1068~P) k_p
21end reaction rules
22end model
BioNetGen Rule-Based Contact Map
ligand bind trans-phos «seed species» EGF(r) + EGFR(l,d) «parameters» EGF = 1200 EGFR = 1000 «reaction rules» R_Bind & R_Dimer «model» kp1 = 1e-3, km1 = 0.1 kp2 = 5e-3, km2 = 0.05 «phosphorylated» EGFR(d!+,Y1068~P) «verification» k_p = 1.20 s^-1 Rule-based ODE/SSA
Drag to pan · Click % to reset

BioNetGen Rule-Based Biochemical Networks (.bngl) ​

@modelscript/bngl (languages/bngl) provides native WebAssembly GLR parsing, rule-based site-specific biochemical network expansion, observable pattern aggregation, 4th-order Runge-Kutta ODE integration, DAEBuilder lowering, and SBML / Modelica projections for BioNetGen Language (BNGL) multiprotein signaling, receptor oligomerization, and post-translational modification models.


Supported Extensions & Standards ​

ExtensionFormatDescription
.bnglBioNetGen ModelBlock-structured rule-based biochemical specification (parameters, molecule types, seed species, observables, reaction rules, actions)

Key Capabilities ​

1. Site-Specific Molecule Types & Bond Graphs ​

  • Parses structured BNGL blocks:
    • molecule types: Multi-component proteins with internal phosphorylation/conformational states (e.g., EGFR(L,CR1,Y1068~U~P)).
    • seed species: Initial molecular complexes with explicit site bonds (!1, !+, !?, !.).
    • observables: Molecules and Species pattern queries aggregating phosphorylated or bound sub-complexes.
    • reaction rules: Unidirectional (->) and bidirectional (<->) site-transformation and binding rules without combinatorial manual enumeration.

2. Automated Network Expansion & ODE Simulation ​

  • Iteratively applies reaction rules to seed species to generate the reachable species and elementary reaction network (generateNetwork / solveBngl).
  • Integrates species concentration trajectories and observable outputs, and lowers the expanded network into @modelscript/runtime's DAEBuilder arena, SBML (bnglToSbml), and Modelica 3.x (bnglToModelica).

Pre-Flight Diagnostics ​

10 rules8 error2 warning

CodeRuleSeverityMessage
M9051molecule-type-undeclarederrorMolecule type '<moleculeName>' referenced in '<context>' is not declared in 'molecule types'.
M9052component-site-undeclarederrorComponent site '<siteName>' is not declared on molecule type '<moleculeName>'.
M9053invalid-internal-stateerrorInternal state '~<stateName>' is not allowed for component '<siteName>' of molecule type '<moleculeName>'.
M9054dangling-bond-labelerrorBond label '!<bondLabel>' in complex pattern '<patternText>' appears '<count>' times; each bond must connect exactly 2 sites.
M9055undefined-rate-parameterwarningReaction rule '<ruleId>' references undeclared rate parameter '<parameterName>'.
M9056reversible-rule-missing-reverse-rateerrorReversible reaction rule '<ruleId>' ('<->') is missing a reverse rate constant.
M9057negative-seed-concentrationerrorSeed species '<speciesPattern>' has negative initial concentration '<concentration>'.
M9058empty-bionetgen-modelerrorBioNetGen model '<modelName>' contains no molecule types, seed species, or reaction rules.
M9059duplicate-observable-nameerrorObservable '<observableName>' is defined multiple times in 'observables'.
M9060unbounded-polymerization-rulewarningReaction rule '<ruleId>' forms intermolecular bonds on multi-site molecule '<moleculeName>' that can cause unbounded polymerization.

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


CLI Usage ​

bash
# Validate molecule site states, bond indices, and reaction rate constants
msx lint EgfrSignaling.bngl

# Parse and inspect BioNetGen blocks
msx parse EgfrSignaling.bngl

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