Skip to content
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

Extract individual spikes from the high pass filtered data problem #90

Closed
skjenks opened this issue Jul 18, 2019 · 2 comments · Fixed by #595
Closed

Extract individual spikes from the high pass filtered data problem #90

skjenks opened this issue Jul 18, 2019 · 2 comments · Fixed by #595

Comments

@skjenks
Copy link

skjenks commented Jul 18, 2019

Hi,
I am trying to extract individual spikes from the high pass filtered data from kilosort2 by using getWaveForms (https://github.com/cortex-lab/spikes/blob/master/analysis/getWaveForms.m). My params are :

gwfparams.fileName = 'temp_wh.dat'; % .dat file containing the raw
gwfparams.dataType = 'int16'; % Data type of .dat file (this should be BP filtered)
gwfparams.nCh = 16; % Number of channels that were streamed to disk in .dat file
gwfparams.wfWin = [-40 41]; % Number of samples before and after spiketime to include in waveform
gwfparams.nWf = 2000; % Number of waveforms per unit to pull out
gwfparams.spikeTimes = readNPY('spike_times.npy'); % Vector of cluster spike times (in samples) same length as .spikeClusters
gwfparams.spikeClusters = readNPY('spike_clusters.npy'); % Vector of cluster IDs (Phy nomenclature) same length as .spikeTimes

I have been able to isolate a spike by using the raw data .dat file. However I would like to use the filtered data. What I did was switch the raw data file with temp_wh.dat run the code and I didn't get a spike but something that looked like it was from a different timestamp.

My questions are:

  1. is temp_wh.dat the high pass filtered data?
  2. if so, then how should I extract the times from the temp_wh.dat so they correspond to the raw data's channels?

@nsteinme

@marius10p
Copy link
Contributor

temp_wh.dat is data in batches, which also contains overlap between batches, which will throw off your spike times.

You are better off filtering the data yourself, by following lines 93-126 in this script

@marius10p
Copy link
Contributor

Issue has become inactive. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants