A new framework for automated and reliable spike sorting in human intracerebral recordings
MCWs (MiCroWire Sorter) is a modular pipeline for automated spike sorting of human intracerebral microwire recordings.
It is designed to handle large-scale clinical datasets and to provide transparent, quality-controlled single-unit isolation.
This repository contains a beta version of MCWs (MiCroWire Sorter).
- You may encounter bugs or unexpected behavior.
- If you find an issue, please open a GitHub issue with a short description, error message, and (when possible) a minimal example.
- We are actively developing this pipeline and will continue to update and refine it.
MCWs implements an end-to-end workflow:
-
Initial Data Loading & Pre-processing
- Data-driven notch filtering and basic cleaning
- Channel selection and basic QC
-
Spike Detection
- Automated thresholding and temporal filtering
- Candidate spike extraction per channel
-
Artifact Rejection
- Bundle-level rejection of obvious non-neural events
- Within-channel rejection using waveform shape and decision logic
-
Feature Extraction
- Waveform- and time-domain features
- Distribution-based features (e.g., GMM fits, variability measures)
- Dimensionality reduction / selection for clustering
-
Clustering (Super Paramagnetic Clustering; SPC)
- Unsupervised clustering of spike features
- Automatic identification of putative units
-
Refine Sorting
- Merge/split operations guided by waveform similarity and firing statistics
- Task-specific response profiles (e.g., peri-event histograms)
-
Quality Metrics
- Unit stability and isolation indices
- Waveform consistency and firing rate characteristics
- Visual summaries for manual review
- Fully modular human-microwire pipeline: every stage (detection, artifact rejection, feature extraction, clustering, refinement) is separable and can be swapped or extended.
- Rich artifact and quality control: two-level artifact rejection and extensive unit quality metrics designed specifically for noisy human intracerebral recordings.
The current implementation expects:
- Neural data in NC5
int16format, and - A corresponding
NSx.matfile containing all metadata required to read the data
(e.g., sampling rate, channel map, recording duration, etc.). See "Sample_of_NSx.mat" for an exemplary file.
If your recordings are in a different format, you will need to:
- Implement a parser that converts your raw data into NC5
int16files. - Create a compatible
NSx.matfile with the necessary metadata fields.
Once you have *.nc5 (int16) and the associated NSx.mat, you can use this repository without further changes to the main pipeline.
