Multicomp model, ECS, pumps and strange concentrations

Extending NEURON to handle reaction-diffusion problems.

Moderators: hines, wwlytton, ramcdougal

Post Reply
bremen
Posts: 41
Joined: Mon Apr 24, 2017 8:15 am
Location: Italy

Multicomp model, ECS, pumps and strange concentrations

Post by bremen » Thu Feb 27, 2020 10:17 am

Hi.

I was checking my RxD code, after implementing it into a multi compartmental model and something very odd came up.

I have a substance, produced by a few dendrites and, trough pumps (the same used in the RxD examples) diffused into the ECS.

If I cancel the code responsible for the generation of the substance, there is still a build up of it in the ECS and inside the sections but only when the pump mechanism is active.
If the pump is commented in the code, than the internal side and the ECS have a zero concentration, as they should be.
It is like the pump is generating the substance.

I discovered that this happens only when I'm using my 300 sections multi compartmental model since everything worked fine with a two single section models.

After some more tinkering with it.
Reducing the model to just 3 sections, soma - dend0 - dend00 (all attached in series) solved the issue.
Instead the issue reappeared with 5 sections in an Y shape like this -> Soma (first branch) dend0-dend00 and (second branch) dend1-dend11.
The two branches share the same origin point but, even placed one at 0 and the other at 0.5 does not resolve the issue.

(NEURON 7.8 compiled 4 days ago and python 3.6.9)

ramcdougal
Posts: 205
Joined: Fri Nov 28, 2008 3:38 pm
Location: Yale School of Public Health

Re: Multicomp model, ECS, pumps and strange concentrations

Post by ramcdougal » Thu Feb 27, 2020 11:13 am

I made a quick attempt to reproduce this, but was unsuccessful (in the sense that no mass was created).

Can you compare your version to mine and tell me how we differ?

Code: Select all

from neuron import h, rxd
from neuron.units import mV, ms
h.load_file('stdrun.hoc')

soma = h.Section(name='soma')
dend0 = h.Section(name='dend0')
dend00 = h.Section(name='dend00')
dend1 = h.Section(name='dend1')
dend11 = h.Section(name='dend11')

dend0.connect(soma)
dend1.connect(soma)
dend00.connect(dend0)
dend11.connect(dend1)

for sec in h.allsec():
    sec.diam = 2
    sec.L = 5

ecs = rxd.Extracellular(-5, -5, -5, 15, 15, 15, dx=0.25)
cyt = rxd.Region(h.allsec(), name='cyt', nrn_region='i')
mem = rxd.Region(h.allsec(), name='cell_mem', geometry=rxd.membrane())

ca = rxd.Species([cyt, ecs], name='ca', charge=2, initial=0)

pump = rxd.MultiCompartmentReaction(ca[cyt], ca[ecs], 1, membrane=mem)

def show_extremes():
    print(f"min(ca[cyt].concentration) = {min(ca[cyt].concentration)}")
    print(f"max(ca[cyt].concentration) = {max(ca[cyt].concentration)}")
    print(f"min(ca[ecs].nodes.concentration) = {min(ca[ecs].nodes.concentration)}")
    print(f"max(ca[ecs].nodes.concentration) = {max(ca[ecs].nodes.concentration)}")

h.finitialize(-65 * mV)
show_extremes()
h.continuerun(5 * ms)
show_extremes()
(This was with NEURON 7.7.2 and Python 3.7.4 on a mac.)

Incidentally, I didn't realize that I had to do the extra .nodes when working with extracellular. I'll look into making a direct .concentration work for extracellular as well as intracellular.

bremen
Posts: 41
Joined: Mon Apr 24, 2017 8:15 am
Location: Italy

Re: Multicomp model, ECS, pumps and strange concentrations

Post by bremen » Fri Feb 28, 2020 9:13 am

Thank you.
I have modified your code and i can reproduce the strangeness.

Code: Select all

from neuron import h, rxd
from neuron.units import mV, ms
h.load_file('stdrun.hoc')

soma = h.Section(name='soma')
dend0 = h.Section(name='dend0')
dend00 = h.Section(name='dend00')
dend00.insert('pump') 

dend1 = h.Section(name='dend1')
dend11 = h.Section(name='dend11')
dend11.insert('pump') 

dend0.connect(soma)
dend1.connect(soma)
dend00.connect(dend0)
dend11.connect(dend1)

for sec in h.allsec():
    sec.diam = 2
    sec.L = 5

ecs = rxd.Extracellular(-5, -5, -5, 15, 15, 15, dx=0.25)
cyt = rxd.Region(dend00, name='cyt', nrn_region='i')

x = rxd.Species([cyt, ecs], name='x', d=3.8, charge=1, initial=0)

def show_extremes():
    print(f"min(x[cyt].concentration) = {min(x[cyt].concentration)}")
    print(f"max(x[cyt].concentration) = {max(x[cyt].concentration)}")
    print(f"min(x[ecs].nodes.concentration) = {min(x[ecs].nodes.concentration)}")
    print(f"max(x[ecs].nodes.concentration) = {max(x[ecs].nodes.concentration)}")

h.finitialize(-65 * mV)
show_extremes()
h.continuerun(5 * ms)
show_extremes()
The pump. https://github.com/neuronsimulator/nrn/ ... s/pump.mod
min(x[cyt].concentration) = 0.0
max(x[cyt].concentration) = 0.0
min(x[ecs].nodes.concentration) = 0.0
max(x[ecs].nodes.concentration) = 0.0
min(x[cyt].concentration) = 0.00044556595500458765
max(x[cyt].concentration) = 0.00044556595500458765
min(x[ecs].nodes.concentration) = 2.1928375902740792e-08
max(x[ecs].nodes.concentration) = 0.25761957101618665
My 2 cent.
The pumps presence on 2 dendrites but with only a single region actually defined, causes the issue. In my original code i had regions for all the pumps but this not prevented the issue.
If the species diffusion value (d) is set, it generates the issue but if it is turned off than max(x[ecs].nodes.concentration) = 1.0.

I have done a fast test on my complete code and MultiCompartmentReaction seems to work fine, so I'll switch to it.

Best
Stefano

ramcdougal
Posts: 205
Joined: Fri Nov 28, 2008 3:38 pm
Location: Yale School of Public Health

Re: Multicomp model, ECS, pumps and strange concentrations

Post by ramcdougal » Fri Feb 28, 2020 10:50 am

Okay, so the fundamental situation is as follows:

dend00 and dend11 both have the pump as defined by a mod file:

Code: Select all

dend00.insert('pump') 
...
dend11.insert('pump') 
This means that x and the pump dynamics must exist in both of these sections.

cyt is defined only on dend00:

Code: Select all

cyt = rxd.Region(dend00, name='cyt', nrn_region='i')
Thus when you initialize as below,

Code: Select all

x = rxd.Species([cyt, ecs], name='x', d=3.8, charge=1, initial=0)
the initial value for species x is only specified here for the extracellular region and for the intracellular concentration in dend00 alone. In particular, it is not specified for the intracellular region of dend11 since this rule doesn't apply there. Therefore dend11's initial xi value is NEURON's default* of 1 mM. The pump then causes mass to move into the extracellular space where it's free to diffuse with a diffusion constant of 3.8 µm^2/ms.

How do you avoid this? You could, as you may have intended, include dend11 in the cytosol, e.g.

Code: Select all

cyt = rxd.Region([dend00, dend11], name='cyt', nrn_region='i')
You could also explicitly define an initial value for xi in dend11, either by changing the intracellular default concentration for species x via h.xi0_x_ion = 0, by setting it in the mod file, by an FInitializeHandler or by manually setting it after the finitialize. (When using CVode, be sure to explicitly re_init after manually changing state variables.)

* As shown above, you can change the default on a per-species basis via e.g. h.xi0_x_ion = 0

Post Reply