The files presented here are meant to provide a moderately paced but comprehensive introduction to the syntax and features of the BioNetGen language (BNGL) and modeling software. These examples can be run either using
BNG2.pl from the command line or using the RuleBender interface. We have made a short video showing how to get started using RuleBender.
Click on the link to see the BNGL code, which can be copy/pasted into a .bngl file in an editor or RuleBender.
Basic structure and syntax
: Simple binding model in BNGL using unstructured molecules to represent each species. Demonstrates basic syntax of
: Simple binding model modified to use
parameters block, which enables
parameter_scan. Also demonstrates use of
# for comments and
\ for line continuation.
: Simple binding model with modifed
method option to
simulate command to demonstrate
ssa method for performing stochastic simulation.
: Lotke-Volterra model in BioNetGen syntax.
Using structured molecules and rules: Binding
: Simple binding model re-factored to used structured molecules with binding sites and a binding rule that adds or deletes a bond. Things to notice:
- Contact Map panel in RuleBender shows Molecule and Component interactions.
- Clicking tabs associated with Obervables shows Patterns and corresponding mathces.
: Simple binding model with a bivalent A molecule that has two identical sites for binding of B. Binding at each site is not affected by the status of the other site (noncooperative binding). Things to notice:
- This is a good model to examine the output of network generation, which is found in the file
BAB.netthat is generated by BioNetGen. In this file the
seed speciesblock is converted to a
speciesblock, which lists all of the species that result from network generation. The
reaction rulesblock is replaced by
reactions, and the
observablesblock is replaced by
groups. In these blocks species strings are replaced by an index referring to entries in the
speciesblock. Both rate constants in reactions and entries in
groupscan be preceded by an integer that specifies a pre-factor arising from symmetry or multiplicity.
: Varying the amount of A reveals nonmonotonic behavior of complexation. This example demonstrates use of the
log_scale option to
parameter_scan. Things to notice:
- To observe the behavior of the BAB complex, you will have to turn off display of the other, more abundant observables.
- You will also need to change the X Axis scale from
- You can replicate the behavior of the
parameter_scanfunction by switching the
Run Fileoption to
Parameter Scanin the Simulation tab in RuleBender and then completing the entries in the form that appears below the selection.
Using structured molecules and rules: Component state change
: Simple enzyme binding and substrate modification scheme. A is a kinase and B contains a phosphorylable substrate site called
Y, which has two states,
P, which represent the unphosphorylated state and phosphorylated states respectively. This model also demonstrates the use of expressions in the
parameters block to perform unit conversions and comments to define a consistent set of units. We recommend cubic microns (fL) as the standard volume unit, µM or molecule counts for concentration, µm for length, and µm2 for area.
: A simplified version of the A-B phosphorylation model in which the explicit binding of A and B is eliminated and the phosphorylation reaction rate is given by the Michaelis-Menten rate law.
Exercise: Try changing the initial amounts of A and B such that A is in ten-fold excess over B and plotting the resulting time courses. What do you observe? (Hint: Be sure to change the duration of the simulation as well.)
More advanced models of substrate modification dynamics. Demonstrates additional use of functions in rate laws, how to define a simulation protocol using multiple
simulate commands and the
setParameter command, and use of the
bifurcate command to examine a bistable system.
Modeling synthesis and degradation
: Simple model illustrating synthesis and degradation of molecules. Also, demonstrates use of
resetConcentrations() to save and restore initial conditions and to compare model simulated with two different methods. Introduces
: Simple model of a two-gene toggle switch describing the synthetic circuit of Gardner, Cantor, and Collins. Demonstrates use of the
bifurcate() command to identify hysteresis loops in a potentially bistable system. Model also demonstrates stochastic transitions between metastable states that could represent cell phenotypes.
Exercise: Make a simple model of an auto-regulating gene in which the gene product P dimerizes and binds to the promoter to block transcription.
: Demonstrates behavior of various rules specifying degradation of complexes and how this can be controlled by the
Exercise: Modify the model you made in the previous exercise to allow degradation of P even when it's bound to DNA without degrading the DNA.
Ligand-receptor binding models
These models address issues of unit definition, how to construct models with distinct spatial compartments, and using network-free simulation for models that have a large or potentially infinite number of possible species and reactions. See the Quick Reference Guide for a brief introduction to the Compartment specification and syntax.
: Non-compartmental model of simple ligand-receptor binding.
: Compartmental model of simple ligand-receptor binding.
: Non-compartmental model of ligand-receptor binding and dimerization. Also demonstrates
visualize command to make
.gml files for visualization of the rule network using the external tool yEd.
: Compartmental model of ligand-receptor binding and dimerization.
: Bivalent ligand - bivalent receptor (BLBR) model, which is a simple model of polymer formation by receptors that can form a chain with infinite length (in the continuum limit). Simulating this model using a generate and simulate approach is problematic because for these parameters the required network of complexes is very large. Using network-free simulation addresses this problem.
Models for CellBlender
As of March 7, 2018 the SBML importer in CellBlender does not create the objects corresponding to the specified compartments. These have to be constructed manually in CellBlender.
: Simple model of tranport involving two cell organelles. This model is used in the CellBlender tutorial. The model exported in SBML format can be imported into CellBlender by selecting File->Import->BioNetGen/SBML model (.bngl,.xml)
: Lotke-Volterra model in compartmental form for export to CellBlender. NOTE: The third reaction needs to be modified to set the product to
cBNGL model of signaling/transcription with negative feedback
Exercise: Can you identify two parameters that change the frequency of the oscillations? Can you find two parameters that change the amplitude of the oscillations?
: Demonstrates the various visualization types that can be generated for a BNGL model.
: A complex model of FceRI (immunoreceptor on mast cells and basophils) signaling with over 200 chemical species and 2000 reactions.
A manuscript on the visualization methods and capabilities available with BioNetGen is available here.
An extended tutorial on visualization is available in the Supporting information: S2 Appendix. Tutorial.
: Input file that can be used to translate an SBML file (with .xml extension) into a BNGL model. The
atomize parameter determines whether the translated will be structured (
atomize=>1) or unstructured (
atomize=>0). "Structured" here means that the translator will attempt to determine the underlying molecules, components, bonds, and states. Some example SBML input models are here. A repository of SBML models is available at biomodels.net. Be sure to download models with annotation (usually SBML Level 2).
: A more complex immunoreceptor signaling network. Demonstrates use of simulation protocol.
Exercise: Can you make a reduced version of this model that has roughly half the number of species but tracks the same observables?
: A simplified model of EGFR signaling.
Exercise: Find out if the parameters for internalization and degradation of the receptor and ligand are realistic. What happens to the behavior of the model if realistic parameters are used?