GENESIS: Tutorial 2

Related Documentation:

Using the GENESIS Shell for
Multi-compartment Modeling and Simulation

In this second of two introductory tutorials you will be guided through a brief session using the GENESIS shell (G-Shell). In this tutorial it is assumed that you are familiar with the contents of Tutorial 1 and the links it contains. You will be shown how to use basic features of the G-Shell to create, explore, and run a realistic multi-compartment model neuron. For example:

    ndf_load cells/purkinje/edsjb1994.ndf  
    run /Purkinje 0.1

Import Model

A large number of predefined model neurons come bundled with the GENESIS distribution. The command:

    genesis > library_show

lists the available model libraries. Example library files can be found with:

    genesis > library_show ndf examples

You can display the contents of the single cell library with:

    genesis > library_show ndf cells

which returns in part:

    ---  
    ndf_library:  
     cells:  
       ...  
       - purkinje/  
       ...

This indicates the existence of a directory in the library where one or more Purkinje cell models are stored. The documentation on Additions to the Models Library describes some other NDF files of models that have been converted from GENESIS 2.

The contents of the purkinje directory can be displayed with:

    genesis > library_show ndf cells/purkinje  
    ---  
    ndf_library:  
     cells/purkinje:  
       - edsjb1994.ndf  
       - edsjb1994_partitioned.ndf

To run one of these models the model description file (NDF) must first be loaded into the G-Shell. (To learn more about the NDF format see Introduction to the NDF File Format.) More details of cell model representation can be found in Technical Guide 1.

For example, to load the multicompartment De Schutter and Bower Purkinje cell model referenced above, enter:

    ndf_load cells/purkinje/edsjb1994.ndf

This command results in the complete Purkinje cell model being made available to the G-Shell.

Note: Currently, it is not advisable to load more than one model at a time into the G-Shell. Although multiple models can be loaded, the command ndf_save will save all models to the ndf file. To change to a different model you can either issue the delete command (see example below) or exit the G-Shell, restart GENESIS, and load the new model (see the Introduction to the GENESIS Shell).

Explore Model

To determine the name of a model that has been loaded and made available to the G-Shell (i.e. the name located at the root node of the element hierarchy tree), enter, for example:

    genesis > list_elements  
    ---  
    - /Purkinje

We can then determine the child elements of /Purkinje with:

    genesis > list_elements /Purkinje  
    ---  
    - /Purkinje/segments

A list of all segments in the model can then be generated with another list_elements command:

    genesis > list_elements /Purkinje/segments  
    ---  
    - /Purkinje/segments/soma  
    - /Purkinje/segments/main[0]  
    . . .  
    - /Purkinje/segments/b3s46[15]

Choosing one of the segments at random (here, for example /Purkinje/segments/b3s45[10]), we can generate a list of the elements that are associated with the given segment either by using the full pathname:

    genesis > list_elements /Purkinje/segments/b3s45[10]  
    ---  
    - /Purkinje/segments/b3s45[10]/cat  
    - /Purkinje/segments/b3s45[10]/cap  
    - /Purkinje/segments/b3s45[10]/kc  
    - /Purkinje/segments/b3s45[10]/k2  
    - /Purkinje/segments/b3s45[10]/km  
    - /Purkinje/segments/b3s45[10]/ca_pool  
    - /Purkinje/segments/b3s45[10]/stellate  
    - /Purkinje/segments/b3s45[10]/Purkinje_spine_0

or by making the chosen element the current working element via the ce (change working element) command. We can then check what the current working element is with the pwe (print working element) command:

    genesis > ce /Purkinje/segments/b3s45[10]  
    genesis > pwe  
    /Purkinje/segments/b3s45[10]  
    genesis > list_elements .  
    ---  
    - /Purkinje/segments/b3s45[10]/cat  
    . . .  
    - /Purkinje/segments/b3s45[10]/Purkinje_spine_0

The ability to change the current working element allows us to either check the value of the model parameters associated with the current working element (such as RM or CM) via the command model_parameter_show, change default parameter values via the model_parameter_set command or view the scaled value of the parameter via the command parameter_scaled_show, for example:

    genesis > pwe  
    /Purkinje/segments/b3s45[10]  
    genesis > model_parameter_show .  
    ---  
       ’parameter name’: SURFACE  
       type: number  
       value: 1.54645e-10  
       . . .  
       ’parameter name’: ELEAK  
       type: number  
       value: -0.08  
    genesis > parameter_show /Purkinje/segments/b3s45[10] RM  
    value = 3  
    genesis > model_parameter_add /Purkinje/segments/b3s45[10] RM 2.0  
    genesis > parameter_show /Purkinje/segments/b3s45[10] RM  
    value = 2  
    genesis > parameter_scaled_show /Purkinje/segments/b3s45[10] RM  
    scaled value = 1.29328e+10

Note:

Another Purkinje cell in the NDF library cells/purkinje is edsjb1994_partitioned.ndf. This model is identical to edsjb1994.ndf with the exception that its morphology has been repartitioned. It is simple to delete the current model and load the repartitioned version:

    genesis > delete /Purkinje  
    genesis > ndf_load cells/purkinje/edsjb1994_partitioned.ndf

We can now ask for a summary of the morphology:

    genesis > morphology_summarize /Purkinje

which generates the following output:

    Number of segments: 4548  
    Number of segments without parents: 1  
    Number of segment tips: 1474

We can also list the segments in /Purkinje/segments:

    genesis > list_elements /Purkinje/segments  
    ---  
    - /Purkinje/segments/soma  
    - /Purkinje/segments/main  
    - /Purkinje/segments/branches  
    - /Purkinje/segments/branchlets

or find the nine segments in the main dendrite (/Purkinje/segments/main), for example:

    genesis > list_elements /Purkinje/segments/main  
    ---  
    - /Purkinje/segments/main/main[0]  
    - /Purkinje/segments/main/main[1]  
    . . .  
    - /Purkinje/segments/main/main[8]

and so on for the branches (“list_elements /Purkinje/segments/branches”) and branchlets (“list_elements /Purkinje/segments/branchlets”).

It is also possible to list the location of the spine heads in the dendritic morphology:

    genesis > morphology_list_spine_heads /Purkinje

This generates considerable output that locates each dendritic spine head in the element hierarchy:

    tips:  
      name: Purkinje  
      names:  
        - /Purkinje/segments/b0s01[1]/Purkinje_spine_0/head  
        - /Purkinje/segments/b0s01[2]/Purkinje_spine_0/head  
        . . .  
        - /Purkinje/segments/b3s46[15]/Purkinje_spine_0/head

Save Model

There are two ways to save a model in the G-Shell.

  1. Explicitly: A model can be saved by giving its name as loaded into the G-Shell and an explicit path to the directory (including the name of the NDF file) where you want to save it:
    ndf_save /Purkinje /<directory path>/<file name>.ndf  
       

  2. Generically: Alternatively, if the name of the model loaded into the G-Shell is not known, a wild card construct can be employed (although remember that a list_elements command with no argument will report the name of the root element of the model hierarchy, in the example used here, /Purkinje):
    ndf_save /** /<directory path>/<file name>.ndf  
       

Note: In the absence of an explicit path to the directory where you would like to save the NDF file, it will be saved by default in the directory where you run the G-shell.

Define Simulation Constants

Here, for example, we set the run-time activity of the model neuron by finding and setting the maximum conductance of the CaT channels located at the soma. To find the settable parameters enter:

   genesis > list_elements  
   ---  
   - /Purkinje  
   genesis > list_elements /Purkinje  
   ---  
   - /Purkinje/SpinesNormal_13_1  
   - /Purkinje/segments  
   genesis > list_elements /Purkinje/segments  
   ---  
   - /Purkinje/segments/soma  
   - /Purkinje/segments/main  
   - /Purkinje/segments/branches  
   - /Purkinje/segments/branchlets  
   genesis > list_elements /Purkinje/segments/soma  
   ---  
   - /Purkinje/segments/soma/km  
   - /Purkinje/segments/soma/kdr  
   - /Purkinje/segments/soma/ka  
   - /Purkinje/segments/soma/kh  
   - /Purkinje/segments/soma/nap  
   - /Purkinje/segments/soma/naf  
   - /Purkinje/segments/soma/cat  
   - /Purkinje/segments/soma/ca_pool

The value of model parameters for CaT channels located at the soma can then be found with:

   genesis > model_parameter_show /Purkinje/segments/soma/cat  
     -  
       ’parameter name’: G_MAX  
       type: number  
       value: 5  
    . . .

As discussed in Tutorial 1, this may also be treated as a run-time parameter. The runtime value of G_MAX can then be set with the following command:

   genesis > runtime_parameter_add /Purkinje/segments/soma/cat G_MAX 4

To check that the parameter value has been correctly set, enter:

   genesis > runtime_parameter_show /Purkinje/segments/soma/cat G_MAX  
   ---  
   runtime_parameters:  
      - component_name: /Purkinje/segments/soma/cat  
         field: G_MAX  
         value: 4  
         value_type: number

Note: Only the run time value of this parameter has been altered. The default value defined by the model is unaffected:

   genesis > model_parameter_show /Purkinje/segments/soma/cat  
     -  
       ’parameter name’: G_MAX  
       type: number  
       value: 5

Define Simulation Inputs

There are currently three ways to provide stimulation inputs to a single cell model. Once the model is loaded into the G-Shell, either of the following input paradigms can be used to provide cell activation:

Current Injection

A 2 nA current injection can be applied to the soma with the following command:

   genesis > runtime_parameter_add /Purkinje/segments/soma INJECT 2e-9

Information about these runtime parameters can be obtained with:

   genesis > runtime_parameter_show  
   ---  
   runtime_parameters:  
      - component_name: /Purkinje/segments/soma  
         field: INJECT  
         value: 2e-9  
         value_type: number

Current or Voltage Clamp

For details see the Perfect Clamp tutorial.

Dynamic Clamp

One project being undertaken by GENESIS developers is the interfacing of the Real-Time eXperiment Interface (RTXI) with GENESIS to enable the realtime tuning of model parameters.

RTXI is a collaborative open-source software development project aimed at producing a real-time Linux based software system for hard real-time data acquisition and control applications in biological research.

Synaptic Activation

  1. Endogenous Poissonian Synaptic Activation: This provides the simplest way to activate synapses.

    Excitatory: The following command applies a Poisson stream of event times at 25 Hz to glutamate synapses on spine heads.

    genesis > runtime_parameter_add spine::/Purk_spine/head/par FREQUENCY 25

    Inhibitory: The following command applies a Poisson stream of event times at 1 Hz to GABAergic synapses on dendrites flagged as thick.

    genesis > runtime_parameter_add thickd::gaba::/Purk_GABA FREQUENCY 1

    Information about the run time parameters that have been set can be obtained with:

    genesis > runtime_parameter_show

    which for the endogenous excitatory and inhibitory Poissonian synaptic activation set above would return:

    runtime_parameters:  
       - component_name: thickd::gaba::/Purk_GABA  
          field: FREQUENCY  
          value: 1  
          value_type: number  
       - component_name: spine::/Purk_spine/head/par  
          field: FREQUENCY  
          value: 25  
          value_type: number  
     

  2. Extrinsic Synaptic Activation: This provides a much more flexible way to activate synapses than the endogenous activation method. Here, explicit synaptic activation times pre-generated outside of GENESIS (e.g. from a specified probability distribution using Matlab) are read from a file containing the required event list.

    After identifying which synapses should be activated, e.g.

    genesis > morphology_summarize /Purkinje  
    genesis > parameter_show /Purkinje/segments/branchlets/b1s06/b1s06[182] SOMATOPETAL_BRANCHPOINTS  
       value = 23  
       

    The event list can then be attached to the spine heads of the specified dendritic segment:

    genesis > runtime_parameter_add /Purkinje/segments/branchlets/b1s06/b1s06[182]/Purkinje_spine_0/head/par/synapse EVENT_FILENAME event_data/events.yml  
       

Define Simulation Outputs

Outputs can be specified from any number of compartments and can consist of any variable known to the mathematical solvers. For example, the following commands will define simulation outputs from the soma for the membrane potential (V m) and calcium concentration ([Ca]in):

   genesis > output_add /Purkinje/segments/soma Vm  
   genesis > output_add /Purkinje/segments/soma/ca_pool Ca

Check Simulation

The following command is used to check the simulation:

   genesis > check /Purkinje

Run Simulation

To run a simulation for 10 s we can use the same run command as used for the simple one compartment model in Tutorial 1

    genesis > run /Purkinje 10.00

Reset Simulation

A simulation can be returned to its initial state, where the time step of the simulation is set to zero and the initial values for all solved variables are loaded, with the following command:

    genesis > reset /Purkinje

Save Model State

The state of a simulation can be saved to a file name of your choosing, for example:

   genesis > model_state_save /Purkinje /<directory path>/<file name>.ndf

This command saves the state of a model to a file at the given location following the last update time step of a run. In the absence of a directory path, the file is saved by default in the current directory, i.e. the directory from which the G-Shell was initiated.

A simulation can then be initiated from this saved state with the command

   genesis > model_state_load /<directory path>/<file name>.ndf

The next run command will then start the simulation from this reinitialized state.

Check Simulation Output

Simulation output (in the default location) can be checked with the following command:

   genesis > sh cat /tmp/output

This will print the values in /tmp/output to the screen.

Note: Most common UNIX shell commands can be run in the G-Shell if passed as arguments to the sh command.

The next tutorial in this series (Tutorial 3) is devoted to the process of loading existing GENESIS 2 simulation scripts into the G-shell, saving the models in NDF files, and running them in GENESIS 3.