Skip to content

Tutorial

Ashley Schnider edited this page Feb 9, 2021 · 5 revisions

Purpose

Here we will go over how to run through a few example data sets for possible analyses that the codebase covers. We use the term pipeline to mean a series of function calls to manipulate and extract information from the data. This tutorial will cover the following pipelines:

Running the Parser

The first step in getting files formatted to run through a given pipeline analysis is to run the parser_main in Matlab. The parser currently supports following formats:

  • plx/pl2 files with spike data and events
  • rhd/rhs files with continuous data

Running parser_main requires a specific file structure and some informative csv files about the data.

Required fie layout to run parser:

All the data is to be organized in one project directory with a raw directory inside of it. Here, the top level project directory is called Project_ABC, where "ABC" stands for whatever experimental code the user has assigned. The raw directory contains sub-directories for each subject where the raw data files are stored to be parsed. Each subject directory should have a labels file as well and a config file that details the parameters used in the parser main.

Before running parser_main

Project_ABC
    ├──ABC001_labels.csv
    ├──ABC###_labels.csv
    ├──parser_config.csv
    ├──raw
    |    ├──ABC001
    |    |    └──*.plx
    |    ├──ABC###
    |    |    └──*.plx

As the parser main runs, it automatically generates directories to store the data in. For spike data, it creates a parsed_spike directory and for continuous data, it creates a parsed_continuous directory to store the parsed files in.

After running the parser_main for spike data

Project_ABC_experiment
    ├──ABC001_labels.csv
    ├──ABC###_labels.csv
    ├──parser_config.csv
    ├──raw
    |    ├──ABC001
    |    |    └──*.plx
    |    ├──ABC###
    |    |    └──*.plx
    ├──parsed_spike
    |    ├──ABC001
    |    |    ├──*.mat
    |    |    └──ABC001_labels_log.csv
    |    ├──ABC###
    |    |    ├──*.mat
    |    |    └──ABC001_labels_log.csv
    |    └──parser_config_log.csv

Config File

The config file lives on the top level in the project directory. The config file requires a header row with the parameter names and a row for each directory in the raw directory. Please see the parser config page for more details on what is in the config file and what each parameter does.

Labels File

The labels file provides information on how the channels map to different brain regions per recording session. The label file must be exhaustive in that the label file must have a row for every channel in a given recording file. Please see the labels csv page for more details on the headers required in the labels file.

Running Parser Main

Before running parser_main in Matlab, you should add the codebase to your Matlab path so that Matlab can find all of the functions in the codebase. For more information on how to add the codebase, see the documentation on the Dependencies Wiki or see the documentation from Matlab. Assuming the codebase is on Matlab's path, there are no other dependencies required to run the parser.

  1. Run parser_main in Matlab's terminal
  2. Select the project directory where your data is stored.

Try running this on the example data set included in the codebase to parse either the spike example or continuous example.

psth_main

psth_main is used to control data analysis routines for the receptive field analysis pipeline.

continuous_main

continuous_main is used to control data analysis routines for continuous neural data.

Clone this wiki locally