This capsule is designed to postprocess ephys data for the AIND pipeline.
This capsule first removes redundant/duplicate units (sharing >90% of the spikes). Then, it computes sparse waveforms and then in computes several additional postprocessing data, including:
- spike amplitudes
- unit locations
- spike locations
- correlograms
- ISI histograms
- template similarity
- template metrics
- PCA scores
In addition, quality metrics are also computed here. Postprocessed data are used downstream for spike sorting curation and visualization.
The data/ folder must include the output of the aind-ephys-preprocessing and the aind-ephys-spikesort-pykilosort/aind-ephys-spikesort-kilosort25capsules, including the preprocessed_{recording_name} and spikesorted_{recording_name} folders.
Parameters are read from a params.json file that must be in the root folder of the capsule (next to code/, i.e. ../params.json from code/), with a logging and a postprocessing section (keys such as n_jobs (default -1), max_spikes_per_unit, additional_extensions).
A full list of parameters can be found in the in the aind-ephys-pipeline repository, and are defined in this schema.
The output of this capsule is the following:
results/postprocessed_{recording_name}folder, containing the postprocessed data (as a WaveformExtractor folder)results/postprocessed-sorting_{recording_name}folder, containing the spike sorted data, saved by SpikeInterface, after de-duplicationresults/data_process_postprocessing_{recording_name}.jsonfile, a JSON file containing aDataProcessobject from the aind-data-schema package.