Sharing variables between NMODL files without using ions

NMODL and the Channel Builder.
Post Reply
tyrell_turing
Posts: 4
Joined: Fri Jan 24, 2014 5:33 pm

Sharing variables between NMODL files without using ions

Post by tyrell_turing »

Hi all,

Is there any way to pass variables between NMODL files without resorting to the use of ions? I ask because we are working on a model of chloride transport wherein we have two NMODL files: (1) a file for calculating the percentage of potassium chloride cotransporter proteins (KCC2) in the membrane (which is a dynamic variable) and (2) a file for chloride transport and diffusion. (We had to separate these two functions into different .mod files because the change in the chloride transporter is handled by a DERIVATIVE block, while the transport and chloride diffusion is handled by a KINETIC block, and we couldn't put both types of block in the same .mod file.)

The variable we have to share between the .mod files is the percentage of KCC2 transporter in the membrane from the first file - it helps to determine the efficacy of chloride transport in the second .mod file. As it currently stands we use a dummy ion to stand in for the percentage of transporter in the mebrane. So, in the first file we have:

Code: Select all

USEION mkcc2 WRITE mkcc2i VALENCE 1
...
mkcc2i = percentage of KCC2 in the membrane
and in the second file:

Code: Select all

USEION mkcc2 READ mkcc2i VALENCE 1
...
use mkcc2i to modulate transporter efficacy
This works, but it seems deeply inelegant to me. Not least because we have to translate into mM to do this, yet the percentage can only be between 0-1! Does anyone know a better way to share variables between .mod files?

Thanks,

Blake
ted
Site Admin
Posts: 6300
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Sharing variables between NMODL files without using ions

Post by ted »

I've used the "bogus ion" trick myself on occasion. Inelegant, maybe, a bit of a hack, yes, but it can do the job. The alternatives are
1. use a POINTER variable to communicate the "percentage of KCC2 transporter" value from the mechanism that calculates it to the chloride accumulation mechanism that needs it. See documentation of setpointer in the Programmer's Reference. For examples see the "continous transmitter release" synapse example of chapter 10 in the NEURON book, and also https://senselab.med.yale.edu/modeldb/S ... odel=39949 in particular damsg.mod, caL.mod, and kir.mod, and the comments about 'Implementation 2: a "networked" model cell' near the end of readme.html.
or
2. revise the two mechanisms so that they can be combined in one mod file. The latter would require rewriting the ODE that governs "percentage of KCC2 transporter" as a kinetic scheme, or rewriting the kinetic scheme description of ion accumulation and diffusion as a set of ODEs.

If you have questions about either of these approaches, let me know.
tyrell_turing
Posts: 4
Joined: Fri Jan 24, 2014 5:33 pm

Re: Sharing variables between NMODL files without using ions

Post by tyrell_turing »

Thanks for your reply, Ted. I will take a look at using a POINTER variable, it sounds like a good option.

Cheers,

Blake
Post Reply