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
Reloading mechanisms library
Moderator: tom_morse
-
- Site Admin
- Posts: 6384
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: Reloading mechanisms library
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 potentialClearly -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(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 soand
* change the formula for minf (probably in a PROCEDURE called something like "rates") to
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
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))
Code: Select all
: minf = 1/(1 + exp((40+v)/10))
: shift half activation point 10 mV negative
minf = 1/(1 + exp((50+v)/10))
Instead, why not
* declare a new variable called vhalfm in the PARAMETER block like so
Code: Select all
PARAMETER {
vhalfm = -40 (mV) : default value
* 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))
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
Re: Reloading mechanisms library
They only affect the parameters not the form. So the solution you proposed should work.
Thanks
Christoph
Thanks
Christoph
Re: Reloading mechanisms library
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
salva