Tutorial 2 Averaging tracesWe have recorded frames from the microelectrode with high gain amplification (ME high) as trace 0 and also recorded frames from the electrode placed on the dorsum of the spinal cord (Cord Dorsum) as trace 1. The trace collection was triggered by the what was defined as the trigger channel input in the Capture program. Fig 2.1 shows an example of each of these traces: ME high trace on the top the and the cord dorsum on the bottom.

Fig 2.1

t02_averaging_traces.gif

You can see the calibration pulse at the beginning of the top frame close to the 20 ms mark. During the time while this frame was taken, 80 ms, there were 3 stimulation events. As you can read it from the descriptor of the run file, the first stimulation was delivered to the Sart nerve, the second to the TA nerve and the third is to the EDL nerve. The responses to these stimulations recorded via the microelectrode can be seen onthe top trace, and the responses recorded via the cord dorsum electrode can be seen on the bottom trace. The most obvious response is elicited by the stimulation of the EDL nerve, the third stimulus. On the cord dorsum recording you see 2 larger peaks corresponding to the artifact evoked by the second and third stimulators but it is really hard to distinguish the occurrence of the Sart simulation.

In Tutorial 1 we dealt with how to display the traces (vertically). Now we will show how to display traces horizontally and how to perform averaging of selected frames. There are different types of traces averages, for example spike-triggered or averages based on the step-cycle. In this tutorial, we will talk about the averaging of selected traces and in subsequent tutorials you will find exercises about special trace averaging, such as spike triggered or cycle-based averaging.

 

2.1 Take a closer look at the traces

In our experiment we were interested in the post-synaptic potentials (PSPs) evoked in the motoneurons after peripheral nerve stimulations. In some cases there were not only PSPs evoked but the cell fired (action potential was evoked) due to the stimulus. The traces with the action potentials will contaminate our traces and make out PSP measurements faulty. Therefore, the traces with the action potential are undesired in the analysis and we have to flag them so they will not be included in the averaging. In order to find which traces are the undesired ones we need to us the Frmsel program. This program allows you to display any frame in the collected run.

Open c08-01 file in analysis (a c08-01) and set the range of display from 0 to max (s,r,s:0<CR>e:max<CR>,Esc). Start the Frmsel program by selecting Maintenance from the Top Menu of the Analysis program and then choose the Select-frame option. “m,s

You will see a page with text displayed on it. The display tells you about the run file, the sampling rate, the length of the run, the number of frames collected in the run and the window, the delay and the average trigger period. There is also a list of the collected traces in the run file. (Note that if you wanted to change the file you are working on using the File option in the menu of the Frmsel program you could just enter a new file name.)

From the display you can tell that there were two traces collected in each frame: ME high (trace 0) and Cord Dorsum (trace 1). To select which one you want to analyze select the Trace option in the menu of the Frmsel program. Then enter 0 in order to work with the intracellular recordings and not the cord dorsum recordings.”t:0"

Next select Rows-cols-scale from the menu and set these values to specify the way you want to display the traces. For the rows enter 10 to have 10 rows across the screen when displaying traces. For the number of columns enter 3 in order to have three columns of 10 traces displayed. The magnification is 0 by default and that means autoscaling of every trace individually (the program determines the best factor for each frame and shows the factors used for each magnification). Here, instead of 0, enter 3 for magnification. (Note that the number to use will depend on the range of your data points and your preference so you may use different numbers with other data sets and sometimes you will have to do trial-and-error to select the most appropriate magnification.)Then select Display from the menu and then type “all” to view all the collected frames. Then you will be prompted whether to include the “deleted” frames. By default this is set to yes. This can be important, for example when someone else other than you has flagged frames. To see all the collected traces you should answer yes. Then you will see a screen like Fig 2.2 showing traces from 1 to 20 in 2 columns and 10 rows. The keystrokes to get to this screen were the followings: ”r:10<CR>2<CR>3<CR>d,all,<CR>Y

On the bottom of the screen, you see the code for what you can do on this screen. You may use the keyboard characters or your mouse. Because you entered “all” you will go through all the collected traces in the run when you hit D (done). (Note that you can just type two numbers to display a selected range of traces (eg. “191-405”) and the program will display only those traces included in that range.

 

 

Fig 2.2

t02_averaging_traces1.gif

 

2.2 Flag unwanted tracesIf you take the mouse and left click on a trace you will see a line crossing it out as shown in Fig 2.3 where there is a display of frames from 41 to 60 and trace 56, 58 and 60 is crossed.

The crossed traces are flagged and they will not be included in the averaging. After crossing out all the undesired traces -the ones with a spike in them- on one page you should right click the mouse or hit letter D and view the next page. Do this until you go through all the pages. If you crossed a trace by mistake and you want it undone, you can just click on it again and that should undo the crossing out. There is no way to go back a page if you missed something, you must start from the beginning again. If you wish to quit the viewing and flagging before you get to the end of the list, you can middle click with the mouse and that returns you to the main menu of Frmsel discarding any changes you made to the traces displayed on the current page but not to those displayed on the previous page (this is important to keep in mind if you terminate before you are done).

There is another way to undo the flagging of frames. You may use the undelete option from the main menu, but you have to specify which flags to undo. You can read about this option in more detail on the Frmsel page.Fig 2.3

t02_averaging_traces2.gif

2.3 Change X range of traces (written by Simon Gosgnach)

             To adjust the traces you have collected during an experiment, you may have to change the scaling. The X display of traces cannot be changed in analysis. Any trace averages that are saved to disk can be viewed with the qm program where it is possible to change the X size of traces for viewing. Traces can be trimmed shorter by creating a new run file using the Trimfrms program (see other programs).

            Before changing the X range of a trace you should determine the amount (in ms) that you want to remove from the start and from the end of the trace. Next quit the analysis program and type trimfrms “sourcename” “destinationname”--trimfrms c08-01 08-01trm. The source file is not removed but an additional file (08-01trm) is created. You will then be asked a series of questions: Trim how much from the start? Trim how much from the end? Enter the number of ms which you had previously determined. Enter 10 ms to trim from start and 10 ms from the end. You will then be presented with a summary of what the computer is about to do. If you are satisfied with this type y for yes.

A new file containing all of the data from the original source file except for the new trimmed frames is created. To look at this file and to further analyse it you should open the analysis program: a 08-01trm. After viewing the raw waveforms (A,R,G) display the traces by S,D,W,M: Y in order to see the new trimmed frames. You can also take a closer look at the traces, by using the Frmsel program as described in the above section(“Esc, M,S,R:10, 3, 3, D:all, Y”).

2.4 Setting the Y scale of traces (written by Simon Gosgnach)

At present there is no way to turn off autoscaling on the display of individual frames (i.e. traces) of data when setting parameters visually. This can be a problem for example when looking at spikes in data frames and trying to set the window discriminator. (You can turn off autoscaling when using the "frame select" program (as stand alone or under Maintenance)).

 The Y range of the trace can be set in the analysis program. First disable the autoscale function as described previously: “S,D,S,A: N”. Then set the Y scale manually by selecting Set/Display/ Scaling/Y-scale/Traces and set the upper and lower bounds to the desired values.S,D,S,Y,T”.2.5 Perform trace averaging

After selecting the period from 44 to 94 s–which we want to analyze by using the commands as described in Tutorial 1 “S,R,S:44s,E:94s,Esc,G” and checking the traces you can perform trace averaging and get a result as shown in Fig 2.5. Go to the Main Menu of Analysis. Then select Analysis/ Trace-average/Frame-list/Go. “A, T, F, G”

Fig 2.5

t02_averaging_traces3.gif

You should see a display like Fig 2.5. In the upper left hand corner of the trace average you will read that there is a total of 207 frames in this average. The range you set for the analysis showed that the individual traces from 191 to 405 are included in that period (44-94s). Note that the deleted (flagged) traces are not in the total number of traces that have been averaged.

Looking at the trace average, you can see that in the motoneuron there are EPSPs with different latencies elicited by the EDL stimulation. The rising potential has an inflection point-a small “hump” followed by a larger peak. The first “hump” represents the monosynaptic EPSPs. The “hump” along with the second peak shows that there were also disynaptic EPSPs elicited by the stimulation. We will further analyze the different latency EPSPs in the upcoming tutorials.

 

2.6 Save and print

            If you wish to save the result of the trace average, you can select Plot from the Main Menu of the Analysis program and then select File. Then you should enter the filename for the saved data—that could be “traceavg_1.plt” for example.

            If you wish to print out the trace average—or the results of any other analysis you have performed, select the Plot option from the Main Menu and then select Plotter ”P,P”. This will direct the results of your analysis to the default printer of your machine.

            You may also want to save the trace average as a new run file, for later analysis or viewing with another program, such as the Quick Measure program covered in a later tutorial. You can save the trace average as a run file using the Bins-save option from the main menu.

 

2.6 Viewing all the frames that are part of the average

You have an option to see all the traces that are included in the average. This option can be used to double-check whether you have flagged all the undesired traces. This is also useful if you want to display the individual traces in the raster program for the purpose of making a figure showing individual traces. From the Top Menu, select Set, Average, Preview and enable it with Yes. “Esc, S, A, P: Y, Esc, G.”

Keep pressing Y until you get to the end where you should see the average trace. Then if you Bin-save this file, you will be able to open it in raster. From the Main Menu of Analysis, select Bin-save and enter a filename. “B,”tavg_1”. You will learn about the Raster program later where you will use the tavg_1 file you have just created.

 

After you have looked at the individual traces included in the average disable the trace viewing option by doing “S, A, P:No, Esc, G”.

 

2.7 Displaying standard deviation

            You can display the standard deviation of any averaged data, like the above performed trace averaging as shown in Fig 2.6. From the Top Menu of Analysis select Set, Display-options, Toggle, St-deviation and enable it with Yes. Then press Esc and do an ATF again (or simply just press G for Go and the program will re-do the ATF). The two dashed lines above and below the solid line are the values of the standard deviation. “Esc, S, D, T, S: yes, <CR>,Esc, (A, T, F), G

After you have seen the standard deviation, disable the display option by using the following keystokes: “Esc, S, D, T, S: N, Esc, (A, T, F), G”.