This is an old revision of the document!
Table of Contents
Ephys pipeline overview
Folder structure
- Y:\Data\TDTtanks\Monkey_phys contains the Raw TDT data
- Y:\Data\Sortcodes\Monkey_phys contains sorting related files
- Y:\Data\Monkey contains the behavioral data
- Y:\Data\Monkey_phys_mat_from_TDT contains recorded data, arranged in the same trial structure as the behavioral data
- Y:\Data\Monkey_phys_combined_monkeypsych_TDT contains trial structures with combined behavioral and ephys data
- Y:\Data\All_phys_preprocessing_log\Monkey_phys contains automatically created log files of all preprocessing performed
- \Dropbox\DAG\phys\Monkey_phys_dpz contains
- Electrode_depths matfile
- Same_cells matfile
- plx files excel table
- Sorted_neurons excel table
General Workflow
- Update Electrode depths matfile. Only block/channel combinations defined here will be processed (?)
- (Optional - Synapse only) Reformat Synapse tank folder format to match previous conventions
- (Optional - WC only) Run waveclus automatic sorting (Channels with electrodes in the same depth across blocks will be combined across blocks)
- (Optional - WC only) manually refine WC sorting
- (Optional - Plexon only) Create Plexon sortcodes
- (Optional - Plexon only) Manual Plexon sorting
- Update plx files excel table
- Combine TDT and behavioral data
- Create TDT trial structure
- Combine
- Update Same_cells matfile
- Update sorted_neurons excel table
Most of the steps above are automatized, check out phys_gui page for details.
Synchronization
- TDT data is stored as a continuous data (starting from start of recording)
- behavioral data is stored per trial (starting from first trial)
For combining both, we first convert TDT data to trial format (function TDT_trial_struct.m) preferentially using epocs store (Tnum and SVal) information.
Note: There is a flag for using the continous state information stream (stream_state_info), but it is permanently turned off, as the epoc information is already extracted from the continuous state information within the TDT circuit.
Importantly, trial start reference is STATE 2 (fixation acquisition). Trial end is STATE 2 of the next trial.
Therefore, ITI between trial 1 and 2 as well as STATE 1 (initiation) of trial 2 are found at the end of trial 1.
This also means that data recorded before 1st trial's state 2 can not be stored in the trial structure and is saved in a separate variable (First_trial_INI) instead.
Associated code
Data conversion functions are located in Github External_modified/PLXTDT repository
- PLX2SPK
- PLX2TDT
- SEV2mat_working
- SPK2PLX
- TDT2PLX
- TDTbin2mat_working
- WC32SPK
- WC32SPK_concatenated
- WC32SPK_directly
The remaining code related to phys preprocessing (not including Waveclus and Plexon) can be found on Github Phys_preprocessing repository
- Core functions
- phys_gui_working.m
- phys_gui_execute.m
- TDT_trial_struct.m
- ph_combine_MP_and_TDT_data
- DAG_update_sorting_table.m
- Waveclus pipeline specific
- DAG_WC3_preprocessing.m
- DAG_parse_data_tdt.m
- DAG_SpikefilterChan.m
- WC32SPK_directly.m
- ph_readout_broadband_lag.m
- Plexon pipeline specific
- DAG_create_PLX.m
- DAG_update_plx_file_table.m
- ph_get_new_plx_extension.m
- Extra standalone functions
- DAG_derive_TDT_streamer_broadband_lag.m
- ph_debugging_GUI.m
- DAG_take_over_sortcode_PLX2PLX.m
- Only of historical relevance
- DAG_move_sorting_files.m Was used to transfer sortcodes to their current destination
- ph_derive_electrode_depth.m Was used to create the first electrode_depths file extracting from sorted_neurons table
- ph_derive_same_cells.m Was used to create the first same_cells file extracting from sorted_neurons table
- ph_simulate_history.m Was used to create the first log files