This repository provides tools to integrate
- MountainSort spike sorting
- with the Phy curation environment.
-
Clone the repository:
git clone https://github.com/yourusername/mountainsort-to-phy.git cd mountainsort-to-phy
-
Install dependencies:
pip install -r requirements.txt
-
Add the Phy plugins: Copy the plugins to your Phy plugins directory. This is typically located at
~/.phy/plugins/
.mkdir -p ~/.phy/plugins cp plugins/* ~/.phy/plugins/
-
Update your Phy configuration: Edit your
~/.phy/phy_config.py
to include the new plugins:c.TemplateGUI.plugins = ['MSCurationTagsPlugin', 'WaveformUMAPPluginComplete', 'TetrodeMetrics', 'MSCurationSave']
To convert Phy clusters back to the MountainSort format, run:
python phy_to_mountainsort.py /path/to/phy/folder
To convert MountainSort data for use in Phy:
- Ensure your MountainSort data is organized in the specified directory structure.
- Run the conversion script:
python mountainsort_to_phy.py
Use the provided MATLAB scripts to add behavioral data to Phy:
- Update the configuration in
makeNPYfiles.m
andatomicNPYfile.m
as needed. - Run the MATLAB scripts to generate the NPY files for behavioral data.
Converts Phy clusters back to the MountainSort format. The script expects a folder containing Phy output and converts it to a format compatible with MountainSort.
Processes MountainSort output to prepare it for use with Phy. This includes extracting waveforms, spike sorting, and exporting to Phy format.
- umap_plugin.py: Adds a custom UMAP view for dimensionality reduction and visualization in Phy.
- MSclusterPlugins.py: Integrates MountainSort cluster metrics with Phy for enhanced curation capabilities.
- constructheader.m: Constructs headers for NPY files.
- write.m: Writes MATLAB arrays to NPY files.
- makeNPYfiles.m: Generates NPY files for behavioral data to be used in Phy.
- atomicNPYfile.m: Helper function to write behavioral data to NPY files.
filtered
: Use filtered MDA files instead of raw MDA files.toleratemissing
: Skip folders with missing tetrodes.skipproc
: Skip already processed folders.parent_path
: Directory containing MountainSort data.
Update the configuration variables in mountainsort_to_phy.py
as needed:
config['filtered'] = True
config['toleratemissing'] = True
config['skipproc'] = True
config['parent_path'] = '/mnt/data/MountainSort'
Contributions are welcome! Please fork the repository and submit a pull request with your changes.
This project is licensed under the MIT License. See the LICENSE file for details.