User Tools

Site Tools


ephys_pipeline:1_pipeline_overview

This is an old revision of the document!


Ephys pipeline overview

Folder structure

Inputs Info
Y:\Data\TDTtanks\Monkey_phys Raw TDT data
Y:\Data\Sortcodes\Monkey_phys sorting related files
Y:\Data\Monkey behavioral data
\Dropbox\DAG\phys\Monkey_phys_dpz\Electrode_depths.mat electrode depths documentation
\Dropbox\DAG\phys\Monkey_phys_dpz\Same_cells.mat same cells across blocks assignment
Outputs Info
Y:\Data\Monkey_phys_mat_from_TDT recorded data, arranged in the same trial structure as the behavioral data
Y:\Data\Monkey_phys_combined_monkeypsych_TDT trial structures with combined behavioral and ephys data
Y:\Data\All_phys_preprocessing_log\Monkey_phys automatically created log files of all preprocessing performed
\Dropbox\DAG\phys\Monkey_phys_dpz\plx_files.xls (for multiple sortings:) used plx file documentation
\Dropbox\DAG\phys\Monkey_phys_dpz\Mon_sorted_neurons.xlsblock/run/unit electrode locations, IDs, ratings, and procedures information

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
    1. Create TDT trial structure
    2. 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
    1. phys_gui_working.m
    2. phys_gui_execute.m
    3. TDT_trial_struct.m
    4. ph_combine_MP_and_TDT_data
    5. DAG_update_sorting_table.m
  • Waveclus pipeline specific
    1. DAG_WC3_preprocessing.m
    2. DAG_parse_data_tdt.m
    3. DAG_SpikefilterChan.m
    4. WC32SPK_directly.m
    5. ph_readout_broadband_lag.m
  • Plexon pipeline specific
    1. DAG_create_PLX.m
    2. DAG_update_plx_file_table.m
    3. ph_get_new_plx_extension.m
  • Extra standalone functions
    1. DAG_derive_TDT_streamer_broadband_lag.m
    2. ph_debugging_GUI.m
    3. DAG_take_over_sortcode_PLX2PLX.m
  • Only of historical relevance
    1. DAG_move_sorting_files.m Was used to transfer sortcodes to their current destination
    2. ph_derive_electrode_depth.m Was used to create the first electrode_depths file extracting from sorted_neurons table
    3. ph_derive_same_cells.m Was used to create the first same_cells file extracting from sorted_neurons table
    4. ph_simulate_history.m Was used to create the first log files
ephys_pipeline/1_pipeline_overview.1641842899.txt.gz · Last modified: 2022/12/29 07:15 (external edit)