Spikes sorted during dead_Times

37 views
Skip to first unread message

Steven Ceto

unread,
Mar 18, 2021, 12:52:40 PM3/18/21
to SpyKING CIRCUS
Hi everyone,

I'm giving a 5-pulse train of electrical stimulation that is creating an artifact in my recordings that is pretty variable across channels. Each pulse is 0.2 ms, and they come every 2 ms. Right now I have the dead_Times file set up so that it ignores from 0.1 ms before stimulus onset to 0.5 ms after onset for each pulse. However, when I check my results from Spyking Circus in Phy, I'm seeing sorted "spikes" with their peaks right in the middle of the interval in which sorting is not supposed to happen (see attached images). This wasn't an issue when ignoring 2 ms windows every 5 seconds for wider artifacts from a different stimulation, so I'm wondering if having dead_Times that are much narrower than a spike template or at too high a frequency just doesn't work. As you can see it seems to work for the first pulse (except for channel 29, which is magnified in the lower image), but then I see more and more sorted "spikes" during the dead_Times with each additional pulse. Any insights would be much appreciated!

Thanks,
Steven
deadTimes_notDead.pdf

Steven Ceto

unread,
Mar 18, 2021, 1:49:50 PM3/18/21
to SpyKING CIRCUS
Not sure if this should be another thread, but I had a second question about the dead_Times file. If I put a separate dead_Times file for each recording in the same folder as the recordings I am trying to process as multi-files, will the algorithm be able to reference each of these files individually for each recording, or does the dead_Times file have to be the same for all the recordings? I tried doing this for six recordings, and the dead times only seemed to have been ignored for the first recording.

Thanks again!

Stephen Whitmarsh

unread,
Mar 18, 2021, 1:58:10 PM3/18/21
to Steven Ceto, SpyKING CIRCUS
Hi Steven,

I can't say with 100% certainty, but I always assumed a single dead_times file for all recordings.
I myself concatenate the artefact timings into a single file, taking care to add the correct number of samples / ms in a cumulative fashion. That works for me.

Cheers,
Stephen




Op do 18 mrt. 2021 om 18:49 schreef Steven Ceto <slc...@gmail.com>:
--
You received this message because you are subscribed to the Google Groups "SpyKING CIRCUS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spyking-circus-u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/spyking-circus-users/6ff962aa-e1cd-4659-9776-cdf94bd45d8bn%40googlegroups.com.

Pierre Yger

unread,
Mar 19, 2021, 4:07:58 AM3/19/21
to Stephen Whitmarsh, Steven Ceto, SpyKING CIRCUS
Indeed, you should only provide a single dead_file text file. However, there is a function to create such a file automatically, if you already have all your individual dead_files, and if they have the .dead extension. This is the script

>> circus-artefacts mydata.dat

This will search for all the files with the .dead extension (or .trig if you are searching for triggers), and concatenate everything, in the right order (the same that will be used by SC while concatenating your files), with the appropriate offset

So if you have a folder with files mydata_1.dat, mydata_2.dat, mydata_1.dead and mydata_2.dead, running circus-artefacts my_data_1.dat should produce a file dead_zones.txt valid for everything, with multi files

Hope I'm clear...

Best

Pierre

Pierre Yger

unread,
Mar 19, 2021, 4:14:46 AM3/19/21
to Stephen Whitmarsh, Steven Ceto, SpyKING CIRCUS
Regarding your other issue, for spike times that are found during dead zones that should have been ignored, maybe the best would be to share the data (or at least the dead_times file sucht that I can try to reproduce the problem). 
You need to be sure that the dead zones are not overlapping, but I guess this is the case, is it? 
Also, on a side note, but if you have a recurrent stim (and thus a recurrent artefact), one option to consider might be to get rid of it with the remove_artefact option. Providing a list of spike times (your triggers) and a duration (how long do you think your artefact is), the code will search for the median artefact over all channels, and subtract it from the data while sorting. 

Best

Pierre

Steven Ceto

unread,
Mar 21, 2021, 2:21:54 PM3/21/21
to SpyKING CIRCUS
Thanks, Stephen and Pierre. I will give the script a shot to get all the dead_times in one file. Unfortunately I don't think artifact subtraction will work for me because the artifact is too variable between channels (both in waveform and amplitude).

Steven Ceto

unread,
Mar 22, 2021, 11:44:52 AM3/22/21
to SpyKING CIRCUS
Hi Pierre,

So the circus-artefacts script worked, but for some reason it converts my dead times from milliseconds to seconds. Since seconds isn't a valid unit in the config file, I get an error if I try to put 's' instead of 'ms' as the 'dead_unit'. Is there a way to get it to leave the times in milliseconds?

Thanks,
Steven

Reply all
Reply to author
Forward
0 new messages