Notice: Undefined offset: 3639 in /var/www/scholarpedia.org/mediawiki/includes/parser/Parser.php on line 5961
VERTEX - Scholarpedia

# VERTEX

Post-publication activity

Curator: Marcus Kaiser

The Virtual Electrode Recording Tool for EXtracellular potentials (VERTEX) is a Matlab tool for simulating extracellular potential recordings in spiking neural network (SNN) models. It uses a forward modelling approach to calculate extracellular potentials in a model given the position of the neurons relative to the virtual electrodes. VERTEX makes use of established theory on extracellular potential generation, modern simulation methods and recent developments in simplified neuron modelling to simulate local field potentials (LFPs) from large neuronal network models encompassing over 100,000 neurons [1]. Applied electric fields can also be incorporated into the ongoing neuronal dynamics, allowing VERTEX to simulate the effect of electric field stimulation [2]. VERTEX is therefore best suited for simulations that seek to model a particular experimental output using realistic tissue geometry and neuron density. Example simulations may be:

• Modelling the LFP generated by pharmacologically induced neuronal oscillations in an in vitro brain slice preparation.
• Modelling the field potential generated by electrical stimulation in cortical grey matter.
• Modelling the effect of non-invasive brain stimulation techniques such as transcranial direct current stimulation.

## Motivation

Extracellular potentials are a robust and commonly used measure of neural activity. They can be related to a multitude of underlying processes, in particular synchronised synaptic activation, but their interpretation is not always obvious. This interpretation is usually based on what we know of the anatomy and physiology of the system we are recording from. In simple systems a conceptual model or simple theoretical model may suffice but in more complex systems such as the neocortex computational models can be used. Computational modelling using VERTEX can help by integrating our knowledge of the underlying anatomy and physiology of the circuit to make a prediction of the LFP that can then be compared directly with the LFP measured in the experiment, creating a tighter coupling between theory and experiment.

## Overview

VERTEX is specifically set up to simulate layered structures - each neuron type specified by the user has a layer in which its soma will be placed. Synaptic connections are specified between neuron groups and each connection has a synapse type, which may indicate whether the connection should have a form of plasticity. Currently short term plasticity models and a spike timing dependent plasticity model are available. VERTEX saves the results of a simulation to files which can then be loaded into MATLAB and visualised using the functions provided or analysed using home made functions written by the users themselves.

Figure 1: Overview of the VERTEX simulation software. A Simulation workflow. The user provides parameters as Matlab structures to setup the neuron populations, position them in layers, connect them together, and simulate their dynamics and the resultant LFPs. Functionality to export to NeuroML is currently under development. B Example program structure. The main simulation program only requires calls to the initNetwork() function and the runSimulation() function, with the information required to set up the simulation specified in separate script files.

## What comprises a VERTEX simulation

To run a VERTEX simulation the user must first specify parameters to build the network over which the simulation will run. These parameters can be split into the following groups: neuron parameters, connection parameters, and tissue parameters. Figure 1 (A) illustrates the overall workflow of a VERTEX simulation, this has three components: specifying the parameters, running the simulation, and analysing the results. Figure 1 (B) shows an example of the MATLAB code used to specify the parameters.

### Tissue Parameters

The tissue parameters group includes the dimensions of the tissue to be simulated, as well as the layer boundaries (specifying the number and size of each layer in the structure), neuron density, and conductivity. The tissue parameters also include any stimulation applied to the tissue, such as the electric field and stimulation timings. The following example specifies a single-layered slice of tissue that is 2500 x 400 x 200 microns in volume, with a neuron density of 20000 and a conductivity of 0.3 Sm^-1:

TissueParams.X = 2500;
TissueParams.Y = 400;
TissueParams.Z = 200;
TissueParams.neuronDensity = 20000;
TissueParams.numLayers = 1;
TissueParams.layerBoundaryArr = [200, 0];
TissueParams.numStrips = 10;
TissueParams.tissueConductivity = 0.3;
TissueParams.maxZOverlap = [-1 , -1];


### Neuron Parameters

The neuron parameters group includes the details required to simulate the intrinsic dynamics of every cell in the network. Each neuron group has its own set of neuron parameters. These include the proportion of the entire network that this group comprises, the layer that the group is in, the details of the dendrite compartments (how many there are and their dimensions), and the passive properties of the neuron (the membrane resistance, the axial resistance, the capacitance, and the leak potential). A typical VERTEX simulation uses a neuron structure that is a caricature of the cell type it wishes to represent to limit the number of compartments and therefore the computational complexity of the simulation. VERTEX comes with a simple tool called the Neuron Model Builder, which allows one to build or modify neuron models for VERTEX simulations. VERTEX also can load neuron geometries from neuron markup language (NeuroML) files. The model used to simulate the spiking mechanism of the group is also included here, the default neuron model used in VERTEX is the Adaptive exponential integrate-and-fire model (AdEx), and so this would also require the parameters that this model uses. The following example creates an AdEx neuron group with 8 compartments as the first neuron group in the simulation (additional neuron groups could be added to the NeuronParams structure as subsequent entries into the array):

NeuronParams(1).neuronModel = 'adex';
NeuronParams(1).V_t = -50;
NeuronParams(1).delta_t = 2;
NeuronParams(1).a = 2.6;
NeuronParams(1).tau_w = 65;
NeuronParams(1).b = 220;
NeuronParams(1).v_reset = -60;
NeuronParams(1).v_cutoff = -45;
NeuronParams(1).numCompartments = 8;
NeuronParams(1).compartmentParentArr = [0, 1, 2, 2, 4, 1, 6, 6];
NeuronParams(1).compartmentLengthArr = [13 48 124 145 137 40 143 143];
NeuronParams(1).compartmentDiameterArr = ...
[29.8, 3.75, 1.91, 2.81, 2.69, 2.62, 1.69, 1.69];
NeuronParams(1).compartmentXPositionMat = ...
[   0,    0;
0,    0;
0,  124;
0,    0;
0,    0;
0,    0;
0, -139;
0,  139];
NeuronParams(1).compartmentYPositionMat = ...
[   0,    0;
0,    0;
0,    0;
0,    0;
0,    0;
0,    0;
0,    0;
0,    0];
NeuronParams(1).compartmentZPositionMat = ...
[ -13,    0;
0,   48;
48,   48;
48,  193;
193,  330;
-13,  -53;
-53, -139;
-53, -139];
NeuronParams(1).axisAligned = 'z';
NeuronParams(1).C = 1.0*2.96;
NeuronParams(1).R_M = 20000/2.96;
NeuronParams(1).R_A = 150;
NeuronParams(1).E_leak = -70;
NeuronParams(1).somaID = 1;
NeuronParams(1).basalID = [6, 7, 8];
NeuronParams(1).apicalID = [2 3 4 5];


### Connection parameters

Using the tissue and neuron parameters VERTEX creates the neuron models and position each cell randomly within its layer. The connection parameters include all the information required to connect the network and to simulate the synaptic dynamics. This includes the number of connections between neuron groups, the neuron compartments onto which the synapses form, and the spatial model used to generate the connections (the default in VERTEX is a Gaussian model, requiring a radius and limit). VERTEX uses MATLAB’s built-in random number generation such that the specific network realisation is unequivocally identified by the random seed used. The final connection parameter is the synaptic model between each pair of neuron groups. This includes the base synapse model (current based, conductance based, exponential, alpha), as well as any plasticity (short term plasticity, spike timing dependent plasticity) that may be applied. Synaptic parameters, such as the weight or decay constants, can be specified as a single value for all synapses in a particular connection or as a distribution, where each synaptic parameter is selected from the distribution. The following code creates connections from neuron group 1 to neuron group 1 and 2, with a current based exponential synapse, and specifies the particular compartment groups which the synapses will target. Common parameters for all connections from neuron group 1 are also specified, these include the axon arbor spatial model and its parameters (the radius and limit), as well as the conduction speed and release delay:

ConnectionParams(1).numConnectionsToAllFromOne{1} = 1700;
ConnectionParams(1).synapseType{1} = 'i_exp';
ConnectionParams(1).targetCompartments{1} = {'basalID', ...
'apicalID'};
ConnectionParams(1).weights{1} = 1;
ConnectionParams(1).tau{1} = 2;

ConnectionParams(1).numConnectionsToAllFromOne{2} = 300;
ConnectionParams(1).synapseType{2} = 'i_exp';
ConnectionParams(1).targetCompartments{2} = {'dendritesID'};
ConnectionParams(1).weights{2} = 28;
ConnectionParams(1).tau{2} = 1;

ConnectionParams(1).axonArborSpatialModel = 'gaussian';
ConnectionParams(1).sliceSynapses = true;
ConnectionParams(1).axonArborLimit = 500;
ConnectionParams(1).axonConductionSpeed = 0.3;
ConnectionParams(1).synapseReleaseDelay = 0.5;


### The simulation process

After building the network one can proceed with simulating its dynamics. This requires the specification of some simulation settings (e.g. the duration of the simulation and the time step) and recording settings (e.g. which variables to record and from which neurons to record them, sampling rate, etc). The simulation loop (the code executed at each time step) involves updating any externally applied electric field, updating all neuron and synapse variables, recording the value of all variables to be recorded, and processing all spikes (this will also involve updates of synaptic variables when plasticity is used). Shown below is an example of how to set up the recording settings structure to record the LFP using a grid of electrodes, as well as recording the membrane potential of every tenth of the first 2000 neurons. The sample rate is set to 5 kHz and the maximum recording time is set to 500 ms indicating that after 500 ms of recording a new file will be created. The simulation settings are set up to simulate for 500 ms with a time step of 0.03125 ms, and the simulation will be run in parallel.

RecordingSettings.saveDir = '~/VERTEX_results/';
RecordingSettings.LFP = true;
[meaX, meaY, meaZ] = meshgrid(0:1000:2000, 200, 600:-300:0);
RecordingSettings.meaXpositions = meaX;
RecordingSettings.meaYpositions = meaY;
RecordingSettings.meaZpositions = meaZ;
RecordingSettings.minDistToElectrodeTip = 20;
RecordingSettings.v_m = 1:10:2000;
RecordingSettings.maxRecTime = 500;
RecordingSettings.sampleRate = 5000;

SimulationSettings.simulationTime = 500;
SimulationSettings.timeStep = 0.03125;
SimulationSettings.parallelSim = true;


### Parallelisation

VERTEX makes use of MATLAB's Single Program Multiple Data (SPMD) parallel programming construct to take advantage of multiple cores. This requires the MATLAB parallel computing toolbox and involves assigning each neuron to a worker on which its neural and synaptic dynamics will be computed. Spikes are transmitted between workers during each simulation step.

### Neuron and synapse models

Figure 2: The class hierarchy relevant to conductance based exponential synapses.

Neuron and synapse types are described using inheritance to avoid the duplication of functionality. The abstract NeuronModel class describes the functionality provided by all multi-compartment neurons. It contains the properties of the membrane potential, external potential, and axial current (the currents that flow between compartments as a result of the difference between their membrane potentials), as well as the functionality required to integrate these. The integration of the stimulating field is included as an additional step during the calculation of the axial currents and is performed at each time step when the stimulation is turned on. It is part of the core functionality of the abstract NeuronModel class. Classes with specific mechanisms then inherit from this, e.g. the NeuronModel_passive class provides a simple wrapper on top to allow a neuron with no active channels. The NeuronModel_adex adds the adaptive exponential integrate and fire mechanism to the soma, allowing the cell to generate action potentials. Here each instance of a class would represent a group of neurons in the same layer and of the same type. This allows employing MATLAB’s vectorised operations when updating variables so that for example the membrane potential variable (v_m) holds the membrane potentials of all neurons in this group as a matrix. This also enables us to utilise the object-oriented design advantages without the overhead that would come from storing each neuron or synapse as its own object. The integration of the axial current involves a loop over all possible neighbouring compartments with an operation vectorised for each compartment. The class hierarchy relevant to conductance-based exponential synapses (SynapseModel_g_exp) is shown in Figure 2. Here, multiple inheritance is used to efficiently describe many combinations of synapse types. Synapse models have a base synapse type (defining how the synapse operates without plasticity, e.g. g_exp as a conductance-based exponential synapse), it can then also have short term plasticity (ab for the Abbott model or mt for the Markram and Tsodyks), spike timing dependent plasticity (STDP), or both. The plasticity models are defined as separate classes from which the synapse model can inherit.

Synapse Class Description
SynapseModel_i_exp Current based, exponential synapse
SynapseModel_g_exp Conductance based, exponential synapse
SynapseModel_g_exp_mt Conductance based, exponential synapse with Markram and Tsodyks [3] short term plasticity
SynapseModel_g_exp_ab Conductance based, exponential synapse with Abbott model [4] of short term plasticity
SynapseModel_g_exp_stdp Conductance based, exponential synapse with STDP
SynapseModel_g_exp_mt_stdp Conductance based, exponential synapse with STDP and Markram and Tsodyks [3] short term plasticity
SynapseModel_g_exp_ab_stdp Conductance based, exponential synapse with STDP and Abbott model [4] of short term plasticity

### Electric field stimulation

Incorporating the effect of an electric field generated by a stimulating electrode is relatively straightforward in VERTEX. The first step is to model the electric field, then the MATLAB Partial Differential Equation (PDE) toolbox can be used to model most simple electrode setups, and the output of this model attached to the tissue parameter structure, forming part of the input to the VERTEX simulation. The only further information needed is the times at which to apply the stimulation, which are specified as a list of stimulation onset and offset times. The following code will set the stimulation field and the times at which to apply it:

TissueParams.StimulationField = stimfield;   % stimfield is either a StationaryResults object
or a TimeDependentResults object from the PDE toolbox.
TissueParams.StimulationOn = [600 700];   % pulse interval of 100 ms
TissueParams.StimulationOff = [600.5 700.5];   % pulse width of 0.5 ms


To generate an appropriate field (either as a stationary or time-dependent field) follow the guide on the MATLAB PDE Toolbox website. Time-dependent fields that are shorter than the duration over which they are applied will be looped, this allows oscillating fields to be generated only for a single period, saving memory.

## Analysing simulation output

Figure 3: Example outputs of VERTEX simulations. A Spike raster of oscillatory activity. Black dots represent excitatory cells firing, pink dots represent inhibitory cells firing. B Soma positions of a network, along with the stimulation field. C LFP generated by applying the stimulation field in B, as a paired-pulse.

After a VERTEX simulation the user can load the simulation results and perform analysis, either using functions provided with VERTEX or custom code. The output files of the simulation are MAT files and so if the user wished to use other software to perform analysis then they would be required to export the data to their required format. VERTEX provides functions to plot a spike raster of the activity or to plot the LFP recorded at a particular electrode. It also provides functions to visualise the weights of synapses in the network, either on a group to group basis, or for each individual connection. The following code will load the results from the directory they were saved in, and plot a spike raster of the activity:

Results = loadResults(RecordingSettings.saveDir);
rasterParams.groupBoundaryLines = [0.7, 0.7, 0.7];
rasterParams.title = 'Spike Raster';
rasterParams.xlabel = 'Time (ms)';
rasterParams.ylabel = 'Neuron ID';
rasterFigure = plotSpikeRaster(Results, rasterParams);


This code will plot the stimulation field stored within the TissueParams struct, and then plot within this the soma positions of the cells in the network:

pdeplot3D(TissueParams.StimulationModel, 'ColorMap', TissueParams.StimulationField.NodalSolution, 'FaceAlpha', 0.8)
hold on;
pars.colors = rasterParams.colors;
plotSomaPositions(Results.params.TissueParams,pars);


Figure 3 shows some example visualisations of VERTEX output, a spike raster (A), the cell positions and stimulating electric field (B), and the response LFP (C).

## Performance

The VERTEX simulator can run simulations at the scale of a cortical column on a modern desktop computer, and at the scale of an in vitro brain slice preparation on a high-performance computing node. Parallelisation significantly improves the performance of large VERTEX simulations. Figure 4 shows the simulation times for a small and large network with increasing numbers of processing cores available. Increasing the number of electrodes from which to record an LFP also increases the simulation time.

Figure 4: Parallel simulation performance with increasing numbers of Matlab workers (i.e. parallel processes). Top row: Model initialisation times for A the 9881 neuron model and B the 123,517 neuron model. Bottom row: Simulation times for 1 s of biological time for C the 9,881 neuron model and D the 123,517 neuron model. Thick black lines denote linear speed scaling; legends indicate the number of electrodes used in each simulation run. The sub-linear speed-up in the small model is due to the decreased relative performance influence of code vectorisation for smaller matrices.

## Potential Applications

VERTEX is well suited to simulating brain oscillations recorded in vitro. For example, [1] build a simulation of persistent gamma oscillations recorded from macaque neocortex, making direct comparisons between the LFP recorded in simulation and experiment. This allows them to make predictions about the importance of specific intra-laminar connections in the generation of gamma oscillations. VERTEX may also be used to build simulations of the response LFP evoked by electrical stimulation. For example, [2] build a simulation of the response to focal electric field stimulation in rat neocortex. Using the simulation they predict the specific postsynaptic currents that contribute to the response LFP, based on what we currently know of the rat neocortical microcircuit. This then allows them to inform the interpretation of the changes seen in the LFP response as a result of short term and spike time-dependent plasticity.

## Comparison with similar software tools

Several simulation packages offer similar capabilities to VERTEX.

The Brian simulator [5], a Python based spiking neural network simulator, has good support for synaptic plasticity, both short term plasticity models and spike timing dependent plasticity models. Brian is easy to install and use, and also very extensible in terms of neuron and synapse models.

The NEST (NEural Simulation Tool) [6] is a mature and easy to use spiking neural network simulator, that allows users to simulate the activity of large scale laminar structures with various forms of synaptic plasticity and a range of neuron and synapse models. It can also be combined with the LFPy tool [7] to simulate the local field potential generated by a large network. The following table shows a selection of features present in each of the simulators.

The Neuron simulation environment [8] is a mature software system with a wide range of features including support for very detailed modelling of cellular processes. It also supports electrical stimulation through its extracellular mechanism, and LFP simulation through the LFPy tool [9] and supports a wide variety of synapse types including short term plasticity and spike timing dependent plasticity. It provides a graphical user interface to many of its features.

VERTEX is specifically designed for modelling multi-layered structures such as the neocortex, and it provides built-in support for modelling LFP generation, synaptic plasticity, and electric field stimulation. VERTEX is particularly suited to simulating electrical stimulation and LFP recording in laminar structures, as it provides built in support to recording the LFP and modeling electric field stimulation.

Feature BRIAN NEST NEURON VERTEX
User language Python Python Python/hoc Matlab
Multiple compartments Yes Yes Yes Yes
LFP calculation No With LFPy With LFPy Yes
Electric field stimulation No No Yes Yes
Parallelisation Yes Yes Yes Yes
Long term plasticity Yes Yes Yes Yes
Short term plasticity Yes Yes Yes Yes

## Acknowledgements

Development of this software was supported by BBSRC (BB/F016980/1), EPSRC (EP/E002331/1, EP/G03950X/1, EP/K026992/1, NS/A000026/1), and the Wellcome Trust (102037).

## References

1. Tomsett, R. J., Ainsworth, M., Thiele, A., Sanayei, M., Chen, X., Gieselmann, M. A., … Kaiser, M. (2015). Virtual Electrode Recording Tool for EXtracellular potentials (VERTEX): comparing multi-electrode recordings from simulated and biological mammalian cortical tissue. Brain Struct Funct 220(4), 2333–2353. https://doi.org/10.1007/s00429-014-0793-x

2. Thornton, C., Hutchings, F., Kaiser, M. (2019). The Virtual Electrode Recording Tool for EXtracellular Potentials (VERTEX) Version 2.0: Modelling in vitro electrical stimulation of brain tissue [version 1; peer review: 2 approved]. Wellcome Open Res 4, 20. https://doi.org/10.12688/wellcomeopenres.15058.1

3. Tsodyks, M., Pawelzik, K., Markram, H. (1998). Neural networks with dynamic synapses. Neural Computation 10(4), 821–835. https://doi.org/10.1162/089976698300017502

4. Abbott, L. F., Varela, J. A., Sen, K., Nelson, S. B. (1997). Synaptic depression and cortical gain control. Science 275(5297), 221–224. https://doi.org/10.1126/science.275.5297.221

5. Goodman, D. F., & Brette, R. (2008). Brian: a simulator for spiking neural networks in python. Frontiers in Neuroinformatics, 2, 5.

6. Plesser H.E., Diesmann M., Gewaltig M.O., Morrison A. (2019) NEST: The Neural Simulation Tool. In: Jaeger D., Jung R. (eds) Encyclopedia of Computational Neuroscience. Springer, New York, NY. https://doi.org/10.1007/978-1-4614-7320-6_258-6

7. Hagen, E., Dahmen, D., Stavrinou, M.L., Lindén, H., Tetzlaff, T., van Albada, S.J., Grün, S., Diesmann, M., Einevoll, G.T. (2016). Hybrid Scheme for Modeling Local Field Potentials from Point-Neuron Networks. Cerebral Cortex 26, 4461–4496. https://doi.org/10.1093/cercor/bhw237

8. Hines M.L., Carnevale N.T. (1997). The NEURON simulation environment. Neural Computation 9(6), 1179–209. https://doi.org/10.1162/neco.1997.9.6.1179

9. Lindén, H., Hagen, E., Leski, S., Norheim, E., Pettersen, K., Einevoll, G. (2014) LFPy: a tool for biophysical simulation of extracellular potentials generated by detailed model neurons. Frontiers in Neuroinformatics , Volume 7. https://doi.org/10.3389/fninf.2013.00041

Ted Carnevale (2007) Neuron simulation environment. Scholarpedia, 2(6):1378.

Alain Destexhe and Claude Bedard (2013) Local field potential. Scholarpedia, 8(8):10713.

Marc-Oliver Gewaltig and Markus Diesmann (2007) NEST (NEural Simulation Tool). Scholarpedia, 2(4):1430.

Dan F. M. Goodman and Romain Brette (2013) Brian simulator. Scholarpedia, 8(1):10883.

Rob Schreiber (2007) MATLAB. Scholarpedia, 2(7):2929.

Frances K. Skinner (2006) Conductance-based models. Scholarpedia, 1(11):1408.