How to activate network by synaptic mini current after time 50 ms when all network cells get silent

Moderator: wwlytton

Post Reply
mmushtaq
Posts: 16
Joined: Mon Jun 23, 2014 7:23 am

How to activate network by synaptic mini current after time 50 ms when all network cells get silent

Post by mmushtaq »

Hi everyone

I am developing thalamocortical model for slow sleep. I am facing some issues in network stimulation and need your help.
1. For network activation I want to give a synaptic mini current.
2. After this stimulation, as network cells start firing mini current should be stop. The network cells will be silent after some time period because of short term synaptic depression.
3. As all network cells become silent, after 50 ms of time, I want to repeat the stimulation process for next active state.
Currently I am using netstim class and giving synaptic current after every 1300 ms but this is not realistic approach.
nslist.o(i).interval = 1300

How can I find the time when all network cells are silent? I will be very thankful for your help.
ted
Site Admin
Posts: 6287
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: How to activate network by synaptic mini current after time 50 ms when all network cells get silent

Post by ted »

First clarify what you mean. Come up with a functional definition of "when all cells are silent."

Problem: by the ordinary meaning of "silent neuron," a neuron "silent" except at the very instant that it generates a spike. By that definition, all cells are silent nearly all the time. That's not useful to you.

An alternative definition might be "when no cell has fired a spike for at least N milliseconds." That's easy to implement. If that's a good enough definition for your purposes, fine--decide what is an appropriate value of N.

If it's not suitable, propose a different definition.
mmushtaq
Posts: 16
Joined: Mon Jun 23, 2014 7:23 am

Re: How to activate network by synaptic mini current after time 50 ms when all network cells get silent

Post by mmushtaq »

Yes sir I mean this "when no cell has fired a spike for at least N milliseconds." That's easy to implement. If that's a good enough definition for your purposes, fine--decide what is an appropriate value of N."
For instance last spike was generated by any network cell at 500 ms, I want to give synaptic current at 550 ms.
Thank you very much for your kind reply.
ted
Site Admin
Posts: 6287
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: How to activate network by synaptic mini current after time 50 ms when all network cells get silent

Post by ted »

For instance last spike was generated by any network cell at 500 ms, I want to give synaptic current at 550 ms.
OK, that should be doable with a bunch of NetCons (one for every cell in the network) and a single "artificial spiking cell." Here's what I suggest.

Every cell in your network will project to the artificial spiking cell via a NetCon; each of these NetCons will have a 1 ms delay. During intialization, the artificial spiking cell will generate a self-event that will return 550 ms later, as long as no cell in your network fires a spike. The artificial spiking cell's NET_RECEIVE block will respond to delivery of the self event by generating an output event ("spike") that can be used to drive excitatory synapses in your network model, and generating another self event that will return 550 ms later (that's 550 ms after the time at which . But if a cell in your network spikes at any time t1, the artificial spiking cell will receive an input event at t2 = t1+1, so code in the NET_RECEIVE block will move the self event to t2 - 1 + 550 ms (i.e. it will push the self event to 550 ms after t1, the time of the most recent spike in your network).

I'll write and send you the NMODL code for such an artificial spiking cell, and an example of how to use it. It'll be up to you to use it in your own network model.
mmushtaq
Posts: 16
Joined: Mon Jun 23, 2014 7:23 am

Re: How to activate network by synaptic mini current after time 50 ms when all network cells get silent

Post by mmushtaq »

Dear sir
Thank you very much for your kind reply. I think I did same as you mentioned.
Every cell in your network will project to the artificial spiking cell via a NetCon;

Code: Select all

proc net_stim() { local i  localobj ns, rs, es, is, r
  nslist = new List()   
  rslist = new List()   
  eslist = new List() 
  islist = new List()

  for i = 0, (PY_cells+IN_cells)-1 {
    ns = new NetStim()
    nslist.append(ns) 
  }
  for i = 0, (PY_cells+IN_cells)-1 {
  if(i<PY_cells) {
    PY[i].dend {
    es = new AMPA_S(.5)         
    eslist.append(es)
    }
  } else {
    IN[i-PY_cells].dend {
    es = new AMPA_S(.5)         
    eslist.append(es)
    // print i
    }
  }
}
  for i = 0, (PY_cells+IN_cells)-1 {
  if(i<PY_cells) {
    PY[i].dend {
    is = new GABAa_S(.5)         
    islist.append(es)
    }
  } else {
    IN[i-PY_cells].dend {
    is = new GABAa_S(.5)         
    islist.append(is)
    // print i
    }
  }
}
}

proc setparams() {local i, j 
  for i = 0,nslist.count()-1 {
    nslist.o(i).interval = 1300
    nslist.o(i).number = 20
    nslist.o(i).start = 500
    nslist.o(i).noise = 0.025 
  }
}

proc instrumentation() { local i  localobj nc, nci 
  for i = 0,nslist.count()-1 {
    nc = new NetCon(nslist.o(i), eslist.o(i), 0, 0., .05)
    nclist.append(nc)
    nc.record(tvec, idvec, i)
    nci = new NetCon(nslist.o(i), islist.o(i), 0, 0., .05)
    nclist.append(nci)
  }
}

net_stim()
setparams()
instrumentation()
I will wait for kind reply regarding mod file.
ted
Site Admin
Posts: 6287
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: How to activate network by synaptic mini current after time 50 ms when all network cells get silent

Post by ted »

I implemented an artificial spiking cell class called Autogoad. A zip file containing its mod file plus two demonstration programs is downloadable from https://www.neuron.yale.edu/ftp/ted/neuron/autogoad.zip

Autogoad has two parameters: delay and interval. An Autogoad instance ignores inputs until t > delay. After that, it monitors inputs (events delivered by NetCons).

When monitoring inputs, it generates a single "spike" event when
t - t0 >= interval
where t0 is the time of "the most recent received event." Note that "the most recent received event" may be either a self-event or an event received from some other spike source.

The demo programs are implemented with NEUIRON's GUI.

rig.ses sets up a toy network model in which Cell0 (based on the IntFire2 class) is driven by epsps that are elicited by the "afferent" spike train produced by the presynaptic neuron NS (based on the NetStim class).

Cell0 projects to AG2 (an instance of the Autogoad class). All connection delays are 1 ms.

Use NEURON to execute rig.ses. Click on the RunControl's Init & Run button to launch a simulation.
During a simulation, NS1 generates two spikes, which happen at 10 and 20 ms (raster 2 in the SpikePlot). The resulting epsps at 11 and 21 ms make Cell0 fire spikes at 21.20, 25.55, and 31.75 ms (rounded to nearest 0.01 ms) (raster 1 in the SpikePlot).

The Autogoad cell's delay parameter is 30 ms, so it ignores inputs that happen before t = 30 ms. Starting at t = 30 ms it monitors events generated by Cell0; note that those events are subjected to a 1 ms delay by the NetCon that projects Cell0's events to AG2. This means AG2 sees events at 22.20, 26.55, and 32.75 ms. It ignores the first two (because they arrive before t = 30 ms). The third event sets AG2's t0 variable to 32.75.

AG2's interval parameter is 12 ms, so if no events arrive before 44.75 ms AG will fire a spike.
Sure enough, AG2 receives no other events, so it generates spikes starting at 32.75 + 12 = 44.75 ms, and continuing at 12 ms intervals (56.75, 68.75, 80.75 etc.).

rig2.ses is similar to rig1.ses, except that in rig2.ses, AG2 makes an excitatory synapse onto NS1. This means that every time AG2 fires a spike, NS1 will generate 2 spikes--2 spikes because that's the number specified by NS1's "number" parameter. The first one will happen 1 ms after AG2's spike (1 ms because of the NetCon's delay) and the second one will be 10 ms after that (10 ms is NS1's interspike interval). And those two spikes from NS1 will make Cell0 fire a few more spikes,
but when Cell0 falls silent for 12 ms, AG2 will trigger NS1 to fire two more spikes. And the wave of excitation and spiking will move around the network for as long as you want to continue the simulation.
mmushtaq
Posts: 16
Joined: Mon Jun 23, 2014 7:23 am

Re: How to activate network by synaptic mini current after time 50 ms when all network cells get silent

Post by mmushtaq »

I tried to used this artificial cell autogoad in my model. I am facing one problem. autogoad cell can not receive input from network cells i.e. PY cells.
I think, that there is connection issue from PY cells to autogoad cell. How can I connect multiple PY to single autogoad cell PY-->autogoad (Multiple network cells to single artificial cell)? I attached attached network stimulation code for solution.

Code: Select all

proc net_stim() { local i  localobj ns, rs, es, is, r, ag, nw
  nslist = new List()   
  rslist = new List()   
  eslist = new List() 
  islist = new List()
  NW_list = new List()

  for i = 0, (PY_cells+IN_cells)-1 {
   // ns = new NStim()
    ns = new NetStim()
    nslist.append(ns) 
  }
  agcell = new Autogoad()
 // agcell = new AMPA_S()
  for i = 0, (PY_cells+IN_cells)-1 {
  if(i<PY_cells) {
    PY[i].dend {
    es = new AMPA_S(.5)         
    eslist.append(es)
    }
  } else {
    IN[i-PY_cells].dend {
    es = new AMPA_S(.5)         
    eslist.append(es)
    // print i
    }
  }
}

 for i = 0, (PY_cells+IN_cells)-1 {
  if(i<PY_cells) {
    PY[i].soma {
    nw = new AMPA_S(.5)         
    NW_list.append(nw)
    }
  } else {
    IN[i-PY_cells].soma {
    nw = new AMPA_S(.5)         
    NW_list.append(nw)
    // print i
    }
  }
}

  for i = 0, (PY_cells+IN_cells)-1 {
  if(i<PY_cells) {
    PY[i].dend {
    is = new GABAa_S(.5)         
    islist.append(is)
    }
  } else {
    IN[i-PY_cells].dend {
    is = new GABAa_S(.5)         
    islist.append(is)
    }
  }
}
}

proc setparams() {local i, j 

  for i = 0,nslist.count()-1 {
    nslist.o(i).interval = 20
    nslist.o(i).number = 2
    nslist.o(i).start = 200
    nslist.o(i).noise = 1 
  }
  agcell.interval = 100
  agcell.delay = 10
}

proc instrumentation() { local i  localobj nc, nci, pyag, agns
  for i = 0,eslist.count()-1 {
    nc = new NetCon(nslist.o(i), eslist.o(i), 0, 1, .035)
    nclist.append(nc)
    nci = new NetCon(nslist.o(i), islist.o(i), 0, 1, .01)
    nclist.append(nci)
    pyag = new NetCon(NW_list.o(i), agcell, 0, 1, .025)
    nclist.append(pyag)
    agns = new NetCon(agcell, nslist.o(i), 0, 1, .005)
    nclist.append(agns)
  }

}

net_stim()
setparams()
instrumentation()

Right now autogoad cell can not receive input from network cells. I need help some help for making correct network connection between PY cells to autogoad cells. Thanks for help in advance.
ted
Site Admin
Posts: 6287
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: How to activate network by synaptic mini current after time 50 ms when all network cells get silent

Post by ted »

If you walk through the code carefully after being away from it for a couple of days, you might see that the problem is with the statement that creates the NetCons that drive the agcell

pyag = new NetCon(NW_list.o(i), agcell, 0, 1, .025)

The "spike sources" in this statement are the elements of the list NW_list.o(i). But the elements of NW_list are instances of the AMPA_S class--they're synaptic mechanisms, in other words they're _targets_ of spike events rather than generators of spike events.

You need to iterate over all biophysical model cells in your network, and that will happen if you replace the above statement with

Code: Select all

    if(i<PY_cells) {
      pyag = new NetCon(&PY[i].soma.v(0.5), agcell, 0, 1, .025)
      }
    } else {
      pyag = new NetCon(&IN[i].soma.v(0.5), agcell, 0, 1, .025)
      }
    }
Let me know if that helps.
mmushtaq
Posts: 16
Joined: Mon Jun 23, 2014 7:23 am

Re: How to activate network by synaptic mini current after time 50 ms when all network cells get silent

Post by mmushtaq »

Thank you very much sir for your kind reply. I made change accordingly but faced an error.

"/Applications/NEURON-7.8//bin/nrniv: NetCon pointer not associated with currently accessed section
Use section ... (&var(x)...) intead of ...(&section.var(x)...)
in Fspikewave.oc near line 872
instrumentation()
^
NetCon(..., Autogoad[0], 0, 1, 0.025)
instrumentation()
xopen("Fspikewave.oc")
execute1("{xopen("Fs...")
"
Would you give me some hint how to solve this error. I will wait for your reply.
ted
Site Admin
Posts: 6287
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: How to activate network by synaptic mini current after time 50 ms when all network cells get silent

Post by ted »

Got it. The Programmer's Reference documentation of NetCon says that, when the section has to be specified, the syntax should be

section netcon = new NetCon(&v(x), target, threshold, delay, weight)

So change

Code: Select all

      pyag = new NetCon(&PY[i].soma.v(0.5), agcell, 0, 1, .025)
to

Code: Select all

      PY[i].soma pyag = new NetCon(&v(0.5), agcell, 0, 1, .025)
and also change

Code: Select all

      pyag = new NetCon(&IN[i].soma.v(0.5), agcell, 0, 1, .025)
to

Code: Select all

      IN[i].soma pyag = new NetCon(&v(0.5), agcell, 0, 1, .025)
mmushtaq
Posts: 16
Joined: Mon Jun 23, 2014 7:23 am

Re: How to activate network by synaptic mini current after time 50 ms when all network cells get silent

Post by mmushtaq »

It works now! Thank you very much for your help.
ted
Site Admin
Posts: 6287
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: How to activate network by synaptic mini current after time 50 ms when all network cells get silent

Post by ted »

Glad to have helped with the "easy" part. The hard part is doing the research and writing up the results.
Post Reply