FUNCTIONS FOR MONKEY MULTIPLE SPIKE TRAIN DATA:

bold: function name
red: obsolete
<..> Necessary parameter. If any parameter is missing the function will run in interactive mode.
[..] key stroke
(...) data type (int, float, string)
If the author is not indicated the code was written by Zoltan Nadasdy.



delsmallfile <file_name> <row_num>
The function checks the length and content of the file as given by the <file_name> and deletes it if the number of rows are less than <row_num>. Otherwise keeps it.


delzerofile <file_name>
The function checks the length and content of the file as given by the <file_name> and either if the length is 0 or the content is empty the file will be deleted, otherwise will be untouched.


linkmtrials <input_file>  <n> <index_position_1> ... <index_position_n>  <output_file> <offset>
A utility for linking together spike train files identified as running indices of the file name extension (TEN system: Trial, Electron, Neuron). The input_file is a single column "spike time of occurrence list". The n is the number of running file indices. Index_position1-n is a list of character positions of the input_file name that identifies each spike train in the TEN system. The output_file is a new "spike time of occurrence list" containing all individual spike trains linked together by an offset time. The offset is supposed to be a time interval longer than any of the single spike train in the list.  Each new spike train red by incrementing the file indices will be linked to the preceding files by adding a monotonicaly increasing time interval to their original time. This interval is determined as time = N*offset where N is the rank of a given input_file from the list of files. As a result, for each simultaneously recorded cells we obtain a long spike train where each new trial starts at the same time. It allow us to extract patterns from the spike trains acccross many trials.
See also: linkmtrialslim and linkmtrialsmc
so: linkmtrialslim and linkmtrialsmc


linkmtrialslim <input_file>  <n> <index_position_1> ... <index_position_n>  <output_file> <offset> <max_indices>
Same as linkmtrials with the difference that you can limit the list of files by giving the last alphanumeric incdex to be red. This option substantially reduces the linking time which, otherwise, would increase exponentially by index positions.
See also: linkmtrialslim


linkmtrialslimfromfile<input_file>  <n> <index_position_1> ... <index_position_n><list_file>  <output_file> <offset> <max_indices>
Same as linkmtrialslim but instead of linking all the files in an increasing order of the file name indices it reads the files from the input according to an index list. The index list is contained by the list_file as a database including exactly as many columns as many running indices n have been defined.
See also: linkmtrialslim and linkmtrials


linkmtrialsmc <input_file>  <n> <index_position_1> ... <index_position_n>  <output_file> <nofc> <start> <increment> <frame>
Alike to linkmtrials this function is for linking together files identified by the running indices of the file name (up to 4 positions).  The n n is the number of running file indices. Index_position1-n is a list of character positions of the input_file name that identifies each file within the sequence of all files in the same directory. However, in contrast to linkmtrials, here input_file-s can be a multiple column data files.The output_file is a new structure containing all the columns of the original file linked together. In addition, an extra column is generated as first column containing indices of the data. The start, increment and frame of the first column must be defined. Start is the very first index value, increment is the increment of the index between successive data lines and frame is the offset of the index at the start of each file. For example, if the frame=1,000, the 8th file will be linked to the previous 7 by starting with 8,000 as initial index. Hence, the frame is incremented by each new file.
See also: linkmtrials and linkmtrialslim


mergeandbin <input_file1> <input_file2> <output_file> <bin_size>
It calculates the spike density from a single column spike train data (input_file2) by subdividing the train bins of a bin_size and merge the spike density to the columns of input_file1. The merged data will be written to output_file, containing the multiple columnsng the multiple columns of input_file1 and the new single column of the binned input_file2. Usually input_file1 is a behavior data which is sampled at a lower frequency relative to the spike data, therefore, it is necessary to bring the spike train data to the temporal scale same as the behavioral data. Accordingly, bin_size is the sampling interval of the behavioral data or input_file1.
See also: spk2bin


spk2bin <input_file> <output_file> <total_length> <bin_size>
Conversion of spike trains to spike density. First the spike train of the input_file is subdivided into n bins where n=total_length/bin_size. Then, the number of spikes within each bin is calculated and written to the output_file as single column ASCII file containing n data. Total_length is necessary for binning simultaneous spike trains by the same number of bins for later averaging.
See also:  mergeandbin


spk_decompose.ksh <filename spike> <filename xy>
Batch for extracting spikes from Abeles format (date.nnn).
(1) It extract spike times and electrodes in ENT (electrode, neuron,time)
(1) It extract spike times and electrodes in ENT (electrode, neuron,time)
(2) Sort the extract by electrodes and neurons
(3) Calculates the spike density/bin and merge it to the XY coordinate it to the XY coordinates of the handmovements


synchronize <JDAS_time_list> <SPIKE_file_time_list> <output_file> <NOFCOL> <control_string> <tolerance> <new_name>
It synchronizes the JDAS digital data files (JDAS_time_list) with spike data extracted from the continuos recording (SPIKE_file_time_list). The output_file will be a batch file of copying each file under a different name given as new_name. NOFCOL is the number of columns in the two input time lists that must be the same for both files. Control_string determines the column that represents the file index (file number) time data as a string of 0-s, 1-s and 2-s (e.g. 120 means the time data is the third column of your three columns input file). Tolerance is the maximum difference allowed to be between the two time lists for each time item. In practice you decrease the tolerance preferably until you get only one match of SPIKE_file_time_list item for each JDAS_time_list item and you you don't have any JDAS time item skipped. This state may not be achieved for every file so you have to compromise and you must complete the pairing by editing the batch file.



t_parser <input_file> <output_file>
A function for extracting spike time data from Abeles data format. The ISI-s are conveted to absolut time of the spikes (in msime of the spikes (in msec) relative to the beginning the actual trial.
 The output file format is a 6 column (trial, index, electrode, spike ID, ISI, spike time) ASCII file.


t_parser_any <input_file> <output_file> <code>
A function for extracting the time of events from data encoded as Abeles-format. The events are specified by the code parameter of event (code table: jdas2nda.txt). The output is converted to absolut time of the events (in msec) relative to the beginning the actual trial.
The output contains 4 columns (trial, index, event code, spike time) in ASCII format.


t_parser_head <input_file> <output_file> <lines> <sampling_interval>
A function for extracting events from data encoded as Abeles-format. The events will be considered between the header lines and the tail. Header lines are specified by the lines parameter and will be ignored. The time data between the header lines and tail will be converted to seconds. The output contains 4 columns (trial, index, event code, time, X,Y) in ASCII format.


t_parser_mov <input_file> <output_file> <code>
A function for extracting motions from data encoded as Abeles-format. The events are specified by the code parameter of event (code table: jdas2nda.txt). The output is converted to a trajectory dataverted to a trajectory data which comprises the absolut time of the events (in msec) relative to the beginning the actual trial and the position of the manipulandum as x,y coordinates.
The output contains 4 columns (trial, index, event code, X, Y) in ASCII format.


t_parser_spk <input_file> <output_file> <code>
A function for extracting the time of spikes from data encoded as Abeles-format.  The output is converted to absolut time of the spikes (in msec) relative to the beginning the actual trial.
The output contains 6 columns (trial, index, electrode, spike ID, ISI, spike time) in ASCII format.


t_parser_onlinespk <input_file> <output_file> <flag>
A function for extracting the time of spikes from input_file encoded as Abeles-format.  The spike event data are converted to absolut time of the spikes (in msec) relative to the beginning the actual trial. The output_file contains 6 columns (trial, index, electrode, spike ID, ISI, spike time) in ASCII format. If flag='c'  the time starts at the beginning of the first trial and continuously increasing till the end of file. If flag='t' then time is reset to zero at the beginning of each trial.


unlinkmtrials <input_file> <output_file> <frame_size>
The inverse of the functions linkmtrials unctions linkmtrials and linkmtrialslim. It decomposes the file generated by linking together trial files of a day (usualy a whole recording session). When trial files are linked together there is an offset defined that separates trials from one anoother  resulting in a non-overlapping serie of time data (a continuous point process). The offset is supposed to be chosen as larger than the longest trial in order to avoid trial overlaps. When frame_size is defined the second trial starts at the 0 time + frame_size, the 3rd trial starts at 0 + 2*frame_size, etc. When unlinkmtrials is used the frame_size tells the breakpoints to segment the input_file to the first, second, etc. files. The input_file is a single column ascii file containing the time data in increasing order. The output_file must have the running index at the seventh position (ses.00?...) following the TEN nomenclature.
See also: linkmtrials and linkmtrialslim.


 
 
 
 
 
 
 
 
 
 
 
ir>