Rule-Based Modeling of Biological Systems

Theory and practice with BioNetGen

Author

James R. Faeder

Published

October 13, 2026

Preface

Cells process information with networks of interacting proteins, genes, and small molecules. To understand how these networks behave, we write down what we know about their parts and interactions and ask what that knowledge implies. Mathematical models make that question precise. This book teaches rule-based modeling, an approach to building such models that suits networks of proteins with many interaction sites, using the BioNetGen language and tools (Blinov et al. 2004; Faeder et al. 2009; Harris et al. 2016).

Who this book is for

The book has three audiences in mind:

  • Students in courses on computational and systems biology. The early chapters assume a little calculus and some Python, but no prior modeling experience.
  • New members of a modeling lab who need to become productive with rule-based models: building them, simulating them, fitting them to data, and sharing them.
  • Experimental and computational biologists who want a practical introduction to the BioNetGen tools.

How the book is organized

Each chapter introduces one set of ideas and applies them to a running example, a cytokine signaling circuit in which STAT transcription factors induce their own inhibitor, SOCS. The chapters are grouped into parts.

Part I. Foundations

  • 1  Reaction networks as dynamical systems: Builds the STAT–SOCS circuit one reaction at a time and shows how a reaction network becomes a set of differential equations.
  • 2  Molecules, patterns, and rules: Shows why naming every complex by hand breaks down, and how rules that act on structured molecules solve the problem.
  • 3  Stochastic simulation and noise: Describes reactions among small numbers of molecules with the chemical master equation and Gillespie’s algorithm, and follows the noise from a single SOCS gene through the feedback loop.
  • 4  A field guide to rules: Writes rules for binding, enzymatic modification, synthesis and degradation, and aggregation, and checks each one against the reactions BioNetGen generates.

Part II. Building realistic models

  • 5  Compartments and transport: Places the circuit in a cell with a nucleus and endosomes, and shows how compartment sizes scale the rates of reactions.
  • 6  Network-free simulation: Simulates models whose networks are too large to generate, using receptor aggregation as the example.
  • 7  Analyzing models: Computes conservation laws, steady states and their stability, dose–response curves, sensitivities, and bistability.
  • 8  Energy-based rule-based modeling: Assigns free energies to molecular structures so that cooperative binding satisfies detailed balance, and distinguishes equilibrium from signaling driven by ATP hydrolysis.

In preparation. Part III, Models meet data, will cover parameter estimation, uncertainty and identifiability, building and sharing models, and AI-assisted modeling. Part IV will cover advanced topics, including spatial simulation, rare events, and visualization, and Part V will present case studies. The plan for the full book is in BOOK_PLAN.md.

Every model in the book is in the models/ folder of the book’s repository, organized by chapter, and every figure is produced by running those models. Each chapter ends with exercises. Lecture slides and a printable worksheet for a course based on Chapters 1 and 2 are in the course repository.

Tools

You can run the models in this book in three ways:

  1. In a web browser, with no installation, using BNG Playground.
  2. In Visual Studio Code with the BioNetGen extension, which provides syntax highlighting, one-click simulation, and plotting.
  3. From Python, using bngsim for fast ODE and stochastic simulation. This is how the figures in the book are made, it runs every model in the book, and it is the route to the analysis and fitting covered in later chapters.

Appendix A — Installing the tools explains how to install them, and Appendix B — BNGL language reference summarizes the syntax of BNGL.

Conventions

BNGL code is shown in shaded blocks:

begin reaction rules
  LRbind: L(r) + R(l) <-> L(r!1).R(l!1) kon, koff
end reaction rules

Python code that produces a figure is shown above the figure in the web version of the book. Unless stated otherwise, concentrations are in micromolar (µM) and time is in minutes. The parameter values in the running example are illustrative, chosen to show the behavior clearly rather than fitted to a particular cell type.

Acknowledgments

BioNetGen began in the Cell Signaling Team at Los Alamos National Laboratory, which Byron Goldstein founded. The team included his late wife, Carla Wofsy, together with Tony Redondo, Bill Hlavacek, Michael Blinov, and me. The problem that led to BioNetGen, the combinatorial complexity of the complexes that form in receptor signaling, came out of that team’s work (Hlavacek et al. 2003), and the first version of the software was written there (Blinov et al. 2004).

I thank Byron and the rest of the Cell Signaling Team at that time, Tony, Carla, and Bill, for inviting me to join them in their odyssey to map and model the world of biological complexes.

Many people have contributed to BioNetGen and the tools built around it since then. Development moved to my group in the Department of Computational and Systems Biology at the University of Pittsburgh, where Leonard Harris, Justin Hogg, José-Juan Tapia, John Sekar, Sanjana Gupta, Ilya Korsunsky, Arshi Arora, Dipak Barua, and Robert Sheehan contributed to BioNetGen 2 (Harris et al. 2016). Leonard Harris and Justin Hogg led the development of compartmental BNGL (Harris et al. 2009). John Sekar and Justin Hogg led the development of energy-based modeling (Sekar et al. 2016), and John Sekar and José-Juan Tapia led the development of the automated visualization of rule-based models used in 2  Molecules, patterns, and rules. José-Juan Tapia also led the development of Atomizer, which converts reaction-network models into rule-based models. Michael Sneddon led the development of NFsim, in a collaboration with Thierry Emonet (Sneddon et al. 2011). Arvind Rasi Subramaniam, an investigator at the Fred Hutchinson Cancer Center in Seattle, pioneered the use of rule-based models to describe translation and also contributed to NFsim. Wen Xu and Adam Smith led the development of RuleBender, a graphical interface for BioNetGen, in a collaboration with G. Elisabeta Marai (Xu et al. 2011), and Yao Sun and Robert Clark also contributed to it. Ali Sinan Saglam created PyBioNetGen and the BioNetGen extension for Visual Studio Code, with contributions from Alex DiBiasi, Nika Zaslavsky, Caleb Armstrong, and Achyudhan Kutuva. Achyudhan Kutuva developed BNG Playground. Adam Husar led the development of MCell4, which integrates particle-based stochastic simulation with rule-based modeling (Husar et al. 2024). Integration of rule-based modeling into MCell4 was developed as part of my longtime collaboration with Tom Bartol and Terry Sejnowski at the Salk Institute, and it built on earlier work by José-Juan Tapia, Ali Sinan Saglam, and Jacob Czech.

At Los Alamos and at Northern Arizona University, Bill Hlavacek, Richard Posner, and their colleagues have extended BioNetGen with tools for simulation and parameter estimation. Jin Yang, Michael Monine, Joshua Colvin, and Ryan Gutenkunst developed network-free simulation methods and RuleMonkey (Yang et al. 2008; Colvin et al. 2010); Brandon Thomas, Lily Chylek, and Joshua Colvin developed BioNetFit (Thomas et al. 2016); Eshan Mitra and Ryan Suderman developed PyBioNetFit (Mitra et al. 2019); and Yen Ting Lin and Song Feng developed the partial scaling algorithm (Lin et al. 2019). Bill Hlavacek also wrote bngsim, which produced every simulation in this book. The commit histories of the RuleWorld repositories record many further contributions. Alan Perelson, Walter Fontana, and Michael Hucka did not contribute directly to BioNetGen, but they encouraged its development in a variety of ways, some intentional and some not. Vincent Danos independently envisioned rule-based modeling as a solution to the problem of combinatorial complexity, and his work inspired, directly and indirectly, many of the subsequent developments in BioNetGen. He and his collaborators in developing the Kappa language, including Jérôme Feret, Russell Harmer, and Jean Krivine, made major contributions to the theory and applications of rule-based modeling (Danos, Feret, Fontana, Harmer, et al. 2007; Danos, Feret, Fontana, and Krivine 2007; Feret et al. 2009).

Development of BioNetGen has been supported by the National Institutes of Health, through the National Center for Multiscale Modeling of Biological Systems (MMBioS, P41GM103712), which ended in 2022, and grants GM076570, GM085273, AI35997, and CA109552; by the National Science Foundation (grant 0829788); by the Arizona Biomedical Research Commission; and by the Department of Computational Biology at the University of Pittsburgh School of Medicine. Work at Los Alamos National Laboratory was performed under Department of Energy contract DE-AC52-06NA25396.

Finally, I thank the students of all ages and career stages who have taken the time to learn BioNetGen and to develop models with it. Their enthusiasm has been the main encouragement for me to assemble this book.

License

The text and figures are licensed under CC BY 4.0, and the code and models under the MIT License. You are free to reuse and adapt them with attribution.