cortex-lab / phy

phy: interactive visualization and manual spike sorting of large-scale ephys data
BSD 3-Clause "New" or "Revised" License
312 stars 157 forks source link

which amplitude value is correct? #1295

Open zkcsmxz opened 1 month ago

zkcsmxz commented 1 month ago

Hi I used Kilosort4.0.13 for spike sorting and Phy2.0a for checking and splitting the cluster.

I got two different values of neuron amplitude. a. from cluster_Amplitude.tsv or cluster_info.tsv. b. I take all the spike amplitude from 'amplitudes.npy' and cell cluster from 'spike_clusters.npy', then take the mean of amplitude for each cell.

both methods give me the same amount of spike per cell. but the mean amplitudes are different.

my question is which amplitude value is correct?

PS. When I split in phy, one cell separated into two cells, which should have different firing rates and amplitudes. In 'cluster_info.tsv', although there are new cell IDs and new firing rates, the amplitudes remain the old data. I think there may be a bug.

thank you

捕获

the code for the second method (Matlab) spike_clusters = readNPY('spike_clusters.npy'); n = unique(spike_clusters); amplitudes = readNPY('amplitudes.npy'); for k1 = 1: length(n) clear temp temp = amplitudes(find(spike_clusters==(n(k1)))); neuron_Amp(k1,1) = mean(temp); end

zm711 commented 1 month ago

What are you using the amplitudes for? They are not real necessarily "real" amplitudes because they are not scaled. If you want more realistic amplitudes I would recommend using something like spikeinterface which will convert to microvolts. If you are just wanting to do comparisons then it would be okay to use these unscaled amplitudes. That being said if it is really not updating that is a problem because it should. Could you try running the same data with KS2,2.5 or 3 and see if the amplitude is corrected when splitting. That would tells us this is a KS4 issue vs a Phy issue.