Reloading mechanisms library

A Python package that facilitates development and use of models of biological neural networks

Moderator: tom_morse

Post Reply
cmetzner
Posts: 2
Joined: Thu Jul 13, 2017 9:57 am

Reloading mechanisms library

Post by cmetzner » Thu Jan 10, 2019 8:28 am

Hi,

I am working on a project where I want to investigate the effect of genetic alterations of ion channel encoding genes on oscillatory activity in a network. I am looking for a convenient way to reload the library that contains the ion channel mechanisms in one script running multiple simulations, since for each genetic alteration some parameters describing the ion channels change and the mod files need to be recompiled. Is that possible?

Best,
Christoph

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

Re: Reloading mechanisms library

Post by ted » Thu Jan 10, 2019 4:54 pm

If the genetic alterations affect the values of parameters, but not the form of the equations that describe the model, there is no need to recompile the mod file or reload the compiled mechanism(s). Instead of hard coding the parameter values into your mod file, just parameterize your NMODL code.

Example: suppose your model has a function that describes how the steady state value of activation variable m depends on membrane potential

Code: Select all

minf = 1/(1 + exp((40+v)/10))
Clearly -40 mV is the membrane potential at which minf equals 0.5. Now suppose there is a mutation that shifts this half activation point 10 mV negative. Well, you could literally change the formula for minf to

Code: Select all

: minf = 1/(1 + exp((40+v)/10))
: shift half activation point 10 mV negative
minf = 1/(1 + exp((50+v)/10))
(note the use of comments!) but then you'd have to exit NEURON, recompile the mod files, then restart NEURON and load your model again.

Instead, why not
* declare a new variable called vhalfm in the PARAMETER block like so

Code: Select all

PARAMETER {
  vhalfm = -40 (mV) : default value
and
* change the formula for minf (probably in a PROCEDURE called something like "rates") to

Code: Select all

: minf = 1/(1 + exp((40+v)/10))
minf = 1/(1 + exp((v - vhalfm)/10))
After you recompile your mechanisms, you can then
1. run a simulation to get results with the control value of vhalfm
2. when you're ready to see the effect of your mutation, execute the assignment statement
vhalfm_hh = -50
and then just run a new simulation with this new value for m's vhalf

cmetzner
Posts: 2
Joined: Thu Jul 13, 2017 9:57 am

Re: Reloading mechanisms library

Post by cmetzner » Fri Jan 11, 2019 3:29 am

They only affect the parameters not the form. So the solution you proposed should work.

Thanks
Christoph

salvadord
Posts: 80
Joined: Tue Aug 18, 2015 3:49 pm

Re: Reloading mechanisms library

Post by salvadord » Sun Jan 27, 2019 12:25 pm

Hey Cristoph, in case useful, you can also use this command to reload the mod files: `neuron.load_mechanisms(folder_with_mod)` and before that you could call the `nrnivmodl` command from python to recompile them. Never tried this but I think it should work.

salva

Post Reply