How does 'Z. F. Mainen and T. J. Sejnowski (1996)' model work?

Managing anatomically complex model cells with the CellBuilder. Importing morphometric data with NEURON's Import3D tool or Robert Cannon's CVAPP. Where to find detailed morphometric data.
Post Reply
Christine Chung
Posts: 17
Joined: Fri May 03, 2019 2:41 am

How does 'Z. F. Mainen and T. J. Sejnowski (1996)' model work?

Post by Christine Chung »

Hello,
I'm beginner and trying to modify morphology of detailed models.

I have question how this codes works.
Z. F. Mainen and T. J. Sejnowski (1996)'s model
https://senselab.med.yale.edu/ModelDB/s ... ls/#tabs-1

This is L5 pyramidal neuron: (since it is too long to upload to forum, I deleted chunk of coordinates in middle of the code)

Code: Select all

/*----------------------------------------------------------------
%W%  %G%
j4.txt  translated Mon Nov  1 16:56:20 1993 by ntscable 2.0
source file syntax: Douglas 3D
output file syntax: CABLE
soma: diameter = 25 um length = 35 um area = 2747.9 um2
11 primary neurites
87 branches totaling 17667.6 um in length, 52996.2 um2 in area
3383 tree points translated to 164 segments (1 requested)
Neurites divided into segments of equal dx between adjacent digitized
branch points.
Segment length constrained to be < 17667.6 um.
----------------------------------------------------------------*/
					/* create sections */
create    soma,\
          dend1[9],\
          dend2[13],\
          dend3[5],\
          dend4[7],\
          dend5[1],\
          dend6[11],\
          dend7[13],\
          dend8[5],\
          dend9[5],\
          dend10[11],\
          dend11[83]



/*----------------------------------------------------------------*/
proc geometry() { local i, j

						/* soma geometry */
    soma {
        nseg = 1
	diam = 25
	L = 35
    }

					/* connect primary neurites */
    soma connect dend1[0] (0), 0.5
    soma connect dend2[0] (0), 0.5
    soma connect dend3[0] (0), 0.5
    soma connect dend4[0] (0), 0.5
    soma connect dend5[0] (0), 0.5
    soma connect dend6[0] (0), 0.5
    soma connect dend7[0] (0), 0.5
    soma connect dend8[0] (0), 0.5
    soma connect dend9[0] (0), 0.5
    soma connect dend10[0] (0), 0.5
    soma connect dend11[0] (0), 0.5


					/* neurite geometry*/
    for i = 0,8 {
        dend1[i] {
            nseg = fscan()
            pt3dclear()
            for j = 1, fscan() {
                pt3dadd(fscan(),fscan(),fscan(),fscan())
            }
        }
    }

    for i = 0,12 {
        dend2[i] {
            nseg = fscan()
            pt3dclear()
            for j = 1, fscan() {
                pt3dadd(fscan(),fscan(),fscan(),fscan())
            }
        }
    }

    for i = 0,4 {
        dend3[i] {
            nseg = fscan()
            pt3dclear()
            for j = 1, fscan() {
                pt3dadd(fscan(),fscan(),fscan(),fscan())
            }
        }
    }

    for i = 0,6 {
        dend4[i] {
            nseg = fscan()
            pt3dclear()
            for j = 1, fscan() {
                pt3dadd(fscan(),fscan(),fscan(),fscan())
            }
        }
    }

    for i = 0,0 {
        dend5[i] {
            nseg = fscan()
            pt3dclear()
            for j = 1, fscan() {
                pt3dadd(fscan(),fscan(),fscan(),fscan())
            }
        }
    }

    for i = 0,10 {
        dend6[i] {
            nseg = fscan()
            pt3dclear()
            for j = 1, fscan() {
                pt3dadd(fscan(),fscan(),fscan(),fscan())
            }
        }
    }

    for i = 0,12 {
        dend7[i] {
            nseg = fscan()
            pt3dclear()
            for j = 1, fscan() {
                pt3dadd(fscan(),fscan(),fscan(),fscan())
            }
        }
    }

    for i = 0,4 {
        dend8[i] {
            nseg = fscan()
            pt3dclear()
            for j = 1, fscan() {
                pt3dadd(fscan(),fscan(),fscan(),fscan())
            }
        }
    }

    for i = 0,4 {
        dend9[i] {
            nseg = fscan()
            pt3dclear()
            for j = 1, fscan() {
                pt3dadd(fscan(),fscan(),fscan(),fscan())
            }
        }
    }

    for i = 0,10 {
        dend10[i] {
            nseg = fscan()
            pt3dclear()
            for j = 1, fscan() {
                pt3dadd(fscan(),fscan(),fscan(),fscan())
            }
        }
    }

    for i = 0,82 {
        dend11[i] {
            nseg = fscan()
            pt3dclear()
            for j = 1, fscan() {
                pt3dadd(fscan(),fscan(),fscan(),fscan())
            }
        }
    }



					/* branching topology*/
    for i = 1,8 {
        dend1[fscan()] connect dend1[i] (0), fscan()
    }

    for i = 1,12 {
        dend2[fscan()] connect dend2[i] (0), fscan()
    }

    for i = 1,4 {
        dend3[fscan()] connect dend3[i] (0), fscan()
    }

    for i = 1,6 {
        dend4[fscan()] connect dend4[i] (0), fscan()
    }

    for i = 1,0 {
        dend5[fscan()] connect dend5[i] (0), fscan()
    }

    for i = 1,10 {
        dend6[fscan()] connect dend6[i] (0), fscan()
    }

    for i = 1,12 {
        dend7[fscan()] connect dend7[i] (0), fscan()
    }

    for i = 1,4 {
        dend8[fscan()] connect dend8[i] (0), fscan()
    }

    for i = 1,4 {
        dend9[fscan()] connect dend9[i] (0), fscan()
    }

    for i = 1,10 {
        dend10[fscan()] connect dend10[i] (0), fscan()
    }

    for i = 1,82 {
        dend11[fscan()] connect dend11[i] (0), fscan()
    }

}

geometry()




NEURITE COORDINATES AND DIAMETERS:

    1 4
   -54.8      6.5      -25      3.5
     -49      5.2    -24.3      3.5
   -44.5        7    -23.7      3.5
   -42.8      7.2    -24.5      3.5

    1 3
   -42.8      7.2    -24.5      3.5
   -41.5        8      -23      2.3
     -40        9      -23      1.7

    1 47
     -40        9      -23      1.7
   -40.5        9      -23      1.7
   -36.5      9.2      -21        2
   -32.5     11.5    -16.5        1
   -28.5     14.2      -13      1.3
   -24.2     16.2    -10.5        1
   -20.8     18.2       -8      1.5
   -15.2       20     -5.7      1.5
   -12.8       22     -3.7      0.5
      -9     24.8     -2.3        2
    -5.2       26      0.5      0.5
      -2       28      1.5      1.7
       2     29.8      4.5      1.3
     5.2     30.5      5.7      1.5
       8     31.2      9.7      1.3
    11.5     33.8     12.3      1.3
    14.5     36.2       16        2
    16.5     40.5       18        1
      21       43     19.7        1
      24     44.2     22.3        1
    28.2     44.5       26      0.5
      33     47.2     32.3      1.3
    36.5     50.2     35.5      0.5
    41.2     51.2     41.3        1
    45.2     52.2       45        1
    46.5     52.5       48      0.5
    52.8     53.5       50        1
    56.2     54.2       53      1.5
    61.5     53.5     56.5        1
    68.5       52     58.7      0.5
      72     49.5     61.7      1.5
      77     48.2     63.3      1.5
    81.5       48     62.7        1
    85.2     51.5     65.3      0.3
    87.8     54.8       66      0.5
      87     58.8     74.7      0.5
    85.2       59     78.7        1
    86.8     59.5     84.3      0.5
      90     61.8       88      0.5
    94.8     66.5     92.5      0.5
    98.8     71.8     94.5        1
   101.2     75.5     95.7      0.5
   101.2     80.2       98      0.3
     102     84.8      100      0.5
     103       88      104      0.3
   104.8       89    105.5        1
     107     91.5    108.7      0.3

    1 11
     -40        9      -23      1.7
     -37     10.2      -23        1
   -30.5       14    -23.7      1.7
     -26     16.5    -25.3      1.3
   -21.8     20.8    -27.3      1.3
   -16.2     25.8    -29.7      0.5
   -11.2     31.5    -31.7      1.5
      -8     35.8    -33.7      1.3
    -4.8     38.2    -35.7      1.3
      -3     40.8      -37      1.7
    -0.2     44.2    -38.7      1.7

    1 34
    -0.2     44.2    -38.7      1.7
     0.2     45.2    -37.5        1
     2.8     50.2    -36.7        1
     6.8     54.5    -36.7      0.5
       9     58.5    -36.3      0.5
      11       63    -35.7      1.3
      15       68    -34.7      0.5
    17.8       71    -35.3      0.5
      20     75.5    -31.5        1
    23.2       79    -28.3      0.5
      25     82.8    -26.5      1.3
    27.2       87    -26.3      0.5
    28.8     92.8    -23.3      0.3
      31       95    -22.5        1
      35       99    -21.7      1.3
    38.5    103.2    -22.5        1
    41.5    107.5    -21.3      1.3
    43.8    111.5    -20.5      0.5
    44.8    112.2      -21      1.7
    53.2    113.2      -19      0.3
      57      115    -18.5        1
    58.8    117.2    -17.5        1
    60.5    119.5    -17.5      0.5
      62    122.5    -14.7      0.5
    62.2    124.5      -12      0.5
    63.2    126.2    -11.3      0.3
    65.8    127.8     -9.7      0.3
      67      129     -9.3      0.5
    68.5    130.2     -8.3      0.3
    71.5    130.8     -5.3        1
    72.8    131.5     -3.3      0.3
    77.8    130.5        0      0.3
    80.5    130.2      1.7      0.3
      82      131      2.7      0.5

    1 26
    -0.2     44.2    -38.7      1.7
       1     45.5    -39.7      0.5
       3     47.5    -43.3        1
       6       50    -46.7      1.3
     9.2     53.8    -49.5      1.3
      10     56.8    -50.5      1.3
    13.5       59      -54      0.5
    20.2       65      -59        1
    21.2     68.5    -59.5      0.3
      24       69    -61.3        1
    29.5     71.2      -65      0.5
    31.8     74.8      -69        1
    35.2     76.5      -73      0.5
    39.8     79.2    -76.3        1
    42.8     80.8    -79.5        1
    41.5       83    -81.5        1
      48     87.2    -84.5      0.3
    50.5       90    -88.3      1.3
    52.5     93.8    -92.3      0.5
    55.5     98.5    -97.5      0.5
    59.8     99.8    -98.3      0.5
    65.5      100   -101.7      0.3
    67.5    101.5   -101.7      0.5
    70.8    104.2   -105.3      0.3
    73.8    107.2   -111.5      0.3
      74    108.2   -113.5      0.3

    1 8
   -42.8      7.2    -24.5      3.5
     -42      5.5    -23.7      0.5
   -38.5      4.8    -24.7      1.5
   -34.2        3    -26.5      2.3
   -30.2      1.5    -27.7      1.7
   -27.2      0.2    -29.7        1
     -25     -0.5      -31      2.3
     -23     -2.5    -33.3      2.3

    1 38
     -23     -2.5    -33.3      2.3


/*----------------------------------------------------------------*/
proc geometry() { 

	/* NULL geometry procedure: keeps the user from
	calling the geometry procedure in isolation. */

    printf("\nYou must re-read the entire geometry\n")
    printf("file to execute geometry().\n\n")
}

How can I know which row(x, y, z, diameter) indicates which dend segment?

A part of the j4a.hoc file:

Code: Select all

    for i = 0,12 {
        dend2[i] {
            nseg = fscan()
            pt3dclear()
            for j = 1, fscan() {
                pt3dadd(fscan(),fscan(),fscan(),fscan())
            }
        }
    }
Here, I have no idea with how fscan find specific row. is it in turn?

There is another Question.
This is demofig1 which imports neuron hoc file:

Code: Select all

/* --------------------------------------------------------------
   Multi-compartment simulations of neocortical neurons
   DEMO
  
   Z. F. Mainen and T. J. Sejnowski (1996) Influence of dendritic
   structure on firing pattern in model neocortical neurons. 
   Nature 382: 363-366. 
   
   Demo of Figure 1.

   updated: 11/1/96
   author:
   Zach Mainen
   zach@salk.edu or zach@cshl.org


   Corrections to methods of Figure 1 misprinted in paper:

   1. Time step = 25 usec, not 250 usec
   
   2. I_Na rate functions are all shifted 5 mV negative
   m:
   alpha = 0.182(v+30)/(1-exp(-(v+30)/9))
   beta = -0.124(v+30)/(1-exp((v+30)/9))
   h:
   alpha = 0.024(v+45)/(1-exp(-(v+45)/5))
   beta = -0.0091(v+70)/(1-exp((v+70)/5))
   beta_inf = 1/(1+exp(v+60)/6.2)

   3. I_Ca activation not inactivation  is given first 

   4. I_Km rates 
   alpha =  0.001 (v+30)/(1-exp(-(v+30)/9))
   beta =   0.001 (v+30)/(1-exp((v+30)/9)

   5. g_kca = 3 (pS um^-2)

   Correction to Figure 4:

   "transfer impedance" should be "transfer conductance"
   Z^-1 = I/V (uS) 
   
Minor revisions to GUI code by Ted Carnevale 2/2011
to use load_file rather than load_proc,
and to control locations of RunControl panel, 
model selection panel, voltage axis graph, 
and PlotShape.
 
   -------------------------------------------------------------- */

load_file("nrngui.hoc")

objref sh, st, axonal, dendritic, dendritic_only

create soma
access soma

tstop = 1000
steps_per_ms = 40
dt = 0.025


// --------------------------------------------------------------
// passive & active membrane 
// --------------------------------------------------------------

ra        = 150
global_ra = ra
rm        = 30000
c_m       = 0.75
cm_myelin = 0.04
g_pas_node = 0.02

v_init    = -70
celsius   = 37

Ek = -90
Ena = 60


gna_dend = 20
gna_node = 30000
gna_soma = gna_dend

gkv_axon = 2000
gkv_soma = 200

gca = .3
gkm = .1
gkca = 3

gca_soma = gca
gkm_soma = gkm
gkca_soma = gkca
 

// --------------------------------------------------------------
// Axon geometry
//
// Similar to Mainen et al (Neuron, 1995)
// --------------------------------------------------------------

n_axon_seg = 5

create soma,iseg,hill,myelin[2],node[2]

proc create_axon() {

  create iseg,hill,myelin[n_axon_seg],node[n_axon_seg]

  soma {
    equiv_diam = sqrt(area(.5)/(4*PI))

    // area = equiv_diam^2*4*PI
  }
  if (numarg()) equiv_diam = $1

  iseg {                // initial segment between hillock + myelin
     L = 15
     nseg = 5
     diam = equiv_diam/10        // see Sloper and Powell 1982, Fig.71
  }

  hill {                
    L = 10
    nseg = 5
    diam(0:1) = 4*iseg.diam:iseg.diam
  }

  // construct myelinated axon with nodes of ranvier

  for i=0,n_axon_seg-1 {
    myelin[i] {         // myelin element
      nseg = 5
      L = 100
      diam = iseg.diam         
    }
    node[i] {           // nodes of Ranvier
      nseg = 1
      L = 1.0           
      diam = iseg.diam*.75       // nodes are thinner than axon
    }
  }

  soma connect hill(0), 0.5
  hill connect iseg(0), 1
  iseg connect myelin[0](0), 1
  myelin[0] connect node[0](0), 1

  for i=0,n_axon_seg-2  { 
      node[i] connect myelin[i+1](0), 1 
      myelin[i+1] connect node[i+1](0), 1
  }
}

// --------------------------------------------------------------
// Spines
// --------------------------------------------------------------

      // Based on the "Folding factor" described in
      // Jack et al (1989), Major et al (1994)
      // note, this assumes active channels are present in spines 
      // at same density as dendrites

spine_dens = 1
      // just using a simple spine density model due to lack of data on some 
      // neuron types.

spine_area = 0.83 // um^2  -- K Harris

proc add_spines() { local a
  forsec $o1 {
    a =0
    for(x) a=a+area(x)

    F = (L*spine_area*spine_dens + a)/a

    L = L * F^(2/3)
    for(x) diam(x) = diam(x) * F^(1/3)
  }
}



proc init_cell() {

  // passive
  forall {
    insert pas
    Ra = ra 
    cm = c_m 
    g_pas = 1/rm
    e_pas = v_init
  }

  // exceptions along the axon
  forsec "myelin" cm = cm_myelin
  forsec "node" g_pas = g_pas_node

  // na+ channels
  forall insert na
  forsec dendritic gbar_na = gna_dend
  forsec "myelin" gbar_na = gna_dend
  hill.gbar_na = gna_node
  iseg.gbar_na = gna_node
  forsec "node" gbar_na = gna_node

  // kv delayed rectifier channels
  iseg { insert kv  gbar_kv = gkv_axon }
  hill { insert kv  gbar_kv = gkv_axon }
  soma { insert kv  gbar_kv = gkv_soma }

  // dendritic channels
  forsec dendritic {
    insert km    gbar_km  = gkm
    insert kca   gbar_kca = gkca
    insert ca    gbar_ca = gca
    insert cad
  }

  soma {
    gbar_na = gna_soma
    gbar_km = gkm_soma
    gbar_kca = gkca_soma
    gbar_ca = gca_soma
  }

 
  forall if(ismembrane("k_ion")) ek = Ek
  forall if(ismembrane("na_ion")) {
    ena = Ena
    // seems to be necessary for 3d cells to shift Na kinetics -5 mV
    vshift_na = -5
  }
  forall if(ismembrane("ca_ion")) {
    eca = 140
    ion_style("ca_ion",0,1,0,0,0)
    vshift_ca = 0
  }
}

proc load_3dcell() {

// $s1 filename

  aspiny = 0
  forall delete_section()
  xopen($s1)
  access soma

  dendritic = new SectionList()

  // make sure no compartments exceed 50 uM length
  forall {
    print diam
    diam_save = diam
    n = L/50
    nseg = n + 1
    if (n3d() == 0) diam = diam_save
    dendritic.append()
  }    


  // show cell
/*
  sh = new PlotShape()
  sh.size(-300,300,-300,300)
*/
  // but control position of PlotShape window -- Ted Carnevale
  sh = new PlotShape(0)
  sh.size(-300,300,-299.522,299.522)
  sh.variable("v")
  {sh.view(-300, -299.522, 600, 599.043, 265, 369, 200.64, 200.32)}

  dendritic_only = new SectionList()
  forsec dendritic dendritic_only.append()
  soma  dendritic_only.remove()

  create_axon()

  init_cell()

  if (!aspiny) add_spines(dendritic_only,spine_dens)

  st=new IClamp(.5)
  st.dur = 900
  st.del = 5
}

// GUI

// run control panel

{
xpanel("RunControl")
xvalue("Init","v_init", 1,"stdinit()", 1, 1 )
xbutton("Init & Run","run()")
xbutton("Stop","stoprun=1")
xvalue("Continue til","runStopAt", 1,"{continuerun(runStopAt) stoprun=1}", 1, 1 )
xvalue("Continue for","runStopIn", 1,"{continuerun(t + runStopIn) stoprun=1}", 1, 1 )
xbutton("Single Step","steprun()")
xvalue("t","t", 2 )
xvalue("Tstop","tstop", 1,"tstop_changed()", 0, 1 )
xvalue("dt","dt", 1,"setdt()", 0, 1 )
xvalue("Points plotted/ms","steps_per_ms", 1,"setdt()", 0, 1 )
xvalue("Scrn update invl","screen_update_invl", 1,"", 0, 1 )
xvalue("Real Time","realtime", 0,"", 0, 1 )
xpanel(0,105)
}

// menu of models

proc fig1a() {
  load_3dcell("cells/lcAS3.hoc")
  st.amp = 0.05
}

proc fig1b() {
  load_3dcell("cells/j7.hoc")  
  st.amp = 0.07
}

proc fig1c() {
  load_3dcell("cells/j8.hoc")
  st.amp = 0.1
}

proc fig1d() {
  load_3dcell("cells/j4a.hoc") 
  st.amp = 0.2
}

xpanel("Figure 1")
xbutton("a. L3 Aspiny","fig1a()")
xbutton("b. L4 Stellate","fig1b()")
xbutton("c. L3 Pyramid","fig1c()")
xbutton("d. L5 Pyramid","fig1d()")
xpanel(159,481)

// graph of v(0.5) vs. t

objref g

{
g = new Graph(0)
g.size(0,1000,-80,40)
{g.view(0, -80, 1000, 120, 265, 105, 300.48, 200.32)}
graphList[0].append(g)
g.addexpr("v(.5)", 1, 1, 0.8, 0.9, 2)
}
Here, 255th row:
forall {
diam_save = diam
n = L/50
nseg = n + 1
if (n3d() == 0) diam = diam_save
dendritic.append()
}

Does diam_save save diameter of j4a.hoc of each row?
Then, if I want to modify dendrite's diameter, do I have to do like this?
diam = diam_save * 0.5

Also, I could not understand why 'if (n3d() == 0)' needs here.

Thank you in advance
ted
Site Admin
Posts: 6287
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: How does 'Z. F. Mainen and T. J. Sejnowski (1996)' model work?

Post by ted »

trying to modify morphology of detailed models
Read about 3d specification of model geometry. In fact, read everything on this page
https://www.neuron.yale.edu/neuron/stat ... metry.html
or the corresponding page for hoc
https://www.neuron.yale.edu/neuron/stat ... metry.html
Z. F. Mainen and T. J. Sejnowski (1996)'s model
Beware of that model. The authors represented the contributions of spine area to the electrical properties of the model cell by distorting section lengths and diameters, following the example of papers by Jack et al. and Major et al.. Only a few published models ever used that approach (in fact, I don't recall any others that did that, but I'm sure that some exist); most anatomically detailed models, including those by Major himself, take spine area into account by multiplying specific membrane capacitance and nonsynaptic ionic conductances by the factor
1 + (assumed total area of all spines/total area of cell without spines)
Here, 255th row:
. . .
Does diam_save save diameter of j4a.hoc of each row?
No, because the diam = diam_save statement is executed only for sections that do not have pt3d data. To understand this answer, you will first need to read the Programmer's Reference page mentioned above.
Christine Chung
Posts: 17
Joined: Fri May 03, 2019 2:41 am

Re: How does 'Z. F. Mainen and T. J. Sejnowski (1996)' model work?

Post by Christine Chung »

Thanks for providing information.
I changed diameter by using pt3dchange. Thanks!
Post Reply