Run neurondemo and select the "Pyramidal" model.
Build / CellBuilder
Management / Import
Click on the big "Import" button, then select "Top Level".
A "warning" message pops up.
Click on "Go ahead and import".
Click on "Turn off indexed name display" and "Don't draw short sections as circles".
Save the CellBuilder to a ses file called cell0.ses, then exit NEURON.
Every model cell has Ra and cm.
Since the cell has a linear I-V relationship, and a resting potential of -70 mV, this model cell should also have the pas mechanism, with e_pas = -70 mV.
The exact values of Ra, cm, and g_pas are unknown,
but plausible starting values are
Ra = 100 ohm cmIt is easy to use the Biophysics strategy and parameters pages to specify these parameters for the all subset.
cm = 1 uf/cm2
g_pas = 0.0001 S/cm2
The question is how to set up the g_pas gradient in the apical tree.
Select apicals_x and click on the following selections:
metric: path length from root
proximal: no translation
distal: no normalization
A0 = gsoma = 1/10000
A = gmax - gsoma. If we assume that gmax is 10 times larger than gsoma (a plausible guess), then A = 1/1000 - 1/10000 = 9e-4
k = 1/50 because we're following Stuart and Spruston on this
d = 1000 (another plausible guess)
Management / Export / Export to file
Specify "cell.hoc" as the file name, then click on Save.
Now exit NEURON.
We could do this by writing our own procedures in hoc, but why reinvent the wheel? With model specifications that are complex, the more we can reuse working code and avoid writing our own code, the less likely we are to introduce mistakes.
So let's see if we can reuse the procedures that the CellBuilder created for us in cell.hoc
Before you start, make sure to register cell.hoc with your version control system. If you're not using a version control system (why not?), at least make a copy of cell.hoc and put it in a safe place.Open cell.hoc in a text editor. Note that it begins with
celldef() is the "main" procedure in cell.hoc. It is "in charge" of everything that cell.hoc does to create a model cell. Notice that celldef() calls two procedures whose names indicate they may be involved in specifying the biophysical properties of the model: biophys() and biophys_inhomo().load_file("subiter.hoc") proc celldef() { topol() subsets() geom() biophys() geom_nseg() biophys_inhomo() }
Search for biophys() and find
Uh-oh. "Magic numbers" buried deep inside code.proc biophys() { forsec all { Ra = 100 cm = 1 insert pas g_pas = 0.0001 e_pas = -70 } }
and insert the following at the start of cell.hocproc biophys() { forsec all { // Ra = 100 // cm = 1 Ra = Ra_ cm = cm_ insert pas // g_pas = 0.0001 g_pas = g_pas_ e_pas = -70 } }
Now in order to change Ra to a new value (say, 200), just execute Ra_=200 and then call biophys().Ra_ = 100 cm_ = 1 g_pas_ = 0.0001
We must also make sure that A0, A, and d can be specified by the MRF. Search for biophys_inhomo() and find
Note that the next procedure isproc biophys_inhomo() { // Path Length from root with no translation // and no normalization ranges from 41.2433 to 959.532 apicals_x = new SubsetDomainIterator(apicals, 0, 0, 0) g_pas_apicals_x() }
More magic numbers, buried deep inside code. And these parameters (A0, A, and d) are all "local" so they aren't visible outside g_pas_apicals_x().proc g_pas_apicals_x() {local x, p, p0, p1, A0, A, k, d apicals_x.update() p0 = apicals_x.p0 p1 = apicals_x.p1 A0 = 0.0001 A = 0.0009 k = 0.02 d = 1000 for apicals_x.loop() { x = apicals_x.x p = apicals_x.p g_pas(x) = A0 + A/(1 + exp(k*(d - p))) } }
The workaround is identical to what we did to proc biophys(): invent new variables A0_, A_, and d_ that are defined at the beginning of cell.hoc
and change the corresponding assignment statements in g_pas_apicals_x()A0_ = 0.0001 A_ = 0.0009 d_ = 1000
Finished! cell.hoc now starts with these statementsproc g_pas_apicals_x() {local x, p, p0, p1, A0, A, k, d . . . // A0 = 0.0001 A0 = A0_ // A = 0.0009 A = A_ k = 0.02 // d = 1000 d = d_ . . . }
so the MultipleRunFitter can control A0_, A_, d_, Ra_, cm_, g_pas_, then call biophys() and biophys_inhomo() to make these parameter changes affect the model.Ra_ = 100 cm_ = 1 g_pas_ = 0.0001 A0_ = 0.0001 A_ = 0.0009 d_ = 1000 load_file("subiter.hoc") proc celldef() { . . .
A final comment: Remember that changing Ra or cm may affect spatial accuracy. After obtaining what looks like a good fit, it is a good idea to verify that the optimized model's spatial grid is sufficiently fine, e.g. execute forall nseg*=3 then run a simulation to see if this affects the results. If it turns out that the grid is not fine enough, it may be necessary to increase nseg in one or more sections, then run another optimization. It may save some time if you do some exploratory simulations in order to discover which sections need larger nseg values.