Skip to the content.

Back to the projects list

Visualizing Raw Data

Key Investigators

Josh Siegle (Allen Institute), Jeremy Magland (Flatiron Institute)

Project Description

A crucial (but often ignored) step in the spike sorting process is visual inspection of the raw data before and after pre-processing steps have been performed. This can be done by looking at the raw traces for individual channels, but a qualitative assessment of overall data quality is often easier to grasp by looking at the channels x samples matrix displayed as an image. Using standard Python plotting libraries does not allow efficient interactions with large datasets, which is one reason why this step may be skipped.

We will attempt to overcome this limitation by using deck.gl, a visualization framework for big datasets that works well in the browser and in Python environments (via the pydeck bindings). Many of its functions assume you’re looking at geospatial data, but for the most part they are general enough to be adapted for ephys. Other frameworks may work as well, but deck.gl seems the best for getting up and running quickly.

Objectives

  1. Create an interactive visualization of high-channel-count raw + preprocessed data that can run in a browser or a Jupyter notebook
  2. Overlay sorting results on top of the original data
  3. Integrate with existing tools, such as SpikeInterface and sortingview

Approach and Plan

  1. Talk with other hackathon attendees to determine whether there are any unforeseen limitations of deck.gl that make it unsuitable for this application.
  2. Select a visualization framework (deck.gl or an alternative)
  3. Create an interactive visualization of raw data. This will likely require an intermediate step in which the data is saved as an image pyramid or other multi-scale format.
  4. Create an interactive visualization of spike sorting results, with spikes distributed in space and time.
  5. Combine the outputs of 3 + 4 into one visualization.
  6. Add raw data plotting functions to SpikeInterface and (time permitting) sortingview.

Progress

Pre-hackathon

During the hackathon

The last example demonstrates how these plotting methods can be used in practice: given a set of SpikeInterface recording extractors, it’s now possible to generate a link to a scrollable, zoomable visualization of the raw data.

Next steps

Materials

Example data for this project. Includes raw traces for a Neuropixels 1.0 and 2.0 recording, plus Kilosort 2 sorting results.

Background and References

deck.gl TileLayer example - useful for displaying raw data

pydeck ScatterplotLayer example - useful for displaying sorting results