Using Exp2Syn synapses

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

Using Exp2Syn synapses

Post by ksarma »

Hi,

I am trying to add some Exp2Syn synapses driven by a NetStim to my model, but I am having difficulty getting them going. My synapses at this point don't do anything (that is, syn.i is always 0)

Here is my code:

Code: Select all

load_file("nrngui.hoc")

pi = 3.1415926535

create axon
axon {
	pt3dclear()
	pt3dadd(0, 0, 0, 5)
	pt3dadd(100, 0, 0, 5)
	insert pas
	insert extracellular
}

objref syn[10], nc[10], ns
objref synapse_location_file
synapse_location_file = new File()
synapse_location_file.wopen("synapse_locs.dat")

axon ns = new NetStim(0.5)
ns.interval = 10
ns.start = 10
ns.noise = 0
ns.number = 10000000

for i=0,9 {

	axon syn[i] = new Exp2Syn(0.5)
	syn[i].tau1 = 0.2
	syn[i].tau2 = 2
	syn[i].e = 0

	axon nc[i] = new NetCon(ns, syn[i])
	nc[i].weight = 0.004
	nc[i].delay = 0

}

synapse_location_file.close()

objref syncurr_output, imembrane_output

syncurr_output = new File()
imembrane_output = new File()

syncurr_output.wopen("syncurr.dat")
imembrane_output.wopen("imembrane.dat")

proc doOutput() {

	syncurr_output.printf("%9.10g %9.10g %9.10g %9.10g %9.10g %9.10g\n", t, syn[0].i, syn[2].i, syn[4].i, syn[6].i, syn[8].i)
	axon {
		imembrane_output.printf("%9.10g %9.10g %9.10g %9.10g %9.10g %9.10g\n", t, (i_membrane(0.1) * area(0.1)), (i_membrane(0.3) * area(0.3)), (i_membrane(0.5) * area(0.5)), (i_membrane(0.7) * area(0.7)), (i_membrane(0.9) * area(0.9)))
	}
}

dt = 0.01
Tstop = 1000

proc run() {

	fcurrent()
	printf("Starting!\n")
	while (t <= Tstop) {
		fadvance()
		doOutput()
	}

	printf("Complete!\n")

}

run()

syncurr_output.close()
imembrane_output.close()

I would appreciate anyone's help on this matter.
ted
Site Admin
Posts: 5810
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Abandon the standard run system at your own risk!

Post by ted »

The problem lies in the fact that you have abandoned NEURON's standard run system, but not provided an adequate run system of your own. This has numerous fatal consequences, including failure to properly initialize many important items that range from the state variables of the model itself (membrane potential, and any voltage- and time-dependent state variables if there were any) to the event delivery system. The latter is essential for proper operation of NEURON's event-based implementation of spike triggered synaptic transmission.

So throw out your run() procedure.

If you really want your simulation to pause after every fadvance() to write results to output files, use a custom advance() procedure, like this

Code: Select all

proc advance() {
  fadvance()
  doOutput()
}
but you would be better off using the Vector class's record() method to capture values to Vectors at compiled code speed during the simulation, then use the Vector class's printf() method to write them (again, at compiled code speed) to output files after the end of the simulation. This also has the advantage of capturing the values at time 0. You can automate this with your own myrun() procedure:

Code: Select all

proc myrun() {
  run() // the standard run system's own run()!
  write_to_output_files() // your proc that opens the output files, writes data, then closes them
}
A few minor comments:

hoc has a built-in constant PI

For some time now, NEURON's artificial spiking cells do not need or use a "host section." With any reasonably recent version of NEURON, it is not necessary to create a new artificial spiking cell in the context of a currently accessed section.

To create a NetCon nc that has artificial spiking cell ns as its source, the syntax is simply
nc = new NetCon(ns, target)
and there is no need to include the name of a section in this statement.
ksarma

Re: Using Exp2Syn synapses

Post by ksarma »

Hi Ted,

Thank you so much for your comments! Following your advice solved the problem.


I do, however, have another question. I have compared i_membrane(0.5) * area(0.5) * 0.01 (units of nA) to the total synaptic current 10 * syn[0].i (units of nA), and found that i_membrane is considerably less than the total synaptic current. I would expect these quantities to be comparable, however, as I thought that i_membrane included synaptic currents. Is this not in fact the case?


Thanks again for your help!
ted
Site Admin
Posts: 5810
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Using Exp2Syn synapses

Post by ted »

I have compared i_membrane(0.5) * area(0.5) * 0.01 (units of nA) to the total synaptic current 10 * syn[0].i (units of nA), and found that i_membrane is considerably less than the total synaptic current. I would expect these quantities to be comparable, however, as I thought that i_membrane included synaptic currents. Is this not in fact the case?
Excellent question. I see you take nothing for granted. Good!

i_membrane does include synaptic currents. It includes all transmembrane currents. In a single compartment model, Kirchhoff's current law dictates that the sum of all transmembrane currents is 0. Therefore i_membrane should be 0. But numerical integration has a finite error, so there will always be a small nonzero residual, and that's what you're seeing in the simulation of your single compartment model. Make nseg = 3 (which will not disturb the location of your syaptic mechanism) and you will see total membrane current in the section centerd at 0.5 jump to 2/3 of the synaptic current.

In computational modeling, most unexpected results are either caused by an error in one's code or an error in one's understanding of the system that is being modeled. Some, like this one, would make nice "trick questions" for "academic one-upmanship" or perhaps even for qualifying exams.
ksarma

Re: Using Exp2Syn synapses

Post by ksarma »

Ah, that makes a lot of sense. Thanks again!
ted
Site Admin
Posts: 5810
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Using Exp2Syn synapses

Post by ted »

Yeah, doesn't resolution of cognitive dissonance feel good to the brain?

Thanks for using NEURON in your work. And when you publish anything that reports work done with NEURON, please let us know so we can include your article in the NEURON Bibliography http://www.neuron.yale.edu/neuron/bib/usednrn.html
ksarma

Re: Using Exp2Syn synapses

Post by ksarma »

Well, the synapses now appear to be working properly, but the effect on the membrane potential seems to be rather wrong.

I have tuned the weight parameter to get the expected peak current of an AMPA synapse (~10-20 pA), and added appropriate membrane properties (adapted from Bernander et. al 1991 and Gold 2006). When I run the simulation, I find that it produces the correct peak current, but the membrane potential on top of the single synapse deviates significantly (it rises to about -45 mV and then oscillates between -45 and -53 mV). I would only expect at most a few mV deviation in the membrane potential at the synapse. Upon further investigation, I found that the problem was my choice of g_pas. I have set g_pas to be 5e-5 (and the associated Rm = 1/g_pas), but setting it to the default value of 0.01 produces a more reasonable effect on the membrane potential (~1mV deviations). A g_pas of 0.001, however, seems extremely high (as it is associated with a rather low Rm = 1 kOhm * cm^2). Have I done something wrong while initializing my simulation? (Note that I still have not implemented recording with Vectors).

Thanks again for your help, and I apologize in advance if I have gotten some terminology wrong or made some other novice mistake -- I am still very new to neuronal biophysics.
ted
Site Admin
Posts: 5810
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Using Exp2Syn synapses

Post by ted »

ksarma wrote:I have tuned the weight parameter to get the expected peak current of an AMPA synapse (~10-20 pA), and added appropriate membrane properties (adapted from Bernander et. al 1991 and Gold 2006). When I run the simulation, I find that it produces the correct peak current, but the membrane potential on top of the single synapse deviates significantly (it rises to about -45 mV and then oscillates between -45 and -53 mV).
Are you quite sure you didn't adjust the weight to get a peak of 10-20 nA? A unitary conductance transient with parameters as per your original hoc code, attached to a model with the properties specified by your original hoc code, requires an event with an empirically determined weight of 0.000143 to generate a peak current of 10 pA in a model with resting potential -70 mV, and produces a peak depolarization of only 0.4 mV relative to resting potential.

An aside--Exp2Syn is implemented in such a way that the synaptic weight is also the peak synaptic conductance, in nS, elicited by synaptic activation. Knowing this, and the fact that the epsp is very small, we can discover for ourselves if the empirically determined synaptic weight makes sense. Here's how:

Since the EPSP is so small, and the synaptic equilibrium potential is 0 mV, the driving force for charge entry is almost identical to the resting potential throughout the course of synaptic activation. A peak conductance of 1 nS with a driving force of 1 mV generates a peak current of 1 nA, so 1 nS with a driving force of 70 mV generates a peak current of 70 nA. But we want 10 pA, which is 7000 times smaller, and that means we need a peak conductance of 1 nS / 7000. This theoretically estimated peak conductance is very nearly equal to 0.000143 nS, the empirically determined peak conductance that produces a peak current of 10 pA. So it makes sense.
ksarma

Re: Using Exp2Syn synapses

Post by ksarma »

Hi Ted,

Thanks again for the reply! I am fairly certain that I did tune the weight to the proper range (the weight ended up being 0.0003, with a peak synaptic current of about 0.016 nA). This does seem believable from your analysis as well.

Here is the code I used -- it is mostly the same, with only a few additional parameters added:

Code: Select all

load_file("nrngui.hoc")

create axon
axon {
	pt3dclear()
	pt3dadd(0, 0, 0, 2)
	pt3dadd(100, 0, 0, 2)
	insert pas
	insert extracellular
	nseg = 3
	e_pas = -65
	g_pas = 5e-5
	Rm = 1/g_pas
}

v_init=-65

objref syn[1], nc[1], ns


ns = new NetStim(0.5)
ns.interval = 10
ns.start = 10
ns.noise = 0
ns.number = 10000000

for i=0,0 {

	axon syn[i] = new Exp2Syn(0.5)
	syn[i].tau1 = 0.2
	syn[i].tau2 = 2
	syn[i].e = 0

	nc[i] = new NetCon(ns, syn[i])
	nc[i].weight = 0.0003
	nc[i].delay = 0

}

objref syncurr_output, imembrane_output, membrane_output, extracellular_output

syncurr_output = new File()
imembrane_output = new File()
membrane_output = new File()
extracellular_output = new File()

syncurr_output.wopen("syncurr.dat")
imembrane_output.wopen("imembrane.dat")
membrane_output.wopen("membrane.dat")
extracellular_output.wopen("extra.dat")

proc doOutput() {

	syncurr_output.printf("%9.10g %9.10g\n", t, syn[0].i)
        axon {
        	imembrane_output.printf("%9.10g %9.10g %9.10g %9.10g %9.10g %9.10g\n", t, (i_membrane(0.1) * area(0.1)), (i_membrane(0.3) * area(0.3)), (i_membrane(0.5) * area(0.5)), (i_membrane(0.7) * area(0.7)), (i_membrane(0.9) * area(0.9)))
		membrane_output.printf("%9.10g %9.10g %9.10g %9.10g %9.10 %9.10g\n", t, v(0.1), v(0.3), v(0.5), v(0.7), v(0.9))
		extracellular_output.printf("%9.10g %9.10g %9.10g %9.10g %9.10g %9.10g\n", t, e_extracellular(0.1), e_extracellular(0.3), e_extracellular(0.5), e_extracellular(0.7), e_extracellular(0.9))
        }


}

dt = 0.01
tstop = 1000

proc advance() {
	fadvance()
	doOutput()
}

run()

syncurr_output.close()
imembrane_output.close()

Thanks again for your help! I really appreciate your detailed replies -- I learn something useful with each one!
ted
Site Admin
Posts: 5810
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Using Exp2Syn synapses

Post by ted »

Your new code differs from the original in the following key aspects:
synaptic current is 1.9 times larger
surface area is 2.5 times smaller
membrane time constant 20 times longer
From the new synaptic current and surface area alone, one would expect that a single synaptic activation would generate a peak depolarization that is ~ 5 times larger than occurred in the original, i.e. about 2 mV above rest. But membrane time constant is much longer, so the cell is a more effective integrator of synaptic current, and the depolarization should be larger. Which it is--a single synaptic activation now produces ~5.9 mV depolarization.
When I run the simulation, I find that it produces the correct peak current, but the membrane potential on top of the single synapse deviates significantly (it rises to about -45 mV and then oscillates between -45 and -53 mV).
You must be referring to the results of temporal summation, during a long train of repeated synaptic activations. For the passive model in your most recent post, v eventually fluctuates between ~ -53.9 and -51 mV. A demonstration of a classical phenomenon called "nonlinear summation," which is still much discussed--here's a recent paper, full text of which is available, that you might find interesting:
Sharon Cushing, Tuan B. Bui, and P. K. Rose. Effect of non-linear summation of synaptic currents on the input/output properties of spinal motoneurons. J Neurophysiol 94: 3465-3478, 2005
http://jn.physiology.org/cgi/content/short/94/5/3465
ksarma

Re: Using Exp2Syn synapses

Post by ksarma »

That clears things up. Thanks again!
Post Reply