Drive a neuron with an external (non-NEURON) txt file

The basics of how to develop, test, and use models.
Post Reply
Prokopiou

Drive a neuron with an external (non-NEURON) txt file

Post by Prokopiou »

Hello all,
Most probably what I want to do can be solved easily since what I find in the forum seems to be more complicated than what is needed.

What I want to do is to drive a single node (eg the beginning of a section) with an external signal. The signal is a sequence of zeros and ones (stream of logical bits) that indicate when a spike is initiated. (eg. if the dt = 0.25ms then 0 0 0 1 0 0 1 would symbolize a spike initiation at 0.75ms and at 1.5ms)
The logical stream will be read from a pre-saved .txt file with scanvar or something similar.

The logical stream of bits symbolizes when a synapse releases enough neurotransmitter to start a spike at the distal end of the neuron propagating up the system to more central parts. Any aborted spikes should be rejected through the course of the signal travelling along the neuron, so when an 1 exists in the logical sequence I want to ensure that a spike will have the maximum possibility to be initiated given the previous state of the neuron dynamics when the synapse sits.

It seems to me that ExpSyn is the pointprocess I need for this but im a bit confused of what is the best way to drive a spike at the time I need it to start and then just let it propagate along the neuron.

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

Re: Drive a neuron with an external (non-NEURON) txt file

Post by ted »

I'd suggest something like an IClamp instead, set to deliver a brief (0.1 ms) current with amplitude adjusted to 2 x threshold for eliciting a spike. Rationale: simpler than ExpSyn, current is big from the start, guaranteed to deliver the same amount of charge each time.

"But an IClamp will deliver only a single pulse."

True, but see "How to make IClamp deliver multiple pulses or a waveform" in the "Hot tips" area of the NEURON Forum. I'll make a variant of the Ipulse1 or Ipulse2 mechanisms that can be driven to spike at user-specified times and post it to this thread.

You're not going to be able to elicit spikes that begin at predetermined times. There will be a delay between the onset of the current and whatever point on the spike waveform you choose to use as the indicator of spike timing. The delay will depend on the magnitude and detailed time course of the current that you use to elicit the spike. It will also depend on the previous spiking history of the axon, because the gating states are not instantaneous functions of membrane potential.
ted
Site Admin
Posts: 6300
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Drive a neuron with an external (non-NEURON) txt file

Post by ted »

OK, go to NEURON's FAQ page http://www.neuron.yale.edu/neuron/faq/general-questions and look for the question
I want a current clamp that will generate a pulse when I send it an event, or that I can use to produce pulses at precalculated times. Download pulsedistrib.zip, expand it, and get ipulse3.mod. This specifies the properties of Ipulse3, a current clamp that you can drive with events, just like a synapse.

"Where will the events come from?"

Store the event times in a Vector and use an instance of the VecStim class to generate events at those times. This is discussed in the "Hot tips" area of the NEURON Forum under the topic
Driving a synapse with recorded or precomputed spike events
Prokopiou

Re: Drive a neuron with an external (non-NEURON) txt file

Post by Prokopiou »

Thanks! Ill work on it after the weekend and ill let you know what happened
Prokopiou

Re: Drive a neuron with an external (non-NEURON) txt file

Post by Prokopiou »

Hello, I finished the code, ill just place an example here in case this falls in other's interests.

Code: Select all

// enter the section the synapse attaches to
access terminal

objref f1, f2
f1 = new File()
f2 = new File()

// Load the data that come from Matlab
f1.ropen("synapse_simulation_data.txt")

dt = f1.scanvar()
tstop = f1.scanvar()
spike_number = f1.scanvar()
pulse_duration = f1.scanvar()
pulse_amplitude = f1.scanvar()

f1.close()


objref ns, nc, ipls // NetCon,VecStim,ipulse3 
objref evec // vector that holds the spike times in ms

evec = new Vector(spike_number) 

f2.ropen("ANspikes_event_time.txt")

for i = 0,spike_number-1 {

	evec.x(i) = f2.scanvar() // reading the spike times

}

f2.close

ns = new VecStim()
ns.play(evec) // load up spike event times

ipls = new Ipulse3(0)
ipls.dur = pulse_duration  
ipls.amp = pulse_amplitude

//Network Connection object that defines 
//a synaptic connection between source and target. 
nc = new NetCon(ns, ipls)
nc.delay = 0

so this assumes that the morphology of the cell is loaded before and what is left is to integrate and record results.
ted
Site Admin
Posts: 6300
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Drive a neuron with an external (non-NEURON) txt file

Post by ted »

Prokopiou wrote:Hello, I finished the code, ill just place an example here in case this falls in other's interests.
Thanks for posting that. Looks good. You tested it and it seems to work?

One suggestion:
In all this code, there is only one statement that needs the "currently accesed section" to be specified--

Code: Select all

ipls = new Ipulse3(0)
Instead of declaring

Code: Select all

access terminal
right at the start of the file, I'd suggest specifying the currently accessed section in close proximity to the statement that creates the Ipulse3 instance. Also, to avoid possible side-effects of (re)specifying the default section, it would be better to use "section stack syntax"

Code: Select all

terminal ipls = new Ipulse3(0)
Prokopiou

Re: Drive a neuron with an external (non-NEURON) txt file

Post by Prokopiou »

Yeap its tested and it works exactly as it is supposed to.

Thank you for your suggestion! Just made the changes and as expected still works.
Post Reply