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 job_type (spelled fit_type
in the legacy edition 1). 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.
Getting Started
User Guide
- Configuring a Fitting Job
- Configuration Keys
- Algorithms
- Summary of Available Algorithms
- General implementation features for all algorithms
- Differential Evolution
- Scatter Search
- Particle Swarm
- Metropolis-Hastings MCMC
- Simulated Annealing
- Parallel Tempering
- Adaptive MCMC
- DREAM
- Preconditioned DREAM
- Hamiltonian Monte Carlo (NUTS)
- Simplex
- Refinement (choosing a local optimizer)
- Powell
- CMA-ES
- Gradient-based optimization
- Model checking
- Model selection and posterior analysis
- Noise Models and Objective Functions
- Priors and Parameter Initialization
- Gradient-based fitting (forward sensitivities)
- Running a gradient fit
- Multiple shooting (
job_type = ms) - Profile likelihood (identifiability + confidence intervals)
- What it computes
- Estimated σ (a free-parameter noise scale)
- Log / lognormal noise scale
- Asymmetric and non-Gaussian families
- Trajectory transforms and normalization
- Constraint penalties
- Measurement-model layer (SBML / Antimony)
- Pre-equilibration / steady state
- Discrete events
- The capability gate (what is supported)
- Enabling sensitivities
- Cost
- Parameter scales
- Analytical and user-defined objectives
- PEtab interoperability
- Advanced Features
- Running on a cluster
- Troubleshooting
- Failed simulations
- Timed out simulations
- Which methods did my run actually execute?
- Unexpected behavior when generating SBML files in COPASI
- Too many open files
- Too many threads
- Jobs still running after PyBNF stops
- My fitted noise scale is missing from
sorted_params_final.txt - PyBNF has encountered a fatal error
- An unknown error occurred
- Other issues
Developer Reference
- Algorithm Development
- PyBNF Module References
- PyBNF entry point (
pybnf.pybnf) - PyBNF algorithms (
pybnf.algorithms) - PyBNF cluster setup (
pybnf.cluster) - PyBNF configuration (
pybnf.config) - PyBNF constraint specification (
pybnf.constraint) - PyBNF data container (
pybnf.data) - PyBNF convergence diagnostics (
pybnf.diagnostics) - PyBNF gradient plumbing (
pybnf.gradient) - PyBNF ArviZ bridge (
pybnf.inference_data) - PyBNF measurement models (
pybnf.measurement) - PyBNF noise models (
pybnf.noise) - PyBNF objective functions (
pybnf.objective) - PyBNF configuration parsing (
pybnf.parse) - PyBNF PEtab v2 interoperability (
pybnf.petab) - PyBNF printing functions (
pybnf.printing) - PyBNF priors (
pybnf.priors) - PyBNF model and parameter containers (
pybnf.pset) - Multiple shooting (
pybnf.shooting) - Constrained transcription (
pybnf.transcription)
- PyBNF entry point (