Esempio n. 1
0
    def __init__(self, **parameters):
        # define ion channel parameters
        leak = Mechanism('pas', e=-65, g=parameters['g_leak'])
        hh = Mechanism('hh',
                       gl=parameters['g_leak'],
                       el=-65,
                       gnabar=parameters['gnabar'],
                       gkbar=parameters['gkbar'])
        # create cable sections
        self.soma = Section(L=30, diam=30, mechanisms=[hh])
        self.apical = Section(L=600,
                              diam=2,
                              nseg=5,
                              mechanisms=[leak],
                              parent=self.soma,
                              connect_to=1)
        self.basilar = Section(L=600,
                               diam=2,
                               nseg=5,
                               mechanisms=[leak],
                               parent=self.soma)
        self.axon = Section(L=1000, diam=1, nseg=37, mechanisms=[hh])
        # synaptic input
        self.apical.add_synapse('ampa', 'Exp2Syn', e=0.0, tau1=0.1, tau2=5.0)

        # needed for PyNN
        self.source_section = self.soma
        self.source = self.soma(0.5)._ref_v
        self.parameter_names = ('g_leak', 'gnabar', 'gkbar')
        self.traces = {}
        self.recording_time = False
Esempio n. 2
0
    def build_sections(self, Ra=160, cm=1, axon=True, soma=True, *args, **kwargs):
        # membrane properties across the cell
        self.Ra = Ra  # Ohm cm        cytoplasmic resistivity
        self.cm = cm  # uF/cm^2     specific membrane capacitance
        # geometry and topology
        if soma:
            if 'soma_L' in kwargs:
                soma_l = kwargs['soma_L']
            else:
                soma_l = 15
            if 'soma_diam' in kwargs:
                soma_diam = kwargs['soma_diam']
            else:
                soma_diam = 15

            self.soma = Section(L=soma_l, diam=soma_diam, Ra=self.Ra, cm=self.cm,
                                mechanisms=self.mechanisms)
            self.soma.name = 'soma'

            self.sections.append(self.soma)

        if axon:
            self.axon = Section(L=100, diam=0.2, Ra=self.Ra, cm=self.cm,
                                mechanisms=self.mechanisms,
                                parent=self.soma,
                                connection_point=PROXIMAL)
            self.axon.name = 'axon'
            self.sections.append(self.axon)
Esempio n. 3
0
class SimpleNeuron(object):

    def __init__(self, **parameters):
        # define ion channel parameters
        leak = Mechanism('pas', e=-65, g=parameters['g_leak'])
        hh = Mechanism('hh', gl=parameters['g_leak'], el=-65,
                       gnabar=parameters['gnabar'], gkbar=parameters['gkbar'])
        # create cable sections
        self.soma = Section(L=30, diam=30, mechanisms=[hh])
        self.apical = Section(L=600, diam=2, nseg=5, mechanisms=[leak], parent=self.soma,
                              connection_point=DISTAL)
        self.basilar = Section(L=600, diam=2, nseg=5, mechanisms=[leak], parent=self.soma)
        self.axon = Section(L=1000, diam=1, nseg=37, mechanisms=[hh])
        # synaptic input
        self.apical.add_synapse('ampa', 'Exp2Syn', e=0.0, tau1=0.1, tau2=5.0)

        # needed for PyNN
        self.source_section = self.soma
        self.source = self.soma(0.5)._ref_v
        self.parameter_names = ('g_leak', 'gnabar', 'gkbar')
        self.traces = {}
        self.recording_time = False

    def _set_g_leak(self, value):
        for sec in (self.apical, self.basilar):
            for seg in sec:
               seg.pas.g = value
        for sec in (self.soma, self.axon):
            for seg in sec:
                seg.hh.gl = value

    def _get_g_leak(self):
        return self.apical(0.5).pas.g
    g_leak = property(fget=_get_g_leak, fset=_set_g_leak)

    def _set_gnabar(self, value):
        for sec in (self.soma, self.axon):
            for seg in sec:
                seg.hh.gnabar = value

    def _get_gnabar(self):
        return self.soma(0.5).hh.gnabar
    gnabar = property(fget=_get_gnabar, fset=_set_gnabar)

    def _set_gkbar(self, value):
        for sec in (self.soma, self.axon):
            for seg in sec:
                seg.hh.gkbar = value

    def _get_gkbar(self):
        return self.soma(0.5).hh.gkbar
    gkbar = property(fget=_get_gkbar, fset=_set_gkbar)

    def memb_init(self):
        """needed for PyNN"""
        for sec in (self.soma, self.axon, self.apical, self.basilar):
            for seg in sec:
                seg.v = self.v_init
Esempio n. 4
0
class SimpleNeuron(object):

    def __init__(self, **parameters):
        # define ion channel parameters
        leak = Mechanism('pas', e=-65, g=parameters['g_leak'])
        hh = Mechanism('hh', gl=parameters['g_leak'], el=-65,
                       gnabar=parameters['gnabar'], gkbar=parameters['gkbar'])
        # create cable sections
        self.soma = Section(L=30, diam=30, mechanisms=[hh])
        self.apical = Section(L=600, diam=2, nseg=5, mechanisms=[leak], parent=self.soma,
                              connection_point=DISTAL)
        self.basilar = Section(L=600, diam=2, nseg=5, mechanisms=[leak], parent=self.soma)
        self.axon = Section(L=1000, diam=1, nseg=37, mechanisms=[hh])
        # synaptic input
        self.apical.add_synapse('ampa', 'Exp2Syn', e=0.0, tau1=0.1, tau2=5.0)

        # needed for PyNN
        self.source_section = self.soma
        self.source = self.soma(0.5)._ref_v
        self.parameter_names = ('g_leak', 'gnabar', 'gkbar')
        self.traces = {}
        self.recording_time = False

    def _set_g_leak(self, value):
        for sec in (self.apical, self.basilar):
            for seg in sec:
                seg.pas.g = value
        for sec in (self.soma, self.axon):
            for seg in sec:
                seg.hh.gl = value

    def _get_g_leak(self):
        return self.apical(0.5).pas.g
    g_leak = property(fget=_get_g_leak, fset=_set_g_leak)

    def _set_gnabar(self, value):
        for sec in (self.soma, self.axon):
            for seg in sec:
                seg.hh.gnabar = value

    def _get_gnabar(self):
        return self.soma(0.5).hh.gnabar
    gnabar = property(fget=_get_gnabar, fset=_set_gnabar)

    def _set_gkbar(self, value):
        for sec in (self.soma, self.axon):
            for seg in sec:
                seg.hh.gkbar = value

    def _get_gkbar(self):
        return self.soma(0.5).hh.gkbar
    gkbar = property(fget=_get_gkbar, fset=_set_gkbar)

    def memb_init(self):
        """needed for PyNN"""
        for sec in (self.soma, self.axon, self.apical, self.basilar):
            for seg in sec:
                seg.v = self.v_init
Esempio n. 5
0
 def __init__(self,
              ion_type,
              current_type,
              L=20,
              diam=20,
              Ra=150,
              g_pas=0.00003334):
     self.ion_type = ion_type
     self.current_type = current_type
     leak = Mechanism('pas', e=-65, g=g_pas)
     self.soma = Section(L, diam, Ra=Ra, mechanisms=[leak])
Esempio n. 6
0
 def build_sections(self, Ra=100, **kwargs):
     super(SingleDend, self).build_sections(Ra=Ra, **kwargs)
     self.dend.append(Section(L=self.L, diam=self.diam, nseg=self.nseg, Ra=self.Ra, cm=self.cm,
                              mechanisms=[self.pas],
                              parent=self.soma))
     self.dend[0].name = 'dend_1'
     self.sections += self.dend
    def __init__(self, **parameters):

        # Create single compartment Rubin and Terman GP cell section, i.e. soma section
        self.soma = Section(L=parameters['L'],
                            diam=parameters['diam'],
                            nseg=parameters['nseg'],
                            Ra=parameters['Ra'],
                            cm=parameters['cm'],
                            mechanisms=[
                                Mechanism('myions'),
                                Mechanism('GPeA',
                                          gnabar=0.04,
                                          gkdrbar=0.0042,
                                          gkcabar=0.1e-3,
                                          gcatbar=6.7e-5,
                                          kca=2,
                                          gl=4e-5)
                            ])

        # Initialize ion concentrations
        h("cai0_ca_ion = 5e-6 ")
        h("cao0_ca_ion = 2")
        h("ki0_k_ion = 105")
        h("ko0_k_ion = 3")
        h("nao0_na_ion = 108")
        h("nai0_na_ion = 10")

        # insert current source
        self.stim = h.IClamp(0.5, sec=self.soma)
        self.stim.delay = 0
        self.stim.dur = 1e12
        self.stim.amp = parameters['bias_current']

        # Add DBS stimulation current to neuron model
        self.DBS_stim = h.IClamp(0.5, sec=self.soma)
        self.DBS_stim.delay = 0
        self.DBS_stim.dur = 1e9
        self.DBS_stim.amp = 0

        # Append the DBS stimulation iclamps to global list
        GV.GPe_stimulation_iclamps.append(self.DBS_stim)

        # Add AMPA and GABAa synapses to the cell, i.e. add to the soma section
        self.AMPA = h.AMPA_S(0.5, sec=self.soma)
        self.GABAa = h.GABAa_S(0.5, sec=self.soma)

        # needed for PyNN
        self.source_section = self.soma
        self.source = self.soma(0.5)._ref_v
        self.rec = h.NetCon(self.source, None,
                            sec=self.soma)  # Needed to clear the simulator
        self.spike_times = h.Vector(0)
        self.parameter_names = ('L', 'diam', 'nseg', 'Ra', 'cm',
                                'bias_current_density')
        self.traces = {}
        self.recording_time = False
Esempio n. 8
0
    def __init__(self, axNum=15, axon_mechanisms=list(), bouton_mechanisms=list(), all_ena=55, all_ek=-97):
        
        self.axNum = axNum
        
        #See comment below on measuring the total ion currents
        #if add_charge:
        #    axon_mechanisms.append(Mechanism("charge_", tmin=charge_start, tmax=charge_end))   
        #    bouton_mechanisms.append(Mechanism("charge_", tmin=charge_start, tmax=charge_end))   
        
        # Define axon
        self.axons = [Section(nseg = 5 if i < axNum else 20, 
                              L = 35 if i < axNum else 150, 
                              diam = 0.8, 
                              cm = 0.9/10,
                              mechanisms=axon_mechanisms)
                 for i in range(axNum+1)]
        
        self.boutons = [Section(nseg=1,
                                L=8,
                                diam=8,
                                cm=0.9,
                                mechanisms=bouton_mechanisms)
                 for i in range(axNum)]

        # Connectivity
        for axon, bouton in zip(self.axons, self.boutons):
            bouton.connect(axon)       # connect bouton 0-end to preceeding axon 1-end
        for bouton, axon in zip(self.boutons, self.axons[1:]):
            axon.connect(bouton(1),0)  # connect axon 0-end to preceeding bouton 1-end

        # Someting for all
        h.celsius = 37   
        h.Ra = 120
        for section in h.allsec():
            section.ena = all_ena
            section.ek = all_ek
    def __init__(self, **parameters):

        # Create single compartment Otsuka STN cell section, i.e. soma section
        self.soma = Section(L=parameters['L'],
                            diam=parameters['diam'],
                            nseg=parameters['nseg'],
                            Ra=parameters['Ra'],
                            cm=parameters['cm'],
                            mechanisms=[
                                Mechanism('myions'),
                                Mechanism('stn',
                                          gnabar=49e-3,
                                          gkdrbar=57e-3,
                                          gkabar=5e-3,
                                          gkcabar=1.0e-3,
                                          gcalbar=15e-3,
                                          gcatbar=5e-3,
                                          kca=2,
                                          gl=0.35e-3)
                            ])
        # Initialize ion concentrations
        h("cai0_ca_ion = 5e-6 ")
        h("cao0_ca_ion = 2")
        h("ki0_k_ion = 105")
        h("ko0_k_ion = 3")
        h("nao0_na_ion = 108")
        h("nai0_na_ion = 10")

        # Add bias current to neuron model
        self.stim = h.IClamp(0.5, sec=self.soma)
        self.stim.delay = 0
        self.stim.dur = 1e12
        self.stim.amp = parameters['bias_current']  # bias current density (nA)

        # Add AMPA and GABAa synapses to the cell, i.e. add to the soma section
        self.AMPA = h.AMPA_S(0.5, sec=self.soma)
        self.GABAa = h.GABAa_S(0.5, sec=self.soma)

        # needed for PyNN
        self.source_section = self.soma
        self.source = self.soma(0.5)._ref_v
        self.rec = h.NetCon(self.source, None,
                            sec=self.soma)  # Needed to clear the simulator
        self.spike_times = h.Vector(0)
        self.parameter_names = ('L', 'diam', 'nseg', 'Ra', 'cm',
                                'bias_current')
        self.traces = {}
        self.recording_time = False
Esempio n. 10
0
    def __init__(self, **parameters):
        # define ion channel parameters
        leak = Mechanism("pas", e=-65, g=parameters["g_leak"])
        hh = Mechanism("hh", gl=parameters["g_leak"], el=-65, gnabar=parameters["gnabar"], gkbar=parameters["gkbar"])
        # create cable sections
        self.soma = Section(L=30, diam=30, mechanisms=[hh])
        self.apical = Section(L=600, diam=2, nseg=5, mechanisms=[leak], parent=self.soma, connection_point=DISTAL)
        self.basilar = Section(L=600, diam=2, nseg=5, mechanisms=[leak], parent=self.soma)
        self.axon = Section(L=1000, diam=1, nseg=37, mechanisms=[hh])
        # synaptic input
        self.apical.add_synapse("ampa", "Exp2Syn", e=0.0, tau1=0.1, tau2=5.0)

        # needed for PyNN
        self.source_section = self.soma
        self.source = self.soma(0.5)._ref_v
        self.parameter_names = ("g_leak", "gnabar", "gkbar")
        self.traces = {}
        self.recording_time = False
Esempio n. 11
0
    def __init__(self, **parameters):
        # define ion channel parameters
        leak = Mechanism('pas', e=-65, g=parameters['g_leak'])
        hh = Mechanism('hh', gl=parameters['g_leak'], el=-65,
                       gnabar=parameters['gnabar'], gkbar=parameters['gkbar'])
        # create cable sections
        self.soma = Section(L=30, diam=30, mechanisms=[hh])
        self.apical = Section(L=600, diam=2, nseg=5, mechanisms=[leak], parent=self.soma,
                              connect_to=1)
        self.basilar = Section(L=600, diam=2, nseg=5, mechanisms=[leak], parent=self.soma)
        self.axon = Section(L=1000, diam=1, nseg=37, mechanisms=[hh])
        # synaptic input
        self.apical.add_synapse('ampa', 'Exp2Syn', e=0.0, tau1=0.1, tau2=5.0)

        # needed for PyNN
        self.source_section = self.soma
        self.source = self.soma(0.5)._ref_v
        self.parameter_names = ('g_leak', 'gnabar', 'gkbar')
        self.traces = {}
        self.recording_time = False
    def __init__(self, **parameters):

        # Create single compartment Rubin and Terman Thalamic cell section, i.e. soma section
        self.soma = Section(L=parameters['L'],
                            diam=parameters['diam'],
                            nseg=parameters['nseg'],
                            Ra=parameters['Ra'],
                            cm=parameters['cm'],
                            mechanisms=(Mechanism('thalamic_i_leak'),
                                        Mechanism('thalamic_i_na_k'),
                                        Mechanism('thalamic_i_t')))
        """
		# Note: Thalamic current has no bias current in original paper, i.e. bias_current_density = 0
		#       Can be added in if required.
		# insert current source
		self.stim = h.IClamp(0.5, sec=self.soma)
		self.stim.delay = 0
		self.stim.dur = 1e12
		self.stim.amp = parameters['bias_current_density']*(self.area())*(0.001) 	# (0.001 or 1e-3) is conversion factor so pA -> nA
		"""

        # insert synaptic noise
        self.noise = h.SynNoise(0.5, sec=self.soma)
        self.noise.f0 = 0
        self.noise.f1 = 0.3

        # Add AMPA and GABAa synapses to the cell, i.e. add to the soma section
        self.AMPA = h.AMPA_S(0.5, sec=self.soma)
        self.GABAa = h.GABAa_S(0.5, sec=self.soma)

        # needed for PyNN
        self.source_section = self.soma
        self.source = self.soma(0.5)._ref_v
        self.rec = h.NetCon(self.source, None,
                            sec=self.soma)  # Needed to clear the simulator
        self.spike_times = h.Vector(0)
        self.parameter_names = ('L', 'diam', 'nseg', 'Ra', 'cm',
                                'bias_current_density')
        self.traces = {}
        self.recording_time = False
    def __init__(self, **parameters):

        # Create single compartment Destexhe Interneuron cell section, i.e. soma section
        self.soma = Section(L=parameters['L'],
                            diam=parameters['diam'],
                            nseg=parameters['nseg'],
                            Ra=parameters['Ra'],
                            cm=parameters['cm'],
                            mechanisms=(Mechanism('interneuron_i_leak'),
                                        Mechanism('interneuron_i_na'),
                                        Mechanism('interneuron_i_k')))

        # Add bias current to neuron model - current amplitude is in terms of original model paper, nA
        self.stim = h.IClamp(0.5, sec=self.soma)
        self.stim.delay = 0
        self.stim.dur = 1e12
        self.stim.amp = parameters['bias_current_amp']  # nA

        # insert synaptic noise
        self.noise = h.SynNoise(0.5, sec=self.soma)
        self.noise.f0 = 0
        self.noise.f1 = 0.3

        # Add AMPA and GABAa synapses to the cell, i.e. add to the soma section
        self.AMPA = h.AMPA_S(0.5, sec=self.soma)
        self.GABAa = h.GABAa_S(0.5, sec=self.soma)

        # needed for PyNN
        self.source_section = self.soma
        self.source = self.soma(0.5)._ref_v
        self.rec = h.NetCon(
            self.source, None,
            sec=self.source_section)  # Needed to clear the simulator
        self.spike_times = h.Vector(0)
        self.parameter_names = ('L', 'diam', 'nseg', 'Ra', 'cm',
                                'bias_current_amp')
        self.traces = {}
        self.recording_time = False
Esempio n. 14
0
class ICGCell(object):
    def __init__(self,
                 ion_type,
                 current_type,
                 L=20,
                 diam=20,
                 Ra=150,
                 g_pas=0.00003334):
        self.ion_type = ion_type
        self.current_type = current_type
        leak = Mechanism('pas', e=-65, g=g_pas)
        self.soma = Section(L, diam, Ra=Ra, mechanisms=[leak])

    def insert_mechanism(self, mech):
        """
        Insert density mechanism into cell
        :param mech:
        """
        if isinstance(mech, basestring):
            mech = Mechanism(mech)
        mech.insert_into(self.soma)
        self.setRevVar()
        self.setConc()

    insert_distributed_channel = insert_mechanism

    def insert_synapse(self, suffix, **parameters):
        """

        :param suffix:
        :param parameters: passed as e=-70, g=0.0001
        :return:
        """
        self.soma.add_synapses(suffix.lower(), suffix, **parameters)
        return getattr(self.soma, suffix.lower())

    insert_single_channel = insert_synapse

    def setRevVar(self):
        self.eRev = {
            'kv': 'ek',
            'nav': 'ena',
            'cav': 'eca',
            'kca': 'ek',
            'ih': 'eh'
        }[self.ion_type]
        tmp_eRev = {
            'kv': -86.7,
            'nav': 50.0,
            'cav': 135.0,
            'kca': -86.7,
            'ih': -45.0
        }[self.ion_type]
        setattr(self.soma, self.eRev, tmp_eRev)

    def setConc(self):
        self.iConc = {
            'kv': 'ki',
            'nav': 'nai',
            'cav': 'cai',
            'kca': 'ki',
            'ih': None
        }[self.ion_type]
        self.oConc = {
            'kv': 'ko',
            'nav': 'nao',
            'cav': 'cao',
            'kca': 'ko',
            'ih': None
        }[self.ion_type]
        tmp_iConc = {
            'kv': 85.0,
            'nav': 21.0,
            'cav': 8.1929e-5,
            'kca': 85.0,
            'ih': None
        }[self.ion_type]
        tmp_oConc = {
            'kv': 3.3152396,
            'nav': 136.3753955,
            'cav': 2.0,
            'kca': 3.3152396,
            'ih': None
        }[self.ion_type]
        setattr(self.soma, self.iConc, tmp_iConc)
        setattr(self.soma, self.iConc, tmp_oConc)
    def __init__(self, **parameters):

        # Create cortical pyramidal neuron soma compartment using Pospischil (2008) single compartment model
        self.soma = Section(L=parameters['soma_L'],
                            diam=parameters['soma_diam'],
                            nseg=parameters['soma_nseg'],
                            Ra=parameters['soma_Ra'],
                            cm=parameters['soma_cm'],
                            mechanisms=(Mechanism('cortical_soma_i_leak'),
                                        Mechanism('cortical_soma_i_na'),
                                        Mechanism('cortical_soma_i_k'),
                                        Mechanism('cortical_soma_i_m')))

        # Create cortical pyramidal neuron axon compartments using Foust (2011) axon model
        self.ais = Section(L=parameters['ais_L'],
                           diam=parameters['ais_diam'],
                           nseg=parameters['ais_nseg'],
                           Ra=parameters['ais_Ra'],
                           cm=parameters['ais_cm'],
                           mechanisms=(Mechanism('cortical_axon_i_leak',
                                                 g_l=3.3e-5),
                                       Mechanism('cortical_axon_i_na',
                                                 g_Na=4000e-4),
                                       Mechanism('cortical_axon_i_kv',
                                                 g_Kv=20e-4),
                                       Mechanism('cortical_axon_i_kd',
                                                 g_Kd=0.015)),
                           parent=self.soma)

        # Use loop to create myelin and node sections of axon
        self.myelin = []
        self.node = []
        for i in np.arange(parameters['num_axon_compartments']):
            if i == 0:
                self.myelin.append(
                    Section(L=parameters['myelin_L'],
                            diam=parameters['myelin_diam'],
                            nseg=11,
                            Ra=parameters['myelin_Ra'],
                            cm=parameters['myelin_cm'],
                            mechanisms=(Mechanism('cortical_axon_i_leak',
                                                  g_l=0),
                                        Mechanism('cortical_axon_i_na',
                                                  g_Na=10e-4)),
                            parent=self.ais))
            else:
                self.myelin.append(
                    Section(L=parameters['myelin_L'],
                            diam=parameters['myelin_diam'],
                            nseg=11,
                            Ra=parameters['myelin_Ra'],
                            cm=parameters['myelin_cm'],
                            mechanisms=(Mechanism('cortical_axon_i_leak',
                                                  g_l=0),
                                        Mechanism('cortical_axon_i_na',
                                                  g_Na=10e-4)),
                            parent=self.node[i - 1]))

            self.node.append(
                Section(L=parameters['node_L'],
                        diam=parameters['node_diam'],
                        nseg=parameters['node_nseg'],
                        Ra=parameters['node_Ra'],
                        cm=parameters['node_cm'],
                        mechanisms=(Mechanism('cortical_axon_i_leak',
                                              g_l=0.02),
                                    Mechanism('cortical_axon_i_na',
                                              g_Na=2800e-4),
                                    Mechanism('cortical_axon_i_kv', g_Kv=5e-4),
                                    Mechanism('cortical_axon_i_kd',
                                              g_Kd=0.0072)),
                        parent=self.myelin[i]))

        self.collateral = Section(
            L=parameters['collateral_L'],
            diam=parameters['collateral_diam'],
            nseg=parameters['collateral_nseg'],
            Ra=parameters['collateral_Ra'],
            cm=parameters['collateral_cm'],
            mechanisms=(Mechanism('cortical_axon_i_leak'),
                        Mechanism('cortical_axon_i_na', g_Na=1333.33333e-4),
                        Mechanism('cortical_axon_i_kv', g_Kv=10e-4),
                        Mechanism('cortical_axon_i_kd', g_Kd=0.006)),
            parent=self.node[-1])

        middle_index = int((parameters['num_axon_compartments'] / 2.0))
        self.middle_node = self.node[middle_index]
        self.middle_myelin = self.myelin[middle_index]

        # Add extracellular and xtra mechanisms to collateral
        self.collateral.insert('extracellular')
        self.collateral.insert('xtra')

        # Assign default rx values to the segments rx_xtra
        #  - these values are updated in the main run file
        # 	 where rx is calculated as the transfer resistance
        #    for each collateral segments to the stimulation
        #    electrode in the homogenous extracellular medium
        for seg in self.collateral:
            seg.xtra.rx = seg.x * 3e-1

        # Setting pointers to couple extracellular and xtra mechanisms for simulating extracellular DBS
        for seg in self.collateral:
            h.setpointer(seg._ref_e_extracellular, 'ex', seg.xtra)
            h.setpointer(seg._ref_i_membrane, 'im', seg.xtra)

        # Add bias current to neuron model - current amplitude is in terms of original model paper, nA
        self.stim = h.IClamp(0.5, sec=self.soma)
        self.stim.delay = 0
        self.stim.dur = 1e12
        self.stim.amp = parameters['soma_bias_current_amp']

        # insert synaptic noise
        self.noise = h.SynNoise(0.5, sec=self.soma)
        self.noise.f0 = 0
        self.noise.f1 = 0.3

        # Add AMPA and GABAa synapses to the cell, i.e. add to the soma section
        self.AMPA = h.AMPA_S(0.5, sec=self.soma)
        self.GABAa = h.GABAa_S(0.5, sec=self.soma)

        # needed for PyNN
        self.source = {
            'soma': self.soma(0.5)._ref_v,
            'middle_axon_node': self.middle_node(0.5)._ref_v,
            'collateral': self.collateral(0.5)._ref_v
        }
        self.source_section = {
            'soma': self.soma,
            'middle_axon_node': self.middle_node,
            'collateral': self.collateral
        }
        self.rec = h.NetCon(self.source['collateral'],
                            None,
                            sec=self.source_section['collateral']
                            )  # Needed to clear the simulator
        self.spike_times = h.Vector(0)
        self.traces = {}
        self.recording_time = False
        self.parameter_names = ()