Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ You will need both python (3.7 and above) and perl installed. Once both are avai
$ pip install bionetgen
```

### Optional: in-process simulation with BNGsim

PyBioNetGen can optionally use [BNGsim](https://github.com/RuleWorld/bngsim) as an in-process simulation engine (ODE/SSA/NFsim, multi-format input). This is fully opt-in: if BNGsim is not installed, every simulation uses the existing subprocess `BNG2.pl` path and behavior is unchanged. BNGsim is never a required dependency.

BNGsim is a compiled extension and is not on PyPI yet, so `pip install bionetgen[bngsim]` will not resolve until it is published. To try it now, install a prebuilt wheel from the [release assets](https://github.com/wshlavacek/PyBioNetGen/releases/tag/bngsim-wheels-0.9.10) (macOS / Python 3.12; build from source on other platforms). PyBioNetGen requires BNGsim `0.9.10` or newer. Set `BIONETGEN_NO_BNGSIM=1` to force the legacy subprocess path even when BNGsim is installed. See the [BNGsim documentation page](https://pybionetgen.readthedocs.io/en/latest/bngsim.html) for details.

### Features

PyBioNetGen comes with a command line interface (CLI), based on [cement framework](https://builtoncement.com/), as well as a functional library that can be imported. The CLI can be used to run BNGL models, generate Jupyter notebooks and do rudimentary plotting.
Expand Down
3 changes: 3 additions & 0 deletions bionetgen/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from .core.defaults import defaults
from .core.tools.bngsim_bridge import BNGSIM_AVAILABLE, BNGSIM_VERSION
from .modelapi import bngmodel
from .modelapi.runner import run
from .simulator import sim_getter
Expand All @@ -8,6 +9,8 @@

__all__ = [
"defaults",
"BNGSIM_AVAILABLE",
"BNGSIM_VERSION",
"bngmodel",
"run",
"sim_getter",
Expand Down
13 changes: 13 additions & 0 deletions bionetgen/core/tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,16 @@
from .cli import BNGCLI
from .visualize import BNGVisualize
from .gdiff import BNGGdiff
from .bngsim_bridge import (
BNGSIM_AVAILABLE,
BNGSIM_HAS_NFSIM,
BNGSIM_VERSION,
detect_input_format,
run_bngl_with_bngsim,
run_bngl_with_bngsim_backend_hook,
run_nfsim,
run_with_bngsim,
)
from .bngsim_backend_helper import (
execute_backend_payload as execute_bngsim_backend_payload,
)
Loading
Loading