Original Document "scrc guide.wpd"
from B. Fedirchuk; June 9, 1998
THE UNIVERSITY OF MANITOBA SPINAL CORD RESEARCH CENTRE
Department of Physiology Neuroscience Research Program
USER'S GUIDE TO
SCRC DATA CAPTURE
AND ANALYSIS SOFTWARE
Historical:
The SCRC software is a collection of programs that have been designed for the
acquisition
and analysis of electrophysiological data. Originally, analogue to digital (A/D)
conversion rates
were rather limited on most hardware platforms, so SCRC software was developed for
a
Masscomp computer using a UNIX operating environment. The A/D conversion rate of
that
system has recently been equaled (and surpassed) by inexpensive PC based systems,
so the
SCRC software has been ported to the Linux and QNX operating environments running
on the
IBM based PC. This means that a PC with an appropriate A/D card, operating under
QNX, can
be used to digitize data at very high sampling rates and the data can be subsequently
analysed either on that same PC or another PC configured to run Linux.
Terminology applied to Digitized Data:
Data that has been digitized can be from different signals attached to different channels
of the
computer's A/D converter, and as mentioned above, data can be digitized either
continuously
or discontinously. While CALIBRATE does allow us to add meaningful names to the
signals as
they are digitized, those names are often only meaningful for that particular experiment.
In a
different experiment a different signal may be digitized and analysed in very similar
ways, so
the analysis software must use terminology that is independent of the specific signal
attached
to the A/D converter. It is crucial that one understands the
terminology which is used
throughout the SCRC software to accurately discuss different portions of the digitized
data and to understand the analysis procedures.
Continuous Digitization:
Within CAPTURE, one can choose to digitize signals on selected A/D channels
continuously
(at a sampling rate of their choice), which will continue either for the length of time that
the
experimentor has entered as the "run length" or until they manually stop the capture by
pressing "q". The data digitized in this way is called a "waveform". A separate waveform is
made for each A/D channel that has been digitized. If you had entered a name for the
signal
attached to the A/D board, that name will be added to each waveform. All the
waveforms that
are digitized at one time are saved together as a "run". The name of the run file is set by the
experimentor in CAPTURE, and unless changed, the next captured run will be
automatically
incremented by 1. A number is added to the end of the filename if it wasn't there
already.
This run of data is subsequently loaded into other programs specialized for analysing the data by calling it by it's "filename" (you don't need to type the ".frm"). Within the .frm file, all the information about how many waveform files there should be, the length of the run etc, is stored. The .frm therefore has vital information pertaining to the waveform files (.w00, .w01, .w02), so all these files should be treated as a package. DON'T DELETE A WAVEFORM FILE IN AN ATTEMPT TO DELETE WAVEFORMS THAT ARE UN-NECESSARY. That should be done using the ANALYSIS program (it will update the .frm file). Also, DON'T DELETE THE .FRM FILE AND EXPECT TO BE ABLE TO SEE THE WAVEFORMS. THE .FRM FILE CONTAINS INFORMATION THAT IS ESSENTIAL FOR DECODING THE WAVEFORM FILES.
At the end of the digitization for that run, you will be prompted to enter a "run descriptor". This gives you the opportunity to add a one line description of that digitized data which will automatically be saved as a file named "filename.txt". You can edit the filename.txt file using any text editor (e.g.'s: PICO, EMACS or VI) anytime later. Or, if a descriptor was not entered after the digitization (then CAPTURE would not have created the "filename".txt file), you may create a text file using an editor and save it as "filename".txt. Anytime the run file is loaded by a SCRC software, it searches the current directory for an appropriate .txt file which will also be loaded.
Discontinuous Digitization:
Analogue signals can be digitized either as a waveform (i.e. continuously, see above),
or as a
"trace", where the signal is digitized in
bursts that are discontinuous, triggered by some signal
that you supply to the A/D board, and are of a user defined duration. (Sometimes data
digitized as a trace is also called a "sweep" in slang since it is analogous to
one sweep of an
oscilloscope.) The main advantage of capturing data as a trace is that if the
phenomenon of
interest is associated with a specific time period (e.g. following a stimulus pulse), then
you can
successively digitize those areas of interest at a high sampling frequency without
digitizing the
signal in time periods in between (when nothing interesting is happening). This saves a
considerable amount of hard disk space and makes all the data files smaller and more
managable. Also, trace aquisition can be paused during capture while digitization of
waveforms continues.
The CAPTURE program allows the experimentor to select some A/D channels as waveforms and others as traces, giving you the flexibility to create capture paradigms that have high sampling rates of discontinous sampling for some channels, yet permitting continuous digitization of other channels (or even the same channel) often to look at slower events with a lower sampling frequency.
Since more than one signal can be
digitized discontinuously, each trigger pulse may initiate the
digitization of several traces. As depicted, all the traces that are triggered from an
individual
trigger pulse are collectively called a "frame". Therefore, a run can consist both of several
waveforms and traces (separated into frames).
SUMMARY OF FILE TYPES PRODUCED BY SCRC SOFTWARE:
Files created by
CAPTURE:
"filename".frm -frm files are also called "runfiles", and contain any data digitized as
traces as
well as information used to decode the digitized data (both for traces and waveforms)
therefore, deleting of waveforms should be done from within the ANALYSIS
program.
"filename".txt -contains a one line text descriptor of that runfile. If one wasn't typed in after that particular capture, the .txt file will not exist but can be created later either within ANALYSIS or using a text editor.
"filename".frd -If you are capturing frames and have "sweeps to pause" set or you
press
"space" during a capture to pause the acquisition of frames, you are prompted for a run
descriptor for the last group of frames that were captured. These descriptions will be
saved in
the "filename.frd" file (for frame
descriptor)
Files created by ANALYSIS:
In addition to the files created when the data was digitized, the ANALYSIS program also creates files to save parameters that are set during various analysis procedures.
"filename".prm -contains analysis parameters saved either from within or upon exiting ANALYSIS.
"filename".p?? -contains waveform parameter information. For example, if you set a voltage level for spike detection or define step cycles, those parameters are not added into the .w?? file (that file is only for original data), so ANALYSIS creates a new parameter file associated with the appropriate waveform.
You may also create plot files, bin-save files or copy segments of a run to a new file etc., from within ANALYSIS, but in all of these cases you will be prompted for a new file name.
SCRC software runs under UNIX or more commonly now, under "UNIX-like" environments (i.e. Linux & QNX). Currently CAPTURE is run on a PC the QNX environment, and most ANALYSIS is done in the Linux environment (this saves buying a QNX license for each analysis workstation). Therefore, in order to manage data files, the user needs to know at least some UNIX-type commands. To find out about other commands or more detail about these, either consult a Linux or UNIX manual or try the online manual by typing: "man command" at the prompt.
In general, UNIX commands are highly abbreviated (i.e. not very descriptive), and have several options available. Usually the format is "command -option" (the minus sign is important). Also, there is usually little feedback as to whether the command has been successful. (For instance when copying a file with "cp" the operating system does not say "1 file copied" or any such thing. It just performs the command.) When doing a copy "cp" or move "mv" if the destination file already exists, it is overwritten by the command without confirming that that's what you intended to do!
Warning for the uninitiated:
A UNIX-LIKE OPERATING SYSTEM ASSUMES THAT YOU KNOW WHAT YOU ARE DOING, SO IT DOES NOT ASK YOU IF YOU REALLY INTEND TO OVERWRITE OR DELETE FILES... IT JUST DOES IT!!
THERE IS NO UN-DELETE FUNCTION IN A UNIX-LIKE OPERATING SYSTEM!! IF YOU DELETE OR OVERWRITE SOMETHING BY MISTAKE... IT'S GONE.
You can't say that you haven't been warned!!
Here is a VERY incomplete guide to UNIX, but these are basic commands that you'll need or want to use at some time or other:
copies a file Note: do not use this to copy a runfile of data. See SCRC file utilities and use "copyrun" instead.
DANGER: if the newfilename already exists, it will be overwritten!
e.g. "ls -l *txt > txtlist" means that the output of the "ls" command is redirected to a file called "txtlist" which will be created by the redirect command. DANGER: If the destination filename already exists, it will be overwritten!
e.g. "more txtlist" shows the text tile "txtlist" (as created above) and is displayed page by page
BIG WARNING:
rm with a "-r" option: an "rm -r filename_or_directory_name" is the most
powerful & dangerous
command known to man!! "-r" means "recursive" but it might be better to think of it as
meaning
"remove safety features!" because in addition to the files that you specify, matching
directories,
and the contents of those directories and all sub-directories and
their contents will be
deleted. It is never a good idea to use "rm -r" with a wildcard,
and it is always wise to
double check that directories that you intend to delete do not also contain
subdirectories with
contents that do not intend to delete. Again, there is no such thing as
"undelete" or "unrm" so be careful, and don't "rm -r" any directory unless you are sure
that you want it and everything it contains obliterated!!
Now, after all that warning, "rm -r directory_name" is often used to delete a directory and it's contents when it is not wanted anymore. A slower, but less dangerous alternative is to "cd" into that directory, delete the contents a bit at a time using an "rm filename" command, and then move to the parent directory ("cd ..") and remove the now empty directory using "rmdir directory_name"
Warning: If the destination_file already exists, it will be silently overwritten!!
Warning: If you intend to mv a single file to a different directory, but the directory that you name does not exist, mv will create a new FILE (ie. function like a "rename command"). Subsequent attempts to mv other files to the non-existent directory will silently overwrite the newly renamed file. (This is the same problem as with the "cp" command, but when done you don't still have the original copy.)
If you intend the destination to be a directory, the safe thing to do is to append a trailing "/" to its name. Doing that will cause an error message to be given if the directory doesn't exist rather than creating a new filename. e.g. "mv filename sub_directory_name/"
*
-the asterisk is a wildcard that substitutes for any character and any
number of characters. In
Unix, the dot before the filename suffix does not terminate the matching of an asterisk
(unlike
DOS), so "*" matches all files, while "*.*" matches only those filenames containing a "."
(i.e. in
Unix a dot more or less just a regular character)
For example:
ls Cell1* would list: Cell1-01.frm, Cell1-01.txt, Cell10-01.frm, Cell10-01.txt etc... if they
exist in
the current directory
? -a question mark will specify any character, but only a single character.
For example:
ls Cell1-0?.txt would list: Cell1-01.txt, Cell1-02.txt, Cell1-03.txt etc..
Brackets [ ], are
used to give a range of acceptable matches for a single character. It is sort of
a "?" with restrictions.
For example:
ls Cell1-0[1-3].txt would list: Cell1-01.txt, Cell1-02.txt, Cell1-03.txt
Braces (curly brackets) {
}, can be used to form a list of acceptable matches separated by
a
comma, that will be considered in turn.
For example:
ls Cell1-0{2,4}.txt would list: Cell1-02.txt and Cell1-04.txt
These
wildcards can of course be combined.
For example: ls Cell?-*{txt,frd} would list Cell1-01.txt, Cell1-01.frd, Cell1-02.txt,
Cell1-02.frd ....
Cell9-15.txt, Cell9-15.frd etc.
history: Unix keeps a record of what commands you have typed in the current session. This list is called the "history", and this list can be viewed (by typing "history"). These commands can then be called up using either an exclamation point or the arrow keys as described below.
! -an exclamation
point is a special character that denotes that you want to re-run a
previously used command. Unix knows what commands have been given in the current
session from the "history" list.
How to use an !:
-2 exclamation points (!!) will repeat the previous command given in the history list. So,
if the
last command you typed at the prompt was "ls *txt | more", typing !! will repeat that
command.
-an exclamation point followed by a letter (or letters) will repeat the most recent
command in
the history list that starts with that character(s): eg. "!l" will repeat "ls *txt | more" if that
was the
last command in the list starting with an "l".
-an exclamation point followed by a number will repeat that command (the number
denotes the
number of the history list)
Note: the exclamation point is somewhat shell dependent so it may be a bit different on some systems (esp. some QNX shells)
up arrow, down arrow: are used to scroll through the commands currently in the history list. It's especially nice because you can edit the command before pressing "return"
files starting with a
"-": since the dash is normally used to denote an option following
a
command, if you inadvertently create a file started with a hyphen, you will have to
use;
command ./-filename (where the command could be rm, mv, cp etc.)
more *txt > descriptors #more reads all of the .txt files and the output is redirected to a new file named "descriptors"
fold descriptors | lpr #folds the long lines so they don't run off the page and then pipes the output to lpr which prints it.
you may want to direct the output to the default network printer, so the lpr command should be used with the options -Phpt which defines the destination. i.e. fold descriptors | lpr -Phpt
In QNX, to see the print spooler contents you use "lprq" and to cancel a print job
use:
lprrm print_job_number
"setenv DISPLAY remote_name:0"
or "export DISPLAY remote_name:0"
or "DISPLAY=remote_name:0" followed by "export DISPLAY"
After this, if you start an application in your remote Xterminal, it will displayed on your terminal.
By default, Linux mounts the DOS partition at startup as /dos/c (or /dos/d). Note: on old Linux systems it may be /dosd or /dosc (Currently we don't normally mount jaz cartridges on Linux machines, but that will likely change before long.)
In QNX the commands are different.... they are "mntcd" or "mntjaz" to mount and "umntcd" and "umntjaz" to un-mount. Same as above about the "device busy" error.
QNX does not mount the DOS partition by default. (so it isn't seen by a "df" command).