Converting your data to ndata
It is usually simple to convert spike-time data to the ndata format. There are two text file formats, T1 and T2, that can be directly converted to ndata. Below are examples of converting single-unit and multiple single-unit data to ndata. If you have a more complicated data format that you would like to convert to ndata, please contact Wyeth Bair.
T1 text file formatSingle-unit data that is written in the simple text format known as T1 (shown below) can be converted to ndata with the following command:ndutil t12nd [input_T1_file] [output_ndata_file]after replacing values in [ ]'s with appropriate file names. In the ndata file that is created, the channel name will be unit0.
Example T1 data file:
The file begins with a list of identifiers (in green) and values (in red). The identifier, Name specifies a character string that identifies the data file. The identifiers Start and Duration define the time period during which data was recorded. The unit of time is defined by Sampling, which specifies the number of samples per second. Thus, a sampling value of 1000.0 indicates milliseconds. The identifier, Params is followed by a list of parameter names whose values vary and thus are specified for each trial. The identifier, Trials is followed by the number of trials of data in the file.
The rest of the file consists of data organized in trials. Each trial begins with T followed by the trial number, which can run in order from 1 up to the total number of trials in the file. The next items on the line (in white) specify the values for each parameter named above by Params. Values must be separated by spaces or tabs, and a newline (i.e., an end-of-line character) must terminate the line. The next line in the trial begins with R (for record) and specifies the number of data points in the record (in red) and the times of action potentials (in yellow) in units specified by Sampling. If no spikes were recorded on a given trial, the record line is simply "R 0", as in trial 3 above. There should be no action potential values that fall outside of the time period specified by Start and Duration. In this example, the integers from 0 to 1999, inclusive, are the only acceptable values for spike times. Spike time values should be separated by spaces (or tabs) and the last spike time (on each trial) must be followed by a newline.
Converting multiple single-unit data to ndataTo convert multiple single-unit data to ndata, simply use the T1 format shown above and repeat the record lines (those beginning with R) for the appropriate number of single units (see below for dual single units). In the ndata file that is created, the channel names will be unit0, unit1, etc. It is necessary that every trial has the same number of record lines, even if there are zero spikes for some records.
Use the following command to convert the T1 file to ndata:nda_util t12nd [input_T1_file] [output_ndata_file]after replacing values in [ ]'s with appropriate file names.
T2: Converting data with event codes to ndataIf the neural data includes a set of event codes, these can be encoded using the T2 format (shown below) and converted to ndata using the command:ndutil t22nd [input_T2_file] [output_ndata_file]
Other features of the T2 format include the following. A time reference is given by the integers (in blue) following the trial index number (in green) and before the variable parameter values (in white). This time reference indicates when each recording began relative to the start of the first trial, which can be set to zero. A set of constant paramters that describe featuers of the data file that do not vary across trials can also be included in the header. In the example above, two parameter names and values are shown. Parameters do not need to be on separate lines.