How to record data from the graph to text file ??

Using the graphical user interface to build and exercise models. Includes customizing the GUI by writing a little bit of hoc or Python
Post Reply
magpie

How to record data from the graph to text file ??

Post by magpie »

I was examining the electrotonic properties, especially "V(measure)/V(inject) ", of a model cell with the Impedance tool and I could see the results in "LogAvsX[0]" window. However, I couldn't find the way to record all results to the text file for further analysis. Is there any way to do so? In addition to this, can I look at the source codes for member functions in Impedance class such as compute(), input(), loc() and so on?

Thanks in advance.
csh
Posts: 52
Joined: Mon Feb 06, 2006 12:45 pm
Location: University College London
Contact:

Re: How to record data from the graph to text file ??

Post by csh »

magpie wrote:I was examining the electrotonic properties, especially "V(measure)/V(inject) ", of a model cell with the Impedance tool and I could see the results in "LogAvsX[0]" window. However, I couldn't find the way to record all results to the text file for further analysis. Is there any way to do so?
A getting-started-tutorial for the Impedance class has recently been posted:
https://www.neuron.yale.edu/phpBB2/viewtopic.php?t=771
There are several options to save results into a text file:
1. If you are using the GUI, you can right-click on a Graph, select "Pick Vector", left-click on the Graph line you are interested in, and then save this into a text file by selecting "Save to File" from the "Vector" entry of the main menu.
2. You can also write some hoc code to save your results. Here is a slight modification of the tutorial's calcZ() procedure:

Code: Select all

proc calcZ() {
  soma zz.loc(WHERE)  // sets origin for impedance calculations
  zz.compute(FREQ, 1) // takes the impedance contributions of
                      // gating state differential equations into account
                      // but requires mechanisms to be compatible with CVODE
  wopen("textfile.txt")
  fprint("x\tdistance(x)\tinput(x)\tinput_phase(x)\ttransfer(x)\ttransfer_phase(x)\tratio(x)\n")
  forall {
    fprint("%s\n",secname())
    for (x) {
      fprint("%g\t%g\t%g\t%g\t%g\t%g\t%g\n", x, distance(x), zz.input(x), zz.input_phase(x), zz.transfer(x), zz.transfer_phase(x), zz.ratio(x))
    }
  }
  wopen()
}
magpie wrote:In addition to this, can I look at the source codes for member functions in Impedance class such as compute(), input(), loc() and so on?
It would probably be most helpful to have a look at the original publication:
Tsai KY, Carnevale NT, Claiborne BJ, Brown TH (1994) Efficient mapping from neuroanatomical to electrotonic space. Network 5:21-46.
To my knowledge, the algorithms are implemented in src/nrniv/Impedanc.cpp
ted
Site Admin
Posts: 6289
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

The electrotonic transformation and the GUI Impedance tools

Post by ted »

Thanks, csh, I couldn't have done that better myself. Here are a couple more articles that
may be of interest:

Carnevale, N.T., Tsai, K.Y., Claiborne, B.J., and Brown, T.H.. The electrotonic
transformation: a tool for relating neuronal form to function. In: Advances in Neural
Information Processing Systems, vol. 7, eds. Tesauro, G., Touretzky, D.S., and Leen, T.K..
MIT Press, Cambridge, MA, 1995, pp. 69-76. Preprint available at
http://www.neuron.yale.edu/neuron/paper ... psfin.html

O'Boyle, M.P., Carnevale, N.T., Claiborne, B.J., and Brown, T.H. A new graphical
approach for visualizing the relationship between anatomical and electrotonic
structure. In: Computational Neuroscience: Trends in Research 1995, edited by
J.M. Bower. San Diego: Academic Press, 1996, p. 423-428. Preprint available at
http://www.neuron.yale.edu/neuron/paper ... s95pre.pdf

A tutorial on the use of the Impedance class's GUI tools
http://www.neuron.yale.edu/neuron/stati ... zclass.htm
magpie

Big help!!

Post by magpie »

Thanks a lot to you...
mattmc88

Re: How to record data from the graph to text file ??

Post by mattmc88 »

Along similar lines as the original question in this posting:

I'm using the GUI, and have generated a plot of V(measure)/V(inject) as a function of distance from the soma, using the LogAvsX impedance tools. So now I have a plot with many (~200) vectors in it.

How do I have save all of the vectors to a text file(s), so I can perform some analysis and plotting with other software (e.g., averaging as a function of distance, averaging and statistics across cells/models, making 3D plots of V(measure)/V(inject) as a function of distance from soma and frequency)?

THANKS!

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

Re: How to record data from the graph to text file ??

Post by ted »

Start with proc calcZ() shown above and add a bit of file i/o code, referring as necessary to the Programmer's Reference for documentation (especially of the File class and its methods).
mattmc88

Re: How to record data from the graph to text file ??

Post by mattmc88 »

There really is no easier way to save the source data for a plot in the NEURON GUI?

I'll see what I can figure out.

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

Re: How to record data from the graph to text file ??

Post by ted »

Short of having somebody else write your code for you, not really.
Post Reply