Uninserting mechanisms

NMODL and the Channel Builder.
Post Reply
adamimos
Posts: 45
Joined: Mon Jan 25, 2010 4:49 pm

Uninserting mechanisms

Post by adamimos »

Hi,

I was wondering what the most efficient way to uninsert all distributed AND point process mechanisms is. Relatedly, is there a way to print all distributed and point process mechanisms that are currently in the entire simulation?

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

Re: Uninserting mechanisms

Post by ted »

Look in the Programmer's Reference for
uninsert
allobjectvars
ismembrane

If it's all your code, you might try writing the model setup part in such a way as to keep track of this, e.g. by using SectionLists as sets to keep track of which sections have which density mechanisms (or else use forall if (ismembrane())), and Lists to save objrefs for point processes i.e. in setup instead of

Code: Select all

objref stim, syn
soma stim = new IClamp(0.5)
dend syn = new ExpSyn(0.3)
do

Code: Select all

objref tobj, pplist
pplist = new List()
soma tobj = new IClamp(0.5)
pplist.append(tobj)
dend tobj = new ExpSyn(0.3)
pplist.append(tobj)
objref tobj // destroy reference to most recently created point process
// then to eliminate any particular point process:  objref pplist.o(i)
You can make this more automatic by using a proc, e.g.

Code: Select all

objref pplist, tobj
pplist = new List()

// call in context of a particular section
// $s1 is a string of the form ClassName(range)

proc newpp() {
  sprint($s1, "tobj = new %s", $s1)
  execute($s1)
  pplist.append(tobj)
  objref tobj
}

soma newpp("IClamp(0.5)")
dend newpp("ExpSyn(0.3)")

// verify that it happened
for i=0,pplist.count()-1 print i, pplist.o(i)
adamimos
Posts: 45
Joined: Mon Jan 25, 2010 4:49 pm

Re: Uninserting mechanisms

Post by adamimos »

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

Re: Uninserting mechanisms

Post by ted »

You're welcome.
Post Reply