cortex-lab / KiloSort

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

Error using randperm, error with templates #214

Open dberisha opened 4 years ago

dberisha commented 4 years ago

Hello all,

I'm trying to run kilosort on 32-channel data.

For some of our rats, the data is pretty "quiet." For those few rats, I get this error (for others there is no issue running kilosort):

Error using randperm K must be less than or equal to N.

Error in extractTemplatesfromSnippets (line 54) wTEMP = dd(:, randperm(size(dd,2), nPCs));

Error in learnTemplates (line 12) [wTEMP, wPCA] = extractTemplatesfromSnippets(rez, NrankPC);

Error in learnAndSolve8b (line 12) rez = learnTemplates(rez, iorder0);

Thanks in advance!

nikolaskaralis commented 3 years ago

For future readers: The core issue that leads to this error is an improper assignment of xcoords and ycoords.

Ensure that your channels have distinct ycoords and it should fix this problem.