The current work around is to create the regions everywhere as you had before, then alter the diffusion coefficient and use parameters to exclude the unwanted region. Unfortunately, this approach does not allow the volume fraction to vary; that is, if there is no ER in the spine, you might expect cytosol to occupy a different fraction of the volume, but this approach would still have it being the same percent as in the dendrite. For example;
Code: Select all
from neuron import h, rxd
from neuron.units import μM
from matplotlib import pyplot as plt
h.load_file('stdrun.hoc')
# parameters (from http://modeldb.yale.edu/185858)
fraction_cyt = 0.83
fraction_er = 0.17
caD = 0.233
gleak = 3 * 1000 # increased leak rate for this example
# morphology
dend = h.Section(name='dend')
dend.L=100
dend.diam=2
dend.nseg = 101
spine = h.Section(name='spine')
spine.L=5
spine.diam=0.5
spine.nseg=11
spine.connect(dend(0.5))
# regions
cyt = rxd.Region(h.allsec(), name='cyt', nrn_region='i',
geometry=rxd.FractionalVolume(fraction_cyt,surface_fraction=1))
er = rxd.Region(h.allsec(), name='er',
geometry=rxd.FractionalVolume(fraction_er))
cyt_er_membrane = rxd.Region(h.allsec(), geometry=rxd.ScalableBorder(1))
# helper function
def excluded_er(node):
if node.region == er and node.sec == spine:
return 0
return 1
# species
ca = rxd.Species([cyt,er], name='ca', charge=2,
initial=lambda nd: 100 * μM if nd.region == cyt and
nd.sec == spine else 60*μM)
dendonly = rxd.Parameter([er], name='dendonly',
initial=lambda nd: excluded_er(nd))
# prevent spine ER diffusion
for nd in ca.nodes:
nd.d = caD * excluded_er(nd)
# reactions
leak = rxd.MultiCompartmentReaction(ca[er] + dendonly[er],
ca[cyt] + dendonly[er],
gleak, gleak,
membrane=cyt_er_membrane)
# record some concentrations
t_vec = h.Vector().record(h._ref_t)
caer_vec = h.Vector().record(ca[er].nodes(dend(0.5))._ref_concentration)
cacyt_vec = h.Vector().record(spine(0.5)._ref_cai)
# run the simulation
h.finitialize(-70)
h.continuerun(100)
# plot the results
plt.figure()
plt.subplot(2,1,1)
plt.plot(t_vec, cacyt_vec/μM, label='Ca$^{2+}_{Cyt}$ spine')
plt.plot(t_vec, caer_vec/μM, label='Ca$^{2+}_{ER}$ dendrite')
plt.xlabel('time (ms)')
plt.ylabel('concentration (μM)')
plt.legend(frameon=False)
plt.subplot(2,1,2)
plt.plot([seg.x * dend.L for seg in dend], [seg.cai/μM for seg in dend],
label='cyt')
plt.plot([nd.x * dend.L for nd in ca[er].nodes(dend)],
[nd.value/μM for nd in ca[er].nodes(dend)], label='ER')
plt.xlabel('dendrite (μm)')
plt.ylabel('concentration (μM)')
plt.legend(frameon=False)
plt.show()
If you wish, you may experiment with this code example online:
https://colab.research.google.com/drive ... aDXIu0TcCp