# Ball - Stick model

## Physical System

## Model

### Ball-Stick approximation to cell

## Simulation

This exercise introduces the CellBuilder, a graphical tool for building and managing models of individual cells. First you will use the CellBuilder to create a model cell, which is essentially a "virtual experimental preparation." Then you will set up a user interface (run control, stimulator, graphs) for exercising the model cell and examining simulation results. This user interface is analogous to the instrumentation you would use in a wet lab, so you might think of it as a "virtual lab rig."

You will also learn a simple but effective strategy for managing the simulation environment that you have set up: making a kind of software wrapper that lets you conveniently recreate both the experimental preparation and the lab rig. One advantage of this approach is that it helps to separate the specification of the model cell from the specification of the instrumentation. This modularity makes it easier to reuse the same model cell in many different kinds of experiments, and to perform the same kind of experiment on many different model cells.

### Getting started

In this exercise you will be creating several files, so you need to be in a working directory for which you have file "write" permission. Start NEURON with course/ballstk as the working directory.

Hint
There are several ways to do this.
- Under UNIX it is most direct to go to the course/init directory and enter the command line `nrngui`
- Under MSWin it is easiest to double-click the nrngui icon on the desktop. Take a look at NEURONMainMenu / File / recent dir. If course/init appears in the menu list, select it. Otherwise, use NEURONMainMenu / File / working dir to bring up a directory browser that you can use to navigate to the desired location.

### Making the representation

Use the CellBuilder to make a simple ball and stick model that has these properties:

Section | Anatomy | Compartmentalization | Biophysics
soma | length 20 microns diameter 20 microns | nseg = 1 | Ra = 160 ohm cm, Cm = 1 uf/cm2 Hodgkin-Huxley channels
dend | length 1000 microns diameter 5 microns | nseg = 1 | Ra = 160 ohm cm, Cm = 1 uf/cm2 passive with Rm = 10,000 ohm cm2

Hints
1. Starting the CellBuilder. Use the NEURONMainMenu / Build / CellBuilder.
2. Overview of the CellBuilder.
3. Hints for using the CellBuilder.
4. It may be helpful to look up these terms in the on-line Help Reference :
   diam L nseg hh pas

### Using the Representation

At this point you should have :
  1. entered the specification of the ball & stick model in the CellBuilder
  2. created a Window Group called Ball Stick Model and added the CellBuilder (with Continuous Create ON) to this group
  3. saved the Ball Stick Model window group to a session file called ballstk.ses and verified what you saved
  4. exited NEURON

In the course/ballstk directory, make an init.hoc file with the contents

    	// load the GUI tools
    	load_file("nrngui.hoc")
    	// your specification of the model
    	load_file("ballstk.ses")
    	// your GUI
    	load_file("start.ses")

Make a beginning start.ses file with the single line

    	print "ready!"

| Actually you could put any innocuous statements you like into the start.ses file, because you'll be overwriting them with a custom user interface that you construct later.

Start NEURON with the init.hoc argument. Under unix use the command

    	nrngui init.hoc

Under MSWindows just double click on the init.hoc file in the file manager ("Windows Explorer").

## Exercises

1. Establish that the representation in the computer basically corresponds to the model.
Connectivity? (type `topology()`)
Soma area? (type `area(0.5)`)
Are the properties what you expect? Try

    	soma psection()
    	dend psection()

2. Use the NEURONMainMenu toolbar to construct an interface that allows you to inject a stimulus current at the soma and observe a plot of somatic Vm vs. time.

3. When a current stimulus is injected into the soma, does it flow into the dendrite properly? Hint: examine a space plot of membrane potential.

## Saving and Retrieving the Complete Experimental Setup

You now have a complete setup for doing simulation experiments. The CellBuilder, which specifies your "experimental preparation," is safe because you tucked it away in the Ball Stick Model window group and saved that to the session file ballstk.ses. However, the GUI that constitutes your nicely-configured "lab rig" (the RunControl, PointProcessManager, graph of v vs. t, and space plot windows) could easily be lost if you exited NEURON prematurely or if the computer crashed, and it would be very tedious to re-create. To make it easy to reconstitute the virtual lab rig, you should use the WindowGroupManager to save these windows to a session file. This will allow you to immediately begin with the current GUI.

1. Bring up the WindowGroupManager (NEURONMainMenu / Window / Group Manager). Note that the Ball Stick Model group already exists (left panel of WGM). The names of the windows that constitute your lab rig appear in the "Ungrouped Windows" list (right panel of WGM).
2. Create a new group and give it a descriptive name, e.g. Lab Rig.
3. Click on each of the items in the Ungrouped Windows list to add them to the Lab Rig group.
4. Save the Lab Rig group to a session file called start.ses

Test it by using NEURONMainMenu / File / load session to retrieve the start.ses file. Copies of the "lab rig" windows should overlay the originals. If so, exit NEURON and then restart it with the init.hoc argument. It should start up with the windows that you saved.

## More exercises

4. How does the number of segments in the dendrite affect your simulation? Turn on Keep Lines in the graph of Vm vs. t so you will be able to compare runs with different nseg.
Then in the interpreter window issue the command
`dend nseg *= 3`
and run a new simulation. Repeat until you no longer see a significant difference between consecutive runs.
Then use the command
`dend print nseg`
to see how many dendritic segments were required.

5. Is the time step (dt) short enough?

6. Here's something you should try on your own, perhaps after class tonight: using the CellBuilder to manage models "on the fly."

## Footnotes and Asides

1. Here are sample init.hoc and initial start.ses files.

2. The CellBuilder can be used to make your own "digital stem cells." If you have a model cell that you would like to return to later, save the CellBuilder to a session file. To bring the model back, just retrieve the session file. This is a good way to create an "evolutionary sequence" of models that differ only in certain key points.

3. The CellBuilder can also be used to manage models based on detailed morphometric reconstructions. This is covered in a later exercise.

NEURON hands-on course
Copyright © 1998-2003 by N.T. Carnevale and M.L. Hines, all rights reserved.