Page 1 of 1
gap junction example doesn't work...
Posted: Tue Oct 09, 2007 3:56 pm
by blop
Hi,
I wanted to implement a gap junction in my model and failed. So I went back to the NEURON book, created an empty test directory, copied the gap.mod file :
Code: Select all
NEURON {
POINT_PROCESS gap
POINTER vgap
NONSPECIFIC_CURRENT i
RANGE r, i
}
PARAMETER {
r = 2e9 (megohm)
}
ASSIGNED {
v (millivolt)
vgap (millivolt)
i (nanoamp)
}
BREAKPOINT {
i = (v - vgap)/r
}
as well as the book's example hoc file
Code: Select all
create a,b
access a
forall {nseg=10 L=1000 diam=10 insert hh}
objref g
g = new gap()
g.r =3
and I obtain the following error:
Additional mechanisms from files
gap.mod
/Applications/NEURON-6.0/nrn/i386/bin/nrniv.app/Contents/MacOS/nrniv: point process not located in a section
in test.hoc near line 6
g.r =3
^
Now, if I do locate the synapse (that's what I did in my main model) by using
Code: Select all
create a,b
access a
forall {nseg=10 L=1000 diam=10 insert hh}
objref g
g = new gap(0.5)
g.r =3
The script runs well... until I use finitialize or fadvance
finitialize(-50)
/Applications/NEURON-6.0/nrn/i386/bin/nrniv.app/Contents/MacOS/nrniv: Bus error See $NEURONHOME/lib/help/oc.help
near line 1
finitialize(-50)
^
NB: I'm under Mac OS 10.4 and use NEURON 6.0
Re: gap junction example doesn't work...
Posted: Tue Oct 09, 2007 9:49 pm
by ted
Except that what's in the book does work.
Your version of gap.mod isn't a copy of what's in the book; however, that's
not the cause of the problems you encountered.
as well as the book's example hoc file
Take another look at page 272 and compare it with what you posted here.
(Come to think of it, make sure that what you posted here is what you tried
to use on your Mac.)
What is posted here is
--lacking one of the objrefs
--doesn't assign a location to the objref that it does have
--doesn't link the POINTER variable vgap to the "presynaptic" membrane potential
The moral of this story: steal working code (we like to call this "programming
by example," which sounds so much more genteel, no?), but don't break it
in the process.
Re: gap junction example doesn't work...
Posted: Wed Oct 10, 2007 10:11 am
by blop
ted wrote:What is posted here is
--lacking one of the objrefs
--doesn't assign a location to the objref that it does have
--doesn't link the POINTER variable vgap to the "presynaptic" membrane potential
The first point wasn't the problem I guess since I tried that too
Code: Select all
create a,b
access a
forall {nseg=10 L=1000 diam=10 insert hh}
objref g[2]
for i=0,1 {
g[i] = new gap()
g[i].r =3
}
and it gives the same error message,
which means that the end of the file
Code: Select all
a g[0].loc(0.9999)
b g[1].loc(0.0001)
setpointer g[0].vgap, b.v(0.0001)
setpointer g[1].vgap, a.v(0.9999)
is needed. And I hardly understand this since I though that the commands (except loops, procedure, etc) could be typed in the oc> directly, i.e. linearly. I guess that objects belong to the "etc" category of my parenthesis...
ted wrote:The moral of this story: steal working code (we like to call this "programming
by example," which sounds so much more genteel, no?), but don't break it
in the process.
Well, when I'm stealing code, I try to understand what I steal. So I play with it to see if it follows my understanding. Call this "torture the examples" if you want ;-)
Re: gap junction example doesn't work...
Posted: Wed Oct 10, 2007 11:09 am
by blop
PS: I tried to torture this example a bit further with something like this:
Code: Select all
begintemplate myneuron
public soma, gapsyn
create soma
objref gapsyn
proc init() {
create soma
objref gapsyn
gapsyn=new gap(0.5)
}
endtemplate myneuron
And
Code: Select all
xopen("myneuron.tem")
objref N1,N2
N1 = new myneuron()
N2 = new myneuron()
setpointer N1.gapsyn.vgap, N2.soma.v(0.5)
setpointer N2.gapsyn.vgap, N1.soma.v(0.5)
access N1.soma
finitialize(-50)
and I have to admit that, at my great surprise, it works...
Re: gap junction example doesn't work...
Posted: Mon Jun 16, 2008 1:00 pm
by EtOH_ataxia
OK, I need help.
I am trying to do exactly what blop did. Here are the files I made, to me they look the same as blop's working version.
Except they don't work. I get an error saying
nrniv: gap is not a template
in myneuron.tem near line 9
gapsyn=new gap(0.5)
^
xopen("myneuron.tem" )
I don't really understand, I thought gap should not be a template!
The only difference I can tell is the operating system, I am using NEURON 6.1 on Windows XP.
Code: Select all
begintemplate myneuron
public soma, gapsyn
create soma
objref gapsyn
proc init() {
create soma
objref gapsyn
gapsyn=new gap(0.5)
}
endtemplate myneuron
Code: Select all
xopen("myneuron.tem")
objref N1,N2
N1 = new myneuron()
N2 = new myneuron()
setpointer N1.gapsyn.vgap, N2.soma.v(0.5)
setpointer N2.gapsyn.vgap, N1.soma.v(0.5)
access N1.soma
finitialize(-50)
Code: Select all
NEURON {
POINT_PROCESS gap
POINTER vgap
NONSPECIFIC_CURRENT i
RANGE r, i
}
PARAMETER { r = 1e10 (megohm) }
ASSIGNED {
v (millivolt)
vgap (millivolt)
i (nanoamp)
}
BREAKPOINT {
i = (v - vgap)/r
}
Sorry, but I can't find the bug...can you help me?
Re: gap junction example doesn't work...
Posted: Tue Jun 17, 2008 7:36 am
by EtOH_ataxia
I got a version that works
I tried the previous files also with Linux (Zenwalk -Slackware) and they still did not work. Same error.
the version that works for me is this (same .hoc, only changed r to 1 to see a large effect)
Code: Select all
objref gapsyn_1, gapsyn_2
create cell_1
cell_1{
insert hh
}
create cell_2
cell_1 gapsyn_1=new gap(0.5)
cell_2 gapsyn_2=new gap(0.5)
setpointer gapsyn_1.vgap, cell_2.v(0.5)
setpointer gapsyn_2.vgap, cell_1.v(0.5)
I made cell_1 generating an action potential (by lowering gkbar_hh to 0.003) so the v waveform was obvious
I still do not understand why it is not working with the template version, though.
Paola
Re: gap junction example doesn't work...
Posted: Wed Jul 15, 2009 6:24 pm
by tmwilliams
I'm having similar problems. I'm using NEURON version 7.0 and MSWindows. My code is as follows:
My gap.hoc file is:
Code: Select all
create a,b
access a
forall {nseg=10 L=1000 diam=10 insert hh}
objref g[2]
for i=0,1 {
g[i] = new Gap()
g[i].r = 3
}
a g[0].loc(0.9999)
b g[1].loc(0.0001)
setpointer g[0].vgap, b.v(0.0001)
setpointer g[1].vgap, a.v(0.9999)
My gap.mod file is:
Code: Select all
NEURON {
POINT_PROCESS Gap
POINTER vgap
RANGE r, i
NONSPECIFIC_CURRENT i
}
PARAMETER { r = 1e10 (megohm) }
ASSIGNED {
v (millivolt)
vgap (millivolt)
i (nanoamp)
}
BREAKPOINT { i = (v - vgap)/r }
As far as I can tell, my code is identical to that in The NEURON Book. I compiled the .mod file using mknrndll.
When I try to run gap.hoc, I get the following error:
nrniv: point process not located in a section
in C:/Documents and Settings/tmw/Desktop/gap.hoc near line 14
}
^
Can someone tell me what the problem is?
Re: gap junction example doesn't work...
Posted: Thu Jul 16, 2009 1:14 am
by ted
tmwilliams wrote:Can someone tell me what the problem is?
Must be what the interpreter said--
Code: Select all
point process not located in a section
a is the default section, but it appears that, for versions of NEURON more recent than what I used when writing this example for Chapter 10, an actual location must be specified when a point process is created. Change the statement
to
and the example in the book works. Score another erratum for the NEURON Book.
Re: gap junction example doesn't work...
Posted: Thu Jul 16, 2009 2:05 pm
by tmwilliams
Thanks for the explanation, I almost went crazy yesterday trying to figure this out!
I'm sorry, but I'm really new to this NEURON software, so I have a couple more questions.
I'm assuming that the statements:
Code: Select all
a g[0].loc(0.9999)
b g[1].loc(0.0001)
setpointer g[0].vgap, b.v(0.0001)
setpointer g[1].vgap, a.v(0.9999)
change the pointer location from 0.5 to 0.9999 for cell a and 0.0001 for cell b. Is that correct?
And, can you tell me what the following statement means?
Re: gap junction example doesn't work...
Posted: Thu Jul 16, 2009 6:03 pm
by ted
tmwilliams wrote:change the pointer location from 0.5 to 0.9999 for cell a and 0.0001 for cell b
Almost. Variables that are continuous functions of position in the original biological system--which are called "range variables" in NEURON (e.g. membrane potential)--are computed at locations that are equally spaced along the interior of each section. Each section has its own discretization parameter nseg that specifies how many nodes are used to represent the section.
Code: Select all
create dend // nseg == 1 by default, node is at 0.5
print dend.diam(0.5) // diameter at middle of dend
dend.nseg = 3 // nodes are at 1/6, 1/2, and 5/6
print dend.diam(x) // if 0<x<1, prints diam at nearest node to x
a g[0].loc(0.9999) places g at the internal node that is closest to the 1 end, assuming that a.nseg is not very large.
Since you are new to NEURON, it would be advisable to read chapters 4 and 5 of The NEURON Book ASAP (your original question suggests you do have the book; if I have jumped to the wrong conclusion, then at least read the "Key papers about NEURON" listed on NEURON's Documentation page
http://www.neuron.yale.edu/neuron/docs).
can you tell me what the following statement means?
Assign 3 to the parameter r that belongs to the object referenced by g
. Here's how to fish: have a go at chapter 13 of the NEURON book, or at least read http://www.neuron.yale.edu/neuron/stati ... n/obj.html
Re: gap junction example doesn't work...
Posted: Mon Jul 20, 2009 10:29 am
by tmwilliams
I think I didn't word my question clearly, I understood that the statement: g.r = 3 was assigning the value 3 to the parameter r that belongs to g, I just couldn't figure out what r was. Later I realized that it is (obviously) the resistance, I must have been having a senior moment. Thanks for your help!
Re: gap junction example doesn't work...
Posted: Mon Jul 20, 2009 12:03 pm
by ted
A recurring puzzle in any Forum or mailing list is how to interpret questions--deciding whether a question requires a literal answer, what pre-existing knowledge may be assumed and what must be stated explicitly, what level of detail to get into etc..