Basic Usage

Building Networks with bionetlite

Note

Using bionetlite requires BMTK code and data. In most cases, existing BMTK code can be reused.

Initializing NeuliteBuilder

bionetlite can be used simply by importing NeuliteBuilder in existing BMTK code:

from bionetlite import NeuliteBuilder as NetworkBuilder

# Create network
net = NetworkBuilder(
    'network_name',
    convert_morphologies=True,  # Convert morphology files (default: True)
    convert_ion_channels=True   # Convert ion channel settings (default: True)
)

Parameter Description

  • network_name: Name of the network (string)

  • convert_morphologies: Whether to preprocess SWC files for Neulite (True/False)

  • convert_ion_channels: Whether to convert ion channel configuration files (JSON) to CSV for Neulite (True/False)

Note

convert_morphologies and convert_ion_channels are set to True by default. From the second run onwards, you can skip processing by setting them to False.

Adding Nodes

The method of adding nodes is identical to existing BMTK code.

net.add_nodes(
    N=100,  # Number of neurons
    pop_name='Scnn1a',  # Population name
    model_type='biophysical',  # Model type
    model_template='ctdb:Biophys1.hoc',
    dynamics_params='472363762_fit.json',  # Ion channel parameters
    morphology='Scnn1a_473845048_m.swc',  # Morphology file
    ei='e'  # Excitatory ('e') or inhibitory ('i')
)

Supported Model Types

Currently, bionetlite and Neulite support only biophysical neurons. Point neurons and Virtual cells are automatically excluded from output.

  • biophysical: Biophysical neuron with morphology

  • point_neuron: Point neurons (LIF, etc.) - Not supported

  • virtual: Virtual neurons - Not supported

Adding Edges (Synaptic Connections)

Defining Basic Connections

net.add_edges(
    source={'pop_name': 'Exc'},  # Source population
    target={'pop_name': 'Inh'},  # Target population
    connection_rule=5,  # Number of connections or probability
    syn_weight=0.001,  # Synaptic weight
    delay=2.0,  # Delay (ms)
    dynamics_params='AMPA_ExcToInh.json',  # Synapse parameters
    model_template='exp2syn'  # Synapse model
)

Supported Synapse Models

Currently, bionetlite supports the following synapse models:

  • exp2syn: Double exponential synapse

  • ❌ Other synapse models - Not supported

Note

For the exp2syn model, synapse models in the directory specified in config are automatically applied.

Saving the Network

# Build the network
net.build()

# Save node information
net.save_nodes(output_dir='network')

# Save edge information
net.save_edges(output_dir='network')

Execution Flow

The execution flow of bionetlite is as follows:

  1. Import NeuliteBuilder: Import bionetlite instead of bionet

  2. Define the network: Define nodes and edges in the same way as bionet

  3. Build: Build the network with net.build()

  4. Save: Generate files with save_nodes() and save_edges()

  5. Run with Neulite: Execute the generated files with the Neulite kernel

Limitations

bionetlite does not support the following features:

  • Point neuron (LIF, etc.)

  • Virtual neuron

  • Spike input from file

  • Synapse models other than exp2syn

For details, see Specifications and Limitations.

Next Steps