parametrized subsets

Managing anatomically complex model cells with the CellBuilder. Importing morphometric data with NEURON's Import3D tool or Robert Cannon's CVAPP. Where to find detailed morphometric data.
Post Reply
szabolcs
Posts: 8
Joined: Fri Aug 06, 2010 10:37 am

parametrized subsets

Post by szabolcs »

Dear All,

Is there a way to define subsets in the Cell Builder in a parametric way (e.g., include all sections which are less than 300 micrometers away from the soma)? If not, is there a simple way to achieve this using the hoc interpreter, such that the subset definitions are used subsequently by the Cell Builder?

Thank you,

Szabolcs

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

Re: parametrized subsets

Post by ted »

szabolcs wrote:Is there a way to define subsets in the Cell Builder in a parametric way (e.g., include all sections which are less than 300 micrometers away from the soma)?
Not in the CellBuilder itself. With a bit of hoc one could create a SectionList and append to it all sections that satisfy the criterion. However, it would be difficulty to "package" such a SectionList into the CellBuilder in a robust way. An obvious problem is: what should happen to the contents of the SectionList if one were to change the length of any section, as one might easily do if geometry is specified in terms of L and diam?

If your aim is to specify that some biophysical parameter that is present in all sections should be changed in those compartments that satisfy some distance criterion, you could just define an iterator for the all subset, then on the Biophysics page instead of using one of the built-in functional forms for f(p) you enter a call to a hoc function (that you write yourself and define in your source code BEFORE the
load_file("cellbuilder.ses")
statement) that expects distance as its argument and returns the desired value.

For example, suppose all sections contain pas, where g_pas is 1e-5 for compartments that lie within 300 um of the soma, but 1e-4 for compartments that are more distant. On the Subsets page, select the "all" subset, then click on the "Parameterized Domain Page" button, and finally click on "Create a SubsetDomainIterator". The middle panel now displays

Code: Select all

all
   all_x
Specify that the metric is "path length from root" with no translation or normalization.

When you finally get to the Biophysics page, with "Specify Strategy" showing a checkmark and the "all" subset selected, you will click on the "pas" button. Then select all_x and click on g_pas. After setting up the rest of your strategy, click on "Specify Strategy" to clear that checkmark and reveal the field editors for entering the actual parameter values.

In the middle panel, right below all_x, click on g_pas. In the right panel, click on f(p) / New. You'll see a window that contains the message
"Step 1 of 2: Enter parameter names separated by spaces"
below which there is a text entry field that contains

Code: Select all

A0 A k d
Click in this field and replace its contents with

Code: Select all

proxval distval dthresh
, then click Accept.

Now you see a new window with the message
"Step 2 of 2: Enter expression involving p and parameter names"
below which there is a text entry field that contains

Code: Select all

p
. Replace the contents of this field with

Code: Select all

proxval*(p<dthresh) + distval*(p>=dthresh)
Finally, enter the values of proxval (1e-5), distval (1e-4), and dthresh (300) in the numeric fields next to the labeled buttons.

Assuming that you made no mistakes, and the CellBuilder has no bugs (you _have_ been saving this to a ses file after each significant change, right?), you should now be able to click on Continuous Create, then use Model View to examine the spatial distribution of g_pas and confirm that it is correct.

szabolcs
Posts: 8
Joined: Fri Aug 06, 2010 10:37 am

Re: parametrized subsets

Post by szabolcs »

Thank you for the detailed response including the example.

The situation I am facing is slightly different though. I am in the process of building (in fact, mostly porting from GENESIS) a detailed cell model I created earlier, which includes a total of about 15 different biophysical mechanisms in a morphologically reconstructed dendritic tree. Many of these mechanisms are present in only a subset of the dendrites (or present in distinct forms in different parts of the neuron, which is practically the same problem), depending on the distance from the soma (either along the dendrites, or in Cartesian coordinates). Of course, I could include all of these mechanisms everywhere in the cell, and then simply set the density to 0 (the way you describe in your post) everywhere where that particular mechanism is actually absent, but this seems to be a terrible waste of resources (assuming that mechanisms with 0 density still get simulated).

Is there a better way to solve the problem?

Thanks,

Szabolcs

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

Re: parametrized subsets

Post by ted »

szabolcs wrote:I could include all of these mechanisms everywhere in the cell, and then simply set the density to 0
but the ODEs would still exist in each compartment, increasing computational overhead while yielding no benefit.

Instead, just do this:

1. Use the CellBuilder to specify just the geometry of the cell, and to define just those subsets that are most easily defined with the CellBuilder. Save this CellBuilder to a .ses file in case you ever need it again in the future. Also, from this CellBuilder export a hoc file called basic_cell.hoc

2. Create a text (plain ASCII) file called init.hoc that contains the following statements:
load_file("nrngui.hoc")
load_file("basic_cell.hoc")
load_file("define_subsets.hoc")

3. Create a text file called define_subsets.hoc, and in that file include hoc statements that define the subsets that you were unable to define with the CellBuilder. For example, to include all sections that contain points that are within a particular distance dmax of soma(0), you could do this:
objref psl
psl = new SectionList()
soma distance() // soma(0) is origin for path distances
forall if (distance(0) < 300) psl.append()
This assumes, of course, that the topology has been constructed by connect statements that attach the 0 end of each child section to the 1 end of its parent (with the exception of soma, whose 0 end, or internal locations such as 0.5, may also be used as attachment points for the 0 ends of one or more child sections).

Then you will have to manage the algorithmic distribution of channel densities yourself. For example,
forsec psl insert pas
will insert pas into all sections in the psl SectionList, and
soma distance()
forsec psl for (x,0) g_pas(x) = gpasfunc(distance(x))
will assign values to g_pas in each compartment according to function gpasfunc() of path distance from soma(0). It's up to you to fill in the body of

Code: Select all

func gpasfunc() { local tmp
  tmp = code involving $1 that generates a numerical value
  return tmp
}

Post Reply