Kilosort
Kilosort copied to clipboard
Removing 'Bad Channels' in Probe or Data View
Greetings! our lab is relatively new to using Kilosort to analyze the data we have acquired using a NeuroNexus 64 channel probe in rats with an Intan RHD2000 recording system. Upon running a few of the amplifier.dat files, we can successfully run the code in Matlab 2019a without issues (using 'Run All' without deselecting any channels). However, once we start trying to delete channels that are clearly un-useful for analysis, either by clicking them in the 'Probe View' or 'Data View', we start getting Error A. Then, if we 'Run All', we get Error B. We suspect the errors are linked in some capacity since the same files will run with zero issues within Kilosort when we refrain from deselecting channels. We would greatly appreciate any direction from more experienced Kilosort users - i.e. could this be a configuration file issue when we set up the channel mapping? Or is this a known bug? If any further info is necessary to help address the issue, please let us know!
Error A Unable to perform assignment because the left and right sides have a different number of elements. Error in ksGUI/updateDataView (line 900) chListW(q) = find(cmconn==chList(q),1); Error in ksGUI/probeClickCB (line 1381) obj.updateDataView; Error in ksGUI>@(f,k)obj.probeClickCB(f,k) (line 366) set(obj.H.probeAx, 'ButtonDownFcn', @(f,k)obj.probeClickCB(f, k)); Error while evaluating Axes ButtonDownFcn.
Error B Unable to perform assignment because the left and right sides have a different number of elements. Error in ksGUI/updateDataView (line 900) chListW(q) = find(cmconn==chList(q),1); Error in ksGUI/runPreproc (line 759) obj.updateDataView(); Error in ksGUI/runAll (line 633) obj.runPreproc; Error in ksGUI>@(~,~)obj.runAll() (line 321) 'Callback', @(~,~)obj.runAll()); Error while evaluating UIControl Callback.
Sorry that this gui functionality isn't working, it's a little hard to debug from here. But, I can give you a workaround: if you change your channel map file to have a vector called 'connected' which has entries that are 'true' for all the channels you want to include and 'false' for the ones you want to exclude, then just start with that channel map file, it should work. Some of the example channel maps have this setup.
On Sun, Apr 18, 2021 at 5:30 PM Jennifer Magnusson @.***> wrote:
Greetings! our lab is relatively new to using Kilosort to analyze the data we have acquired using a NeuroNexus 64 channel probe in rats with an Intan RHD2000 recording system. Upon running a few of the amplifier.dat files, we can successfully run the code in Matlab 2019a without issues (using 'Run All' without deselecting any channels). However, once we start trying to delete channels that are clearly un-useful for analysis, either by clicking them in the 'Probe View' or 'Data View', we start getting Error A. Then, if we 'Run All', we get Error B. We suspect the errors are linked in some capacity since the same files will run with zero issues within Kilosort when we refrain from deselecting channels. We would greatly appreciate any direction from more experienced Kilosort users - i.e. could this be a configuration file issue when we set up the channel mapping? Or is this a known bug? If any further info is necessary to help address the issue, please let us know!
Error A Unable to perform assignment because the left and right sides have a different number of elements. Error in ksGUI/updateDataView (line 900) chListW(q) = find(cmconn==chList(q),1); Error in ksGUI/probeClickCB (line 1381) obj.updateDataView; Error in ksGUI>@(f,k)obj.probeClickCB(f,k) (line 366) set(obj.H.probeAx, 'ButtonDownFcn', @(f,k)obj.probeClickCB(f, k)); Error while evaluating Axes ButtonDownFcn.
Error B Unable to perform assignment because the left and right sides have a different number of elements. Error in ksGUI/updateDataView (line 900) chListW(q) = find(cmconn==chList(q),1); Error in ksGUI/runPreproc (line 759) obj.updateDataView(); Error in ksGUI/runAll (line 633) obj.runPreproc; Error in ksGUI>@(,)obj.runAll() (line 321) 'Callback', @(,)obj.runAll()); Error while evaluating UIControl Callback.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/MouseLand/Kilosort/issues/371, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABZ5IP2I7K2NS5GIFTCQDUDTJN2TFANCNFSM43EZHBGA .
Thanks! We're in the process of trying out this as a debugging line in our specific channel map file. It may be something we'll end up needing to do for each individual session (i.e. if we drive the probe and a specific channel ends up with better signal on subsequent sessions). If this doesn't work, we'll reach out!
Actually, we just edited our code for the channel mapping and are continuing to have issues with errors etc. Here is our code with the added information for one testing session, taking out known bad channels for that specific session:
Nchannels = 64;
% set connected to false for any bad/noisy channels (so kilosort doesn't % try to pull spikes from them) connected = true(Nchannels,1); bad_channels = [8,16,6,5,13,3,2,1,9]; connected(bad_channels) = false;
chanMap0ind = [53, 50, 52, 51, 55, 48, 54, 49, ... 61, 58, 60, 59, 63, 56, 62, 57, ... 37, 36, 38, 34, 40, 33, 41, 32, ... 47, 46, 43, 45, 39, 44, 35, 42, ... 16, 17, 19, 21, 18, 25, 20, 29, ... 26, 27, 28, 24, 31, 22, 30, 23, ... 04, 03, 05, 02, 06, 01, 07, 00, ... 12, 11, 13, 10, 14, 09, 15, 08]; chanMap = chanMap0ind + 1; % I think this is needed because Intan counts from zero and Matlab starts indexing at 1
xcoords = repmat(50 * (1:8),8,1); xcoords = xcoords(:)'; ycoords = repmat(200 * (1:8),1,8); kcoords = repmat(1:8,1,8); % for now, clustering sites along rows because they have 50 um spacing vs 200 um spacing vertically
fs = 20000; save(....)
We then open the gui, select data for the session, and edit the probe channel map to reflect above. The issue is now a slightly different issue then above, in that we can no long select/deselect probe channels within the 'Probe View' and can no longer use the controls set for the 'Data View'. These files appear to run fine if selecting one of the pre-made channel maps that were downloaded from the Git repository and run fine without selecting for bad channels either in the code or in the gui (i.e. running all the channels irrespective of what appears to be bad sites). The errors we see now are:
Unable to perform assignment because the left and right sides have a different number of elements. Error in ksGUI/updateDataView (line 900) chListW(q) = find(cmconn==chList(q),1); Error in ksGUI/computeWhitening (line 782) obj.updateDataView; Error in ksGUI/updateProbeView (line 1222) obj.computeWhitening() Error in ksGUI>@(~,~)obj.updateProbeView('reset') (line 273) 'Callback', @(~,~)obj.updateProbeView('reset')); Error while evaluating UIControl Callback.
Again, we would appreciate any suggestions! Thanks!
Hi, have you found your answer? Would mind to share?
@jmagnu1 @cafalchio have you resolved the issue? Please share if you've figured out how to remove bad channels. Thanks!