how to export data from NEURON

Moderator: wwlytton

Post Reply
KG_UIUC
Posts: 6
Joined: Thu Nov 08, 2012 12:45 pm

how to export data from NEURON

Post by KG_UIUC »

My problem is I am new to NEURON and neuroscience. I need your help with two things.

1. I need to know the reference which can explain me what output is generated(membrane potential, spike plot, sodium current) from modelling of a network has a physical meaning.

2. I am able to create a gui for a spinal cord which 2 Right cell and 2 left cells connected through inhibitory and excitatory synapses and receives the stimulus from artifical neuron.

What I want to know, how to go from this stage to export membrane potential data and spike plot data for cells as .dat file

and if I have to increase the number of cells, what should I change in .hoc code which is generated automatically form gui.
ted
Site Admin
Posts: 6300
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: how to export data from NEURON

Post by ted »

KG_UIUC wrote:I need to know the reference which can explain me what output is generated(membrane potential, spike plot, sodium current) from modelling of a network has a physical meaning.
The sentence is broken so I don't understand it. Did you accidentally leave out one or more words? Or maybe you meant to write two shorter sentences? If you need general background information about NEURON, try reading chapters 5 and 6 of The NEURON Book, or read
Hines, M.L. and Carnevale, N.T.
The NEURON simulation environment.
Neural Computation 9:1179-1209, 1997
which is available from links at http://www.neuron.yale.edu/neuron/nrnpubs
how to go from this stage to export membrane potential data and spike plot data for cells as .dat file
See
Exporting data generated by a simulation
viewtopic.php?f=15&t=1222
if I have to increase the number of cells, what should I change in .hoc code which is generated automatically form gui.
In brief, extract the cell class definitions (templates) from that file, then use them with your own hoc statements that create the necessary number of instances of each cell class and connect them with the appropriate network architecture, weights, and delays. This involves significant programming effort. This paper
Hines, M.L. and Carnevale, N.T.
Translating network models to parallel hardware in NEURON.
J. Neurosci. Methods 169:425-455, 2008
(available from a link at http://www.neuron.yale.edu/neuron/nrnpubs, source code available from ModelDB https://senselab.med.yale.edu/modeldb/)
may be helpful, particularly the serial implementations of the ring and random network. The templates used in those were exported from a NetworkBuilder-managed toy model.
KG_UIUC
Posts: 6
Joined: Thu Nov 08, 2012 12:45 pm

Re: how to export data from NEURON

Post by KG_UIUC »

Ted

I have 4 sets of data to be saved i.e four cells in a network for which I want to the v(0.5) for each cell.

after creating the gui of the network

I wrote following in the command window

>forall {
>print secname()
>}

C_Cell[0].soma
C_Cell[1].soma
C_Cell[2].soma
C_Cell[3].soma

%%%% then I wrote a code on command window to save the membrane potential vector from each cell from t=0 to 150;

proc setuprecording() { localobj tobj
iveclist = new List()
forall for x,o {
tobj.record(C_Cell[x].soma.v(0.5))
iveclist.append(tobj)
}
}

%%%% then I called this function
setuprecording()

but it gives me error
bad stack access:expecting(double*);really(double)
nrniv: interpreter stack error
near line 111
setuprecording()
^
Vector[144].record(23.917 )
%%%%%%%%%% and then I did following
>iveclist.count()
0

I really want to get this going..don't know..where I am making a mistake.

______________________________________________________________
Is there any key control to paste the commands or copy the commands
ted
Site Admin
Posts: 6300
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: how to export data from NEURON

Post by ted »

KG_UIUC wrote:Is there any key control to paste the commands or copy the commands
Everything that appears in NEURON's terminal can be copied to the clipboard, whether under MSWin, OS X, or UNIX/Linux. But except for reporting bugs, that has relatively little utility.
then I wrote a code on command window
Direct entry into the interpreter terminal is OK for "one liners" e.g. forall print secname(). For anything more involved, it is best to use a plain text editor and save to a hoc file, which can then be xopened from the interpreter (or opened by a load_file() or xopen() statement in your program's main hoc file).
then I wrote a code on command window to save the membrane potential vector from each cell from t=0 to 150;
What is the "from t=0 to 150" supposed to do?
proc setuprecording() { localobj tobj
iveclist = new List()
forall for x,o {
tobj.record(C_Cell[x].soma.v(0.5))
iveclist.append(tobj)
}
}
1. Your code will be more readable if you use indentation to indicate the level of nesting. The Forum preserves indentation if you select the affected text and then click on the button labeled "Code" (just above the text entry area).
2. "forall for x,o" contains several errors. First and foremost, there is no need to try to iterate over all internal nodes if you merely want to iterate over the midpoint of each C_Cell's soma. forall will do the job.
3. Had iveclist already been declared to be an objref? I guess so, given that iveclist.count() returned a numerical value rather than an error message.
I really want to get this going
Yes, we all have more than enough to do, and too little time.
KG_UIUC
Posts: 6
Joined: Thu Nov 08, 2012 12:45 pm

Re: how to export data from NEURON

Post by KG_UIUC »

Ted

I will elaborate or indent my code

Summary: I have created an oscillator of two neurons which gets stimulus from artificial cell to start.

In all I have 2 cells and 1 artificial cell. Those 2 cells +1 artificial cells have network which has inhibitory synapses, excitatory synapses. Now I want to record the spike data automatically and save it to .dat file.

for which I wrote this procedure file

proc setuprecording() { localobj tobj
iveclist = new Vector() /// iveclist will be the vector which will have spike data
forall for x,o {
tobj.record(C_Cell[x].soma.v(0.5)) //// for all cells which is 2 cells, I want to record the spike data which is essentially the time when the membrane potential has reached threshold
iveclist.append(tobj) /////// this is so that I can concatenate the data of all cells or shall I create new vector for each cell?
}
}
ted
Site Admin
Posts: 6300
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: how to export data from NEURON

Post by ted »

KG_UIUC wrote:I want to record the spike data which is essentially the time when the membrane potential has reached threshold
1. "time when the membrane potential has reached threshold" is not well defined. For example, the squid axon spike mechanism (Hodgkin-Huxley equations) does not have a "threshold." Some investigators like to define "spike time" as the time when the spike reaches its maximum depolarization. The problem with this definition is that you don't know you reached the maximum until after you pass it. A more practical definition of "spike time" is the point in the rising phase of the spike where membrane potential rises above a certain level; many investigators choose a value in the range of -20 to +10 mV.

2. If you want to record spike times, why record the detailed time course of membrane potential? Why not just record the times at which membrane potential rises above whatever level you decide on? Use the NetCon class's record() method to do this (see the Programmer's Reference, and the examples in Translating network models to parallel hardware in NEURON (cited above).
Post Reply