SpikeInterface / spikeinterface

A Python-based module for creating flexible and robust spike sorting pipelines.
https://spikeinterface.readthedocs.io
MIT License
495 stars 187 forks source link

Analyzing data from Neuropixels 2.0 with 4 shanks #1923

Closed ja-94 closed 1 year ago

ja-94 commented 1 year ago

Hi,

I'm using 2.0 Neuropixel probes with 4 shanks. Following the 'Analyze Neuropixels datasets' tutorial I see that si.plot_probe_map(raw_rec, ax=ax, with_channel_ids=True) produces a plot with the wrong channel mapping, where all channels appear on the first shank, even though the four shanks are plotted.

WrongChannelMap

With ax.set_ylim(-50, 3000):

WrongChannelMap

According to this issue the problem with plotting 4 shank probes was solved by upgrading to version 0.97.1, but I'm running version 0.99.0.dev0 and something similar is happening.

I run the whole tutorial and the shanks are being represented as a single one on the sortingview widget as well, so I guess they are just being treated as a single shank throughout the tutorial?

What is recommended for these probes? Should I just split the files into one per shank and analyze them separately like here, or is there a way to treat them as a single probe with four shanks?

Thanks!!

ckwalters commented 1 year ago

Seconding this issue with 4-shank np probes. The channel sites had been mapped correctly when viewing kilosort output in phy with an older version of spikeinterface (0.96.1) that I was running, but this was broken when I updated.

alejoe91 commented 1 year ago

Hi guys, can you try to install probeinterface from the main branch? I believe this has been fixed here: https://github.com/SpikeInterface/probeinterface/pull/205

ja-94 commented 1 year ago

Hi @alejoe91 ,

Thanks for your reply!

I tried erasing the older folder and re-installing with these commands:

git clone https://github.com/SpikeInterface/spikeinterface.git
cd spikeinterface
pip install -e .
cd ..

Still getting the same plot, not sure if I did something wrong.

alejoe91 commented 1 year ago

Hi @ja-94

Can you do the exact same with https://github.com/SpikeInterface/probeinterface.git ?

ckwalters commented 1 year ago

Thanks Alessio, this worked for me! Had to call pip install git+https://github.com/SpikeInterface/probeinterface.git inside my conda env (in case anyone runs into same issue).

ja-94 commented 1 year ago

That worked! Thanks @alejoe91