def BIO_model_threshold_in_CC(ais_start, ais_end, gna_tot, morpho):
        print('AIS start:', ais_start, 'Gna:', gna_tot)
        params = params_model_description
        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,
                              morpho=morpho)
        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,
                              morpho=morpho)
        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_dens):
        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:

            # current threshold
            neuron = model_Na_Kv1(params,
                                  resting_vm,
                                  Na_start=start,
                                  Na_end=end,
                                  density=True,
                                  gna_density=gna_dens)
            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=True,
                                  gna_density=gna_dens)
            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_Kv7(resting_vm, ais_start, ais_end, gna_tot, gm_tot):
     defaultclock.dt = 0.005*ms
     pulse_length = 50.*ms
     
     # current threshold
     neuron = model_Na_Kv1_Kv7(params, resting_vm, Na_start = ais_start, Na_end = ais_end, density=False, gna_tot=gna_tot, gm_tot = gm_tot)
     i_rheo = measure_current_threshold(params=params, neuron=neuron, resting_vm=resting_vm, ais_start=ais_start, ais_end=ais_end,pulse_length = pulse_length)  
     print ('Rheobase:', i_rheo)
         
     # voltage threshold
     neuron = model_Na_Kv1_Kv7(params, resting_vm, Na_start = ais_start, Na_end = ais_end, density=False, gna_tot=gna_tot, gm_tot = gm_tot)
     vs, va, _, _ = measure_voltage_threshold(params=params, neuron=neuron, resting_vm=resting_vm, ais_start=ais_start, ais_end=ais_end,\
                                              i_rheo = i_rheo, pulse_length = pulse_length)
     print ('Thresholds: soma:', vs, ', AIS:', va)
     
     return i_rheo, vs, va
Beispiel #4
0
    def BIO_model_in_CC_Kv(resting_vm, ais_start, ais_end, i_inj, gna_tot):
        defaultclock.dt = 0.005*ms
        pulse_length = 50.*ms

        # current threshold
        neuron = model_Na_Kv1(params, resting_vm, Na_start = ais_start, Na_end = ais_end, density=False, gna_tot=gna_tot)
        i_rheo = measure_current_threshold(params=params, neuron=neuron, resting_vm=resting_vm, ais_start=ais_start, \
                                           ais_end=ais_end, pulse_length=pulse_length, i_inj=i_inj)  
        print ('Rheobase:', i_rheo)
            
        # voltage threshold
        neuron = model_Na_Kv1(params, resting_vm, Na_start = ais_start, Na_end = ais_end, gna_tot = gna_tot, density=False)
        vs, va, _, _ = measure_voltage_threshold(params=params, neuron=neuron, resting_vm=resting_vm, ais_start=ais_start, \
                                           ais_end=ais_end, i_rheo = i_rheo, pulse_length=pulse_length, i_inj=i_inj)
        print('Thresholds: soma:', vs, ', AIS:', va)
        
        neuron = model_Na_Kv1(params, resting_vm, Na_start = ais_start, Na_end = ais_end, gna_tot=gna_tot,  density=False)
        t, v_soma, _, v_ais = calculate_resting_state(neuron, ais_start, ais_end, i_inj)
    
        return i_rheo, vs, va, t, v_soma, v_ais
    def BIO_model_in_CC_threshold_density(ais_start, ais_end, gna_dens):
        defaultclock.dt = 0.005 * ms
        resting_vm = -75. * mV
        pulse_length = 50. * ms
        print(ais_start, ais_end)

        # current threshold
        neuron = model_Na_Kv1(params,
                              resting_vm,
                              ais_start,
                              ais_end,
                              density=True,
                              gna_density=gna_dens)
        i_rheo = measure_current_threshold(params,
                                           neuron,
                                           resting_vm,
                                           ais_start,
                                           ais_end,
                                           pulse_length=pulse_length)

        # voltage threshold
        neuron = model_Na_Kv1(params,
                              resting_vm,
                              ais_start,
                              ais_end,
                              density=True,
                              gna_density=gna_dens)
        vs, va, _, _ = measure_voltage_threshold(params,
                                                 neuron,
                                                 resting_vm,
                                                 ais_start,
                                                 ais_end,
                                                 i_rheo=i_rheo,
                                                 pulse_length=pulse_length)

        return vs