Modeling a demyelinated axon

The basics of how to develop, test, and use models.
dsengupta
Posts: 15
Joined: Tue Jul 10, 2012 4:23 pm

Re: Modeling a demyelinated axon

Post by dsengupta »

here is the original code:

Code: Select all

load_file("nrngui.hoc")

create node[1], myelin[1]
objref nodes, myelins

// topol(nnode) connects an alternating sequence of node/myelin pairs.

proc topol() {local i
	nnode = $1
	create node[nnode], myelin[nnode-1]
	nodes = new SectionList()
	myelins = new SectionList()
	forsec "node" nodes.append
	forsec "myelin" myelins.append
	access node[0]
	for i=0, nnode-2 {
		connect myelin[i](0), node[i](1)
		connect node[i+1](0), myelin[i](1)
	}

	forsec myelins { nseg = 10 }
}

proc geom() {
	forsec nodes { // area = 100 um2
		L = 3.183
		diam = 10
	}
	forsec myelins {
		L = $1
		diam = 10
	}
}

proc biophys() {local fac
	// ohm/cm must be converted to ohm-cm by multiplying by
	// cross sectional area
	fac = PI*diam^2/4 * 1e-8
	forall {
		Ra = 100
	}
	// paper relative to rest=0 but following values relative to -65
	forsec nodes {
		insert hh
		gnabar_hh = 1.2
		gkbar_hh = .36
		gl_hh = .003
		ena = 115 - 65
		ek = -12 - 65
		cm = 1 // uF/cm2
	}
	forsec myelins {
		insert pas
		e_pas = -65
		g_pas = 1.5e-6 // S/cm2
		cm = 0.005 // uF/cm2
	}
	celsius = 18.5
}
 
 
proc make() {
	topol($1)
	geom($2)
	biophys()
}

make(21, 2000) // appropriate down to 25um internode length
Here is my modified code:

Code: Select all

load_file("nrngui.hoc")

create node[1], myelin[1], demyel[1]
objref nodes, myelins, demyels


// topol(nnode) connects an alternating sequence of node/myelin pairs.

proc topol() {local i
	nnode = $1
	create node[2*nnode+1], myelin[nnode], demyel[nnode] 
	nodes = new SectionList()
	myelins = new SectionList()
	demyels = new SectionList()
	forsec "nodes" nodes.append
	forsec "myelin" myelins.append
	forsec "demyel" demyels.append
	access node[0]
	for i=0, 9 {
		connect myelin[i](0), node[i](1)
		connect node[i+1](0), myelin[i](1)
	}
	for i=10, 19 {
		connect demyel[i-10](0), node[i](1)
		connect node[i+1](0), demyel[i-10](1)
	} 
		

	
	forsec myelins { nseg = 10 }
	forsec demyels { nseg = 10 }
}

proc geom() {
	forsec nodes { // area = 100 um2
		L = 3.183
		diam = 10
	}
	forsec myelins {
		L = $1
		diam = 10
	}
	forsec demyels{
		L = $1
		diam = 10
	}
}

proc biophys() {local fac
	// ohm/cm must be converted to ohm-cm by multiplying by
	// cross sectional area
	fac = PI*diam^2/4 * 1e-8
	forall {
		Ra = 100
	}
	// paper relative to rest=0 but following values relative to -65
	forsec nodes {
		insert hh
		gnabar_hh = 1.2
		gkbar_hh = .36
		gl_hh = .003
		ena = 115 - 65
		ek = -12 - 65
		cm = 1 // uF/cm2
	}
	forsec myelins {
		insert pas
		e_pas = -65
		g_pas = 1.5e-6 // S/cm2
		cm = 0.005 // uF/cm2
	}
	forsec demyels {
		insert pas
		e_pas = -65
		g_pas = 1.5e-6 // S/cm2
		cm = 0.005 // uF/cm2
	}
	celsius = 18.5
}
 
proc make() {
	topol($1)
	geom($2)
	biophys()
}
make(10, 2000) // appropriate down to 25um internode length
I think I have fixed the error problem in the secod code. That's not giving any trouble when highlighting the shape plot line to get the space plot.

From my understanding, with the current parameters set in the second code, I should get the same results when I graph both codes on the space plot because the first code is one loop, and for the second code I have broken that same one loop into two loops. I hae a nice continuous action potentil for the first code. However, when I graph the second code on the space plot I get a graph that looks like the stimulis has died out in the first myelin compartment, and that also, after I set a much greater current in the IClamp than for the first model. I can't seem to figure out the problem.

I suspect the problem to be here somewhere but I cant pinpoint it:

Code: Select all

proc topol() {local i
	nnode = $1
	create node[2*nnode+1], myelin[nnode], demyel[nnode] 
	nodes = new SectionList()
	myelins = new SectionList()
	demyels = new SectionList()
	forsec "nodes" nodes.append
	forsec "myelin" myelins.append
	forsec "demyel" demyels.append
	access node[0]

Do you think maybe I should be viewing the results of my code with a different kind of graph? By the end, what i think should happend is that when I change the capacitance of demyelin section, I should see a solid action potential through half of the axon modeled and see failure for the second half.

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

Re: Modeling a demyelinated axon

Post by ted »

The first program in your most recent post seems to be correct, i.e. it creates a model axon that has 21 nodes and 20 internodes, and the model conducts a spike.

The second program contains an error that makes it create a model axon that is entirely passive. This is because of an error in the statement that tries to append sections to the the nodes SectionList, with the result that this sectionlist is empty. If you fix that, the model will work.

A couple of suggestions:

In the revised program, the parameter that proc topol() receives specifies the number of myelinated (and demyelinated) sections, not the number of nodes. For the sake of clarity (and to facilitate future code development and debugging), nnode should be called nmyel.

The revised proc topol()'s two for loops contain magic numbers, which I highlight here:
for i=0, 9
and
for i=10, 19 {
connect demyel[i-10](0), node(1)
connect demyel[i-10](0), node(1)
connect node[i+1](0), demyel[i-10](1)
This ensures that the program will fail if the first argument to proc make() (or the argument to proc topol()) is anything other than 20; the fix is not difficult, and should be done.
dsengupta
Posts: 15
Joined: Tue Jul 10, 2012 4:23 pm

Re: Modeling a demyelinated axon

Post by dsengupta »

I think I finally got it to work the way I want it to! Thank you so much for all yur help. I feel like I learned a lot!

Just on a side note. If you build a cell on CellBuilder, is there a way to retrieve the hoc code for that model?

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

Re: Modeling a demyelinated axon

Post by ted »

dsengupta wrote:I think I finally got it to work the way I want it to! Thank you so much for all yur help. I feel like I learned a lot!
Glad to be of help.
If you build a cell on CellBuilder, is there a way to retrieve the hoc code for that model?
Every "page" of the CellBuilder has a "Hints" button, although on some pages it may be necessary to drag the bottom edge of the CellBuilder down to reveal the button. See what the Management page's Hints button tells you.
Post Reply