membrane compartmentalisation
membrane compartmentalisation
I wish to put 2 different channels into my dendritic tree. I wish to have them both throughout the dendritic tree.
BUT the trick comes with the fact that I would like them geographically seperated, arranged into alternating non-overlapping clusters. So, as we move along the dendritic tree we see:
cluster of channel 1
cluser of channel 2
cluster of channel 1
cluster of channel 2
etc.
And I would like a parameter to control the degree of seperation between the channel clusters. So, perhaps the clusters would be seperated by a distance, x, that could be set by me at will.
But this seems pretty advanced to code and I am a bit lost as to how to do it.
BUT the trick comes with the fact that I would like them geographically seperated, arranged into alternating non-overlapping clusters. So, as we move along the dendritic tree we see:
cluster of channel 1
cluser of channel 2
cluster of channel 1
cluster of channel 2
etc.
And I would like a parameter to control the degree of seperation between the channel clusters. So, perhaps the clusters would be seperated by a distance, x, that could be set by me at will.
But this seems pretty advanced to code and I am a bit lost as to how to do it.
A possible (sketchy) solution can be in the use of sectionlist.
Create three section list:
- Channel1Sections
- Channel2Sections
- SeparotorSections
Now you can use 'forsec' to loop over the different sections types and set properties like the lengths of the sections and the channel density.
Put the loops for the parameters you want to vary in a function that you can call from a loop and you can automatically scan your separation parameter.
Create three section list:
- Channel1Sections
- Channel2Sections
- SeparotorSections
Now you can use 'forsec' to loop over the different sections types and set properties like the lengths of the sections and the channel density.
Put the loops for the parameters you want to vary in a function that you can call from a loop and you can automatically scan your separation parameter.
I'd recommend use of the CellBuild tool and its fairly new SubsetDomainIterator.Then you a can use the iterator to apply a sine or square wave function to one parameter and the opposite to the other. There is a tutorial about this:
http://www.neuron.yale.edu/neuron/stati ... tline.html
http://www.neuron.yale.edu/neuron/stati ... tline.html
So, I am thinking a good way to arrange it would be to have the 2 channels distributed along the dendritic tree as 2 sine wave functions. Have the 2 sine wave functions completely out of phase (I think this is termed 180 degrees out of phase). So, at the dendritic point that one wave is at its maximum displacement, the other wave is at its minimum displacement. So, in this way the 2 channels are both throughout the dendritic tree, but are not in the same places. To increase the seperation between the 2 channels throughout the dendritic tree I could just increase the wavelength of both waves equally.
So I want the 2 channel densities (gcabar_CaP2 and gnabar_naP) to vary accross the sections i=0,18 SpinyDendrite.
I have looked at the cellbuilder way and can follow it. But my model is already quite complex and I don't want to go the trouble and worry of importing it into cellbuilder as I will have to reassign a lot of the
biophysics etc. Just think it would be easier to define this strategy in .hoc if I can and carry on working in .hoc. But then I am sorry to trouble you as I am not entirely confident in how to do this in .hoc. I have cut
and paste the coding I have thus far. I am sure it is not functional but I hope lays the foundation for what is needed.
My code:
---------------
IDENTIFIED PROBLEMS:
----------------
1)
I am not sure if NEURON uses degrees or radians. It would be great if someone could give me some clarification. If it uses radians my sine wave equations will be:
y = A*sin(((2*PI*t)/lambda) - 0)
y = A*sin(((2*PI*t)/lambda) - PI)
if it uses degrees my sine wave equations will be:
y = A*sin(((360*t)/lambda) - 0)
y = A*sin(((360*t)/lambda) - 180)
2) I am setting f(p) twice. I want it to have different values for the 2 different channels. But I am concerned I may just be doing a re-assignment the second time f(p) is written.
3) A =
lambda =
These been left blank. Will give them values as and when.
Thank you so, so much to all that have taken the time to look at this.
So I want the 2 channel densities (gcabar_CaP2 and gnabar_naP) to vary accross the sections i=0,18 SpinyDendrite.
I have looked at the cellbuilder way and can follow it. But my model is already quite complex and I don't want to go the trouble and worry of importing it into cellbuilder as I will have to reassign a lot of the
biophysics etc. Just think it would be easier to define this strategy in .hoc if I can and carry on working in .hoc. But then I am sorry to trouble you as I am not entirely confident in how to do this in .hoc. I have cut
and paste the coding I have thus far. I am sure it is not functional but I hope lays the foundation for what is needed.
My code:
Code: Select all
// --------------------
// Some foundation code that I think I need to set things up
// --------------------
for i=0,18 SpinyDendrite[i] {
for (x, 0) {
i += 1}
x = 0 // 0.5 or 0 or 1--just do this for a single point in the section
p = map.x[i*x]
}
// --------------------
// Setting up channel 1 density in a sine wave pattern
// across i=0,18 SpinyDendrite[i]
// --------------------
for i=0,18 SpinyDendrite[i] {
gcabar_CaP2(x) = f(p)
// Sine wave equation
f(p) = A*sin(((2*PI*p)/lambda) - 0)
A =
lambda =
}
// --------------------
// Setting up channel 2 density in a sine wave pattern (completely out
// phase with prior wave function) across i=0,18 SpinyDendrite[i]
// --------------------
for i=0,18 SpinyDendrite[i] {
gnabar_naP(x) = f(p)
// Sine wave equation
f(p) = A*sin(((2*PI*p)/lambda) - PI)
A =
lambda =
}
IDENTIFIED PROBLEMS:
----------------
1)
I am not sure if NEURON uses degrees or radians. It would be great if someone could give me some clarification. If it uses radians my sine wave equations will be:
y = A*sin(((2*PI*t)/lambda) - 0)
y = A*sin(((2*PI*t)/lambda) - PI)
if it uses degrees my sine wave equations will be:
y = A*sin(((360*t)/lambda) - 0)
y = A*sin(((360*t)/lambda) - 180)
2) I am setting f(p) twice. I want it to have different values for the 2 different channels. But I am concerned I may just be doing a re-assignment the second time f(p) is written.
3) A =
lambda =
These been left blank. Will give them values as and when.
Thank you so, so much to all that have taken the time to look at this.
Implementing the concept of parameterized subsets in hoc requires fairly advanced programming skills. Create one in CellBuild, save as a hoc file and you will see what I mean. As for whether hoc sin uses radians or degrees that is something you can more easily figure out by typing to the hoc interpreter than by looking up in the reference material.
So this is going to be my strategy:
"If you are dealing with an existing model specified in hoc, and don't want to replicate it with the CellBuilder, then
1. make a toy model with the CellBuilder and specify the desired spatial variation of parameter(s)
2. export from that CellBuilder to a hoc file
3. examine that hoc file to find the stuff that sets up the spaitally inhomogeneous parameter(s)
4. adapt that code to your own needs"
I will let you know how I get on.
"If you are dealing with an existing model specified in hoc, and don't want to replicate it with the CellBuilder, then
1. make a toy model with the CellBuilder and specify the desired spatial variation of parameter(s)
2. export from that CellBuilder to a hoc file
3. examine that hoc file to find the stuff that sets up the spaitally inhomogeneous parameter(s)
4. adapt that code to your own needs"
I will let you know how I get on.
So, I have had some success. I used the strategy described above, where I used a "toy" cellbuilder session to generate .hoc code that I can cut and paste into my .hoc NEURON model.
So, I think I have some good code going now (cut and paste below). It puts the 2 channels across these sections (which are all strung together in one line):
i=0, 20 SmoothDendrite AND i=0, 18 SpinyDendrite
And varies them along this length in a Sine wave form. The sine wave for the 2 channels being exactly 180 degrees out of phase.
Now I write because I would like to do a check that this code has set everything up correctly in the model. I would like to plot a graph of the channel density along the length of the dendritic tree (along the length of .i=0, 20 SmoothDendrite AND i=0, 18 SpinyDendrite) And I would hope to see a sine wave form to this plot for each of these 2 channels.
Now, I know that such a plot was possible in the cell builder when I was using it to construct this code. And indeed in these plots I did see sine wave forms. So was very happy with this. But now I would like to check if this code is actually working in my actual model (as opposed to in a toy/play cellbuilder protocal I used to rip code). So, would be very grateful to anyone that can give a tip on how to do such a plot. I hope you guys have a great weekend.
So, I think I have some good code going now (cut and paste below). It puts the 2 channels across these sections (which are all strung together in one line):
i=0, 20 SmoothDendrite AND i=0, 18 SpinyDendrite
And varies them along this length in a Sine wave form. The sine wave for the 2 channels being exactly 180 degrees out of phase.
Now I write because I would like to do a check that this code has set everything up correctly in the model. I would like to plot a graph of the channel density along the length of the dendritic tree (along the length of .i=0, 20 SmoothDendrite AND i=0, 18 SpinyDendrite) And I would hope to see a sine wave form to this plot for each of these 2 channels.
Now, I know that such a plot was possible in the cell builder when I was using it to construct this code. And indeed in these plots I did see sine wave forms. So was very happy with this. But now I would like to check if this code is actually working in my actual model (as opposed to in a toy/play cellbuilder protocal I used to rip code). So, would be very grateful to anyone that can give a tip on how to do such a plot. I hope you guys have a great weekend.
Code: Select all
load_file("subiter.hoc")
objref all
proc subsets() { local i
objref all
all = new SectionList()
// TAKE SOMA OUT OF IT
// soma all.append()
for i=0, 20 SmoothDendrite[i] all.append()
for i=0, 18 SpinyDendrite[i] all.append()
}
objref all_x
proc biophys_inhomo() {
// Path Length from root with most proximal end translation
// and normalized so most distal end at 1 ranges from 0 to 1
all_x = new SubsetDomainIterator(all, 0, 1, 1)
ipumpmax_pump_all_x()
ImaxNax_NaCaex_all_x()
}
proc ipumpmax_pump_all_x() {local x, p, p0, p1, A, lambda
all_x.update()
p0 = all_x.p0 p1 = all_x.p1
A = 0.0008
lambda = 0.1
for all_x.loop() {
x = all_x.x p = all_x.p
ipumpmax_pump(x) = A*sin(((2*PI*p)/lambda)-0)
}
}
proc ImaxNax_NaCaex_all_x() {local x, p, p0, p1, A, lambda
all_x.update()
p0 = all_x.p0 p1 = all_x.p1
A = 3.2
lambda = 0.1
for all_x.loop() {
x = all_x.x p = all_x.p
ImaxNax_NaCaex(x) = A*sin(((2*PI*p)/lambda)-PI)
}
}
Yes. So the latest is that I have now got it working. Kind of.
I have modified the code, which I have cut and paste below. And I have been able to confirm that it is working using Shape plot > Space plot > plot what (plot the channel density). (thanks Raj)
Can see the channel density in a sine wave form distribution. Great!! BUT BUT the sine waves are not very regular and look corrupted. They not all the same shape etc. I don't know what is going on. Maybe there is a problem with my sine wave equations? I dont think so. But could be wrong. Any ideas?
(PS. I have added an offset to the sine wave equations so that they have a non-zero center. So, we dont get negative channel conductances. Such an offset is a standard manipulation for sine wave equations when you dont want negative values. I have made the offset the same value as the amplitude).
(I tried the sine wave equations for degrees and radians. Didnt seem to make any difference)
I have modified the code, which I have cut and paste below. And I have been able to confirm that it is working using Shape plot > Space plot > plot what (plot the channel density). (thanks Raj)
Can see the channel density in a sine wave form distribution. Great!! BUT BUT the sine waves are not very regular and look corrupted. They not all the same shape etc. I don't know what is going on. Maybe there is a problem with my sine wave equations? I dont think so. But could be wrong. Any ideas?
(PS. I have added an offset to the sine wave equations so that they have a non-zero center. So, we dont get negative channel conductances. Such an offset is a standard manipulation for sine wave equations when you dont want negative values. I have made the offset the same value as the amplitude).
(I tried the sine wave equations for degrees and radians. Didnt seem to make any difference)
Code: Select all
load_file("subiter.hoc")
proc celldef() {
subsets()
biophys_inhomo()
}
objref all
proc subsets() { local i
objref all
all = new SectionList()
// TAKE SOMA OUT OF IT
// soma all.append()
for i=0, 20 SmoothDendrite[i] all.append()
for i=0, 18 SpinyDendrite[i] all.append()
}
objref all_x
proc biophys_inhomo() {
// Path Length from root with most proximal end translation
// and normalized so most distal end at 1 ranges from 0 to 1
all_x = new SubsetDomainIterator(all, 0, 1, 1)
ipumpmax_pump_all_x()
ImaxNax_NaCaex_all_x()
}
proc ipumpmax_pump_all_x() {local x, p, p0, p1, A, lambda
all_x.update()
p0 = all_x.p0 p1 = all_x.p1
A = 0.0004
lambda = 0.1
D = A
for all_x.loop() {
x = all_x.x p = all_x.p
ipumpmax_pump(x) = A*sin(((2*PI*p)/lambda)-0) + D
}
}
proc ImaxNax_NaCaex_all_x() {local x, p, p0, p1, A, lambda
all_x.update()
p0 = all_x.p0 p1 = all_x.p1
A = 0.025
lambda = 0.1
D = A
for all_x.loop() {
x = all_x.x p = all_x.p
ImaxNax_NaCaex(x) = A*sin(((2*PI*p)/lambda)-PI) + D
}
}
celldef()
Just tried the sine equations in an online plotting program and they looked fine. Also, got them checked by friend that does PhD in fourier analysis so does a lot with these equations. So, think all in all the sine equations ok. Which is a bit upsetting because then I have no idea what the problem is. One thing that is perhaps worth mentioning is that the amplitude of the sine wave in NEURON is NOT what it is set as in the sine wave equation as the parameter A. It is about twice this. This shows that the wave is perhaps being set by things other than the wave equation. Perhaps there is something in the channel .mod file (perhaps a set density value) that is corrrupting? Just one idea. Though have no idea how to combat this.
Basically - to repeat the problem. I now have sine waves - but these are not regular and seem corrupted. They are not all same size etc. I'm thinking that the problem is that they are being set in their purity by the sine wave equations, but then something else is acting in the system to corrupt the shapes of the sine waves.
Basically - to repeat the problem. I now have sine waves - but these are not regular and seem corrupted. They are not all same size etc. I'm thinking that the problem is that they are being set in their purity by the sine wave equations, but then something else is acting in the system to corrupt the shapes of the sine waves.
Yes. more on this nseg issue. The reason why nseg needs to be increased is because of this background. For those interested.
---------
aliasing is an effect that causes different continuous signals to become indistinguishable (or aliases of one another) when sampled.
Aliasing also refers to the distortion or artifact that is caused by a signal being sampled and reconstructed as an alias of the original signal.
By either meaning, aliasing can take place either in time (temporal aliasing) or in space (spatial aliasing).
Spatial aliasing is insufficient sampling of data along the space axis.
Data must be sampled at more than two points per wavelength, or the wave arrival direction becomes ambiguous.
So, you must have enough NEURON sections to sample the wave. Must have enough nseg.
If the sampling condition is not satisfied, then frequencies will overlap.
The resulting distortion is called aliasing; the reconstructed signal is
said to be an alias of the original signal, in the sense that it has
the same set of sample values.
For a sinusoidal component of exactly half the sampling frequency, the
component will in general alias to another sinusoid of the same frequency, but with a different phase and amplitude.
---------
---------
aliasing is an effect that causes different continuous signals to become indistinguishable (or aliases of one another) when sampled.
Aliasing also refers to the distortion or artifact that is caused by a signal being sampled and reconstructed as an alias of the original signal.
By either meaning, aliasing can take place either in time (temporal aliasing) or in space (spatial aliasing).
Spatial aliasing is insufficient sampling of data along the space axis.
Data must be sampled at more than two points per wavelength, or the wave arrival direction becomes ambiguous.
So, you must have enough NEURON sections to sample the wave. Must have enough nseg.
If the sampling condition is not satisfied, then frequencies will overlap.
The resulting distortion is called aliasing; the reconstructed signal is
said to be an alias of the original signal, in the sense that it has
the same set of sample values.
For a sinusoidal component of exactly half the sampling frequency, the
component will in general alias to another sinusoid of the same frequency, but with a different phase and amplitude.
---------