Introduction to GENESIS

This HTML document roughly corresponds to the "Introduction to GENESIS" tutorial given by Dave Beeman on November 8, 2002 at the GUM*02 meeting in San Antonio, Texas.

Neural modeling with GENESIS

How do we model a real neuron like this pyramidal cell or a network composed of them in the hippocampus?

(For a slightly more detailed overview of compartmental modeling and modeling of ionic currents, see my Introduction to Computational Neuroscience.)

The answer to our question is - we model it piece by piece. The usual approach is to model this with a lumped parameter model in which we divide the neuron into a finite number of compartments containing resistances, capacitances and batteries to represent ionic equilibrium potentials. We model this complex neuron with something like this.

As a contrast to this simple model with just a few compartments, here is a model of a Purkinje cell from the cerebellum made with GENESIS by De Schutter and Bower. It has 4550 comparments and 8021 active conductances ("channels"). If you look closely, you can see that it is actually composed of many cylinders.

Each of these compartments has an equivalent circuit. Here is a circuit diagram for a generic compartment.

Vm represents the membrane potential at a point inside the compartment, relative to the "ground" symbol outside the cell. The membrane capacitance Cm can be charged or discharged as current flows into or out of the compartment, changing the value of Vm. This current can come from adjacent compartments, from the passage of ions through ion channels, or from a current Iinject through a probe injected into the compartment. Adjacent compartments have membrane potentials Vm' and Vm'', and the difference in potential across the axial resistances Ra' and Ra'' can cause current to enter or leave the compartment. The "leakage resistance" Rm and its associated equilibrium potential Em represent the passive channels, and the resistor with the arrow through it represents one of the possible variable conductances that are specific to a particular ion or combination of ions. By convention, these are represented by a conductance Gk, rather than a resistance, 1/Gk. Each one of these conductances has an associated equilibrium potential represented by the battery labeled Ek. The equilibrium potential (reversal potential) is the value of Vm at which there is no net flow of the ion through the conductance. Your textbook explains how these are calculated from the Nernst equation. Typically, there will be several of these variable resistances, with different conductances and equilibrium potentials, corresponding to the different types of channels in the compartment.

The full equation which this circuit obeys can be easily derived from Ohm's law and the circuit diagram:

Hodgkin and Huxley used this approach to model a single compartment representing a short piece of squid giant axon. You could duplicate their model by writing a program in Pascal, C or FORTRAN to solve the equations given in their papers. However, there are a lot of advantages to using a general purpose simulator such as GENESIS and a high level simulation language, rather than writing code in a computer language.

Overview of GENESIS

The design of the GENESIS simulator and interface is based on a ``building block'' approach. Simulations are constructed from modules that receive inputs, perform calculations on them, and then generate outputs. Model neurons are constructed from these basic components, such as compartments. and variable conductance ion channels. Compartments are linked to their channels and are then linked together to form multi-compartmental neurons of any desired level of complexity. Neurons may be linked together to form neural circuits. This object-oriented approach is central to the generality and flexibility of the system, as it allows modelers to easily exchange and reuse models or model components. In addition, it makes it possible to extend the functionality of GENESIS by adding new commands or simulation components to the simulator, without having to modify the GENESIS base code.

GENESIS uses a high-level simulation language to construct neurons and their networks. Commands may be issued either interactively to a command prompt, by use of simulation scripts, or through the graphical interface. A particular simulation is set up by writing a sequence of commands in the scripting language that creates the network itself and the graphical interface for a particular simulation. The scripting language and the modules are powerful enough that only a few lines of script are needed to specify a sophisticated simulation. The principal components of the simulation system and the various modes of interacting with GENESIS are illustrated below.

The underlying level of the GENESIS user interface is the Script Language Interpreter (SLI). This is a command interpreter similar to a Unix system shell with an extensive set of commands related to building, monitoring and controlling simulations. GENESIS simulation objects and graphical objects are linked together using the scripting language. The interpreter can read SLI commands either interactively from the keyboard (allowing interactive debugging, inspection, and control of the simulation), or from files containing simulation scripts.

The graphical user interface (GUI) is XODUS, the X-windows Output and Display Utility for Simulations. This provides a higher level and user-friendly means for developing simulations and monitoring their execution. XODUS consists of a set of graphical objects that are the same as the computational modules from the user's point of view, except that they perform graphical functions. As with the computational modules, XODUS modules can be set up in any manner that the user chooses to display or enter data. Furthermore, the graphical modules can call functions from the script language, so the full power of the SLI is available through the graphical interface. This makes it possible to interactively change simulation parameters in real time to directly observe the effects of parameter variations. The mouse may also be used to plant recording or injection electrodes into a graphical representation of the cell. In addition to provisions for plotting the usual quantities of interest (membrane potentials, channel conductances, etc.), XODUS has visualization features that permit such things as using color to display the propagation of action potentials or other variables throughout a multi-compartmental model, and to display connections and cell activity in a network model.

Here are some examples of the GUI for some GENESIS simulations:

The ``GENESIS Simulation Engine'' consists of the simulator base code that provides the common control and support routines for the system, including those for input/output and for the numerical solution of the differential equations obeyed by the various neural simulation objects.

In addition to receiving commands from the SLI and the GUI, the simulation engine can construct simulations using information from data files and from the pre-compiled GENESIS object libraries. For example, the GENESIS ``cell reader'' allows one to build complex model neurons by reading their specifications from a data file, instead of from a lengthy series of GENESIS commands delivered to the SLI. Similarly, network connection specifications may be read from a data file with the ``fileconnect'' command.

The GENESIS object libraries contain the building blocks from which many different simulations can be constructed. These include the spherical and cylindrical compartments from which the physical structure of neurons are constructed, voltage and/or concentration activated channels, dendro-dendritic channels, and synaptically-activated channels with synapses of several types including Hebbian and facilitating synapses. In addition, there are objects for computing intracellular ionic concentrations from channel currents, for modeling the diffusion of ions within cells (e.g., concentration pools, ionic pumps, and buffers), and for allowing ligand gating of ion channels (e.g., magnesium blocking for NMDA channels).

There are also a number of ``device objects'' that may be interfaced to the simulation to provide various types of input to the simulation (pulse and spike generators, voltage clamp circuitry, etc.) or measurements (peristimulus and interspike interval histograms, spike frequency measurements, auto- and cross-correlation histograms, etc.).

You may find a summary of all the GENESIS device objects in the Reference Manual section on Objects, with links the documentation for individual objects.

The GENESIS Object Hierarchy

The various elements in a GENESIS simulation are organized in a tree like the one shown below, and are referenced with a notation similar to that used in UNIX directory trees. Thus, "/net/cell[5]/dend[7]/GABA" might refer to an inhibitory synaptically activated conductance residing in the dendrite compartment 7 of cell 5 of a network.

These objects communicate by passing messages to each other, and each contain the knowledge of their own variables (fields) and the methods (actions) that they use to perform their duties during a simulation. For example, during a simulaton step, the PROCESS action will be carried for each type of object in its own way. If it is a voltage activated channel, this means carrying out a step in the numerical solution of the Hodgkin-Huxley equations for the conductance. If it is a graph object, this would mean plotting a point with data from any messages that it receives from other objects.

GENESIS Scripting Examples

The use of GENESIS scripting language can best be illustrated with a simple example like the trivial script:

//genesis script for a simple compartment simulation
// These commands may also be entered interactively

// create an instance of the compartment object
create compartment /soma

// set some internal fields
setfield /soma Rm 10 Cm 2 Em 25 inject 5

// create and display a graph inside a form
create xform /data
create xgraph /data/voltage
xshow /data

// add messages (PLOT Vm and inject) to the graph
addmsg /soma /data/voltage PLOT Vm *volts *red
addmsg /soma /data/voltage PLOT inject *current *blue

// make some buttons to execute simulation commands
create xbutton /data/RESET -script reset
create xbutton /data/RUN -script "step 100"
create xbutton /data/QUIT -script quit

// initialize each element before starting
reset       

This would produce the display:

Here is an example of a more realistic simulation, a GENESIS version of the 1991 Traub 19-compartment model hippocampal CA3 region pyramidal cell:

// genesis - "Stand-alone" version of the traub91 tutorial
setclock  0  0.00005            // set the simulation clock

/* file for 1991 Traub model channels */
include traub91proto.g

// Create a library of prototype elements to be used by the cell reader
create neutral /library
pushe /library
create symcompartment symcompartment
make_Na
make_Ca
make_K_DR
make_K_AHP
make_K_C
make_K_A
make_Ca_conc
pope

// Build the cell from a parameter file using the cell reader
readcell CA3.p /cell
setfield /cell/soma inject 0.2e-9  // Provide 0.2 nA injection current

include graphics.g  // You create this file to provide a GUI
reset

This is the basis of a suggested exercise (see cells/traubcell/README), where it is up to you to implement the graphical interface. This simulation makes use of two other files. cells/traubcell/CA3.p is a "cell parameter file" describing the cell, and cells/traubcell/traub91proto.g defines the functions to make the channels and other elements used in the model.

Here is a simple example of a GENESIS script to create an ionic conductance, similar to the ones in traub91proto.g.

/* FILE INFORMATION
   GENESIS script to make a "squid-like" K channel
   squid giant axon voltage-dependent channels,
   A.L.Hodgkin and A.F.Huxley, J.Physiol(Lond) 117, pp 500-544 (1952)
*/

// CONSTANTS
float EREST_ACT = -0.07     // resting potential (volts)
float EK    = -0.082        // potassium equil potential
float SOMA_A = len*PI*dia   // compartment area

function make_K_squid_hh
    str chanpath = "K_squid_hh"
    create tabchannel {chanpath}
    setfield ^ Ek {EK} Gbar {360.0*SOMA_A} Ik 0 Gk 0  \
            Xpower 4 Ypower 0 Zpower 0
    setupalpha {chanpath} X {10e3*(0.01 + EREST_ACT)} \
        -10.0e3 -1.0 {-1.0*(0.01 + EREST_ACT)} -0.01 \
        125.0 0.0 0.0 {-1.0*EREST_ACT} 80.0e-3
end

This script creates a tabchannel (a Hodgkin-Huxley type voltage activated channel with tabulated values of the state variables). The function setupalpha uses a generalized version of the Hodgkin-Huxley state variables alpha and beta, namely (A + B*V)/(C + exp((V + D)/F)), in order to set up the tabchannel tables. Details of using the tabchannel object and the setupalpha command are given in the GENESIS Reference Manual.

If you would like to try running some GENESIS demos and tutorials, there is information to help you get started in the file README.html. To learn more about creating your own GENESIS simulations, see the GENESIS Programming Tutorial.