Skip to content

Electrophysiology notes

Demetris Roumis edited this page May 23, 2023 · 14 revisions

Ephys Research Overview

Extracellular electrophysiology, or "ephys", often refers to methods for recording the electrical activity of neurons in the brain through tiny electrodes. This can involve a range of techniques and levels of recording, from single units (inferred individual neurons), through multi-unit activity (grouped spiking from small clusters of neurons), to local field potentials (the average synaptic activity of large numbers of neurons).

Experiment Duration, Channels, Subjects

  • Ephys recording sessions can vary widely in duration, from minutes to hours, or even days in some long-term studies. My recordings were typically between 1-5 hours per session.
  • Channel count can vary from single channels in single unit recordings, to hundreds of channels in multi-electrode arrays. The bleeding edge research systems are pushing on the thousands (but still uncommon).
  • Typically, experiments are performed on animal models, often rodents, but can also include non-human primates, or in some cases, human patients.

Common Experiment Types

  • Passive Recordings: Recordings of spontaneous neuronal activity.
  • Evoked Potentials: Neuronal responses to specific, controlled stimuli.
  • Behavioral Tasks: Neuronal activity is recorded while the subject performs a specific task, which can be anything from simple movements to complex cognitive tasks.
  • Neuromodulation: Includes recordings during electrical or optogenetic stimulation.
  • Brain-Machine Interface (BMI): Neural activity is used to control external devices.

Other Modalities Commonly Used Simultaneously

  • Calcium Imaging: Allows for the visualization of neural activity via calcium dynamics (direct voltage imaging is still in infancy).
  • Behavioral Tracking: To correlate neural activity with behavior.
  • Optogenetics: For targeted activation or inhibition of specific neurons.
  • Intracellular Recordings: For direct recording of membrane potentials.

Data

Data Size

  • The data size in ephys can grow large quickly, especially with high-channel-count recordings and long recording durations. A typical one-hour recording from a 64-channel system sampled at 30 kHz can easily reach several GB in size.

Data Format

  • Typically, voltage data is stored as 16-bit integers and timestamps are 64-bit floats
  • Historically, extracellular ephys data was typically stored in binary formats, often with accompanying metadata in separate files or headers. There were other file formats for spike sorted (processed spike id and time) data and extracted (:1000 Hz) LFP data.
  • More recently, the field is starting to converge on NWB 2.0 (NWB): From open-ephys:
    • Advantages:
      • NWB is a widely used format for sharing data among neuroscience labs.
      • Data is stored in a single HDF5 file with self-documenting internal structure.
      • Files can be read using the pynwb or matnwb libraries, or with the growing number of high-level tools that support the NWB format.
    • Limitations:
      • HDF5 files must be closed gracefully, so data may be irrecoverable if the recording software crashes during acquisition.
      • The HDF5 C++ library is not thread-safe, so you cannot write to the NWB format from multiple Record Nodes simultaneously.

Data and Signal Specification

  • Units: Ephys data is typically recorded in microvolts (µV).
  • Typical Signal Range: This can vary, but often falls within a range of plus or minus 100 µV. Larger signals may be recorded, particularly during spike events. It really depends on where you are in the brain, noise isolation, and proximity to neuron sources.
  • Sampling Rate: Commonly between 10 to 30 kHz for spike data, and around 1 kHz for local field potentials (LFP).
  • Frequency Ranges of interest: From the 30 KHz raw signal.. several signals are often studied:
    • Spikes:
      • Features waveform snippets at full raw sampling (~30KHz) of action potential (spike) waveforms are used in spike sorting to attribute spikes to specific neurons. Features of the waveform for a given neuron are also helpful in categorizing neuron types.
      • When spikes are sorted into neurons, spike times (peak or center of waveform snippet) are usually saved at 1 kHz (1 ms resolution).
    • LFP:
      • Delta Waves (0.5 - 4 Hz): Delta waves are associated with deep sleep, anesthesia, and some abnormal brain states.
      • Theta Waves (4 - 8 Hz): Theta waves are observed during states such as drowsiness, REM sleep, and certain cognitive processes like memory formation and spatial navigation.
      • Alpha Waves (8 - 13 Hz): Alpha waves are prominent during relaxed wakefulness, with eyes closed but not asleep. They can be attenuated by opening the eyes or engaging in cognitive tasks.
      • Beta Waves (13 - 30 Hz): Beta waves are generally associated with active wakefulness and cognitive processing. They can be further divided into low beta (13 - 20 Hz) and high beta (20 - 30 Hz) ranges.
      • Gamma Waves (30 - 100+ Hz): Gamma waves are high-frequency oscillations that are involved in various cognitive functions such as attention, sensory processing, and memory. They can be further divided into low gamma (30 - 70 Hz) and high gamma (70 - 100+ Hz) ranges.
      • Sharp wave ripples: SWRs are characterized by several spectral components: a slow (5–15 Hz) sharp-wave, a high-frequency “ripple” oscillation (150–200 Hz), and a slow “gamma” oscillation (20–40 Hz)

Data Generation/Simulation

  • Characteristics of the signal that we want to see:

    • action potentials (spikes)
    • local field potential (LFP)
    • noise
  • Characteristics that we want to control:

    • sampling rate
    • duration
    • number of channels/electrodes
    • noise level (maybe)
  • Models:

    • Neuron Models: Hodgkin-Huxley, integrate-and-fire
    • Network Models: Can generate more complex activity by simulating interconnected neurons.
  • Noise:

    • sources: thermal noise, electrical interference, and biological variability
    • Noise Models: often modeled as Gaussian.
  • Sim Software: Tools such as Brian2, NEURON, or NEST can simulate neural activity.

    • TODO: Look into these further.. are they sufficient, too complicated, heavy dependencies?
    • Laurent Perrinet has scripts for simulating neural motifs, project ongoing

Lists/Sources of real data

  • CRCNS: neuroscience data sharing
  • DANDI Brain initiative neuro data archive
  • Specific real datasets of interest:
    • Allen Brain Observatory: Offers high-quality ephys and calcium imaging datasets with attempted best practices

Software

  • open-ephys-python-tools: Intended for reading NWB2.0 (and other) data that was recorded with their system (but hopefully also works for most NWB2.0-formatted data)

Common Analysis Packages (Especially Python):

  • SpikeInterface: A unified Python framework for spike sorting.
  • Neo: A package for representing electrophysiology data in Python.
  • Open Ephys: An open-source platform for multichannel electrophysiology.

Common Visualization Solutions (Especially Python):

  • Matplotlib and Seaborn
  • Phy: A Python tool specifically for visualizing ephys data.

Processing and Analysis

  • Data Cleaning: Similar to EEG, ephys data often need to be cleaned, including removing noise, handling missing data, and removing artifacts.
  • Spike Sorting: This is a key step in ephys analysis, where the raw signals are processed to identify the activity of individual neurons.
  • Feature Extraction: Different features of interest, such as spike rate, inter-spike intervals, spectral properties, or covariate properties (e.g. spatial selectivity) are calculated (ideally per neuron).
  • Statistical Analysis: Statistical techniques are used to compare neuronal activity across different conditions or groups.

Viz Pondering

  • How should we deal with display electrode-groups like tetrodes, octrodes, etc? They are almost always used together in processing like spike sorting and often only 1 of the electrodes (identified as having good-quality) in such a group is used for LFP analysis. Maybe accordian per group within the raw viewer? alt just display them all and color-code.. This is often the solution for other viz software.

Clone this wiki locally