Split a Section

The basics of how to develop, test, and use models.
Post Reply
guyeyal
Posts: 2
Joined: Thu Feb 27, 2014 10:41 am

Split a Section

Post by guyeyal »

Hi
It seems pretty simple question but I didn't find an answer.
I have a model based on a morphology - where each branch is represented with a section.
I'm trying to split branches into 2 (or more) sections dynamically during the program. The aim is to give different rules to each of them (For example different mechanisms densities).

It's pretty simple if I have a basic morphology (axon of few sections) and I want just to add another section in the middle: by creating a new section and then disconnect the parent from the child and re connect with the new one (while changing the length of the old sections).
But how can I do it during the run (couple of times)? as every time i call create it destroys the previously declared new sections.

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

Re: Split a Section

Post by ted »

guyeyal wrote:I'm trying to split branches into 2 (or more) sections dynamically during the program. The aim is to give different rules to each of them (For example different mechanisms densities).
Suggest instead that you do one of the following.

1. During model setup assign nseg > 1 to the section that you want to "split". The limitations are that
--all pieces of that section will have the same length
--only RANGE variables can have different values in each segment, so if some parameter that you want to change happens to be GLOBALs, you'll have to revise its NMODL file to declare it to be a RANGE variable
--this won't work for cytoplasmic resistivity Ra. Ra will have the same value along the entire length of the section

2. Revise the model setup code so that the neurite you want to split is specified as the number of sections that you want. This gives you complete control over the length of each section, and Ra can have different values in each section.
guyeyal
Posts: 2
Joined: Thu Feb 27, 2014 10:41 am

Re: Split a Section

Post by guyeyal »

Hi Ted
Thanks for the answer!

I should have been clearer - I hope not only to use different densities, but also to divide the same section to different sectionlists (for displaying and analysis) according to some rules (Let say the attenuation from the soma) -
If section at x had larger attenuation than some threshold and in y had smaller, i wish to split it to two: A section that will include all Xs and another that will have all Ys (Of course we can assume that these are different groups and Ys come only after the last x).

I do use large nseg value but again it won't help me for that.
regarding the 2nd suggestion - How canI import a morphology (with import3d) such that a branch will be divided to more than 1 section?
That will achieve better results than my current code, although I'd be happy if I could do it dynamically according to the simulation results.

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

Re: Split a Section

Post by ted »

Either edit the original morphometric data file, with whatever tools are available for that purpose, or export from Import3d to a CellBuilder, then export from that CellBuilder to a hoc file, then edit the hoc file. Find the block of pt3dadd statements for the section you want to break up. For example, suppose it looks like this

Code: Select all

  apic[11] {pt3dclear()
        pt3dadd(-138.001, 91.89, 1.25, 1.72)
        pt3dadd(-141.525, 91.251, -11.75, 1.72)
        pt3dadd(-145.475, 88.272, -6.25, 1.72)
        pt3dadd(-147.138, 88.059, -10, 1.72)
  }
and you want to break it into two pieces. Change this to

Code: Select all

/*
  apic[11] {pt3dclear()
        pt3dadd(-138.001, 91.89, 1.25, 1.72)
        pt3dadd(-141.525, 91.251, -11.75, 1.72)
        pt3dadd(-145.475, 88.272, -6.25, 1.72)
        pt3dadd(-147.138, 88.059, -10, 1.72)
  }
*/
  apic[11] {pt3dclear()
        pt3dadd(-138.001, 91.89, 1.25, 1.72)
        pt3dadd(-141.525, 91.251, -11.75, 1.72)
  }
  apic11_2 {pt3dclear()
        pt3dadd(-145.475, 88.272, -6.25, 1.72)
        pt3dadd(-147.138, 88.059, -10, 1.72)
  }
I'm calling the new section apic11_2, which isn't a really good naming strategy because it doesn't scale well, but at least it will probably work because (1) it's reasonably mnemonic, and (2) there probably isn't already a section called apic11_2.
Of course you also have to add these two statements
create apic11_2
apic11_2(0), apic[11](1)
in the top of the file near the other create and connect statements.
Finally, you'll have to find every statement that tries to connect a child section to apic[11](1) and make it connect to apic11_2(1) instead.
Post Reply