Preprocess Code
code for spike sorting, preprocessing LFP and generating 'GoodUnit' files can be found here, which contains the preprocessing code for NNN data, as well as other datasets collected in BaoLab (PKU) using the Macaque Fixation task.
Dependency: add the following tools to the /util directory:
BombCell
prettify_matlab
ShadedErrorBar
npy-matlab
Run NSD_Process_pipeline.m to go through 4 steps:
1) Load_Data_function.m
This function extracts basic information from the MonkeyLogic .bhv file, and the meta data from SpikeGLX .meta, extracts event code from NI data, and check which trial is valid based on eye signal.
Output: META_YYMMDD_Subject_NSD1000_LOC.mat
1) PostProcess_function_raw.m
This function loads the output of Kilosort4, and run BombCell to classify unit into noise, single unit, MUA, and non-somatic unit.
Output: GoodUnitRaw*.mat
1) PostProcess_function.m
This function aligns the spike time to image onset time, generating GoodUnit structure consisting of raster data and PSTH data
Output: GoodUnit*.mat
1) PostProcess_function_LFP.m
This function loads LFP signal and align to image onset time.
Output: GoodLFP*.mat
Run S0_ConvertMatTOh5.m to generate H5 file from GoodUnit files
Paper code
code for analyzing and generating figures in the paper can be found here.
some additional data is needed, they are located at /others in the data bank.
Demo code
Several walkthrough demo for illustration our data can be found here.
- demo1, generating single unit raster plot for several images
- demo2, generating populational preference of interested ROI