def BIO_model_threshold_in_CC(ais_start, ais_end, gna_tot):
        print('AIS start:', ais_start, 'Gna:', gna_tot)
        params = params_model_description  #params_all
        pulse_length = 50. * ms

        neuron = model_Na_Kv1(params=params,
                              resting_vm=-75. * mV,
                              Na_start=ais_start,
                              Na_end=ais_end,
                              gna_tot=gna_tot,
                              density=False)
        i_rheo = measure_current_threshold(params, neuron, -75. * mV,
                                           ais_start, ais_end, pulse_length)
        print('Rheobase:', i_rheo)

        neuron = model_Na_Kv1(params=params,
                              resting_vm=-75. * mV,
                              Na_start=ais_start,
                              Na_end=ais_end,
                              gna_tot=gna_tot,
                              density=False)
        v_thres, _, _, _ = measure_voltage_threshold(params, neuron, -75. * mV,
                                                     ais_start, ais_end,
                                                     i_rheo, pulse_length)
        print('Voltage threshold:', v_thres)
        return v_thres
 def BIO_model_threshold_in_CC(x_star, length, gna_tot):
     defaultclock.dt = 0.005*ms
     resting_vm = -75.*mV
     pulse_length = 50.*ms
     
     # AIS start
     start = round(x_star, 2)*um - length/2
     # AIS end
     end = start + length
     
     # Removing impossible geometries: the length can not be bigger than two times the middle position
     if length/2 <= round(x_star, 2)*um:
         print ('x1/2:', round(x_star, 2)*um, 'AIS length:', length, 'AIS start:', start, 'AIS end:', end)
         
         # current threshold
         neuron = model_Na_Kv1(params, resting_vm, Na_start = start, Na_end = end, density=False, gna_tot=gna_tot, morpho=morpho)
         i_rheo = measure_current_threshold(params, neuron, resting_vm=resting_vm, ais_start=start, ais_end=end, pulse_length = pulse_length)  
         print ('Rheobase:', i_rheo)
         
         # voltage threshold
         neuron = model_Na_Kv1(params, resting_vm, Na_start = start, Na_end = end, density=False, gna_tot=gna_tot, morpho=morpho)
         vs, va, _, _ = measure_voltage_threshold(params, neuron, resting_vm=resting_vm, ais_start=start, ais_end=end, i_rheo = i_rheo, pulse_length = pulse_length) 
         print ('Threshold:', vs)
         res = vs
     else: # bottom right triangle
         res = nan
 
     return res
 def BIO_model_in_CC_constant_density(ais_start, ais_end):
     defaultclock.dt = 0.005*ms
     resting_vm = -75.*mV
     pulse_length = 50.*ms
     print ('AIS start:', ais_start, 'AIS end:', ais_end)
         
     # current threshold
     neuron = model_Na_Kv1(params, resting_vm, ais_start, ais_end, density = True)
     i_rheo = measure_current_threshold(params, neuron, resting_vm, ais_start, ais_end, pulse_length = pulse_length)  
     print ('Rheobase:', i_rheo)
     
     # voltage threshold
     neuron = model_Na_Kv1(params, resting_vm, ais_start, ais_end, density=True)
     vs, va, _, _ = measure_voltage_threshold(params, neuron, resting_vm, ais_start, ais_end, i_rheo = i_rheo, pulse_length = pulse_length) 
     print ('Threshold:', vs)
 
     return vs
Exemplo n.º 4
0
def measure_different_thresholds(gna_ais, i_inj, gL_soma):
    '''
    A function to measure the charge, current and voltage thresholds at the soma. 
    
    Variables: the somatic leak conductance, the total Na conductance at the AIS and the amount of hyperpolarizing current injected at the AIS.
    '''

    # current threshold
    neuron = model_Na_Kv1(params, resting_vm, start, end, density=False, gna_tot=gna_ais, gk_tot=params.Gk, gL_soma = gL_soma)
    i_rheo = measure_current_threshold_no_VC(params, neuron, resting_vm, start, end, pulse_length = 50.*ms, i_inj = i_inj, plot_v = False)  
    print ('Current threshold:', i_rheo)
    
    # voltage threshold
    neuron = model_Na_Kv1(params, resting_vm, start, end, density=False, gna_tot=gna_ais, gk_tot=params.Gk, gL_soma = gL_soma)
    vs, va, _, _, v0, v0_ais= measure_voltage_threshold_no_VC(params, neuron, resting_vm,start, end, i_rheo = i_rheo, pulse_length = 50.*ms, i_inj = i_inj) 
    print ('Threshold:', vs)
    
    # input resistance
    neuron = model_Na_Kv1(params, resting_vm, start, end, density=False, gna_tot=gna_ais, gk_tot=params.Gk)
    rs,_,_ = measure_input_resistance(params, neuron, resting_vm)
    print (rs)
    
    return i_rheo, vs, va, rs, v0, v0_ais
import matplotlib.image as mpimg
import matplotlib.patches as patches

defaultclock.dt = 0.005*ms

### AIS geometry and parameters
start =5.*um # AIS start position
end = 35.*um # AIS end position
params = params_model_description

### Model
# The total conductances at the AIS is fixed:
#neuron = model_Na_Kv1(params, -75.*mV, start, end, density=False, gna_tot=350.*nS, gk_tot=150.*nS, morpho=params.morpho)

# The conductance densities at the AIS is fixed:
neuron = model_Na_Kv1(params, -75.*mV, start, end, density=True, morpho=params.morpho)

M = StateMonitor(neuron, ('v','I_VC', 'INa', 'IK'), record = 0) # recording at the soma
M_AIS = StateMonitor(neuron, ('v', 'm', 'h', 'n', 'INa', 'IK'), record = neuron.morphology.axon[end-1*um]) # recording at AIS end

### Simulation
# Protocol to elicit an AP with fixed initial voltage
neuron.V_VC[0] = -75.*mV
neuron.VC_on[0] = 1
run(20*ms)
neuron.VC_on[0] = 0
neuron.I_CC[0] = 1.5*nA
run(2*ms)
neuron.VC_on[0] = 0
neuron.I_CC[0] = 0*amp 
run(20*ms)