Question about saving current data

The basics of how to develop, test, and use models.
Post Reply
Meena
Posts: 31
Joined: Mon Jan 09, 2006 3:50 pm
Contact:

Question about saving current data

Post by Meena »

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
Raj
Posts: 220
Joined: Thu Jun 09, 2005 1:09 pm
Location: Groningen, The Netherlands
Contact:

Post by Raj »

Where is your run() command?

General structure should be something like this (in pseudo code):

Code: Select all

myVector.record

run()

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

Post by ted »

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
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().
and this bit of example code:

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()
Comment: the init() is superfluous with any recent version of NEURON.
Meena
Posts: 31
Joined: Mon Jan 09, 2006 3:50 pm
Contact:

Post by Meena »

Thanks for the pointer Ted & Raj,

It works fine now and I managed to save the data that I was infact hoping to save!
Post Reply