PyBioNetFit

PyBioNetFit (PyBNF) is a general-purpose program for parameterizing and checking mechanistic biological models. Given a model — written in the BioNetGen rule-based modeling language (BNGL), the Systems Biology Markup Language (SBML), or Antimony — and experimental data, PyBNF scores each candidate assignment of the free parameters with an objective function. An optimization algorithm searches for the single best-fitting parameter set; a Bayesian sampling algorithm instead draws from the posterior distribution to quantify parameter uncertainty. PyBNF runs on Linux, macOS, and Windows workstations as well as on computing clusters.

Algorithms

A fit is driven by one algorithm, chosen by fit_type (spelled job_type in edition-2). These fall into distinct families, and PyBNF ships a broad, parallelized suite of each.

Optimization algorithms search for the single best-fitting parameter set by minimizing the objective:

  • Metaheuristic optimizers — differential evolution, particle swarm, scatter search, CMA-ES, and simulated annealing — for global search over rugged objective surfaces.

  • Gradient-based optimizers — a trust-region least-squares method (trf) and a quasi-Newton method (lbfgs) — driven by analytic parameter sensitivities for fast local convergence.

Bayesian sampling algorithms do not return one best fit; they draw from the posterior distribution of the free parameters to quantify uncertainty — Adaptive MCMC (am, the recommended sampler), DREAM(ZS), Preconditioned DREAM, parallel tempering, and a Hamiltonian Monte Carlo / NUTS reference sampler.

Analysis methods round out the suite: model checking (check) and profile-likelihood analysis for identifiability, plus uncertainty quantification by bootstrapping.

Objectives and noise

Objectives range from classic least-squares to per-observation noise models — Gaussian, Laplace, Student-t, lognormal, and negative-binomial — whose noise parameters can be fixed, read from a data column, or estimated jointly with the model. Qualitative data can be encoded with the Biological Property Specification Language (BPSL) and folded into the same objective. You can also supply an analytical objective — a closed-form log-likelihood given as an expression or as a Python callable — and fit or sample it with no simulator in the loop.

Interoperability and configuration

PyBNF reads and writes PEtab v2 parameter-estimation problems, including problems whose model is written in BNGL, so a problem authored elsewhere can be imported, fit, and exported back. Fits themselves are defined in a concise configuration file; the modern edition-2 surface declares models, data, free parameters, and the fit type as labelled records.

To get started, follow the installation instructions, then work through the Quick Start and the hands-on tutorial.

User Guide