input to a netcon synapse from an external file

Anything that doesn't fit elsewhere.
Post Reply

input to a netcon synapse from an external file

Post by horstmann »

I tried to rewrite a simple Ampa-Synapse from Destexhe et. al with a rectangular transmitter pulse in order to a have a synapse, which is able to deal with NetCon-Events, so that using CVode during simulation is possible.

Everything went fine, until I tried to implement the synapse in hoc.
What I want to do is simulating a pyramidal hippocampal neuron, which gains its input through different synapses from files. The Files are pure ASCII-Files consisting of 0 and 1, which denote if a spike has arrived or not. Because a Netstim-Process can only have as a source a range variable I inserted a dummysoma, which is not connected to anything else and consists of one segment, loaded the files into a vector and played the vectors by brute force into the membranpotential of the dummysoma.

This is the hoc code:


Code: Select all

input = new File()
vector = new Vector(620000)

dummysoma, 0.025) /

objectvar NetConSynapse

dendbas {NetConSynapse = new AMPANETCON(0.2)} 
objref nc

dummysoma nc = new NetCon(&v(0), NetConSynapse, 0.5, 0, 0) 

AMPANETCON is the rewritten Ampa Synapse.

To figure out if the problem may be the new programmed AMPANETCON-Synapse, I tried the same with the "old Synapse"

Code: Select all

    noise1 = new AMPA(0.2)
    stimdummy setpointer noise1.pre, v(0) 
    stimdummy, 0.025)
AMPA is the "old synapse", vector1 the vector, where all the file datapoints are played in

This doesn't work at all (v(0) doesn't change at all), but if I replace v(0) with any arbitrary variable x, everything works fine.

Does anyone know a solution for feeding a NetCon-Synapse with data from file?

Thanks in advance

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

driving a synaptic mechanism with events at specified times

Post by ted »

The straightforward way to do what you want is to exploit the NetCon class's
event() method, which allows you to stuff events into the queue--see ... html#event

Here's an outline of the changes you need to make:
1. Translate your strings of 0s and 1s into a Vector full of event times, i.e. the times at
which you want your synapticmechanism to be activated.
2. Make sure the NetCon that will feed these to your synaptic mechanism has a delay
of 0 (the documentation of NetCon.event says that the times are delivery times, not
"initiating" (source) times, but there's no harm in explicitly making nc.delay = 0).
3. Use an FIinitializeHandler ... ithnd.html
to stuff the event times into that NetCon's queue during initialization. For example, if
the Vector that holds the event times is syntimes, and the NetCon that drives the
synaptic point process nc, this would work:
objref fih
fih = new FInitializeHandler("loadqueue()")
proc loadqueue() { local ii
for ii=0,syntimes.size()-1 nc.event(syntimes.x[ii])
Site Admin
Posts: 5784
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine

model of saturating AMPAergic synapse

Post by ted »

Here's Listing 10.5 from The NEURON Book--the NMODL code for a saturating
AMPAergic synaptic mechanism that works with the event delivery system. You may
want to compare the PARAMETERs against those that Alain used in his original
implementation, and change them if necessary.

Code: Select all

: ampa.mod
: saturating synapse model using discrete events

  GLOBAL Cdur, Alpha, Beta, Erev, Rinf, Rtau

  (nA)   = (nanoamp)
  (mV)   = (millivolt)
  (umho) = (micromho)

  Cdur  = 1.0   (ms)  : transmitter duration (rising phase)
  Alpha = 1.1   (/ms) : forward (binding) rate
  Beta  = 0.19  (/ms) : backward (dissociation) rate
  Erev  = 0     (mV)  : equilibrium potential

  v     (mV)   : postsynaptic voltage
  i     (nA)   : current = g*(v - Erev)
  g     (umho) : conductance
  Rtau  (ms)   : time constant of channel binding
  Rinf  : fraction of open channels if xmtr was present "forever"
  synon : sum of weights of all synapses that are in the "onset" state

STATE { Ron Roff }  : initialized to 0 by default
: Ron and Roff are the total conductances of all synapses 
:   that are in the "onset" (transmitter pulse ON)
:   and "offset" (transmitter pulse OFF) states, respectively

  Rinf = Alpha / (Alpha + Beta)
  Rtau = 1 / (Alpha + Beta)
  synon = 0

  SOLVE release METHOD cnexp
  g = (Ron + Roff)*1(umho)
  i = g*(v - Erev)

DERIVATIVE release {
  Ron' = (synon*Rinf - Ron)/Rtau
  Roff' = -Beta*Roff

NET_RECEIVE(weight, on, r0, t0 (ms)) {
  : on == 1 if transmitter is present ("onset" state), otherwise 0
  : flag is an implicit argument of NET_RECEIVE, normally 0
  if (flag == 0) {
    : a spike happened, so start onset state if not already in onset state
    if (!on) {
      : this synapse joins the set of synapses in the onset state
      synon = synon + weight
      r0 = r0*exp(-Beta*(t - t0)) : r0 at start of onset state
      : r0 joins the "onset" conductance pool,
      :   which grows according to Ron' = ...
      :   and leaves the "offset" conductance pool,
      :   which decays according to Roff' = ...
      Ron = Ron + r0
      Roff = Roff - r0
      t0 = t
      on = 1
      net_send(Cdur, 1)
    } else {
      : already in onset state, so move offset time
  if (flag == 1) {
    : "turn off transmitter"
    : i.e. this synapse joins the set of synapses in the offset state
    synon = synon - weight
    : r0 at start of offset state
    r0 = weight*Rinf + (r0 - weight*Rinf)*exp(-(t - t0)/Rtau)
    : r0 leaves the "onset" conductance pool,
    :   and joins the "offset" conductance pool
    Ron = Ron - r0
    Roff = Roff + r0
    t0 = t
    on = 0


Post by horstmann »

Thank you very much, this works.

Posts: 220
Joined: Thu Jun 09, 2005 1:09 pm
Location: Hanze University of Applied Sciences

Model of saturating AMPAergic synapse

Post by Raj »

Small observation on the absence of state_discontinuity statements and the answer was found in the NEURON book, chapter 10:
Earlier versions of NEURON had to change g (i.e. a state variable) with a state_discontinuity() statement. This is no longer necessary.
Posts: 6
Joined: Tue Jun 12, 2007 4:21 pm

Post by JZ »

This is helpful to me too, does anyone know of a similar implementation (with netcon) of Destexhe's model of the GABA_a receptor?
Post Reply