question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Mismatch between channel and cluster IDs?

See original GitHub issue

Hi Cyrille,

  1. How does Phy2 determine the channel number of a given cluster displayed under ClusterView? I thought that the correct way was to determine the channel which had the biggest template amplitude for each cluster. This seemed to be working in Phy1 but not in Phy2. An adaptation of my matlab code goes below.

  2. Under clusterView, the best channel for a given cluster seems to be mismatched. In the attached picture, you can see that even though channel 2 wasn’t include in this analysis, clusters 3, 4 and 5 indicate it as the best one.

Thanks!

% Load kilosort2 results
results_dir = 'D:\DataAnalysis\Kilosort2\monkey\ephys_2018_03_05_1452\Results';
channel_map = double(readNPY(fullfile(results_dir,'channel_map.npy')));
templates = double(readNPY(fullfile(results_dir,'templates.npy')));
spike_templates = double(readNPY(fullfile(results_dir,'spike_templates.npy')));

% Preallocate clusters_n_channels array
[n_clusters, ~, n_channels] = size(templates);
clusters_n_channels = nan(n_clusters,2);

% Determine cluster Ids
unique_spike_templates = unique(spike_templates);
clusters_n_channels(unique_spike_templates + 1, 1) = unique_spike_templates;

% Choose the channel which has the biggest template amplitude for each cluster
for i_clusters = 1 : n_clusters
    max_amplitude_channel_ind = 1;
    max_amplitude_template = max(templates(i_clusters, :, max_amplitude_channel_ind)) - min(templates(i_clusters, :, max_amplitude_channel_ind));
    for i_channels = 2 : n_channels
        temp_max_amplitude_template = max(templates(i_clusters, :, i_channels)) - min(templates(i_clusters, :, i_channels));
        if temp_max_amplitude_template > max_amplitude_template
            max_amplitude_template = temp_max_amplitude_template;
            max_amplitude_channel_ind = i_channels;
        end
    end
    clusters_n_channels(i_clusters, 2) = channel_map(max_amplitude_channel_ind);
end

phy2_channel_problem

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
rossantcommented, Aug 8, 2019

closing, please reopen if new issues arise

0reactions
JoseGuzmancommented, Sep 11, 2019

I will have to reopen the issue for a minor detail. The TraceView channel ordering will not work if phy is called when >1 probes are analyzed simultaneously. This is after using spyking-circus sorted (latest developmental version).

Attached you can find a screenshot with the most updated developmental version of phy. Channels must be 1-64 ordered in traceView. Note that WaveformView and ProbeView shows the right numeration klustaphy

Read more comments on GitHub >

github_iconTop Results From Across the Web

TiDB Cluster Management FAQs | PingCAP Docs
The etcd cluster ID mismatch message is displayed when starting PD. This is because the --initial-cluster in the PD startup parameter contains ...
Read more >
Storage LUNs that are already in use as an RDM appear ...
This issue occurs due to inconsistency of the LUN VML ID. The NAA IDs are consistent across all of the ESXi hosts in...
Read more >
Cluster fault codes - Product documentation - NetApp
All Fibre Channel nodes are unresponsive. The node IDs are displayed. Check network connectivity. fibreChannelActiveIxL. The IxL Nexus count is ...
Read more >
Troubleshoot Firepower Threat Defense (FTD) Cluster - Cisco
TCP SYN/ACK is forwarded through one of the chassis backplane interfaces to data plane CCL port-channel interface (nameif cluster).
Read more >
Error code reference - IBM
Cluster identifier is different between enclosure and node; 509. The enclosure identity cannot be read. ... A Fibre Channel adapter has a PCI...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found