Example #1
0
 def __init__(self, n, equations, **parameters):
     threshold = brian.EmpiricalThreshold(threshold=-40*mV, refractory=2*ms)
     reset = 0*mV
     refractory = 0*ms
     BaseNeuronGroup.__init__(self, n, equations,
                              threshold, reset, refractory,
                              implicit=True,
                              **parameters)
Example #2
0
 def threshold(self):
     return brian.EmpiricalThreshold(threshold=-40 * mV, refractory=2 * ms)
Example #3
0
def make_gbc_group(num, celsius=37):
    ''' Creates a sbc neuron group

    Parameters:
    -----------
    num : int
        Number of neurons in the neuron group.
    celsius : float
        Temperatur in degree celsius, Default = 37

    Output
    ------
    A brian NeuronGroup

    '''

    C = 12 * pF
    Eh = -43 * mV
    EK = -77 * mV  # -70mV in orig py file, but -77*mV in mod file
    El = -65 * mV
    ENa = 50 * mV

    nf = 0.85  # proportion of n vs p kinetics
    zss = 0.5  # steady state inactivation of glt

    q10 = 3.**((celsius - 22) / 10.)
    T10 = 10.**((celsius - 22) / 10.)

    q10_gbar = 1.5

    gnabar = calc_tf(q10_gbar, celsius) * 2500 * nS
    gkhtbar = calc_tf(q10_gbar, celsius) * 150 * nS
    gkltbar = calc_tf(q10_gbar, celsius) * 200 * nS
    ghbar = calc_tf(q10_gbar, celsius) * 20 * nS
    gl = calc_tf(q10_gbar, celsius) * 2 * nS

    eqs = """
    i_stim : amp
    dvm/dt = (ileak + ina + ikht + iklt + ih + i_syn +i_stim) / C : volt
    vu = vm/mV : 1 # unitless v
    """

    # Rothman 1993 Na channel
    eqs_na = """
    ina = gnabar*m**3*h*(ENa-vm) : amp

    dm/dt = malpha * (1. - m) - mbeta * m : 1
    dh/dt = halpha * (1. - h) - hbeta * h : 1

    malpha = (0.36 * q10 * (vu+49.)) / (1. - exp(-(vu+49.)/3.)) /ms : 1/ms
    mbeta = (-0.4 * q10 * (vu+58.)) / (1. - exp((vu+58)/20.)) /ms : 1/ms

    halpha = 2.4*q10 / (1. + exp((vu+68.)/3.)) /ms  +  0.8*T10 / (1. + exp(vu + 61.3)) /ms : 1/ms
    hbeta = 3.6*q10 / (1. + exp(-(vu+21.)/10.)) /ms : 1/ms
    """
    eqs += eqs_na

    # KHT channel (delayed-rectifier K+)
    eqs_kht = """
    ikht = gkhtbar*(nf*n**2 + (1-nf)*p)*(EK-vm) : amp
    dn/dt=q10*(ninf-n)/ntau : 1
    dp/dt=q10*(pinf-p)/ptau : 1
    ninf =   (1 + exp(-(vu + 15) / 5.))**-0.5 : 1
    pinf =  1. / (1 + exp(-(vu + 23) / 6.)) : 1
    ntau =  ((100. / (11*exp((vu+60) / 24.) + 21*exp(-(vu+60) / 23.))) + 0.7)*ms : ms
    ptau = ((100. / (4*exp((vu+60) / 32.) + 5*exp(-(vu+60) / 22.))) + 5)*ms : ms
    """
    eqs += eqs_kht

    # Ih channel (subthreshold adaptive, non-inactivating)
    eqs_ih = """
    ih = ghbar*r*(Eh-vm) : amp
    dr/dt=q10*(rinf-r)/rtau : 1
    rinf = 1. / (1+exp((vu + 76.) / 7.)) : 1
    rtau = ((100000. / (237.*exp((vu+60.) / 12.) + 17.*exp(-(vu+60.) / 14.))) + 25.)*ms : ms
    """
    eqs += eqs_ih

    # KLT channel (low threshold K+)
    eqs_klt = """
    iklt = gkltbar*w**4*z*(EK-vm) : amp
    dw/dt=q10*(winf-w)/wtau : 1
    dz/dt=q10*(zinf-z)/wtau : 1
    winf = (1. / (1 + exp(-(vu + 48.) / 6.)))**0.25 : 1
    zinf = zss + ((1.-zss) / (1 + exp((vu + 71.) / 10.))) : 1
    wtau = ((100. / (6.*exp((vu+60.) / 6.) + 16.*exp(-(vu+60.) / 45.))) + 1.5)*ms : ms
    ztau = ((1000. / (exp((vu+60.) / 20.) + exp(-(vu+60.) / 8.))) + 50)*ms : ms
    """
    eqs += eqs_klt

    # Leak
    eqs_leak = "ileak = gl*(El-vm) : amp"
    eqs += eqs_leak

    ### Excitatory synapse
    # Q10 for synaptic decay calculated from \cite{Postlethwaite2007}
    Tf = calc_tf(q10=0.75, celsius=celsius, ref_temp=37)
    taue_syn = 0.2 * Tf * ms
    taui_syn = 9.03 * calc_tf(q10=0.75, celsius=celsius,
                              ref_temp=34) * ms  # \cite{Xie2013}
    eqs_syn = """
    i_syn = ge_syn*(0*mV - vm) + gi_syn*(-77*mV - vm): amp
    dge_syn/dt = -ge_syn/taue_syn : siemens
    dgi_syn/dt = -gi_syn/taui_syn : siemens
    """
    eqs += eqs_syn

    if celsius < 37:
        refractory = 0.7 * ms
    else:
        refractory = 0.5 * ms

    group = brian.NeuronGroup(
        N=num,
        model=eqs,
        threshold=brian.EmpiricalThreshold(threshold=-20 * mV,
                                           refractory=refractory),
        implicit=True,
    )

    ### Set initial conditions
    group.vm = El
    group.r = 1. / (1 + np.exp((El / mV + 76.) / 7.))
    group.m = group.malpha / (group.malpha + group.mbeta)
    group.h = group.halpha / (group.halpha + group.halpha)
    group.w = (1. / (1 + np.exp(-(El / mV + 48.) / 6.)))**0.25
    group.z = zss + ((1. - zss) / (1 + np.exp((El / mV + 71.) / 10.)))
    group.n = (1 + np.exp(-(El / mV + 15) / 5.))**-0.5
    group.p = 1. / (1 + np.exp(-(El / mV + 23) / 6.))

    return group
Example #4
0
def make_mso_group(num,
                   gbar_na=3900,
                   gbar_klt=650,
                   gbar_h=520,
                   gbar_leak=13,
                   e_rest=-55.8,
                   voltage_clamp=False):
    ''' Creates a sbc neuron group

    Parameters:
    -----------
    num : int
        Number of neurons in the neuron group.
    celsius : float
        Temperatur in degree celsius, Default = 37
    Output
    ------
    A brian NeuronGroup

    '''
    C = 70 * pF  # [Couchman2010]

    e_h = -35 * mV  # [Baumann2013]
    e_k = -90 * mV

    e_e = -0 * mV  #[Colbourne2005]
    e_i = -70 * mV  #[Coulboure2005]

    e_na = 56.2 * mV
    e_rest = e_rest * mV  # Between -60 and -55

    nf = 1  # proportion of n vs p kinetics
    zss = 0.4  # steady state inactivation of glt

    gbar_na = gbar_na * nS
    gbar_klt = gbar_klt * nS
    gbar_h = gbar_h * nS
    gbar_leak = gbar_leak * nS

    if not voltage_clamp:
        eqs = """
        i_stim : amp
        dvm/dt = - (-i_stim + i_leak + i_na  + i_klt + i_h + i_syn) / C : volt
        vu = vm/mV : 1 # unitless v
        """

    else:
        eqs = """
        i_stim : amp
        vm : volt
        vu = vm/mV : 1 # unitless v
        """

    eqs_na = """
        g_na = gbar_na * m**3 * h : nsiemens
        i_na = g_na * (vm - e_na) : amp

        m_inf = 1 / (1 + exp((vu + 38) / -7)) :1
        h_inf = 1 / (1 + exp((vu + 65) / 6)) :1

        tau_m = (0.48 / (5 * exp((vu + 60) / 18) + 36 * exp((vu + 60) / -25)) ) * ms : ms
        tau_h = (19.23 / (7 * exp((vu + 60) / 11) + 10 * exp((vu + 60) / -25)) + 0.12) * ms : ms

        dm/dt = (m_inf - m) / tau_m :1
        dh/dt = (h_inf - h) / tau_h :1
        """
    eqs += eqs_na

    # [Baumann2013] (Dorsal Cells)
    eqs_h = """
        g_h = gbar_h * a  :nsiemens
        i_h =  g_h * (vm - e_h) : amp

        a_inf = 1 / (1 + exp(0.1 * (vu + 80.4))) :1
        tau_a = (79 + 417 * exp(-(vu + 61.5)**2 / 800)) *ms :ms

        da/dt = (a_inf - a) / tau_a :1
        """
    eqs += eqs_h

    # Potassium low threshold [Khurana2011]
    eqs_klt = """
        g_klt = gbar_klt * w**4 * z : nsiemens
        i_klt =  g_klt * (vm - e_k) : amp

        z_inf = zss + ((1-zss) / (1 + exp((vu + 57) / 5.44))) : 1
        w_inf = 1 / (1 + exp(-(vu + 57.3) / 11.7)) :1


        tau_w = 0.46 * (100. / (6. * exp((vu + 75.) / 12.15) + 24. * exp(-(vu + 75.) / 25) + 0.55)) * ms : ms
        tau_z = 0.24 * ((1000 / (exp((vu + 60) / 20) + exp(-(vu + 60) / 8))) + 50) * ms : ms

        dw/dt =( w_inf - w) / tau_w :1
        dz/dt = (z_inf - z) / tau_z :1
        """
    eqs += eqs_klt

    # leak
    eqs_leak = """
    g_leak = gbar_leak * 1 : nsiemens
    i_leak = g_leak * (vm - e_rest) : amp
    """
    eqs += eqs_leak

    #Synaptic Current
    eqs_syn = """
        ex_syn_i :1
        ex_syn_c :1
        in_syn_i :1
        in_syn_c :1

        i_syn = i_syn_ii + i_syn_ic + i_syn_ei + i_syn_ec : amp

        #inhibitory currents
        i_syn_ii = in_syn_i * siemens * (vm - e_i) : amp
        i_syn_ic = in_syn_c * siemens * (vm - e_i) : amp

        #exitatory currents
        i_syn_ei = ex_syn_i * siemens * (vm - e_e) : amp
        i_syn_ec = ex_syn_c * siemens * (vm - e_e) : amp
        """
    eqs += eqs_syn

    group = brian.NeuronGroup(
        N=num,
        model=eqs,
        threshold=brian.EmpiricalThreshold(threshold=-30 * mV,
                                           refractory=0.5 * ms),
        implicit=True,
    )

    ### Set initial conditions
    group.vm = e_rest
    group.m = group.m_inf
    group.h = group.h_inf
    group.w = group.w_inf
    group.z = group.z_inf
    group.a = group.a_inf

    return group