KiloSort icon indicating copy to clipboard operation
KiloSort copied to clipboard

Error using randperm, error with templates

Open dberisha opened this issue 5 years ago • 1 comments

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!

dberisha avatar Jan 03 '20 15:01 dberisha

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.

nikolaskaralis avatar Sep 17 '21 20:09 nikolaskaralis