Page 1 of 1

Connect two neurons using hoc code

Posted: Sat Jun 11, 2011 2:47 am
by sanjaybioe
I have written the code for the geometric and biophysical features of a simple neuron using hoc code.

I would like to have two identical neurons to exist and connect the axon1 of neuron1 to the dend2[1], using an alpha synapse. Neuron1 is being stimulated at the soma using a current pulse. I would like to see the response in the second neuron for the stimulus given to the first neuron by establishing the synaptic connectivity as I said.

Thanks in advance.

Sanjay.

The code is as follows:

load_file("nrngui.hoc")

ndend = 2

create soma1, dend1[ndend], axon1

access soma1


soma1 {
nseg = 50
diam = 100
L = 100
Ra = 123.0
insert hh

}

dend1[0] {

nseg = 25
diam = 2
L = 300
Ra = 100
insert hh

}


dend1[1] {

nseg = 25
diam = 2
L = 300
Ra = 100
insert hh

}

axon1 {

nseg = 25
diam = 5
L = 2000
Ra = 100
insert hh


}


// Connect things together

connect dend1[0](0), soma1(0)

connect dend1[1](0), soma1(0.2)

connect axon1(0), soma1(1)


// create an electrode in the soma

objectvar stim

stim = new IClamp(0.5)

stim.del = 1
stim.dur = 5
stim.amp = 5

tstop = 25



// SECOND IDENTICAL NEURON

ndend = 2

create soma2, dend2[ndend], axon2

// access soma2


soma2 {
nseg = 50
diam = 100
L = 100
Ra = 123.0
insert hh

}

dend2[0] {

nseg = 25
diam = 5
L = 300
Ra = 100
insert hh

}


dend2[1] {

nseg = 25
diam = 2
L = 300
Ra = 100
insert hh

}

axon2 {

nseg = 25
diam = 5.0
L = 2000
Ra = 100
insert hh


}


// Connect things together

connect dend2[0](0), soma2(0)

connect dend2[1](0), soma2(0.2)

connect axon2(0), soma2(1)





// CONNECTION BETWEEN THE TWO NEURONS

// connect axon1(1),dend2[0](1)

// connect soma1(1),dend2[0](1)



run()

Re: Connect two neurons using hoc code

Posted: Sat Jun 11, 2011 9:56 am
by ted
You're off to a good start.

To set up spike triggered synaptic communication, first attach an Exp2Syn to the postsynaptic cell. Set its two time constants to the same value and it will very closely approximate an alpha synapse with the same time constant. Then create a NetCon that monitors the presynaptic cell for spikes and delivers events to the Exp2Syn.

But read about these things first in the Programmer's Reference--
http://www.neuron.yale.edu/neuron/stati ... etcon.html
http://www.neuron.yale.edu/neuron/stati ... ml#Exp2Syn
You might also want to look at chapters 10 and 11 of The NEURON Book, and check out the two network exercises from the 2008 NEURON Summer Course which you will find at
http://www.neuron.yale.edu/neuron/stati ... ndson.html

Comments:

A section that has "tomato can geometry" (diam = L) is electrotonically compact; nseg = 1 is sufficient.

More complex network architectures are best managed by defining cell classes, then creating a sufficient number of instances of each class, and finally connecting them, as illustrated in the examples in
Hines, M.L. and Carnevale, N.T.
Translating network models to parallel hardware in NEURON.
J. Neurosci. Methods 169:425-455, 2008
and
Brette, R., Rudolph, M., Carnevale, T., Hines, M., Beeman, D., Bower, J.M., Diesmann, M., Goodman, P.H., Harris, F.C.J., Zirpe, M., Natschläger, T., Pecevski, D., Ermentrout, B., Djurfeldt, M., Lansner, A., Rochel, O., Vieville, T., Muller, E., Davison, A., El Boustani, S., and Destexhe, A.
Simulation of networks of spiking neurons: a review of tools and strategies.
J. Comput. Neurosci. 23:349-398, 2007.
Preprints of these articles are available from http://www.neuron.yale.edu/neuron/nrnpubs, and source code is available from ModelDB http://senselab.med.yale.edu/modeldb/.

Re: Connect two neurons using hoc code

Posted: Fri Jul 08, 2011 11:24 pm
by sanjaybioe
Hi dear Ted,

Thanks for that help. I have tried what you suggested and was successful. I included the Exp2Syn for the synapse. I used a single line code having NetCon just describing the source. target and synaptic weight. But I could not figure out how to change the time constants in Exp2Syn. I have the following queries as well.

I would like to develop a computational model of recurrent connectivity between two CA3 pyramidal neurons and include the extracellular field characteristics. Thereafter I wish to see how the pair responds to an electrical stimulus. I plan to start with the model developed by Lazarewicz et al (2002) with accession no.20007. What would be the best way to get started?

This model in fact does not have an axon; they have used a morphology from neuromorpho.org. How do I use a morphology from neuromorpho for developing a model, incorporating NEURON hoc code?

Kindly help.

Sanjay.

Re: Connect two neurons using hoc code

Posted: Sat Jul 09, 2011 12:52 am
by ted
sanjaybioe wrote:I could not figure out how to change the time constants in Exp2Syn.
First you need to know what those parameters are called. Have you read the Programmer's Reference about Exp2Syn?
I would like to develop a computational model of recurrent connectivity between two CA3 pyramidal neurons and include the extracellular field characteristics. Thereafter I wish to see how the pair responds to an electrical stimulus. I plan to start with the model developed by Lazarewicz et al (2002) with accession no.20007. What would be the best way to get started?
In brief outline, the steps are:
1. From their model of a single cell, create a template that defines a cell class. Use that cell class definition to create a single instance of the class. Verifify that this single instance works properly.
2. Use NetCons and event-driven synaptic mechanisms such as ExpSyn or Exp2Syn to set up spike-triggered synaptic transmission between the two cell instances. Verify that the network model works properly.
3. Include extracellular field effects. Read
Extracellular stimulation and recording
viewtopic.php?f=28&t=168
If you decide to use the approach exemplified by the code in extracellular_stim_and_rec.zip, you will need to make sure that your two cells are located at the correct positions in space and have the desired orientations relative to the field.

Of these steps, the first and last are the most complex and demand the most from the user. I will be glad to answer specific questions but do not have the time to do them for you.
This model in fact does not have an axon; they have used a morphology from neuromorpho.org. How do I use a morphology from neuromorpho for developing a model, incorporating NEURON hoc code?
Get an swc morphology file from NeuroMorpho.org. Use NEURON's Import3D tool to get the morphology into a CellBuilder (there's a tutorial on NEURON's Documentation page http://www.neuron.yale.edu/neuron/docs that shows how). Then you can either use the CellBuilder to assign biophysical properties to your model cell, or export a hoc file that you can then modify to include biophysical properties. Since morphology has an important role in deterimining the properties of a cell, it is very unlikely that a model created this way will show the same behavior as the model described by Lazarewicz et al.; it will almost certainly be necessary to adjust ion channel densities to even approximate their results.