Tutorial 4: Network with Multiple Populations
Overview
This tutorial demonstrates simulation of multiple populations consisting of different neuron types.
See also
Corresponding BMTK tutorial: Tutorial: Multi-Population Recurrent Network
Changes from BMTK to bionetlite
Only the import statement needs to be changed. All other code is completely identical.
Before (BMTK):
from bmtk.builder.networks import NetworkBuilder
After (bionetlite):
from bionetlite import NeuliteBuilder as NetworkBuilder
Generated Files
population.csv
Contains information for 100 neurons (80 excitatory + 20 inhibitory).
connection.csv
Contains information for 4 types of synaptic connections (E→E, E→I, I→E, I→I).
Files Generated by Neulite
bionetlite generates files in the following directory:
Directory Structure
sim_ch04_nl/
├── V1_population.csv
├── V1_V1_connection.csv
├── kernel/
│ └── config.h
└── data/
├── Scnn1a_473845048_m.swc
├── Pvalb_470522102_m.swc
├── 472363762_fit.csv
└── 472912177_fit.csv
V1_population.csv
A population file for Neulite with multiple neuron types defined:
#n_cell,n_comp,name,swc_file,ion_file
80,3682,Scnn1a_100,data/Scnn1a_473845048_m.swc,data/472363762_fit.csv
20,1900,PV_101,data/Pvalb_470522102_m.swc,data/472912177_fit.csv
Each row contains the following information:
#n_cell: Number of cells (80 excitatory, 20 inhibitory)n_comp: Number of compartments (Scnn1a: 3682, PV: 1900)name: Population nameswc_file: Path to SWC morphology fileion_file: Path to ion channel parameter file
V1_V1_connection.csv
A connection file for Neulite that defines all synaptic connections within and between populations:
#pre nid,post nid,post cid,weight,tau_decay,tau_rise,erev,delay,e/i
0,1,5,5e-05,1.0,3.0,0.0,2,e
0,1,3351,5e-05,1.0,3.0,0.0,2,e
0,2,28,5e-05,1.0,3.0,0.0,2,e
...
Meaning of each column:
#pre nid: Presynaptic neuron IDpost nid: Postsynaptic neuron IDpost cid: Postsynaptic compartment IDweight: Synaptic weighttau_decay: Decay time constanttau_rise: Rise time constanterev: Reversal potentialdelay: Synaptic delay (ms)e/i: Excitatory (e) or inhibitory (i)
Building and Running the Neulite Kernel
Step 1: Deploy Kernel Sources
Copy the contents of Neulite’s kernel directory to the kernel directory generated by bionetlite. Exclude config.h as it has already been generated by bionetlite:
rsync -av --exclude='config.h' /path/to/neulite/kernel/ sim_ch04_nl/kernel/
Step 2: Build the Kernel
Navigate to the kernel directory and build. config.h has already been generated by bionetlite:
cd sim_ch04_nl/kernel
make
Step 3: Place the Binary
Copy the built binary file nl to the parent directory:
cp nl ../
Step 4: Run the Simulation
Navigate to the directory generated by bionetlite and run the simulation:
cd ..
./nl V1_population.csv V1_V1_connection.csv
Note
About External File Input
Neulite currently does not support spike input from external files as performed in BMTK tutorials. Therefore, simulations using the files generated in this tutorial will not produce spikes due to the absence of external input.
To verify network behavior, please configure constant current injection (I_AMP, I_DELAY, I_DURATION) in config.h.
Simulation Result Files
The following text files are generated after running the Neulite kernel:
s.dat - Spike Time Data
Space-delimited text format recording one spike event per line:
Time(ms) NeuronID
12.5 0
15.3 15
18.9 42
23.1 0
...
Column 1: Time at which spike occurred (ms)
Column 2: ID of the neuron that generated the spike (0-79: excitatory, 80-99: inhibitory)
v.dat - Membrane Potential Data
Space-delimited text format recording membrane potential of all neurons per line:
Time(ms) Neuron0 Neuron1 ... Neuron99
0.0 -65.0 -65.0 ... -65.0
0.1 -64.8 -64.9 ... -65.1
0.2 -64.6 -64.8 ... -65.0
...
Column 1: Time (ms)
Column 2 onwards: Soma membrane potential of each neuron (mV), for all 100 neurons
Note
Data for excitatory (0-79) and inhibitory (80-99) neurons are contained in the same file.
About Mixing with LIF Models
Note
Tutorial 4 originally included LIF model neurons as well, but bionetlite and Neulite currently support only biophysical neurons.
bionetlite supports the following neuron types:
✅ biophysical neurons
❌ point neurons (LIF, etc.)
❌ Virtual neurons
Therefore, only files related to biophysical neurons are generated in this tutorial.
Next Steps
Allen V1 Model: Large-scale Network - Application example with actual research model
Basic Usage - Basic usage
Specifications and Limitations - Details of supported features