Skip to main content

Automatic matching of neurons across sessions

Project description

UnitMatchPy and DeepUnitMatch

This repository contains:

  • UnitMatchPy: automatic matching of neurons across sessions (Python package).
  • DeepUnitMatch: DeepUnitMatch pipeline and demos (see preprint below).

References

Versions

  • UnitMatchPy version: 3.4.1 (from pyproject.toml)
  • DeepUnitMatch: code lives under DeepUnitMatch/ (see DeepUnitMatch (DUM) section)

System requirements

Both UnitMatchPy and DeepUnitMatch can be ran on a standard computer, with sufficient RAM (>32GB for large datasets). This software is supported for Windows and macOS, and has been tested on Windows 11.

Installation

pip install (including pip install -e .) installs into whatever Python environment your pip points to (system Python, a conda env, or a virtualenv). pip does not create or name environments.

We recommend using Anaconda/Miniconda (conda) to create an isolated environment first:

# Create a new environment (pick any name you like; example: UMPy)
conda create -n UMPy python=3.11 pip #(press y when prompted)
conda activate UMPy

Then install using pip (options below). This step should take less than few minutes.

Option A: Install the released package (PyPI)

pip install UnitMatchPy

Optional extras (heavier dependencies used by some notebooks and integration with SpikeInterface):

pip install "UnitMatchPy[full,notebooks]"

Option B: Install a local, editable copy (for development / modified code)

First, open a terminal and navigate to this folder (the one containing pyproject.toml). The pip install -e command must be run from here:

# Windows (PowerShell) - note; you may have to give writing access to the specific CONDA environment via Windows Security → Virus & threat protection → Ransomware protection → Manage ransomware protection. For example, if the below steps result in "could not create 'UnitMatchPy.egg-info'"

Look at Controlled folder access:
cd $HOME\Documents\GitHub\UnitMatch\UnitMatchPy

# macOS / Linux
cd ~/Documents/GitHub/UnitMatch/UnitMatchPy
pip install -e .

Optional extras (e.g. if you'd like to run the notebooks or integrate with SpikeInterface):

pip install -e ".[full,notebooks]"

Demo notebooks

All demo notebooks are in Demo Notebooks/.

Run UnitMatchPy

To run UnitMatchPy, standard spike sorting data is needed (channel positions and extracted raw waveforms for each unit). Waveforms can be extracted externally (e.g. BombCell) or using the demo notebooks:

  • Demo Notebooks/extract_raw_data_demo.ipynb (compressed .cbin/.ch or raw)
  • Demo Notebooks/extract_raw_data_demo_open_ephys.ipynb (Open Ephys)
  • Demo Notebooks/UMPy_spike_interface_demo.ipynb (SpikeInterface workflow)

Example notebooks:

  • Demo Notebooks/UMPy_example.ipynb (recommended starting point)
  • Demo Notebooks/UMPy_example_detailed.ipynb (more modular / advanced)

The GUI is an optional step to curate and explore UnitMatch outputs; see Demo Notebooks/GUI_Reference_Guide.md for usage tips and shortcuts.

Run DeepUnitMatch

To try the DeepUnitMatch version, start with:

  • Demo Notebooks/DeepUnitMatch.ipynb

It should take just a few minutes to run on a standard PC.

If you want to train / fine-tune a model on your own data, see:

  • Demo Notebooks/DUM_training.ipynb

Important note: DeepUnitMatch current trained model is for Npix 2.0 4-shank only. You will need to train a new model with your own data if you have any other type of probe. (For example, Mouse2 from the figshare data is a Npix 1 dataset, you'll notice the trained model won't give good results on this mouse for that reason.)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

unitmatchpy-3.4.1.tar.gz (186.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

unitmatchpy-3.4.1-py3-none-any.whl (490.3 kB view details)

Uploaded Python 3

File details

Details for the file unitmatchpy-3.4.1.tar.gz.

File metadata

  • Download URL: unitmatchpy-3.4.1.tar.gz
  • Upload date:
  • Size: 186.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for unitmatchpy-3.4.1.tar.gz
Algorithm Hash digest
SHA256 2f4617a9c6d0d9257954d79c3cab660e933bf687d3f0029d8c9f669f7a9ce029
MD5 84ead068b5ff6bbf59ddc638dbb62f2e
BLAKE2b-256 c0f48b49880e3107d54b1dc9b0f1632e71fd318459a2289da897fc09c09411d1

See more details on using hashes here.

Provenance

The following attestation bundles were made for unitmatchpy-3.4.1.tar.gz:

Publisher: publish.yml on EnnyvanBeest/UnitMatch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file unitmatchpy-3.4.1-py3-none-any.whl.

File metadata

  • Download URL: unitmatchpy-3.4.1-py3-none-any.whl
  • Upload date:
  • Size: 490.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for unitmatchpy-3.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cde0a0567a92cc06f9f411dd0d7c3e5c31f6d27129641002bebc63b2048add49
MD5 198da738ff933b8e645bce57b591152a
BLAKE2b-256 369337e013a1aeb0a385b641b6f66a424d0fb8f9b55d869527c471245b565649

See more details on using hashes here.

Provenance

The following attestation bundles were made for unitmatchpy-3.4.1-py3-none-any.whl:

Publisher: publish.yml on EnnyvanBeest/UnitMatch

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page