Random Spikes

NMODL and the Channel Builder.
Post Reply
Samuel_30
Posts: 10
Joined: Wed Nov 16, 2016 5:13 pm

Random Spikes

Post by Samuel_30 » Tue Jan 24, 2017 10:41 pm

Hi Ted y friends,

I need to generate random spikes on these two neurons. How should I do?

Code: Select all

load_file("nrngui.hoc")

begintemplate SThcell
public soma, nclist
public x, y, z
public sinapse
public conta

create soma
objectvar nclist
objectvar sinapse
objectvar conta

proc init() {
    x=$1
    y=$2
    z=$3

    create soma
    nclist=new List()


    soma {
      pt3dclear()
      pt3dadd(x,y,z,50)
      pt3dadd(x+50,y,z,50)    
      nseg = 1
      diam = 18.8
      L = 18.8
      Ra = 123.0
      insert hh
   sinapse=new ExpSynSTDP_triplet(0)
      sinapse.e=0
      sinapse.tau=10
      sinapse.factor=1//potentiation depotentiation factor
   sinapse.gw=1e-5 //uS max conductance
    }


}
endtemplate SThcell


//Usa-se os templates

objref neuron[2]
neuron[0]=new SThcell(0,0,0)
neuron[1]=new SThcell(100,0,0)

CONNECTION_PROB=1
CONNECTION_THRESHOLD=0
CONNECTION_DELAY=0
CONNECTION_WEIGHT=1e-5 // max conductance uS

access neuron[0].soma
neuron[0].soma neuron[1].nclist.append(new NetCon(&neuron[0].soma.v(0.5),neuron[1].sinapse,CONNECTION_THRESHOLD,CONNECTION_DELAY,CONNECTION_WEIGHT))


objectvar stim[8]

neuron[0].soma {
    stim[0] = new IClamp(0.5)
    stim[0].del = 100
    stim[0].dur = 1
    stim[0].amp = 0.1

    stim[1] = new IClamp(0.5)
    stim[1].del = 300
    stim[1].dur = 1
    stim[1].amp = 0.0

    stim[2] = new IClamp(0.5)
    stim[2].del = 500
    stim[2].dur = 1
    stim[2].amp = 0.0

    stim[3] = new IClamp(0.5)
    stim[3].del = 4000 //700
    stim[3].dur = 1
    stim[3].amp = 0.0

}

neuron[1].soma {
    stim[4] = new IClamp(0.5)
    stim[4].del = 110
    stim[4].dur = 1
    stim[4].amp = 0.1

    stim[5] = new IClamp(0.5)
    stim[5].del = 300
    stim[5].dur = 1
    stim[5].amp = 0.0

    stim[6] = new IClamp(0.5)
    stim[6].del = 500
    stim[6].dur = 1
    stim[6].amp = 0.0

    stim[7] = new IClamp(0.5)
    stim[7].del = 700
    stim[7].dur = 1
    stim[7].amp = 0.0

}


tstop = 1000

objref grafico[7]

grafico[0]=new Graph()
grafico[0].size(0,tstop ,-100,50)
grafico[0].beginline()
grafico[0].addvar("Pre",&neuron[0].soma.v(0.5),1,1)
grafico[0].addvar("Pos",&neuron[1].soma.v(0.5),2,1)
grafico[0].flush()

grafico[2]=new Graph()
grafico[2].size(0,tstop ,0,10)
grafico[2].beginline()
grafico[2].addvar("Gsyn",&neuron[1].sinapse.g,3,1)
grafico[2].flush()

grafico[4]=new Graph()
grafico[4].size(0,tstop ,-30,20)
grafico[4].beginline()
grafico[4].addvar("peso",&neuron[1].sinapse.peso,3,1)
grafico[4].flush()

grafico[5]=new Graph()
grafico[5].size(0,tstop ,-30,20)
grafico[5].beginline()
grafico[5].addvar("O1",&neuron[1].sinapse.O1,1,1)
grafico[5].addvar("O2",&neuron[1].sinapse.O2,2,1)
grafico[5].addvar("R1",&neuron[1].sinapse.R1,3,1)
grafico[5].addvar("R2",&neuron[1].sinapse.R2,4,1)
grafico[5].flush()


graphList[0].append(grafico[0])
graphList[0].append(grafico[1])
graphList[0].append(grafico[2])
graphList[0].append(grafico[3])
graphList[0].append(grafico[4])
graphList[0].append(grafico[5])
graphList[0].append(grafico[6])

run() 



Maybe this netstim, but it is not working.
P.S .: Ted, I did what you suggested in another post, but I did not get what I need.

Code: Select all

ns = new NetStim(0.5)
ns.start = 1
ns.interval = 25
ns.noise = 0
ns.number = 2

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

Re: Random Spikes

Post by ted » Wed Jan 25, 2017 10:20 am

Why not attach an ExpSyn to each cell's soma, and drive each ExpSyn with random events generated by its own NetStim?

Samuel_30
Posts: 10
Joined: Wed Nov 16, 2016 5:13 pm

Re: Random Spikes

Post by Samuel_30 » Wed Jan 25, 2017 11:09 am

The model already has ExpSyn (triplet-STDP)

Should I create two more for each neuron?

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

Re: Random Spikes

Post by ted » Wed Jan 25, 2017 11:06 pm

I have no idea what "ExpSyn (triplet-STDP)" means.

You asked how to make your model cells generate spikes at random times. The quick and easy way is to apply a large excitatory input at random times. The easiest way to do that is with an ExpSyn that is driven by events that are generated at random times. Whether you add a new ExpSyn or use an existing one is up to you. I'd probably use a new one that has a fast tau to minimize undesired side-effects of the conductance transients that it produces--something short compared to spike duration would do nicely. If a fast synaptic time constant reduced the synaptic current to the point where it didn't trigger spikes reliably, I'd make the ExpSyn's reversal potential e more depolarized than the default value of 0.

Samuel_30
Posts: 10
Joined: Wed Nov 16, 2016 5:13 pm

Re: Random Spikes

Post by Samuel_30 » Thu Jan 26, 2017 8:39 am

I'm starting to understand ...

The ExpSyn model is a synaptic mechanism (alpha synapse controlled by STDP) and is an NMODL file.

To create another ExpSyn, I will need to create another NMODL file, correct?

Thanks, Ted

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

Re: Random Spikes

Post by ted » Thu Jan 26, 2017 6:16 pm

The author of 1984 also wrote an essay in which he said
"the slovenliness of our language makes it easier for us to have foolish thoughts."
He was writing about the political (mis)use of English, but the basic observation is equally true in science, mathematics, and computer programming. It's time to pay some attention to the meaning of words.
The ExpSyn model is a synaptic mechanism
Yes.
(alpha synapse
No. An "alpha synapse" is a synapse whose conductance change follows a time course that is described by an alpha function. Read about ExpSyn in the Programmer's Reference and tell me what describes the time course of its conductance.
controlled by STDP)
No. STDP has nothing to do with it. Read about STDP somewhere else and learn what that acronym means. An ExpSyn is driven by events--arrival of an event with weight w makes conductance change abruptly by an amount equal to w. Read chapter 10 of The NEURON Book. If you don't have the book, read this early draft
https://www.neuron.yale.edu/ftp/ted/boo ... xedref.pdf
and is an NMODL file.
No, it is not an NMODL file. An ExpSyn is an instance of the ExpSyn class. The attributes of the ExpSyn class are specified by statements written in the NMODL programming language.
To create another ExpSyn, I will need to create another NMODL file, correct?
[/quote][/quote]No. You only have to create a new instance of the ExpSyn class, then use hoc statements to alter its parameters. Time to learn about object oriented programming. Read chapter 13 of The NEURON Book. If you don't have the book, read this early draft
https://www.neuron.yale.edu/ftp/ted/boo ... xedref.pdf

Samuel_30
Posts: 10
Joined: Wed Nov 16, 2016 5:13 pm

Re: Random Spikes

Post by Samuel_30 » Thu Jan 26, 2017 9:36 pm

Thank you so much, Ted.
and sorry for the inexperience.
NEURON has been a challenge for me in the biological area.
Need to study better the tutorials.
Another problem is finding nothing in Portuguese, my natural language.

Post Reply