Link Search Menu Expand Document

General tutorial

This tutorial shows you the full processing pipeline, from generating the necessary session metadata from the template, running the processing pipeline, opening multiple sessions for manual curation in CellExplorer, and finally using the cell_metrics for filtering cells, by two different criteria. The tutorial is also available as a Matlab script: (tutorials/CellExplorer_Tutorial.m).

  1. Define the basepath of the dataset to run. The dataset should ideally consist of the raw data basename.dat, and spike sorted data.
    basepath = '/your/data/path/basename/';
  2. Generate session metadata struct using the template function and display the metadata in the session GUI:
    session = sessionTemplate(basepath,'showGUI',true);


You can use the GUI to inspect the metadata. Make sure that the extracellular tab is filled out correctly for your data (see screenshot below). The template script can extracted existing metadata from a Neuroscope compatible basename.xml, from Intan’s info.rhd file, from KiloSort’s rez.mat file, and from a basename.sessionInfo.mat (Buzcode) file.


  1. Run the cell metrics pipeline ProcessCellMetrics using the session struct as input
    cell_metrics = ProcessCellMetrics('session', session,'showGUI',true);

    Setting showGUI to true will display the GUI shown below allowing you to verify parameters and settings for ProcessCellMetrics. You can click the button Verify metadata to show a table with metadata relevant to the processing. Fields requiring your attention will be highlighted in red; optional fields in blue.


  1. Visualize the cell metrics in CellExplorer
    cell_metrics = CellExplorer('metrics',cell_metrics); 
  2. Open multiple session from their basepaths
    basenames = {'Rat08-20130708','Rat08-20130709'};
    basepaths = {'/Volumes/buzsakilab/Buzsakilabspace/Datasets/GirardeauG/Rat08/Rat08-20130708','/Volumes/buzsakilab/Buzsakilabspace/Datasets/GirardeauG/Rat08/Rat08-20130709'};
    cell_metrics = loadCellMetricsBatch('basepaths',basepaths,'basenames',basenames);
    cell_metrics = CellExplorer('metrics',cell_metrics);
  3. Curate your cells in CellExplorer and save the metrics
  4. You may use the script loadCellMetrics for further analysis using the metrics as filters
    1. Get cells labeled as Interneuron
      cell_metrics_idxs1 = loadCellMetrics('cell_metrics',cell_metrics,'putativeCellType',{'Interneuron'});
    2. Get cells that have the groundTruthClassification tag Axoaxonic
      cell_metrics_idxs2 = loadCellMetrics('cell_metrics',cell_metrics,'groundTruthClassification',{'Axoaxonic'});

The cell metrics follows the definition here. E. g. the filtered waveforms are stored in the field cell_metrics.waveforms.filt, and the firing rates in the field: cell_metrics.firingRate.