def create_models(self): self.generic_cell = Cell(id = "GenericCell") morphology = Morphology() morphology.id = "morphology_"+self.generic_cell.id self.generic_cell.morphology = morphology prox_point = Point3DWithDiam(x="0", y="0", z="0", diameter=self.get_bioparameter("cell_diameter").value) dist_point = Point3DWithDiam(x="0", y="0", z=self.get_bioparameter("cell_length").value, diameter=self.get_bioparameter("cell_diameter").value) segment = Segment(id="0", name="soma", proximal = prox_point, distal = dist_point) morphology.segments.append(segment) self.generic_cell.biophysical_properties = BiophysicalProperties(id="biophys_"+self.generic_cell.id) mp = MembraneProperties() self.generic_cell.biophysical_properties.membrane_properties = mp mp.init_memb_potentials.append(InitMembPotential(value=self.get_bioparameter("initial_memb_pot").value)) mp.specific_capacitances.append(SpecificCapacitance(value=self.get_bioparameter("specific_capacitance").value)) mp.spike_threshes.append(SpikeThresh(value=self.get_bioparameter("spike_thresh").value)) mp.channel_densities.append(ChannelDensity(cond_density=self.get_bioparameter("leak_cond_density").value, id="Leak_all", ion_channel="Leak", erev=self.get_bioparameter("leak_erev").value, ion="non_specific")) mp.channel_densities.append(ChannelDensity(cond_density=self.get_bioparameter("k_slow_cond_density").value, id="k_slow_all", ion_channel="k_slow", erev=self.get_bioparameter("k_slow_erev").value, ion="k")) mp.channel_densities.append(ChannelDensity(cond_density=self.get_bioparameter("k_fast_cond_density").value, id="k_fast_all", ion_channel="k_fast", erev=self.get_bioparameter("k_fast_erev").value, ion="k")) mp.channel_densities.append(ChannelDensity(cond_density=self.get_bioparameter("ca_boyle_cond_density").value, id="ca_boyle_all", ion_channel="ca_boyle", erev=self.get_bioparameter("ca_boyle_erev").value, ion="ca")) ip = IntracellularProperties() self.generic_cell.biophysical_properties.intracellular_properties = ip # NOTE: resistivity/axial resistance not used for single compartment cell models, so value irrelevant! ip.resistivities.append(Resistivity(value="0.1 kohm_cm")) # NOTE: Ca reversal potential not calculated by Nernst, so initial_ext_concentration value irrelevant! species = Species(id="ca", ion="ca", concentration_model="CaPool", initial_concentration="0 mM", initial_ext_concentration="2E-6 mol_per_cm3") ip.species.append(species) self.exc_syn = GradedSynapse(id="exc_syn", conductance = self.get_bioparameter("exc_syn_conductance").value, delta = self.get_bioparameter("exc_syn_delta").value, Vth = self.get_bioparameter("exc_syn_vth").value, erev = self.get_bioparameter("exc_syn_erev").value, k = self.get_bioparameter("exc_syn_k").value) self.inh_syn = GradedSynapse(id="inh_syn", conductance = self.get_bioparameter("inh_syn_conductance").value, delta = self.get_bioparameter("inh_syn_delta").value, Vth = self.get_bioparameter("inh_syn_vth").value, erev = self.get_bioparameter("inh_syn_erev").value, k = self.get_bioparameter("inh_syn_k").value) self.elec_syn = GapJunction(id="elec_syn", conductance = self.get_bioparameter("elec_syn_gbase").value) self.offset_current = PulseGenerator(id="offset_current", delay=self.get_bioparameter("unphysiological_offset_current_del").value, duration=self.get_bioparameter("unphysiological_offset_current_dur").value, amplitude=self.get_bioparameter("unphysiological_offset_current").value)
def create_generic_neuron_cell(self): self.generic_neuron_cell = Cell(id="GenericNeuronCell") morphology = Morphology() morphology.id = "morphology_" + self.generic_neuron_cell.id self.generic_neuron_cell.morphology = morphology prox_point = Point3DWithDiam( x="0", y="0", z="0", diameter=self.get_bioparameter("cell_diameter").value) dist_point = Point3DWithDiam( x="0", y="0", z="0", diameter=self.get_bioparameter("cell_diameter").value) segment = Segment(id="0", name="soma", proximal=prox_point, distal=dist_point) morphology.segments.append(segment) self.generic_neuron_cell.biophysical_properties = BiophysicalProperties( id="biophys_" + self.generic_neuron_cell.id) mp = MembraneProperties() self.generic_neuron_cell.biophysical_properties.membrane_properties = mp mp.init_memb_potentials.append( InitMembPotential( value=self.get_bioparameter("initial_memb_pot").value)) mp.specific_capacitances.append( SpecificCapacitance(value=self.get_bioparameter( "neuron_specific_capacitance").value)) mp.spike_threshes.append( SpikeThresh( value=self.get_bioparameter("neuron_spike_thresh").value)) mp.channel_densities.append( ChannelDensity(cond_density=self.get_bioparameter( "neuron_leak_cond_density").value, id="Leak_all", ion_channel="Leak", erev=self.get_bioparameter("leak_erev").value, ion="non_specific")) mp.channel_densities.append( ChannelDensity(cond_density=self.get_bioparameter( "neuron_k_slow_cond_density").value, id="k_slow_all", ion_channel="k_slow", erev=self.get_bioparameter("k_slow_erev").value, ion="k")) ''' mp.channel_densities.append(ChannelDensity(cond_density=self.get_bioparameter("neuron_k_fast_cond_density").value, id="k_fast_all", ion_channel="k_fast", erev=self.get_bioparameter("k_fast_erev").value, ion="k"))''' mp.channel_densities.append( ChannelDensity(cond_density=self.get_bioparameter( "neuron_ca_simple_cond_density").value, id="ca_simple_all", ion_channel="ca_simple", erev=self.get_bioparameter("ca_simple_erev").value, ion="ca")) ip = IntracellularProperties() self.generic_neuron_cell.biophysical_properties.intracellular_properties = ip # NOTE: resistivity/axial resistance not used for single compartment cell models, so value irrelevant! ip.resistivities.append(Resistivity(value="0.1 kohm_cm")) # NOTE: Ca reversal potential not calculated by Nernst, so initial_ext_concentration value irrelevant! species = Species(id="ca", ion="ca", concentration_model="CaPool", initial_concentration="0 mM", initial_ext_concentration="2E-6 mol_per_cm3") ip.species.append(species)
def create_neuron_cell(self, cell_name, morphology): cell = Cell(id=cell_name) cell.notes = "Cell model created by c302 with custom electrical parameters" cell.morphology = morphology cell.biophysical_properties = BiophysicalProperties(id="biophys_" + cell.id) mp = MembraneProperties() cell.biophysical_properties.membrane_properties = mp mp.init_memb_potentials.append( InitMembPotential( value=self.get_bioparameter("initial_memb_pot").value)) mp.specific_capacitances.append( SpecificCapacitance( value=self.get_bioparameter("specific_capacitance").value)) mp.spike_threshes.append( SpikeThresh( value=self.get_bioparameter("neuron_spike_thresh").value)) mp.channel_densities.append( ChannelDensity(cond_density=self.get_bioparameter( "neuron_leak_cond_density").value, id="Leak_all", ion_channel="Leak", erev=self.get_bioparameter("leak_erev").value, ion="non_specific")) mp.channel_densities.append( ChannelDensity(cond_density=self.get_bioparameter( "neuron_k_slow_cond_density").value, id="k_slow_all", ion_channel="k_slow", erev=self.get_bioparameter("k_slow_erev").value, ion="k")) mp.channel_densities.append( ChannelDensity(cond_density=self.get_bioparameter( "neuron_k_fast_cond_density").value, id="k_fast_all", ion_channel="k_fast", erev=self.get_bioparameter("k_fast_erev").value, ion="k")) mp.channel_densities.append( ChannelDensity(cond_density=self.get_bioparameter( "neuron_ca_boyle_cond_density").value, id="ca_boyle_all", ion_channel="ca_boyle", erev=self.get_bioparameter("ca_boyle_erev").value, ion="ca")) ip = IntracellularProperties() cell.biophysical_properties.intracellular_properties = ip # NOTE: resistivity/axial resistance not used for single compartment cell models, so value irrelevant! ip.resistivities.append( Resistivity(value=self.get_bioparameter("resistivity").value)) # NOTE: Ca reversal potential not calculated by Nernst, so initial_ext_concentration value irrelevant! species = Species(id="ca", ion="ca", concentration_model="CaPool", initial_concentration="0 mM", initial_ext_concentration="2E-6 mol_per_cm3") ip.species.append(species) return cell