How to implement ion diffusion#
Jaxley allows you to:
define ion pumps,
update the reversal potential via the Nernst equation, and
diffuse ions within a cell.
Here is a small code snippet that shows this (this snippet requires pip install jaxley-mech):
from jaxley.pumps import CaPump, CaNernstReversal
from jaxley_mech.channels.l5pc import CaHVA
branch = jx.Branch()
cell = jx.Cell(branch, parents=[-1, 0, 0])
# Insert a voltage-gated calcium channel.
cell.insert(CaHVA())
# Insert an ion pump which modifies the intracellular calcium based on the calcium current.
cell.insert(CaPump())
# Insert a mechanism that updates the calcium reversal potential based on the intracellular calcium level.
cell.insert(CaNernstReversal())
# Let the intracellular calcium diffuse within the cell.
cell.diffuse("CaCon_i")
cell.set("axial_resistivity_CaCon_i", 1_000.0)
Jaxley does not yet provide functionality for diffusing ions extracellularly. In
addition, intracellular ion diffusion in Jaxley currently has the following
limitations:
we only allow to diffuse ions within the entire cell (not in just a few branches),
if enabled, ion diffusion occurs within every cell of a network.
Finally, note that, even when ion diffusion is enabled, Jaxley uses a cylindrical
approximation for the compartment area (which is unlike NEURON, which uses a conic
approximation when ion diffusion is enabled).
More explanation#
See this tutorial for more information.