Skip to content

Creating and using flat files

Johannes Niediek edited this page Feb 7, 2023 · 7 revisions

Defintion

By flat file we refer to a single file that incorporates a lot of information from a RIFF experiment at a 100 ms time scale.

Parameters at each time step

For every 100 ms time step, a flat file contains the following information

Field name Description
accel Acceleration of the rat
beh_foods Rewards delivered to the rat at the 12 reward ports
beh_nps Nose-pokes of the rat at the 12 nose-poke detectors
images Images of the rat
MDP_areanum_binary Position (number) of the rat as defined by the MDP (see mdata.areanum_keys)
MDP_areatype_binary Position (type) of the rat as defined by the MDP (see mdata.areatype_names)
MDP_beh_binary Behavior of the rat as defined by the MDP (see mdata.beh_names)
MDP_type_binary State of the MDP (see mdata.type_names)
NA_FR Neural activity, firing rate for each cluster
rat_angs Angular coordiante of the rat
rat_rs Radial coordinate of the rat (distance from center)
silenced Artifacts detected in the neural signal
silenced_percent Percentage of detected artifacts
sounds_speakers Activity of the 12 loudspeakers
sounds_type_binary Sounds playing for each of the sounds
speed The speed of the rat
t_sim_in_SNR_units Time in seconds on the common time axis
x x coordiante of the rat
y y coordinate of the rat

Other fields

Besides the above information, which is calculated for each 100 ms time step, the flat files also contain the following fields

Field Description
mdata Contains meta data, for example regarding the MDP and the recording electrodes
trial_init_ind Indices of each trial start
trial_end_ind Indices of each trial end

Steps to create a flat file

  1. Process a session with neural recordings from the RIFF as explained here
  2. Manually tag noise clusters as explained here
  3. Additionally to analysis_pipeline, also add the folder RIFF_player to the Matlab path
  4. Run the code
    flatten_single_experiment(rat_folder)
    where rat_folder contains the output folder of the analysis pipeline. For example, rat_folder = '~/RIFF_results/nightRIFF/290620/rat_5'.
  5. This creates a single file called flat_behav_DB.mat.