Help varying membrane voltage fluxuation

Anything that doesn't fit elsewhere.
Post Reply
nemomortus
Posts: 11
Joined: Fri Jan 08, 2016 11:05 pm

Help varying membrane voltage fluxuation

Post by nemomortus » Thu Apr 14, 2016 11:38 pm

I am trying to reproduce some of the results of Alain Destexhe in his paper "High-Conductance State of Neocortical Neurons In Vivo (image below), in particular Fig. C1)." If I am trying to vary the membrane voltage fluctuation (SD = ~4 mV) of my system, what parameters would I theoretically change? I have added inhibitory synapses now to my code (attached below) and have tried changing the variables of: EXP2SYNS.i and the WEIGHT parameters, because this affects the synaptic inputs. These changes does not seem to have an apparent effect.

Do you have any insight or guidance into how to reach my goal?

http://postimg.org/image/4htm23lml/

Code: Select all

//=================== creating cell object ==========================
load_file("stdlib.hoc") 
load_file("nrngui.hoc")
load_file("ranstream.hoc")

objref cvode
cvode = new CVode()
cvode.active(1)
load_file("import3d.hoc")

objref L5PC
strdef morphology_file
morphology_file = "../morphologies/cell1.asc"

load_file("../models/L5PCbiophys3.hoc")
load_file("../models/L5PCtemplate.hoc")
L5PC = new L5PCtemplate(morphology_file)

//-------------------parameters-----------------------//
v_init = -80 
eNSNUM = 15000       // how many NetStims to create (total, excite + inhib, so # of excitatory synapses is eNSNUM - iNSNUM)
iNSNUM = 4500         //nuber of inhibitory synapses
MAXSTREAM = 1000 
tstop = 3000      // length of simulation
dendnseg = 83      // as determind by the original model

//-------------------parameters for NetStim-----------//
// this generates a presynaptic train of stimuli
spikeint = 1000    // (ms) mean time between spikes, 1000(ms) to get 1 Hz 
i_spikeinit = 200 // inhibitory 200 (ms) to get 5 Hz
nspikes = 50     // average number of spikes, that NetStim will produce.
spikeonset = 500    // start time (ms) of first spike (delay)
noise = 1         // set to 1 for poisson mode

//-------------------parameters for Exp2Syn-----------//
// S = 1 / Ohms. G is in microOhms
// TAU1 and TAU2 parameters for L5PC in a paper
TAU1 = 0.20     
TAU2 = 1.7    
i_excite = 1      //current (nA), (original: 1), multiplier -> 10
e_excite = 0      //revesral potential

i_inhibit = 0.5   // current (nA), original (original: 0.5) multiplier -> 10
e_inhibit = -60   //leak reversal potential

//-------------------parameters for NetCon------------//
// not sure what parameters to set for this setion. arbitrarily picked
THRESHOLD =  10
DELAY = 0.8
WEIGHT = 0.1

//-------------------MODEL SETUP-----------------------//
objref nslist, rslist, eslist, nclist
nslist = new List()   // NetStim list
rslist = new List()   // RandStream list
eslist = new List()   // Exp2Syn list

//----- make_stims create excitatory synapses, all firing randomly-----//
proc syn_excite() { local i  localobj ns, rs, es, r
  nslist = new List()   
  rslist = new List()   
  eslist = new List()   

  random_stream_offset_ = MAXSTREAM

  for i = 0, $1-1 {
    ns = new NetStim()
    nslist.append(ns)
    rs = new RandomStream(i)
    rslist.append(rs)
    ns.noiseFromRandom(rs.r)
    rs.r.negexp(1)              // must specify negexp distribution with mean = 1
    rs.start()                  // makes random noise and writes results in list
  }

  r = new Random()
  
  for i = 0, $1-1 {
    s1dend= 1                        //s1 dendrite, in our case, we only have 1 dend
    s1comp= r.uniform(0, dendnseg)  //s1 compartment --- choose a random (discunif = discrete uniform) compartment of dendrites
    s1coord= s1comp / dendnseg       //s1 coordinate, remember dendnseg is 1 by original cell model

    L5PC.dend[s1dend] {
    es = new Exp2Syn(s1coord)         //places Exp2Syn on dend in compartment with coordinate s1
    eslist.append(es)
    }
  }
}

syn_excite(eNSNUM)

//this changes the last few EXP2SYN's parameters to be inhibitory (number of inhibitory synapses is iNSNUM)
proc setparams() {local i, j 

  for i = 0,nslist.count()-iNSNUM {
    nslist.o(i).interval = spikeint
    nslist.o(i).number = nspikes
    nslist.o(i).start = spikeonset
    nslist.o(i).noise = noise
  }
  
  for i = nslist.count()-iNSNUM, nslist.count()-1{
    nslist.o(i).interval = i_spikeinit
    nslist.o(i).number = nspikes
    nslist.o(i).start = spikeonset
    nslist.o(i).noise = noise
  }

  for i = 0,eslist.count()-iNSNUM {                        
    eslist.o(i).tau1 = TAU1    //rise time (ms)
    eslist.o(i).tau2 = TAU2    //delay time (ms)
    eslist.o(i).e = e_excite     //reversal potential, change this to make it inhibitory
    eslist.o(i).i = i_excite
  }

  for i = eslist.count()-iNSNUM, eslist.count()-1{
    eslist.o(i).tau1 = TAU1    //rise time (ms)
    eslist.o(i).tau2 = TAU2    //delay time (ms)
    eslist.o(i).e = e_inhibit     //reversal potential, change this to make it inhibitory
    eslist.o(i).i = i_inhibit 
  }
}

setparams()             // default is deterministic spike times (NOISE = 0)

//-------------------instrumentation-----------------------//
// this is where NetCon is caled and connects the NetStim and EXP2SYN

objref nclist, tvec, idvec
idvec = new Vector()
tvec = new Vector()
nclist = new List()

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

//======================= plot settings ============================
objref gV, tempVec

gV = new Graph()
gV.size(0,tstop,-80,40)
graphList[0].append(gV)
gV.addvar("soma","L5PC.soma.v(0.5)",1,1)

objref vvec, r_tvec
vvec = new Vector()
r_tvec = new Vector()
cvode.record(&v(0.5), vvec, r_tvec)

//-------------------starting simulation-----------------------//
run()
print "done!"

//-------------------save settings----------------------------//
objref savv
strdef str1 

count = 16
savv = new File() 
sprint(str1,"v_cell_%d.txt", count)   
savv.wopen(str1)  
vvec.printf(savv) 
r_tvec.printf(savv)       
savv.close()

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

Re: Help varying membrane voltage fluxuation

Post by ted » Sun Apr 17, 2016 1:46 pm

nemomortus wrote:I am trying to reproduce some of the results . . .
Do you have any insight or guidance into how to reach my goal?
There is no such figure in
Destexhe, A.; Rudolph, M. & Paré, D.
The high-conductance state of neocortical neurons in vivo.
Nature Reviews Neuroscience, 2003, 4, 739-751

Nor is there such a figure in
Rudolph, M. & Destexhe, A.
Point-conductance models of cortical neurons with high discharge variability.
Neurocomputing, 2002, 44-46, 147-152

It is generally best to begin by eliminating as much complexity as possible. A morphologically detailed model cell is far too complex--for one thing, it will have way too many parameters. Start with a passive single compartment model.

"But nothing in nature is that simple."

Nothing in nature is as simple as any of the simple conceptual models that physicists have demonstrated time and again to be so useful for understanding and exploring complex natural phenomena. Besides, understanding the capabilities and limitations of the simplest models is an absolute prerequisite for understanding the functional consequences of complexity.

For model parameters (membrane time constant, cell input resistance, resting potential, synaptic reversal potentials, time constants, peak conductances), dig into the experimental literature.

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

Re: Help varying membrane voltage fluxuation

Post by ted » Sun Apr 17, 2016 2:40 pm

Perhaps you meant this paper:
Destexhe, A.; Rudolph, M.; Fellous, J.-M. & Sejnowski, T.
Fluctuating synaptic conductances recreate in vivo-like activity in neocortical neurons.
Neuroscience, 2001, 107, 13-24

I see a mistake in the Gfluct.mod file that they used to simulate synaptic bombardment: if one or both of parameters (tau_e, tau_i) is 0, then calculation of the corresponding conductance (g_e, g_i) involves statements in the BREAKPOINT block that draw values from a pseudorandom number generator. You see, at each time step the slope conductance of each mechanism that produces a current is estimated by evaluating the statements in the BREAKPOINT block twice--once at the actual membrane potential v, and once after shifting membrane potential by 0.001 mV. This is done to obtain a numerical estimate of the mechanism's "instantaneous chord conductance" di/dv. Nothing in the formula that describes the mechanism's current should change between these two calls, except the numerical value of membrane potential. This requirement is clearly violated if the formula calls a random number generator. That corrupts the chord conductance estimate--it can be orders of magnitude too large, and may even become negative--and that in turn corrupts the Jacobian matrix that NEURON uses to advance the simulation from one time step to the next.

This can be manifest as occasional abrupt jumps of membrane potential that are bizarrely large. It is easy to miss this symptom because it can be masked by the low pass filtering effect of passive electrotonus (imagine that the mechanism is a point process that delivers current at some location A but one is only examining membrane potential at some other location B which is tens or hundreds of microns away).

nemomortus
Posts: 11
Joined: Fri Jan 08, 2016 11:05 pm

Re: Help varying membrane voltage fluxuation

Post by nemomortus » Mon May 02, 2016 8:22 am

First, thank you for your search for the figure. I apologize for providing an incorrect reference. After weeks of trying and reading, I have finally fluctuated the SD of the membrane voltage by reduce the total number of excitatory and inhibitory synapses (~900/300). In my original code, I used a series of Exp2Syn, NetCon, and NetStim to makes these synapses.

Now, I am wondering if the average conductance (syn.g) of all of the Exp2Syn is still the same as previously as before when I had ~15000/3000 (excitatory/inhibitory) synapses. Since it is described as this:
[i = G * (v - e) i(nanoamps), g(micromhos); G = weight * factor * (exp(-t/tau2) - exp(-t/tau1))], it has to be a function of time. Is it possible to record and then save this variable over time? I have been unable to figure out how to record this variable (if possible) for the past week.

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

Re: Help varying membrane voltage fluxuation

Post by ted » Mon May 02, 2016 11:13 am

I see that the Programmers' Reference does not list all public variables that belong to ExpSyn or Exp2Syn. For any NMODL-defined class (point process, artificial spiking cell, or whatever) or density mechanism, the quickest and surest way to find out what is exposed to hoc and Python is to examine the declarations in the NEURON, PARAMETER, and STATE blocks. STATEs are automatically exposed to hoc and Python and are range variables (so they may have different values in each instance of a mechanism). PARAMETERs are also exposed to hoc and Python, but they are global (identical in all instances of a mechanism) unless designated RANGE in the NEURON block. Finally, in addition to overriding the default global attribute of PARAMETERs, designations in the NEURON block can be used to expose ASSIGNED variables as RANGE or GLOBAL, or simply to remind oneself (and others) of the GLOBALness or RANGEness of this or that variable.

ExpSyn and Exp2Syn have a STATE variable called g, so record it to your heart's content. See the Programmers' Reference documentation of the Vector class's record method. If every ExpSyn in your model has the same tau and reversal potential e, and all are attached to the same segment, they can all be represented by a single instance of the ExpSyn class that is driven by all of your model's NetCons, so only a single vector is needed to capture the time course of the sum of all their conductances. Ditto for the Exp2Syns.

As a sanity check you might consider calculating mean synaptic conductance analytically. Assuming that the statistics of the event trains that drive any particular synaptic instance are stationary, the mean conductance elicited by N events with identical weight delivered to a particular synaptic mechanism at random times over interval T is N*g*U/T where g is the weight of each event, and U is the integral of the conductance transient elicited by a single event with weight 1.

Post Reply