Problems trying to assign reference channels to tetrode recordings

54 views
Skip to first unread message

Joachim Grimstvedt

unread,
Dec 20, 2022, 7:47:40 AM12/20/22
to SpyKING CIRCUS

Hey everyone!

I’ve done some recordings with the Open Ephys system using 16-tetrode ShuttleDrives and want to try out Spyking-circus to identify clusters. I previously used the in-built spike sorter in OpenEphys GUI (0.4.6,), but was recommended to try another one. I’ve mainly worked with Matlab before, so I’m fairly new to python.

 

My recordings are in vivo in mice, and should be fairly decent as far as noise goes. However, when using the in-built spike sorter in OE, I had to sacrifice one tetrode to create a mean reference for the other channels. We tried using the designated ground channels, but they proved to be too noisy in our hands. My raw files (.continuous) are not referenced however, so I need to apply a reference to the signal before spike sorting.

 

I’ve downloaded spyking circus and made parameters and probe files (attached), and I managed to run the algorithm and get some plots out.

 

However, I cannot find a good way to assign some of my channels as reference to the others, which I really need to do to get my data out.  I’d rather not use the “remove_median” setting, as this would easily include variations from individual tetrodes (and which indeed does make the signal look weird in the spyking-circus preview mode as you can see in the attachments).

 

Is there a way to assign a few channels as reference to the rest? I tried using “common_ground”, to assign the 4 channel on my most silent tetrode. First I tried “common_ground  = {12: [48, 49, 50, 51]}”  but this gave an error saying “Probe has no channel [48, 49, 50, 51] grounds in shank 12”. Then I tried with just “common_ground  = {12:48}” to have just ch48 on tetrode 12 be the ref, but then I got KeyError: 0 (see attachment). Is this just a syntax error on my end?

 

In general, I’m not certain if I designed my .prb file correctly, but I tried to group them 4 by 4. I’d like to set criteria for spike detection to be evaluated within each group of 4 tetrodes. I’m not really sure how to do this, but perhaps this is already accounted for by the radius parameter?

 

I think the Spyking-circus looks like a really great tool, and I love that its open source. The guidelines are also really comprehensive and easy to follow, but I could not an answer to these questions.

 

Best regards

Joachim SG

Continuous_Data.params
Spyking-circus preview remove median .png
16x4_shuttle.prb
Spyking-circus prompt error giving reference channels.png

Pierre Yger

unread,
Dec 20, 2022, 9:54:34 AM12/20/22
to Joachim Grimstvedt, SpyKING CIRCUS
Hi Joachim

Thanks for your interest and your feedback. In theory, in Sc, you should be able to select one ground per shank, as you have done it. The problem is that since this is not a feature I am using at all, it is not designed the way you would like it to be :-)
By reading the code, I just realized that what SC expects is a ground per shank. So then, in your case you have to pass a dict such as
{0: ground_0, 1:groud_1, .... 12: 48, ....}

I guess this is not what you want, is it? You just want to set grounds for some shanks and not others? 

Best

Pierre


--
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/c18ac7b3-8793-4b8e-89d1-4db6c1f939b8n%40googlegroups.com.

Joachim Grimstvedt

unread,
Dec 20, 2022, 12:29:20 PM12/20/22
to SpyKING CIRCUS
Hey Pierre, and thanks for the quick response! : ) 

Indeed, I would like to have just one common reference for all channels, based on 1 designated, low activity tetrode. This gave the best results with previous systems we used. 
I could use just one channel, or the average from all channels within one tetrode. Other tetrodes should not have their own ground reference, but only have the common reference subtracted from the signal. 

Would it be possible to designate all channels as if they belong to just one channel group, but assign a geometry which "isolates" the tetrodes? And within that prb. setup, maybe I can just designate some channels as grounds?

Something like: 
####
total_nb_channels = 64
radius            = 100

channel_groups = {
    # Tetrode index
    0:
        {
          'channels': [0, 1, 2, 3, ... , 42, 43, 44, 45, ... , 60, 61, 62, 63],
        'graph' : [],
          'geometry': {0:[0,0], 1:[1,0], 2:[2,0], 3:[3,0], ... ,42: ground_0 , 43: ground_1, 44: ground_2, 45:ground_3, ... , 60:[18,9], 61:[19,9], 62:[20,9], 63:[21,9] },
        },
}


Not sure if this would work. But maybe something like this could be a workaround?

Best
J

Pierre Yger

unread,
Dec 22, 2022, 4:48:40 AM12/22/22
to Joachim Grimstvedt, SpyKING CIRCUS
Yes, you can do that, put everything in a single shank and design a geometry such that channels will be considered as "independent" per tetrode groups. Then, remove the common ground to everyone with the channel id you've selected. This will work

Best

Pierre

Reply all
Reply to author
Forward
0 new messages