-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: peak_channel of the clsuters is the reference channel #93
Comments
If you look at the waveforms for units with peak channel at 191, do they look like real action potentials, or are they noise? If they are noise, then they can be safely ignored – it's unlikely that real waveforms would have a peak on the reference channel, since there's no signal there. |
Hi, jsiegle Initially, I used KS4, and I noticed that some clusters had their peak_channel appearing on a reference_channel. Then I tried KS2, and I found that there were still clusters whose peak_channel fell on channels not present in the channel_map or channel_position. However, those channels were no longer reference_channels. I am genuinely puzzled as to what might be causing this issue. Could you please provide some guidance? I would greatly appreciate your help. Best regards, |
Hi, jsiegle Initially, I used KS4, and I noticed that some clusters had their peak_channel appearing on a reference_channel. Then I tried KS2, and I found that there were still clusters whose peak_channel fell on channels not present in the channel_map or channel_position. However, those channels were no longer reference_channels. I am genuinely puzzled as to what might be causing this issue. Could you please provide some guidance? I would greatly appreciate your help. Best regards, |
It's possible that the mean waveforms module is computing the waveform across all channels, regardless of whether they were included for spike sorting. To find the peak only across channels that were used by Kilosort, you'd have to apply the same channel mask to the waveform, then calculate which channel has the highest amplitude. It would help to see some plots of the affected waveforms to better understand what's happening. |
@jsiegle vpp_allchan = np.amax(mean_waveforms, 2) - np.amin(mean_waveforms, 2) In this part of the code, meas_pkchan can include channel 191, which then replaces the peak_channel from the original clus_Table. As a result, channel 191 appears as the peak_channel in both the waveform_metrics.csv and metrics.csv files. So, if I restrict the computation of "vpp_allchan" to only include channels present in channel_map, this issue no longer occurs. I also have a small question: is this second method of finding the peak_channel intended as a double-check for the first method? Looking forward to your clarification. Best regards, |
I now realize you're using @jenniferColonell's fork of this repo -- maybe she has some insights about this? |
Hi @OlyOlympic Sorry for the confusion. If you are using C_Waves to compute the mean waveforms, the output includes all channels in the original binary. The waveform metrics module then uses those channels in its calculations. It perhaps could be improved, but this difference between channels used in the sort and channels used in the waveform metrics is accounted for in the main function of the mean_waveforms module by loading in the correct channel positions for all channels in the original binary file. |
@jsiegle @jenniferColonell Best regards, |
Hi, I have encountered an issue while working with the data in metrics.csv. Specifically, I noticed that there are clusters with peak_channel = 191. However, when using ecephys_spike_sorting/scripts/create_input_json.py, we set reference_channel to 191. Based on this, I would expect no clusters to have a peak_channel of 191.
Could you please advise if I might have made an error in my setup or processing? This situation is causing an additional problem because there is no position corresponding to 191 in channel_map or channel_position, which prevents me from determining the position of those neurons.
Additionally, I would like to ask: If reference_channel = [191], how should I configure the IMRO table or any other relevant parameters to ensure compatibility with Neuropixels during recording?
Thank you for your guidance, and I look forward to your response.
Best regards,
Oly
The text was updated successfully, but these errors were encountered: