User Tools

Site Tools


ephys_pipeline:4_sorting

Sorting

Currently, there are 3 different sorting approaches implemented

  • Waveclus sorting (with potential to refine sorting in plexon)
  • Snippets sorting (sorting online detected spikes with plexon)
  • Realigned snippets sorting (re-aligning online detected spikes with plexon)

The latter two are basically identical in terms of workflow, so they are described in the same section. For the waveclus pipeline, waveclus preprocessing to create snippets from Broadband is required.

Sorting pipeline

  1. Fill in Electrode depths file (required as first step for WC pipeline)
  2. WC: Create waveclus pre-clustering files (implemented in phys_gui)
  3. WC: Run waveclus and sort for all channels, don’t forget to save (wave_clus3new3, MATLAB 2014+)
    • Preferentially separate spike shapes in difficult cases
  4. Create plxfiles (implemented in phys_gui)
  5. Check and clean PLX file and TAKE NOTES (single/SNR/stability rating)
  6. Now we need to assess which units are the same within and across blocks (based on channel, electrode depths, spike shapes and potentially tuning, carefully check notes for this). For that purpose you might want to do the following steps in any order (potentially even going back and forth):
    • Create combined (phys+behavior) files (implemented in phys_gui)
    • Assign same cells across blocks in Same cells file
    • Plot single unit tuning assuming cells are unique in every block (implemented in phys_gui) - This is meant to help assessing if two “units” in the same block might actually be the same (if they have very similar tuning properties)
    • Re-sort PLX file (combining same cells sort codes of same block same channel)
  7. If you have finalized the sorting, create combined (phys+behavior) files (implemented in phys_gui) (yes, once again, now that you have a different amount of cells)
  8. Complete Same cells file
  9. Automatically update the automatic_sorting sheet from the Excel sorting table using phys_gui
  10. Copy the automatic_soting entries to the final_sorting sheet of the Excel sorting table and complete with manual entries.

Waveclus preprocessing workflow

Waveclus (pre-)sorting

How to use waveclus to sort spikes is a topic on its own, please see Waveclus for more detailed information

Plexon workflow

Plexon sorting

Sorting in plexon is - similar to waveclus - a topic on its own. However, there are a few internal rules:

  • usually the biggest units are put first - this makes assigning same cells easier
  • better have one stable (and therefore useful) multiunit than 2 unstable single units
  • You can cut off in time if there is a specific section where sorting does not work

Problems with online detected snippets

All of these issues can make online snippet sorting very difficult. However, realigned snippets will have the (due to shift) missing information padded with 0's. This means that shifted snippets might appear like a different cluster. So they will potentially have to be sorted with redefined principle components for each subset.

Plexon file naming

Session_blocks_N.plx are based on online snippets
Session_realigned_blocks_N.plx are based on realigned online snippets
Session_from_BB_blocks_N.plx are based on waveclus clustering
Importantly, when you save a plx file, it never overwrites an existing file, but rather appends “-01” to the file name. If that filename already exists as well, it will append “-02” instead, and so on. That means, all files with “-NN” affixes are manually saved. Because of that, for all steps after sorting, the plx file extension (-01, -02, …) to use is defined in the plx_file_table.

ephys_pipeline/4_sorting.txt · Last modified: 2022/12/29 07:15 by 127.0.0.1