-
Notifications
You must be signed in to change notification settings - Fork 222
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
Channel sites not accurate in Phy #225
Comments
In the Phy documentation you can read that spike_times.npy contains the times (in sampling points) of all units. In spike_clusters.npy you will have an unique cluster ID (an integer) that corresponds to every spike in spike_times.npy. The first element of spike_clusters.npy the ID of the first unit in your cluster. To collect all spikes of that unit, you need to see in which position the integer appears in spike_clusters.npy, and read them from spike_times.npy. In Python, you would use something like this to get all the spikes form that first cluster: # read *npy binaries, let path be the location of your sorting (e.g. $HOME/binaries/Nobelprize/TC001/kilosorting/)
spike_times = np.load(path + 'spike_times.npy').flatten()
spike_clusters = np.load(path + 'spike_clusters.npy')
myid = spike_clusters[0] # first unit (an integer)
spike_times[np.where(spike_clusters==myid)] If you divide the length of by the size of the recording by the size of your recording (in sec.) you can get the average firing rate of your Unit. You will see that Phy returns a similar value (with 2 decimal points accuracy, though) |
Thank you! |
Hi,
After using KS2 for sorting my data, I obtain the unit activities for each of the clusters and then compute the firing rate. I want to know which cluster belongs to what channel and I was relying on Phy for it. However, the firing rate computed by Phy for my cluster of interest is different from what I calculated. Is there a way I can find the exact channel sites for the clusters?
The text was updated successfully, but these errors were encountered: