Page 1 of 1

spines

Posted: Wed Apr 23, 2008 4:16 pm
by jlaville
I want to make a two compartment model of a spine and then connect it to diferent locations on an already created cell. However, to simulate real spine density, I don't want to connect the spines only at the 1 end of the parent section but at diferent segments of that section.
I know that this question is answered somewhere but I'm not able to find it.

March a spine over a cell and do something at each location

Posted: Wed Apr 23, 2008 4:51 pm
by ted
Use connect, disconnect(), a SectionList, and forsec to march the model spine along
each internal node of the model cell (except for the nodes that belong to the spine), and
do something at each node. Please be sure to see the Programmer's Reference for
documentation of these.

Example:

Code: Select all

// specify model cell properties

create dend
access dend
nseg = 5

// set up SectionList that contains all sections that are of interest

objref sl
sl = new SectionList()
forall sl.append()

/*
// verify contents of sl
forsec sl print secname()
*/

// specify spine properties

create neck, head
connect head(0), neck(1)

// simulation control

proc dosomething() {
  print "spine is connected to ", secname(), " ", x
  // could have been run() followed by call to a data analysis/storage/display procedure
}

// march spine over each internal node of cell
// and do something at each point

proc walk() {
/*
  // verify that we can walk over the internal nodes of all sections in sl
  forall for (x, 0) print secname(), " ", x
*/
  forsec sl for (x, 0) {
    connect neck (0), x
    dosomething()
    neck disconnect() // avoids notice that neck(0) had previously been
                      // connected to something else
  }
}

walk()
The output produced by this program is

Code: Select all

spine is connected to dend 0.1 
spine is connected to dend 0.3 
spine is connected to dend 0.5 
spine is connected to dend 0.7 
spine is connected to dend 0.9

Posted: Fri Apr 25, 2008 12:47 pm
by jlaville
I have tried the code and works fine. It is what I needed.