cortex-lab / KiloSort

GPU code for spike sorting
GNU General Public License v2.0
179 stars 100 forks source link

Can I use Kilosort for these datasets? #97

Open ferchaure opened 7 years ago

ferchaure commented 7 years ago

Hi, I have a few questions:

marius10p commented 7 years ago

Yes.

No, but some people write the clipped spikes into a binary file in series, which Kilosort can take in. It's really not ideal, since you cannot resolve waveform overlaps very well this way.

ferchaure commented 7 years ago

I tried to sort an eMouse simulation of one channel, but this error occurs during the sorting:

Time 22.98. Preprocessing complete! Index exceeds matrix dimensions.

Error in optimizePeaks (line 119) W(:,j,:) = w(:, 1:Nrank)/sum(Sv(1:ops.Nrank).^2).^.5;

Error in fitTemplates (line 32) WUinit = optimizePeaks(ops,uproj);%does a scaled kmeans

Error in master_eMouse (line 25) rez = fitTemplates(rez, DATA, uproj); % fit templates iteratively

ferchaure commented 6 years ago

Just before that error, in optimizePeaks.m is the line: https://github.com/cortex-lab/KiloSort/blob/d748f1e45f42d53fbf86dbefb39e8dd8ce08ca26/initialize/optimizePeaks.m#L125

For one channel ops.Nrank should be 1, doesn't it? But that line set it equal to 3

ferchaure commented 6 years ago

And probably the 3 inside the reshape is related to Nrank to https://github.com/cortex-lab/KiloSort/blob/d748f1e45f42d53fbf86dbefb39e8dd8ce08ca26/mainLoop/mexMPregMUcpu.m#L12

kkatlowitz commented 6 years ago

In the meantime, as a workaround, I just pad my data with 2 extra channels that only have low white noise. As expected, Kilosort only finds spikes in my single channel