import neuroml.loaders as loaders
from neuroml import Cell
cell_doc = loaders.NeuroMLLoader.load("SingleCompMuscle.cell.nml")
cell = cell_doc.cells[0]
print('Loaded cell: %s'%cell.id)
Loaded cell: SingleCompMuscleCell
segment = cell.morphology.segments[0]
p = segment.proximal
d = segment.distal
print('Cell has a single segment (id: %s, name: %s) consisting of a cylinder from (%s, %s, %s) to (%s, %s, %s)' %
(segment.id, segment.name, p.x, p.y, p.z, d.x, d.y, d.z))
Cell has a single segment (id: 0, name: Body) consisting of a cylinder from (0.0, 0.0, 0.0) to (0.0, 0.0, 230.3459)
membrane_properties = cell.biophysical_properties.membrane_properties
reversal_potentials = {}
densities = {}
for chan_dens in membrane_properties.channel_densities:
reversal_potentials[chan_dens.id] = chan_dens.erev
densities[chan_dens.id] = chan_dens.cond_density
print("Reversal potentials: %s"%reversal_potentials)
print("Channel densities: %s"%densities)
Reversal potentials: {'Leak_all': '10 mV', 'ca_boyle_all': '49.11 mV', 'k_fast_all': '-54.9998 mV', 'k_slow_all': '-64.3461 mV'} Channel densities: {'Leak_all': '0.0193181 mS_per_cm2', 'ca_boyle_all': '0.220209 mS_per_cm2', 'k_fast_all': '0.399994 mS_per_cm2', 'k_slow_all': '0.43584 mS_per_cm2'}
k_slow = loaders.NeuroMLLoader.load("k_slow.channel.nml").ion_channel[0]
k_fast = loaders.NeuroMLLoader.load("k_fast.channel.nml").ion_channel[0]
ca_boyle = loaders.NeuroMLLoader.load("ca_boyle.channel.nml").ion_channel[0]
for chan in [k_slow, k_fast, ca_boyle]:
print('Loaded channel: %s'%chan.id)
for g in chan.gate_hh_tau_infs:
print(" Gate %s present, instances %i"%(g.id,g.instances))
if g.time_course:
print(" Time course: %s, tau: %s"%(g.time_course.type, g.time_course.tau))
if g.steady_state:
print(" Steady state: %s, rate: %s, scale: %s, midpoint: %s"%(g.steady_state.type, g.steady_state.rate, g.steady_state.scale, g.steady_state.midpoint))
Loaded channel: k_slow Gate n present, instances 1 Time course: fixedTimeCourse, tau: 25.0007 ms Steady state: HHSigmoidVariable, rate: 1.0, scale: 15.8512 mV, midpoint: 19.8741 mV Loaded channel: k_fast Gate p present, instances 4 Time course: fixedTimeCourse, tau: 2.25518 ms Steady state: HHSigmoidVariable, rate: 1.0, scale: 7.42636 mV, midpoint: -8.05232 mV Gate q present, instances 1 Time course: fixedTimeCourse, tau: 149.963 ms Steady state: HHSigmoidVariable, rate: 1.0, scale: -9.97468 mV, midpoint: -15.6456 mV Loaded channel: ca_boyle Gate e present, instances 2 Time course: fixedTimeCourse, tau: 0.100027 ms Steady state: HHSigmoidVariable, rate: 1.0, scale: 6.74821 mV, midpoint: -3.3568 mV Gate f present, instances 1 Time course: fixedTimeCourse, tau: 150.88 ms Steady state: HHSigmoidVariable, rate: 1.0, scale: -5.03176 mV, midpoint: 25.1815 mV Gate h present, instances 1