Hi,
I am trying to save the sodium current at the soma in my model in an .asc file.
This current would be called soma.i_na(0.5)
When I try getting the current profile in Neuron's "current" graph, I have no problem, I see a very small negative ( inward current) on my screen, this is what I expect to see as well.
But when I try saving this data using a vector into a .asc file, and replotting it using Microsoft Excel, I get a completely different profile.
I feel that I am making no error when I save this current, and yet, I cannot undertstand why I don't see the right profile.
Here's how I saved it and printed it onto a file:
objref recina
recina = new Vector()
recina.record(&soma.i_na(0.5))
objref savcurrent
savcurrent = new File()
savcurrent.wopen("current_soma.asc")
objref current_matrix
current_matrix = new Matrix()
savcurrent.wopen("current_soma.asc")
savcurrent.printf(" Time I_Na\n")
current_matrix.resize(rect.size(),2)
current_matrix.setcol(0, rect)
current_matrix.setcol(1, recina)
current_matrix.fprint(savcurrent, " %g")
savcurrent.close()
Can you please as advise as to what maybe going wrong ?
Am I missing something?
Thanks,
Meena
Question about saving current data
Where is your run() command?
General structure should be something like this (in pseudo code):
General structure should be something like this (in pseudo code):
Code: Select all
myVector.record
run()
myVector.save
-
- Site Admin
- Posts: 6393
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Quite to the point, Raj. To underscore and explain this, see the documentation of the
Vector class's record() method
http://www.neuron.yale.edu/neuron/stati ... tml#record
where you will find the following
Comment: the init() is superfluous with any recent version of NEURON.
Vector class's record() method
http://www.neuron.yale.edu/neuron/stati ... tml#record
where you will find the following
and this bit of example code:Save the stream of values of "var" during a simulation into the vdest vector. Previous record and play specifications of this Vector (if any) are destroyed.
Details: Transfers take place on exit from finitialize() and on exit from fadvance().
Code: Select all
objref dv
dv = new Vector()
dv.record(&terminal.v(.5))
init() // or push the "Init and Run" button on the control panel
run()