I wish...

Anything that doesn't fit elsewhere.
Post Reply
Bill Connelly
Posts: 86
Joined: Thu May 22, 2008 11:54 pm
Location: Australian National University

I wish...

Post by Bill Connelly »

I wish it was easier to "hot swap" dlls. Sometimes one has quit a complex experimental rig set up, and you wish you could change something in a MOD file, and the only way is to quit out and start again. I know one should do ones best to make the hoc load all that up, but sometimes it isn't practical. So, I wish you could recompile your dll with neuron still open.
ted
Site Admin
Posts: 6289
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: I wish...

Post by ted »

Many changes can be made by simply exposing parameters to hoc.
For example, the hh.mod built into NEURON contains this definition of the rate constants for m:
alpha = .1 * vtrap(-(v+40),10)
beta = 4 * exp(-(v+65)/18)
You could copy hh.mod to a new file--call it myhh.mod for this example--then edit the new file and make these changes:

Code: Select all

NEURON {
:  SUFFIX hh
  SUFFIX myhh
  . . .
PROCEDURE rates(v(mV)) {
  . . .
:  alpha = .1 * vtrap(-(v+40),10)
:  beta =  4 * exp(-(v+65)/18)
  alpha = kam * vtrap(-(v-vham),gam)
  beta =  kbm * exp(-(v-vhbm)/gbm)
which requires declaring the new symbol names in the PARAMETER block

Code: Select all

PARAMETER {
  . . .
  kam = 0.1
  vham = -40 (mV)
  gam = 10 (mV)
  kbm = 4
  vhbm = -65 (mV)
  gbm = 18 (mV)
The result would be a new mechanism called myhh that, after compilation, would have global* parameters known to hoc as kam_hh, vham_hh, gam_hh etc.. This would allow you to shift the half-activation points, alter the slopes of voltage dependence, and change the magnitudes of the forward and backward transitions for m, all from hoc, without having to recompile myhh.mod.

*--and if you preferred them to be RANGE, just declare that in the NEURON block
RANGE kam, vham, gam etc.

Another workaround is to use channels implemented with the ChannelBuilder, which enables many changes to be made at will without recompilation.
Post Reply