behii wrote:“ncslist.o(i).weight[0]” cannot track conductances' changes!
True. There is no assignment statement that has w on the left hand side. w remains unchanged throughout the simulation. The effect of any synaptic input event is manifest by what it does to the state variables B and C. These statements
C = C + (w + A)*factor
B = B + (w + A)*factor
in the NET_RECEIVE block, the calculation of factor in the INITIAL block, and the statements
g = B - C
i = g*gs*(v - e)
in the BREAKPOINT block, make me suspect that an input event with weight w will cause a synaptic conductance transient with peak amplitude given by
(w + A)*gs
You should test this for yourself with a very simple toy model: a single compartment with the Hodgkin-Huxley mechanism hh, to which you have attached an IClamp. Set the IClamp to deliver a 0.1 ms current pulse at 1 ms, and adjust its amplitude so that it is large enough to elicit a spike. Next change the IClamp's amplitude to 0, and attach a an instance of the STDPE2 mechanism driven by a NetStim via a NetCon. Set the NetStim to generate a single event at 1 ms, and set the NetCon's delay to 1 ms and its weight to 0.001. Run a simulation and verify that the STDPE2's g starts out at 0 ms, begins to increase at 2 ms, and peaks at 0.001 uS.
Next increase the number of events delivered by the NetStim to 2, and set the interval between them to 10 ms. Check the peak amplitudes of the two synaptic conductance transients. See if these agree with what you would predict from the values of w and A (the [0] and [1] elements of the NetCon's weight vector) and gs.
Now restore the IClamp's amplitude to a nonzero value. Vary the time at which the current pulse is delivered and see what happens to the synaptic conductance transients. Compare with what you would expect based on the values of w and A.
How should I change mod file of STDP so that I can record conductance?
You don't want to do that. Conductance changes continuously throughout the simulation. You really want the peak ampitude of each condutance transient that is elicited by a synaptic input--that's much less data to have to deal with. And you can calculate that from w, A, and gs. You will only need to record the value of gs whenever an input arrives, and of each NetCon's A when it changes, i.e. when it delivers an input event. I see that the NMODL code does not expose gs to hoc. This is not good--gs may change in the course of a simulation. You will want to declare gs as a RANGE variable in the NEURON block.
In addition, I found an object named “STDPE2-“ in “plot what” that has 100 components from 0 to 99, each of which has other objects like B,C,e,g, etc.
Good for you. It can be very difficult to understand someone else's code (hard enough for me to understand my own code). What you found was 100 instances of the STDPE2 class. These are not 100 synapses. They are 100 synaptic mechanisms. They may be used to represent the effects of many more than 100 synapses.
"How?" you might well ask.
By superposition. Suppose you have a biological cell with two synapses of the same kind (ampaergic, gabaergic, whatever) that are anatomically close to each other, so that they are also "electrically" close to each other. Activate one and it produces a conductance change g1. Activate the other and it also produces a conductance change g2. The total conductance produced by both is the sum of their individual conductances. They both see the same local membrane potential v, and the ions that flow through their channels have the same reversal potential es. So the total current is
istotal = (g1 + g2)*(v - es)
Now, the time courses of g1 and g2 are governed by one or more differential equations (DEs) that have identical form--in this case,
B' = -B/tau
C' = -C/tau
Furthermore, these DEs are linear.
So in building a computational model of these two biological synapses, we can take advantage of superposition, and use a single set of DEs to represent their response to synaptic activation. And if there were 100 synapses of the same type attached to an anatomically small region of a cell, and they were described by a set of linear DEs, we could represent all 100 of them with a single set of DEs.
So there may be only 100 instances of some synaptic mechanism X, but each instance may receive events from as many presynaptic spike sources as you like.
I ploted some conductances in this way
Well, the actual conductance associated with any STDPE2 is actually g*gs. In its present form STDPE2 only allows you to know the value of g, not the value of gs. gs may be either 1 or gscale, depending on what's happening in the network. Furthermore, the value of g represents the sum of all inputs that converge onto the STDPE2. So you are completely in the dark about the conductance produced by any individual synaptic connection between two cells. You can only discover the peak conductance change elicited by an individual synaptic activation, and you can only do that if you know gs, w, and A (the former is a property of the STDPE2 and the latter two belong to a particular NetCon).
but I don’t know each of these conductances are between which cells. Do you have any idea how can I know that?
You need to know which NetCon belongs to which presynaptic-postsynaptic cell pair. Keeping track of what is connected to what is something that is typically done during model setup, although sometimes for diagnostic purposes there is code that traces connections after setup has been completed (you may find it interesting to look at the code for the second model described in
Hines, M.L. and Carnevale, N.T.
Translating network models to parallel hardware in NEURON.
J. Neurosci. Methods 169:425-455, 2008
). I wouldn't be surprised if the code in ModelDB entry 123815 includes one or more procedures that take care of that.