Skip to content
This repository has been archived by the owner on May 4, 2023. It is now read-only.

Spike Alignment Question #223

Open
PatrickHonma opened this issue Oct 14, 2022 · 5 comments
Open

Spike Alignment Question #223

PatrickHonma opened this issue Oct 14, 2022 · 5 comments

Comments

@PatrickHonma
Copy link

PatrickHonma commented Oct 14, 2022

Hi Ferchaure,

I have been using wave_clus to sort .pl2 files. Using raw WB signals collected on an OmniPlex, we filtered and digital filtered in matlab to create .mat files that are then fed into Wave_clus. The sorting has been working well; example results here:
fig2print_data_354_Ch14

This data was collected during optogenetic stimulation, in which we are stimulating in periods of 2 minutes at 40 Hz (1 ms light on every 25 ms). When aligning the sorted spikes to the laser timestamps, we have noticed that some units appear ~1 ms before the laser turns on. Note that Cluster 3 is likely a light artifact. I have an alignment_window=10, w_pre = 30, w_post=44, interpolation='y', and par_detection='neg'. Will the spike_alignment with these parameters cause a shift in any of the timestamps or do you know what may be accounting for the shift in timing of these units?

@ferchaure
Copy link
Member

Hi Patrick, I don't think that spike_alignment could add a shift, maybe your filtering step? are you using zero phase filters?

@PatrickHonma
Copy link
Author

I am using the 4th order ellip filter, which should be zero phase?

@ferchaure
Copy link
Member

If you applied with the function filtfilt it should be zero phase

@PatrickHonma
Copy link
Author

Here is what I used to filter, which I believe should match up with the Wave_clus filter:

if exist('ellip','file') %Checks for the signal processing toolbox
[b,a] = ellip(4,0.1,40,[300 7500].*2./fs);
if exist('FiltFiltM','file')
filtWBdata = FiltFiltM(b, a, rawWBdata);
else
filtWBdata = filtfilt(b, a, rawWBdata);
end

The timestamps of my laser stimulations are in seconds. Do you think the conversion of the wave_clus (ms) to seconds may be causing a shift in the timestamps? #143 and #210 also mention similar issues

@ferchaure
Copy link
Member

Then the filtering is fine. I would recommend to check the alignment between recording and laser timestamps

#143 was mainly about tetrodes (and the sr parameters). Do you have your sampling rate in the file set_parameters?
#210 just didn't realised that the output as in ms

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

No branches or pull requests

2 participants