Obtaining Voltage Spike Data

Using the graphical user interface to build and exercise models. Includes customizing the GUI by writing a little bit of hoc.
Post Reply
Js Lee
Posts: 4
Joined: Fri Jun 15, 2012 12:59 pm

Obtaining Voltage Spike Data

Post by Js Lee » Thu Jul 12, 2012 9:59 am

Hello,

I am currently running my simulations through a desktop computer; however, the time it takes to plot these graphs through the GUI in NEURON is taking forever. Hence, I am trying to run the simulations through a High-Performance Computing Cluster (HPCC) at my college. Is there a way to export the voltage spike data in NEURON to a file so that I can plot the data separately through Python?

Thank you,
Js Lee

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

Re: Obtaining Voltage Spike Data

Post by ted » Thu Jul 12, 2012 11:37 am

If you want the complete time course of membrane potential, use the Vector class's record() method to capture membrane potential at a particular location to a Vector. Example:

Code: Select all

// these statements only need to be executed once
// a good time to do this would be immediately after the model specification code
// i.e. the statements that set up the topology, geometry, and biophysics of the model
objref vvec, tvec
tvec = new Vector()
tvec.record(&t) // record time
vvec = new Vector()
axon vvec.record(&v(1)) // record v at 1 end of axon
If you only need spike times, the best thing to do is to use the NetCon class's record() method to capture spike times to a Vector. For an example, see the Programmer's Reference documentation of the NetCon class; as with Vector recording, this only has to be done once in a program, and an appropriate place for these statements would be right after the model specification has been executed.

In either case, after a simulation you just write the contents of the Vector to a file (see documentation of the Vector and File classes). If you're going to { run, then save results } many times, you might want to create your own procedure to automate this task, e.g.

Code: Select all

proc myrun() {
  run() // launches a simulation
  saveresults()
}
run() is part of NEURON's standard run system. saveresults() is your own procedure that you wrote to open a file, write results to it, and close the file and can be as fancy as you like--most convenient would be if it automatically creates a different file name each time it is called.

Js Lee
Posts: 4
Joined: Fri Jun 15, 2012 12:59 pm

Re: Obtaining Voltage Spike Data

Post by Js Lee » Thu Jul 12, 2012 2:24 pm

Great! Thank you Ted for your help. I added a new record section within my code, and it works as intended.

Js Lee

Post Reply