def create_cell(self): self.dummy = h.Section() cell = h.Izhi2003a(0.5, sec=self.dummy) for var in self.PARAM_NAMES: setattr(cell, var, getattr(self, var)) return cell
def __init__ (self, type='tonic spiking', host=None, cellid=-1): self.type=type if host is None: # need to set up a sec for this self.sec=h.Section(name='izhi2003'+type+str(cellid)) self.sec.L, self.sec.diam = 6.3, 5 # empirically tuned self.izh = h.Izhi2003b(0.5, sec=self.sec) else: self.sec = dummy self.izh = h.Izhi2003a(0.5, sec=self.sec) # Create a new u,V 2007 neuron at location 0.5 (doesn't matter where) self.izh.a,self.izh.b,self.izh.c,self.izh.d = type2003[type] self.izh.Iin = 509.7
('subthreshold oscillations' , (0.05 , 0.26 , -60.0 , 0.0 , -62.0 , 200.0)) , ('rebound burst' , (0.03 , 0.25 , -52.0 , 0.0 , -64.0 , 200.0)) , ('accomodation' , (0.02 , 1.0 , -55.0 , 4.0 , -65.0 , 400.0)) , ('tonic bursting' , (0.02 , 0.2 , -50.0 , 2.0 , -70.0 , 220.0)) , ('Class 1' , (0.02 , -0.1 , -55.0 , 6.0 , -60.0 , 300.0)) , ('resonator' , (0.1 , 0.26 , -60.0 , -1.0 , -62.0 , 400.0)) , ('threshold variability' , (0.03 , 0.25 , -60.0 , 4.0 , -64.0 , 100.0)) , ('inhibition-induced spiking' , (-0.02 , -1.0 , -60.0 , 8.0 , -63.8 , 350.0)) , ('phasic bursting' , (0.02 , 0.25 , -55.0 , 0.05 , -64.0 , 200.0)) , ('Class 2' , (0.2 , 0.26 , -65.0 , 0.0 , -64.0 , 300.0)) , ('integrator' , (0.02 , -0.1 , -55.0 , 6.0 , -60.0 , 100.0)) , ('bistability' , (0.1 , 0.26 , -60.0 , 0.0 , -61.0 , 300.0)) , ('inhibition-induced bursting' , (-0.026 , -1.0 , -45.0 , -2.0 , -63.8 , 350.0))]) choices = collections.OrderedDict([ ('2003 PP model' , (lambda: h.Izhi2003a(0.5,sec=cell03), lambda: izh._ref_V, type2003)), ('2003 Sec model', (lambda: h.Izhi2003b(0.5,sec=cell03), lambda: cell03(0.5)._ref_v, type2003)), ('2004 PP model' , (lambda: h.Izhi2003a(0.5,sec=cell03), lambda: izh._ref_V, type2004)), ('2004 Sec model', (lambda: h.Izhi2003b(0.5,sec=cell03), lambda: cell03(0.5)._ref_v, type2004)), ('2007 PP model' , (lambda: izh07.IzhiCell(host=izh07.dummy), lambda: izh._ref_V, izh07.type2007)), ('2007 Sec model' , (lambda: izh07.IzhiCell(), lambda: cell07.sec(0.5)._ref_v, izh07.type2007))]) ch=choices.keys() def newmodel (ty=None) : "2003,2004 was the orig model; 2007 is the redesign; look at global izhtype if no " return izhtype.find('2007') > -1 if ty is None else ty.find('2007') > -1 #* setup the cell izhtype='2004 PP model' def cellset (): global cell07, cell03, izh, vref, uvvset, fih, izhtype
# exec(open('Izhitemplate.py').read()) # Author: Anal Kumar, NCBS # Makes an Izhikevich model (2003a version), inserts GABAR and AMPAR (with modified Exp2Syn mod files), # one input which connects to AMPAR, and one which connects to GABAR. # As the in-built Exp2Syn and IClamp mechanisms use the cell's i and v, I have used POINTER so that they use the V and I used in Izhikevich mechanism. from neuron import h, gui import numpy as np import matplotlib.pyplot as plt v_init = -70 dummyE1 = h.Section(name='dummyE1') #dummy section to insert Izhikevich izhiE1 = h.Izhi2003a(0.5, sec=dummyE1) #insert Izhikevich izhiE1.V = v_init AMPAR = h.Exp2SynAMPAR(dummyE1(0.5)) #insert AMPAR synapse AMPAR.tau1 = 3.5 AMPAR.tau2 = 21 AMPAR.e = 0 GABAR = h.Exp2SynGABAR(dummyE1(0.5)) #insert GABAR synapse GABAR.tau1 = 6.4 GABAR.tau2 = 40 GABAR.e = -80 stim = h.IClampizhi(dummyE1(0.5)) #insert IClamp izhikevich version stim.delay = 1500 stim.dur = 500
can graph u, v for any model simple.show('v3a','v3b') # compare voltage output for the 2 versions of the 2003/2004 parameterization; will NOT be identical simple.show('v7a','v7b','v7bw') # compare voltage output for 3 versions of the 2007 parameterization ''' from neuron import h, gui import numpy as np import izhi2007Wrapper as izh07 import pylab as plt import pprint as pp plt.ion() fih = [] dummy = h.Section() # make a 2003a STATE {u,vv} cell (used for 2003, 2004) iz03a = h.Izhi2003a(0.5, sec=dummy) iz03a.Iin = 4 # make a 2003b (Section v) cell sec03b = h.Section() # this section will actually be used sec03b.L, sec03b.diam = 5, 6.3 # empirically tuned iz03b = h.Izhi2003b(0.5, sec=sec03b) iz03b.Iin = 4 def iz03b_init(): sec03b(0.5).v, iz03b.u = -65, -65 * iz03b.b fih.append(h.FInitializeHandler(iz03b_init))
('rebound burst', (0.03, 0.25, -52.0, 0.0, -64.0, 200.0)), ('accomodation', (0.02, 1.0, -55.0, 4.0, -65.0, 400.0)), ('tonic bursting', (0.02, 0.2, -50.0, 2.0, -70.0, 220.0)), ('Class 1', (0.02, -0.1, -55.0, 6.0, -60.0, 300.0)), ('resonator', (0.1, 0.26, -60.0, -1.0, -62.0, 400.0)), ('threshold variability', (0.03, 0.25, -60.0, 4.0, -64.0, 100.0)), ('inhibition-induced spiking', (-0.02, -1.0, -60.0, 8.0, -63.8, 350.0)), ('phasic bursting', (0.02, 0.25, -55.0, 0.05, -64.0, 200.0)), ('Class 2', (0.2, 0.26, -65.0, 0.0, -64.0, 300.0)), ('integrator', (0.02, -0.1, -55.0, 6.0, -60.0, 100.0)), ('bistability', (0.1, 0.26, -60.0, 0.0, -61.0, 300.0)), ('inhibition-induced bursting', (-0.026, -1.0, -45.0, -2.0, -63.8, 350.0)) ]) choices = collections.OrderedDict([ ('2003 PP model', (lambda: h.Izhi2003a(0.5, sec=cell03), lambda: izh._ref_V, type2003)), ('2003 Sec model', (lambda: h.Izhi2003b(0.5, sec=cell03), lambda: cell03(0.5)._ref_v, type2003)), ('2004 PP model', (lambda: h.Izhi2003a(0.5, sec=cell03), lambda: izh._ref_V, type2004)), ('2004 Sec model', (lambda: h.Izhi2003b(0.5, sec=cell03), lambda: cell03(0.5)._ref_v, type2004)), ('2007 PP model', (lambda: izh07.IzhiCell(host=izh07.dummy), lambda: izh._ref_V, izh07.type2007)), ('2007 Sec model', (lambda: izh07.IzhiCell(), lambda: cell07.sec(0.5)._ref_v, izh07.type2007)) ]) ch = choices.keys()