File Formats

This section explains the formats of files generated by bionetlite.

Overview

bionetlite generates the following two types of files:

  1. SONATA format: HDF5 format compatible with BMTK

  2. Neulite format: CSV format read by the Neulite kernel

SONATA Format Files

SONATA format files are also generated for compatibility with other BMTK tools.

Node Files:

  • <network_name>_nodes.h5 - Node data in HDF5 format

  • <network_name>_node_types.csv - Node type definitions in CSV

Edge Files:

  • <src>_<trg>_edges.h5 - Edge data in HDF5 format

  • <src>_<trg>_edge_types.csv - Edge type definitions in CSV

These files follow BMTK’s standard format.

Neulite Format Files

Files for the Neulite kernel.

<network_name>_population.csv

Defines neuron population information.

Header

#n_cell,n_comp,name,swc_file,ion_file

Columns

Column Name

Type

Description

#n_cell

int

Number of neurons for this model type

n_comp

int

Number of compartments (number of rows in SWC file)

name

string

Model name (format: <pop_name>_<node_type_id>)

swc_file

string

Path to morphology file (e.g., data/Scnn1a.swc)

ion_file

string

Path to ion channel configuration file (e.g., data/472363762_fit.csv)

Example

#n_cell,n_comp,name,swc_file,ion_file
80,195,Scnn1a_100,data/Scnn1a_473845048_m.swc,data/472363762_fit.csv
20,158,PV_101,data/Pvalb_473862421_m.swc,data/472912177_fit.csv

<src>_<trg>_connection.csv

Defines synaptic connection information.

Header

#pre nid,post nid,post cid,weight,tau_decay,tau_rise,erev,delay,e/i

Columns

Column Name

Type

Description

#pre nid

int

Presynaptic neuron ID (0-indexed)

post nid

int

Postsynaptic neuron ID (0-indexed)

post cid

int

Postsynaptic compartment ID (node number in SWC file)

weight

float

Synaptic weight

tau_decay

float

Decay time constant (ms), tau2 of exp2syn

tau_rise

float

Rise time constant (ms), tau1 of exp2syn

erev

float

Reversal potential (mV)

delay

int

Synaptic delay (ms, rounded to integer)

e/i

string

‘e’ (excitatory) or ‘i’ (inhibitory)

Note

  • post cid is randomly sampled from sections specified by target_sections

  • delay is rounded to integer using ROUND_HALF_UP (2.5 becomes 3)

Example

#pre nid,post nid,post cid,weight,tau_decay,tau_rise,erev,delay,e/i
0,5,42,0.0005,1.7,0.1,0.0,2,e
0,8,15,0.0005,1.7,0.1,0.0,2,e
25,5,12,0.002,8.3,0.5,-70.0,1,i

SWC File (Processed)

Neuron morphology file preprocessed for Neulite.

Processing Details

bionetlite performs the following processing:

  1. Convert to zero-based indexing - Convert 1-based to 0-based

  2. Axon modification - Conversion to Perisomatic model (adding simplified artificial axon)

  3. Depth-first search (DFS) sort - For efficient processing in Neulite

Format

#id type x y z r parent
0 1 0.0 0.0 0.0 12.5 -1
1 1 0.0 0.0 5.0 12.5 0
2 2 0.0 0.0 35.0 0.5 1
3 2 0.0 0.0 65.0 0.5 2
4 3 -5.0 0.0 5.0 0.8 1

Columns:

  • #id - Compartment number (0-based)

  • type - 1=soma, 2=axon, 3=basal dendrite, 4=apical dendrite

  • x, y, z - 3D coordinates (μm)

  • r - Radius (μm)

  • parent - Parent compartment number (-1 for root)

Output location: <neulite_dir>/data/

Ion Channel Configuration CSV

Ion channel parameter file (JSON to CSV conversion complete).

Header

Cm,Ra,leak,e_pas,gamma,decay,NaV,NaTs,NaTa,Nap,Kv2like,Kv3_1,K_P,K_T,Kd,Im,Im_v2,Ih,SK,Ca_HVA,Ca_LVA

Meaning of Rows

A 4-row CSV file where each row represents a section of the neuron:

1,<soma values>
2,<axon values>
3,<basal dendrite values>
4,<apical dendrite values>

Main Parameters

  • Cm (μF/cm²) - Membrane capacitance

  • Ra (Ω·cm) - Axial resistance

  • leak (S/cm²) - Leak conductance (g_pas)

  • e_pas (mV) - Leak equilibrium potential

  • gamma, decay - Calcium dynamics

  • Ion channels - NaV, NaTs, NaTa, Nap, Kv2like, Kv3_1, K_P, K_T, Kd, Im, Im_v2, Ih, SK, Ca_HVA, Ca_LVA

Output location: <neulite_dir>/data/

config.h

Configuration header file for the Neulite kernel.

Generated Macros

#pragma once

// Simulation parameters
#define TSTOP ( 3000.0 )
#define DT ( 0.1 )
#define INV_DT ( ( int ) ( 1.0 / ( DT ) ) )

// Neuron parameters
#define SPIKE_THRESHOLD ( -15.0 )
#define ALLACTIVE ( 0 )

// Current injection parameters
#define I_AMP ( 0.1 )
#define I_DELAY ( 500.0 )
#define I_DURATION ( 500.0 )

Parameters

  • TSTOP (ms) - Simulation end time

  • DT (ms) - Time step

  • INV_DT - Inverse of time step (integer)

  • SPIKE_THRESHOLD (mV) - Spike detection threshold

  • ALLACTIVE - allactive model flag (0 or 1)

  • I_AMP (nA) - Amplitude of current injection

  • I_DELAY (ms) - Start time of current injection

  • I_DURATION (ms) - Duration of current injection

Output location: <neulite_dir>/kernel/config.h

Directory Structure

bionetlite generates the following directory structure:

project/
├── network/                      # SONATA format (BMTK compatible)
│   ├── V1_nodes.h5
│   ├── V1_node_types.csv
│   ├── V1_V1_edges.h5
│   └── V1_V1_edge_types.csv
└── neulite/                      # Neulite format
    ├── V1_population.csv
    ├── V1_V1_connection.csv
    ├── kernel/
    │   └── config.h
    └── data/
        ├── *.swc                 # Converted SWC files
        └── *.csv                 # Ion channel CSV

Next Steps