What is Bionetlite?

Overview

Bionetlite is a Python package that extends the bionet module of Brain Modeling Toolkit (BMTK). It generates network data for the Neulite kernel and allows existing BMTK code to be reused with minimal modifications.

Features

Reuse of Existing Code

You can generate data for Neulite by simply changing the import statements of network construction code written in BMTK.

# BMTK case
from bmtk.builder.networks import NetworkBuilder

net = NetworkBuilder('v1')
net.add_nodes(...)
net.build()
net.save_nodes(output_dir='network')
# bionetlite case (only change import)
from bionetlite import NeuliteBuilder as NetworkBuilder

net = NetworkBuilder('v1')
net.add_nodes(...)  # Same code
net.build()         # Same code
net.save_nodes(output_dir='network')  # Same code

Technical Details

It extends the BMTK NetworkBuilder class, maintaining all bionet functionality while adding output for Neulite.

# bionet case
from bmtk.builder.networks import NetworkBuilder

# bionetlite case
from bionetlite import NeuliteBuilder as NetworkBuilder

Main Processing

  • SWC File Preprocessing: Conversion to Perisomatic model, DFS sorting

  • Ion Channel Configuration Conversion: From JSON to CSV format

  • Network File Generation: <network_name>_population.csv, <src>_<trg>_connection.csv

See Design and Implementation for details.

Comparison of Output Files

bionet and bionetlite generate different files.

Comparison of Output Files

File Type

bionet (BMTK)

bionetlite

Network Data

<network>_nodes.h5
<network>_node_types.csv
<src>_<trg>_edges.h5
<src>_<trg>_edge_types.csv
<network>_nodes.h5
<network>_node_types.csv
<src>_<trg>_edges.h5
<src>_<trg>_edge_types.csv
+ <network>_population.csv
+ <src>_<trg>_connection.csv

Morphology Files

Original SWC files (unchanged)

Processed SWC files (Perisomatic model conversion, DFS sorted)

Ion Channels

JSON format (*_fit.json)

JSON format (*_fit.json)
+ CSV format (converted for Neulite)

bionetlite maintains full compatibility with BMTK’s standard output (H5/CSV) while generating additional files for Neulite (<network_name>_population.csv, <src>_<trg>_connection.csv). This allows you to run both simulators on the same network data.

Usage Example

from bionetlite import NeuliteBuilder as NetworkBuilder

# Create network
net = NetworkBuilder('v1')

# Add nodes and edges (same as BMTK)
net.add_nodes(...)
net.add_edges(...)

# Build and save
net.build()
net.save_nodes(output_dir='network')
net.save_edges(output_dir='network')

Automatic Support for Data Standardization

This approach automatically supports standard formats such as SONATA and Allen Cell Types Database that BMTK supports.

Related Links

See also

For design details, implementation, and background on BMTK and BioNet, please refer to Design and Implementation.