setting non uniform conductances in a section

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
fabien tell
Posts: 36
Joined: Mon Mar 25, 2013 1:36 pm
Location: france
Contact:

setting non uniform conductances in a section

Post by fabien tell » Mon Mar 14, 2016 9:06 am

Hello,

I'm trying to set an non uniform conductance in a section.
I read the "Specifying parameterized variation of biophysical properties" tutorial but I did not want to use the cell builder system. I need to put a statement in my hoc files. As suggested in the tutorial, I've tried the following but it appears uncorrected.

Code: Select all

create DSI 

DSI {
nseg=9
L=50
diam=1.5
Ra=150
cm=1
insert pasnts
gbar_kdrSI=1000
insert Na12
forsec DSI (0,x) {gbar_Na12=(950/L)*x +50)}  : the conductance should starts at 50 ps/µm2 and then increase linearly to 1000 at the end of the segment[/b] 
ena=60
ek=-90
}
I guess that the parameter "x" in undefined.
Thanks a lot

Fabien

fabien tell
Posts: 36
Joined: Mon Mar 25, 2013 1:36 pm
Location: france
Contact:

Re: setting non uniform conductances in a section

Post by fabien tell » Mon Mar 14, 2016 11:14 am

Hello again,

By the time I posted the previous message I tried this and it seems to be working well :

Code: Select all

create DSI
access DSI
    DSI {
    nseg=9
    L=50
    diam=1.5
    Ra=150
    cm=1
    insert Na12
     ena=60
  
    }
 forsec "DSI" for (x,0) {gbar_Na12(x)=(950*x)}

/* in fact "x"  is is the "length" (the position?) of a negative seg (0 and 1 being the start and the end of the section), f I understood well */

for (x) print x, L*x
for (x) if (x >= 0 && x <= 1) { print x, gbar_Na12(x) }

/* here I print x vs L*x then x and the conductance density 

An I got

Code: Select all


:  x vs L*x
0 0 
0.055555556 2.7777778 
0.16666667 8.3333333 
0.27777778 13.888889 
0.38888889 19.444444 
0.5 25 
0.61111111 30.555556 
0.72222222 36.111111 
0.83333333 41.666667 
0.94444444 47.222222 
1 50 

: x vs conductance 

0 52.777778 : well it starts with a conductance of 52 , I would have expected 0 according to the equation 
0.055555556 52.777778 
0.16666667 158.33333 
0.27777778 263.88889 
0.38888889 369.44444 
0.5 475 
0.61111111 580.55556 
0.72222222 686.11111 
0.83333333 791.66667 
0.94444444 897.22222 
1 897.22222 : it ends with 897 I would have expected 950 according to the equation 


Apart the values at 0 and 1 it seems Ok

Is it correct to do this way?

Thanks

ted
Site Admin
Posts: 5218
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: setting non uniform conductances in a section

Post by ted » Mon Mar 14, 2016 12:23 pm

Your hoc code works, and it's perfectly fine if you only have to specify the value of a range variable parameter in one section. If ever need to specify parameter values over multiple sections, or use a distance metric other than path length from the 0 end (e.g. radial distance from a point, distance above or below a cell body layer, distance above or below a cortical layer), it would be a good idea to first use the CellBuilder to construct a toy model, set up a subset of neurites over which the parameter is to vary, and specify the distance metric and the function f() that relates channel density to that distance metric. Then you can export a hoc file from that CellBuilder which will contain procedures that set up your subset, implement your distance metric, and your function f(). You can steal that code from the hoc file and reuse it with your own hoc code.

fabien tell
Posts: 36
Joined: Mon Mar 25, 2013 1:36 pm
Location: france
Contact:

Re: setting non uniform conductances in a section

Post by fabien tell » Mon Mar 14, 2016 1:46 pm

Hello Ted,

You're right. I tried to specific non uniformity in several section in my hoc code but it does work only for the first one. For the second section I get a median conductance of 1500 !!!

Code: Select all

create dend1
create DSI

 dend1 :  I don't have to write "access" do I ?
{nseg=9
L=40
diam=2
Ra = 150.0  
cm=1
insert Na12
ena=60
 }
DSI 

{nseg=9
L=40
diam=2
Ra = 150.0  
cm=1
insert Na12
ena=60

}

forsec "dend1" for (x,0) {gbar_Na12(x)=(950*x)}

forsec "DSI" for (x,0) {gbar_Na12(x)=((1000*x)+1000)}
why is it not possible to do it?
As suggested, I could steal from the ses file but I preferred to write my hoc code because it more understandable to me . I'm still learning and I prefer to write it from scratch.
But if it is not possible, I 'd use the cell builder...
Thanks

ted
Site Admin
Posts: 5218
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: setting non uniform conductances in a section

Post by ted » Mon Mar 14, 2016 4:02 pm

Code: Select all

dend1 :  I don't have to write "access" do I ? 
1. The colon : is not a comment delimiter in hoc.
2. Section stack syntax is of the form
sectionname statement
or
sectionname { statement1 statement2 . . . }
or
sectionname {
statement1
statement2
. . . }
That is, the opening curly bracket must be on the same line as the sectionname
As suggested, I could steal from the ses file
That was not my suggestion. I suggested exporting hoc code from the CellBuilder. On the Management page, click on the Export button, then click on "Export to file". The result is a very nicely structured, human readable file that looks nothing like the contents of a ses file. Everything in that hoc file is pertinent to the properties of the model cell.

Yes, a ses file does contain hoc statements, and sometimes it is useful to steal code from a ses file, but many (often most) statements in a ses file are purely administrative--they tell NEURON how to reconstruct one or more GUI tools, and have little or nothing to do with what you or I care about--the biophysical and anatomical properties of model cells.
I'm still learning and I prefer to write it from scratch.
Learning also happens "by example," especially in programming, and the CellBuilder produces some of the cleanest code you'll ever see--especially when it comes to code that specifies spatial discretization or spatial nonuniformity of parameters. Should a student of fencing or piano insist on developing technique entirely from scratch, or rely entirely on written descriptions?

fabien tell
Posts: 36
Joined: Mon Mar 25, 2013 1:36 pm
Location: france
Contact:

Re: setting non uniform conductances in a section

Post by fabien tell » Mon Mar 14, 2016 4:39 pm

Thanks again Ted,

I know that the colon is not a comment delimiter. It was just to highlight my question.
Thank you for explaining to me the last point about the hoc code generated by the cell builder. I'll try it.
And you're right (as usual), as a recorder player I didn’t learn everything from scratch.

Thanks a lot for your time

Fabien

ted
Site Admin
Posts: 5218
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: setting non uniform conductances in a section

Post by ted » Mon Mar 14, 2016 4:51 pm

Small world. I'm a lapsed clarinetist. We woodwind players have to stick together. BTW, I tried inventing some technique of my own in fencing long ago, and it didn't turn out well.

Post Reply