BETSE, the BioElectric Tissue Simulation Engine.
Project description
BETSE
BETSE (BioElectric Tissue Simulation Engine) is an open-source cross-platform finite volume simulator for 2D computational multiphysics problems in the life sciences – including electrodiffusion, electro-osmosis, galvanotaxis, voltage-gated ion channels, gene regulatory networks, and biochemical reaction networks (e.g., metabolism). BETSE is associated with the Paul Allen Discovery Center at Tufts University and supported by a Paul Allen Discovery Center award from the Paul G. Allen Frontiers Group.
BETSE is portably implemented in pure Python 3, continuously stress-tested with GitLab-CI × Appveyor + py.test, and permissively distributed under the BSD 2-clause license.
BETSEE
BETSEE (BETSE Environment) is the official open-source cross-platform graphical user interface (GUI) for BETSE. BETSEE wraps the low-level command-line interface (CLI) bundled with BETSE in a high-level interactive modelling environment optimized for both new and advanced users alike.
Like BETSE, BETSEE is portably implemented in Python 3 and permissively distributed under the BSD 2-clause license. Unlike BETSE, BETSEE leverages the industry-standard PySide2-based Qt 5 application framework to deliver a modern scientific workflow.
Installation
BETSE currently supports Linux, macOS, and Windows out-of-the-box.
Simple
For new users, BETSE is portably installable as follows:
[Windows] Emulate Ubuntu Linux via the Windows Subsystem for Linux (WSL). [1]
Install the Python 3.x [2] (e.g., 3.6) variant of Anaconda. [3]
Open a Bash terminal. [4]
Run the following commands.
Enable conda-forge.
conda config --add channels conda-forge
Install BETSE. [5]
conda install betse
[Optional] Test BETSE. [6]
betse -v try
Advanced
For developers and advanced users, any version of BETSE – including the live repository and prior stable releases – is manually installable as follows:
Install Python 3.x and all dependencies required by BETSE. Under:
Linux, install these dependencies via your distribution-specific package manager (e.g., APT under Debian-based distributions). Do not use pip.[7]
macOS, either:
(Recommended) Install the Python 3.x variant of Anaconda.
Or both:
Install a third-party package manager (e.g., Homebrew, MacPorts). Apple does not provide a package manager out-of-the-box.
Install these dependencies via that package manager. Do not use pip.[7]
Open a terminal.
Download either:
The unstable BETSE repository as follows:
Install Git.
Clone the master branch of this repository.
git clone https://gitlab.com/betse/betse.git
Prepare for installation.
cd betse
Any stable BETSE release, including the most recent, as follows:
Visit our source tarball archive.
Click the download icon to the right of the desired release and select Download tar.gz.
Extract the downloaded tarball into the current directory.
tar -xvzf betse-*.tar.gz
(Optional) Remove this tarball.
rm betse-*.tar.gz
Prepare for installation.
cd betse-*
Install BETSE either:
(Recommended) Editably, installing a cross-platform symbolic link to the current BETSE codebase. Modifications to this code are applied immediately without requiring reinstallation.
sudo python3 setup.py develop
Non-editably, installing a physical copy of the current BETSE codebase. Modifications to this code are ignored and thus require reinstallation.
sudo python3 setup.py install
(Optional) Test BETSE, running all modelling phases of a sample simulation from a new directory.
cd /tmp && betse try
Do not install scientific dependencies (e.g., NumPy, SciPy) with either pip or easy_install; doing so typically degrades BETSE to single-core performance. To optimize BETSE across multiple cores, always install these dependencies with your platform-specific package manager (e.g., Homebrew, APT).
Unlike Linux and macOS, Anaconda is (effectively) required under Windows. Due to Microsoft’s lack of support for POSIX-compliant toolchains, no reasonable alternatives for installing multicore-aware scientific dependencies exist.
Usage
Basic
BETSE installs the betse command, a low-level command line interface (CLI) designed for experienced users. The typical CLI-based workflow resembles:
Create a default simulation configuration in a new my_sim/ subdirectory of the current directory.
betse config my_sim/sim_config.yml
[Optional] Edit the new my_sim/sim_config.yml file with your favourite text editor.
Create a pseudo-random cell cluster from this simulation configuration.
betse seed my_sim/sim_config.yml
[Optional] Export all enabled plots, animations, and comma-separated value (CSV) files from this cell cluster.
betse plot seed my_sim/sim_config.yml
Initialize (i.e., calculate steady-state concentrations for) this cell cluster.
betse init my_sim/sim_config.yml
[Optional] Export all enabled plots, animations, and comma-separated value (CSV) files from this initialization.
betse plot init my_sim/sim_config.yml
Simulate this initialized cell cluster.
betse sim my_sim/sim_config.yml
[Optional] Export all enabled plots, animations, and comma-separated value (CSV) files from this simulation.
betse plot sim my_sim/sim_config.yml
Also note that our sister project BETSEE installs the betsee command, a high-level graphical user interface (GUI) designed for all users – regardless of prior experience or familiarity with the command line.
Expert
BETSE provides a variety of command-line options and subcommands in addition to those synopsized above. The standalone betse and betse --help commands describe these options and subcommands as follows:
usage: betse [-h] [-v] [-V] [--log-file LOG_FILENAME]
[--log-level {all,debug,info,warning,error,critical,none}]
[--profile-type {none,call,size}]
[--profile-file PROFILE_FILENAME]
[--matplotlib-backend MATPLOTLIB_BACKEND_NAME]
{config,seed,init,sim,sim-grn,plot,info,try} ...
The BioElectric Tissue Simulation Engine (BETSE) is a finite volume simulator
for 2D computational multiphysics problems in the life sciences -- including
electrodiffusion, electro-osmosis, galvanotaxis, voltage-gated ion channels,
gene regulatory networks, and biochemical reaction networks.
optional arguments:
-h, --help show this help message and exit
-v, --verbose print and log all messages verbosely
-V, --version print program version and exit
--log-file LOG_FILENAME
file to log to (defaults to
"/home/leycec/.betse/betse.log")
--log-level {all,debug,info,warning,error,critical,none}
minimum level of messages to log to "--log-file"
(defaults to "info") [overridden by "--verbose"]
--profile-type {none,call,size}
type of profiling to perform (defaults to "none"):
* "none", disabling profiling
* "call", profiling callables (functions, methods)
* "size", profiling object sizes (requires "pympler")
--profile-file PROFILE_FILENAME
file to profile to unless "--profile-type=none"
(defaults to "/home/leycec/.betse/betse.prof")
--matplotlib-backend MATPLOTLIB_BACKEND_NAME
name of matplotlib backend to use (see: "betse info")
subcommands:
Exactly one of the following subcommands must be passed:
{config,seed,init,sim,sim-grn,plot,info,try}
config create a default config file for BETSE simulations
seed seed a new cell cluster for a config file
init initialize a seeded cell cluster for a config file
sim simulate an initialized cell cluster for a config file
sim-grn simulate a gene regulatory network for a config file
plot plot an initialized or simulated simulation
info print metadata synopsizing BETSE and current system
try create, init, simulate, and plot a sample simulation
subcommand help:
For help with a specific subcommand, pass the "-h" or "--help" option to that
subcommand. For example, for help with the "config" subcommand, run:
betse config --help
Documentation
BETSE also provides external documentation optimized for offline reading – complete with explanatory examples, sample plots, and ample screenshots:
Official BETSE 0.4 documentation. (PDF format; 72 pages.)
Official BETSE 0.3 documentation. (PDF format; 77 pages.)
Introduction
BETSE simulates biorealistic electrochemical phenomena in gap junction-networked 2D cellular collectives. To predict bioelectric patterns and their spatio-temporal dynamics, BETSE:
Models ion channel and gap junction activity.
Tracks changes in ion concentration and net ionic charge.
Calculates endogenous voltages and currents.
Accepts simulation parameters, variables, and options as human-readable, well-commented configuration files in YAML format.
Exports simulation results to a variety of output formats, including:
Publication-quality:
Plots, charts, and animations driven by Matplotlib, the industry standard for open-source plot visualization.
Directed graphs (i.e., networks) driven by Graphviz, the industry standard for open-source graph visualization.
Internet-friendly compressed video driven by any of various popular open-source video encoders, including FFmpeg, Libav, and MEncoder.
Post-processable tabular data (e.g., comma-separated values (CSV)).
Imports bitmask images defining the shapes of:
Cell clusters.
Cell cluster regions localizing ion channel activity, typically signifying disparate types of adjacent tissue.
To assemble simple concepts into complex simulations, BETSE supplies a richly configurable, highly scalable biological toolset consisting of:
Ions
Simulations may enable arbitrary combinations of the principal ions implicated in bioelectrical signaling – including:
Sodium (Na+).
Potassium (K+).
Chloride (Cl-).
Calcium (Ca2+).
Hydrogen (H+).
Anionic proteins (P-).
Bicarbonate (HCO-3).
Ion Channels
Individual cells in simulations may enable arbitrary combinations of voltage-gated ion channels, each implementing the Hodgkin-Huxley (HH) formalism with experimentally-derived parameters sourced from reputable knowledge-based systems (e.g., Channelpedia). Explicitly supported channel types include:
L-type Ca, T-type Ca, and P/Q-type Ca.
Leak and ligand-gated channels, including:
Custom ion channels parametrized by user-selected constants may be trivially defined in the same manner (e.g., via a YAML-formatted configuration file).
Ion Pumps and Exchangers
For fine-grained control over cell dynamics, notable ion pumps and exchangers may also be selectively enabled – including:
Custom ion pumps and exchangers parametrized by user-selected constants may be trivially defined in the same manner (e.g., via a YAML-formatted configuration file).
Extracellular Space
Cells form interconnected intracellular networks via voltage-sensitive gap junction connections embedded within an extracellular environment, maintained by tight junctions at the cell cluster periphery. Simulation of this environment enables exploration of local field potentials, transepithelial potential, and ephaptic coupling between cells.
Biological Networks
Simulation of gene regulatory and biochemical reaction networks at both the cellular and mitochondrial level supports deep spatial analysis of otherwise intractable biological processes. Metabolism, disease, aging, and other genetic and epigenetic phenomena commonly associated with quasi-Big Data are all valid targets for exhaustive study with BETSE.
To integrate these potent control systems with bioelectrical signaling, the activity-modulated interaction between gene products and similar biochemicals is fully integrated with ion channels, ion pumps, and gap junctions.
Validation
BETSE is peer-reviewed software receiving continual evidence-based scrutiny. Simulation output is reproducibly synchronized with experimental observations on membrane permeability, resting potential, ion concentration, and similar real-world biophysical quantities. Predictable outcomes have been demonstrated for such well-known cases as:
Transmembrane voltage changes on perturbations to single cell membrane states and environmental ion concentrations.
Bioelectrical signals at large-scale cellular wound sites.
Citation
BETSE is formally described in our introductory paper. Third-party papers, theses, and other texts leveraging BETSE should ideally cite the following:
Alexis Pietak and Michael Levin, 2016. Exploring instructive physiological signaling with the bioelectric tissue simulation engine (BETSE). (Supplement). [9] Frontiers in Bioengineering and Biotechnology, 4(55). https://doi.org/10.3389/fbioe.2016.00055
Subsequent papers expanding the BETSE architecture with additional theory, experimental results, and comparative metrics include:
Alexis Pietak and Michael Levin, 2017. Bioelectric gene and reaction networks: computational modelling of genetic, biochemical and bioelectrical dynamics in pattern regulation. (Supplement). [9] Journal of The Royal Society Interface, 14(134), p.20170425. https://doi.org/10.1098/rsif.2017.0425
Vaibhav P. Pai, Alexis Pietak, Valerie Willocq, Bin Ye, Nian-Qing Shi, and Michael Levin, 2018. HCN2 rescues brain defects by enforcing endogenous voltage pre-patterns. (Supplement). [9] Nature Communications. 9(1), p.998. https://doi.org/10.1038/s41467-018-03334-5
Javier Cervera, Alexis Pietak, Michael Levin, and Salvador Mafe, 2018. Bioelectrical coupling in multicellular domains regulated by gap junctions: A conceptual approach. Bioelectrochemistry. 128, pp.45—61. https://doi.org/10.1016/j.bioelechem.2018.04.013
Alexis Pietak and Michael Levin, 2018. Bioelectrical control of positional information in development and regeneration: A review of conceptual and computational advances. Progress in Biophysics and Molecular Biology. https://doi.org/10.1016/j.pbiomolbio.2018.03.008
This article’s supplement extends the cursory theory presented by this article with a rigorous treatment of the mathematics, formalisms, and abstractions required to fully reproduce this work. If theoretical questions remain after completing the main article, please consult this supplement.
Contact
To contact Dr. Pietak, the principal developer of the BETSE codebase and first or second author of all above papers, cordially direct correspondence to either:
The anonymous contact form at Organic Mechanics, the personal archives of all material published to date by Dr. Pietak – including papers, presentations, textbooks, and additional theoretical work.
The personal e-mail account of Dr. Pietak: [10]
Username: alexis {dot} pietak
Hostname: gmail {dot} com
To report a software issue (e.g., bug, crash, or other unexpected behaviour) or request a new feature in BETSE, consider submitting a new issue to our issue tracker. Thanks in advance; it’s only through generous user contributions that your user experience can continue to improve.
To protect Dr. Pietak’s e-mail address against automated harvesting, this address has been intentionally obfuscated. Reconstruct the original address by:
Replacing the {dot} substring with the . charecter.
Concatenating the username and hostname strings with the @ character.
For this reason, consider directing correspondence to the anonymous contact form at Organic Mechanics instead.
See Also
For prospective users:
Installation, detailing BETSE’s installation with exhaustive platform-specific instructions.
For prospective contributors:
Development, detailing development of the BETSE codebase – philosophy, workflow, and otherwise.
Testing, detailing testing of the BETSE codebase – continuous integration, manual testing, and otherwise.
Freezing, detailing conversion of the BETSE codebase into redistributable platform-specific executable binaries.
License
BETSE is open-source software released under the permissive BSD 2-clause license.
The logo prominently displayed on this project page is a flat Noun Project icon entitled “Cow,” kindly released under the permissive BSD-compatible CC BY 3.0 license by Maxim Kulikov.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.