Designing your probe file

What is the probe file?

In order to launch the code, you must specify a mapping for your electrode, i.e you must tell the code how your recorded data can be mapped onto the physical space, and what is the spatial position of all your channels. Examples of such probe files (with the extension .prb) can be seen in the probes folder of the code. They will all look like the following one:

total_nb_channels = 32
radius            = 100

channel_groups = {
    1: {
        'channels': list(range(32)),
        'graph' : [],
        'geometry': {
            0 : [20, 0],
            1 : [20, 40],
            2 : [40, 210],
            3 : [40, 190],
            4 : [40, 150],
            5 : [40, 110],
            6 : [40, 70],
            7 : [40, 30],
            8 : [20, 160],
            9 : [20, 200],
            10 : [40, 50],
            11 : [40, 90],
            12 : [40, 130],
            13 : [40, 170],
            14 : [20, 120],
            15 : [20, 80],
            16 : [20, 100],
            17 : [20, 140],
            18 : [0, 170],
            19 : [0, 130],
            20 : [0, 90],
            21 : [0, 50],
            22 : [20, 220],
            23 : [20, 180],
            24 : [0, 30],
            25 : [0, 70],
            26 : [0, 110],
            27 : [0, 150],
            28 : [0, 190],
            29 : [0, 210],
            30 : [20, 60],
            31 : [20, 20],
        }
    }
}
../_images/probe.jpg

An example of a probe mapping, taken from Adam Kampff

This prb format is inherited from the phy documentation, in order to ensure compatibility.

Key parameters

As you can see, an extra requirement of the SpyKING CIRCUS is that you specify, at the top of the probe file, two parameters:

  • total_nb_channels: The total number of channels currently recorded. This has to be the number of rows in your data file
  • radius: The default spatial extent [in um] of the templates that will be considered for that given probe. Note that for in vitro recording, such as the MEA with 252 channels, a spike can usually be seen in a physical radius of 250um. For in vivo data, 100um seems like a more reasonable value. You can change this value in the parameter file generated by the algorithm (see documentation on the configuration file)

Channel groups

The channel_group is a python dictionary where you’ll specify, for every electrodes (you can have several of them), the exact geometry of all the recording sites on that probe, and what are the channels that should be processed by the algorithm. To be more explicit, in the previous example, there is one entry in the dictionary (with key 1), and this entry is itself a dictionary with three entries:

  • channels: The list of the channels that will be considered by the algorithm. Note that even if your electrode has N channels, some can be discarded if they are not listed in this channels list.
  • graph: Not used by the SpyKING CIRCUS, only here to ensure compatibility with phy
  • geometry: This is where you have to specify all the physical positions of your channels. This is itself a dictionary, whose entries are the number of the channels, and whose values are the position [in um], of the recoding sites on your probe.

Note

You only need, in the geometry dictionary, to have entries for the channels you are listing in the channels list. The code only needs positions for analyzed channels

Examples

By default, during the install process, the code should copy some default probe files into /home/user/spyking-circus/probes. You can have a look at them.

How do deal with several shanks ?

There are two ways to simply handle several shanks:

  • in the .prb file, you can create a single large channel group, where all the shanks are far enough (for example in the x direction), such that templates will not interact (based on the physical radius). If your radius is 200umm, for example, if you set x to 0 for the first shank, 300 for the second one, and so on, templates will be confined per shank.
  • in the .prb file, you can also have several channel groups (see for example adrien.prb in the probes folder). What is done by the code, then, is that during internal computations templates are confined to each channel groups. However, for graphical purpose, when you’ll use the GUI, the global x/y coordinates across all shanks are used. Therefore, if you do not want to have them plotted on top of each other, you still need to add a x/y padding for all of them.