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
Obtaining Voltage Spike Data
-
- Site Admin
- Posts: 6385
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: Obtaining Voltage Spike Data
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:
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.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.
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
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()
}
Re: Obtaining Voltage Spike Data
Great! Thank you Ted for your help. I added a new record section within my code, and it works as intended.
Js Lee
Js Lee