NetCon : how to write the reference to 'source'

NMODL and the Channel Builder.
Post Reply
stil
Posts: 28
Joined: Thu Jul 01, 2010 8:47 am
Location: Mulhouse - France

NetCon : how to write the reference to 'source'

Post by stil »

Hello,

i am building an thrshold-crossing detection using the NetCon Class.

On one hand, i have a POINT PROCESS "src", defined in NMODL, that has a state "srcState", which is my source for NetCon
On the other hand, i have another POINT PROCESS "trgt", in a NMODL, having a NET_RECEIVE block, with a if(flag == 0){...} clause, that should detect events generated by the NetCon object : This is my target.

I believe this part is ok, but i cannot find how to build the bridge using the NetCon object in my .hoc : I don't know how to write the reference to src.srcState :

Code: Select all

objref nc
nc = new NetCon(PRE(0.5).&src.srcState, trgt, 0.999, 0, 3000) // source, target, threshold, delay, weight
Of course, the previous does not work...
Could anyone help me to write this please ?
ted
Site Admin
Posts: 5810
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: NetCon : how to write the reference to 'source'

Post by ted »

Suggest you follow the strategy used by spikeout.mod in ModelDB entry 83319
http://senselab.med.yale.edu/modeldb/Sh ... odel=83319
Drill down to NEURON/coba/spikeout.mod
and pay attention to the NET_RECEIVE block. With this implementation strategy, you will then be able to use the same syntax with your point process as is used when an artificial spiking cell is the presynaptic neuron, i.e.
objrefname = new NetCon(pointprocessobjref, targetobjref)
because the threshold detection and event generation is done in the presynaptic point process itself, not by the NetCon watching a presynaptic range variable.
stil
Posts: 28
Joined: Thu Jul 01, 2010 8:47 am
Location: Mulhouse - France

Re: NetCon : how to write the reference to 'source'

Post by stil »

OK, i found out what you meant, it deals with WATCH(), for threshold detection within the POINTPROCESS, and net_send() function to dialog with the NetCon object.
Hence, i have the following, with a reduced test model :

the hoc instantiates one ns POINTPROCESS in PRE, one nr POINTPROCESS in POST, and one NetCon object :

Code: Select all

load_file("nrngui.hoc")
objref cvode
cvode = new CVode(1)
cvode_active(1)

create PRE
objref ns
ns = new myns(.5)

create POST
objref nr
nr = new mynr(.5)

objref nc
nc = new NetCon(ns,nr,1,0,ns.w)
myns POINTPROCESS implements a WATCH element, and generate net_event(t) events at appropriate times :

Code: Select all

NEURON {POINT_PROCESS myns
RANGE w}
STATE {XX}
INITIAL {
	XX = 0.0
	net_send(0,1)
}
PARAMETER{
	w = 2.0
}
BREAKPOINT {
SOLVE states METHOD derivimplicit
}

DERIVATIVE states{
XX' = (1.1-XX)/10.0
}

NET_RECEIVE(w){
	if (flag == 1){
		WATCH(XX>1.0) 2
	}
	if(flag == 2){
		net_event(t)
		XX = 0.0
	}
}
And mynr object is basically an exp2syn object, implementing a NET_RECEIVE block :

Code: Select all

NEURON {
	POINT_PROCESS mynr
	RANGE tau1, tau2, e, i
	NONSPECIFIC_CURRENT i

	RANGE g
}

UNITS {
	(nA) = (nanoamp)
	(mV) = (millivolt)
	(uS) = (microsiemens)
}

PARAMETER {
	tau1=.1 (ms) <1e-9,1e9>
	tau2 = 10 (ms) <1e-9,1e9>
	e=0	(mV)
}

ASSIGNED {
	v (mV)
	i (nA)
	g (uS)
	factor
}

STATE {
	A (uS)
	B (uS)
}

INITIAL {
	LOCAL tp
	if (tau1/tau2 > .9999) {
		tau1 = .9999*tau2
	}
	A = 0
	B = 0
	tp = (tau1*tau2)/(tau2 - tau1) * log(tau2/tau1)
	factor = -exp(-tp/tau1) + exp(-tp/tau2)
	factor = 1/factor
}

BREAKPOINT {
	SOLVE state METHOD cnexp
	g = B - A
	i = g*(v - e)
}

DERIVATIVE state {
	A' = -A/tau1
	B' = -B/tau2
}

NET_RECEIVE(weight (uS)) {
	A = A + weight*factor
	B = B + weight*factor
}
Nice, thanks !
ted
Site Admin
Posts: 5810
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: NetCon : how to write the reference to 'source'

Post by ted »

From the code you posted it appears that there has been some confusion on both sides of the discussion, and you are heading off on a tangent that will probably not be productive. When you indicated you wanted something that involved detection of threshold crossing, I thought you were dealing with a biophysical model of a cell and advised you accordingly. However, it now appears that you may really want an artificial spiking cell--because your sample code ignores membrane potential or any of the "biological" state variables (e.g. concentrations) that one might reasonably need a section for.

There are also some errors in the hoc code, regardless of what your intent might be (e.g. as it stands, both point processes will either be attached to nothing, or to the same section, depending on whether NEURON's policy is to assume that, absent any specification of a default section or currently accessed section, it just assumes that the first created section will be the default section). Then there are some issues with the NMODL code . . .

So let's start over and get this right. Perhaps it would be best to discuss via email exchange until we have clarity on both sides. My address is ted dot carnevale at yale dot edu
Post Reply