GaitherNews Escape the Algorithm
Today --°
Updated
Categories
Neuroscience 0 views

Spike inference from calcium imaging data acquired with GCaMP8 indicators

Article excerpt

Thank you for visiting nature.com. You are using a browser version with limited support for CSS. To obtain the best experience, we recommend you use a more up to date browser (or turn off compatibility mode in Internet Explorer). In the meantime, to ensure continued support, we are displaying the site without styles and JavaScript.

Calcium imaging is a central method in neuroscience but it records neuronal activity only indirectly and thereby produces results that are difficult to interpret. Here we evaluate the GCaMP8 calcium indicator variants, together with methods to infer neuronal spiking, and thus interpret GCaMP8 recordings. We find that the linearity of GCaMP8 indicators enables accurate detection of both single action potentials and high-frequency spiking events. Ground-truth recordings from mouse neocortex show that the most linear variants GCaMP8s and GCaMP8m (but not GCaMP6, GCaMP7f or GCaMP8f) robustly detect isolated spikes in cortical pyramidal neurons. In addition, we fine-tune and benchmark algorithms for spike inference (CASCADE, OASIS and MLSpike) with data from all GCaMP8 variants for pyramidal neurons and interneurons, and we demonstrate how the fast rise time of GCaMP8 indicators enables real-time detection of neuronal activity. Overall, we provide tools and guidelines to optimally process GCaMP8 calcium signals and highlight the key role of linearity in interpreting calcium imaging data.

Calcium imaging is an essential method in systems neuroscience that is ideally suited to study neural activity at the levels of single cells and across large populations with sub-second resolution 1 . Calcium imaging reports neuronal activity due to the influx of calcium ions during action potentials (APs) (‘spikes’) 2 , which is reflected by the fluorescence changes of the calcium-sensitive molecule, the calcium indicator. The commonly used normalized fluorescence change (∆ F / F ) is, however, a noisy, relatively slow, and nonlinear readout of neuronal spiking activity 3 , 4 , 5 , 6 . To estimate the true spike patterns from this proxy and to simultaneously denoise the recording, spike inference methods are essential tools 7 , 8 , 9 , 10 , 11 . They have been optimized for specific calcium indicators, either by tuning the parameters of a model 7 , 9 , 12 , 13 or by training supervised methods 11 , 14 , 15 . It is often not clear, though, how these methods can be optimally applied to new calcium indicators.

Calcium indicators like the GCaMP indicator family are continually refined through protein engineering 16 , 17 , 18 , 19 , 20 . The latest iterations of GCaMP optimization (the ‘f’, ‘m’ and ‘s’ variants of GCaMP8) were designed to further improve sensitivity and kinetics compared to its predecessors 21 . Yet, it remains unclear how previously established methods should be adapted for GCaMP8 data, and for which applications GCaMP8 offers specific advantages.

Here, we systematically address these questions, taking advantage of datasets with simultaneous calcium imaging and electrophysiological juxtacellular recordings of spikes from the same neurons (‘ground-truth datasets’). We investigate how spike inference with deep learning-based (CASCADE) 11 and model-based approaches (OASIS, MLSpike) 10 , 12 generalizes from previous calcium indicators to GCaMP8. We find that algorithms adapted for GCaMP8 make an important step toward more accurate and interpretable spike inference by considering the improved linearity of the ‘s’ and ‘m’ variants of GCaMP8.

We first evaluated how well algorithms for spike inference that had been optimized on GCaMP6 data generalize to GCaMP8 indicators. To enable this evaluation, we used the ground-truth datasets provided with the original GCaMP8 study 21 , 22 , consisting of recordings from L2/3 pyramidal neurons in visual cortex of anesthetized mice during spontaneous activity or during visual stimulation (Fig. 1a,b ; n = 36 neurons for GCaMP8f, n = 42 for GCaMP8m, n = 39 for GCaMP8s, plus n = 22 for GCaMP7f). Electrophysiological properties were similar to previous ground-truth recordings from pyramidal neurons in mouse cortex 5 , 17 , 23 , with a modest increase of the burst propensity (Extended Data Fig. 1 ). We complemented this GCaMP8-dataset with an existing compound ground-truth dataset using GCaMP6 indicators 11 (Fig. 1b ; n = 125). We resampled all ground-truth datasets to a consistent frame rate (30 Hz) and added Gaussian noise. This procedure allowed us to create, from the same ground-truth data, low noise recordings (standardized noise level ~2; typical for recordings of up to 100, 200 neurons 11 , 24 ) and high noise recordings (noise level ~8; typical for recordings from >1,000 neurons).

a , Schematic of ground-truth recordings, obtained by simultaneous juxtacellular electrophysiology and two-photon calcium imaging. b , Overview of calcium indicator datasets from a database before GCaMP8 (left, ref. 11 ) and datasets from the GCaMP8 study (right, ref. 21 ). c , Overview of three commonly used algorithms for spike inference. d , Example of spike inference from calcium imaging data (top trace, resampled at 30 Hz, at a standardized noise level of ‘8’, GCaMP8m), with ground-truth spike rate (black) as well as spike rates inferred by different variants of the CASCADE algorithm (blue), OASIS (pink) and MLSpike (brown). GC8-tuned models were trained with the ground-truth available across all GCaMP8 variants, while fine-tuned models were trained based only on the variant of interest (for example, GCaMP8m). The dashed box highlights an isolated AP. Spike inference for the same recording but resampled at lower noise levels is shown in Extended Data Fig. 1 . e , Quantification of model performance across all GCaMP8 ground-truth data resampled at 30 Hz and with standardized noise level of ‘8’ ( n = 117 neurons). f , Example of spike inference from the same ground-truth, resampled at high versus low noise levels. Dashed box the same as in d . g , Improvement of spike inference (increase of correlation, ∆ c , compared with using ∆ F / F as a proxy for neuronal spike rate) for low and high noise levels ( n = 117 neurons). For box plots, the median is indicated by the central line; 25th and 75th percentiles are indicated by the box; and maximum, minimum values excluding outliers (points) are indicated by the whiskers.

We evaluated several standard algorithms for inferring spiking activity from fluorescence traces (Fig. 1c ). First, we used raw ∆ F / F traces as a baseline for the benchmark. Second, we applied OASIS, a widely used method implemented in Suite2p 25 and CaImAn 26 . Third, we used MLSpike 12 , which has consistently been shown to be a state-of-the-art model-based method for spike inference 11 , 15 . Fourth, we included CASCADE 11 , a supervised method based on deep learning that was trained on a large and diverse set of calcium indicators, but with a focus on GCaMP6. The published version, henceforth referred to as ‘Default CASCADE’, has been shown to outperform other existing approaches including MLSpike. Finally, using ground-truth data from all GCaMP8 variants, we trained new CASCADE models for GCaMP8 data in general (‘GC8-tuned CASCADE’) and for each GCaMP8-variant specifically (‘fine-tuned CASCADE’, for example, ‘GC8s-tuned CASCADE’). We then compared each model’s performance in a cross-validated manner on GCaMP8 data using the correlation with ground-truth spike rates as performance metric (Fig. 1d,e ).

All models outperformed the baseline set by raw ∆ F / F for both high (Fig. 1 ) and low noise recordings (Extended Data Fig. 2 ). With default parameters, OASIS and MLSpike performed reasonably well, but their performance was improved by fine-tuning (Fig. 1e ). This improvement was modest for OASIS (from 0.72 (0.58, 0.79) to 0.74 (0.59, 0.82); median correlation with interquartile ranges (IQR) across 105 neurons) but more prominent for MLSpike, for which more parameters can be optimized (from 0.71 (0.53, 0.82) to 0.81 (0.75, 0.88)). The optimal performance was robust against parameter choices both for OASIS and MLSpike (Supplementary Figs. 1 and 2 ). Notably, the optimal decay times found for the GCaMP8 variants (0.45, 0.70 s for OASIS and 0.3, 0.8 s for MLSpike) were much longer than the measured decay time constant of the indicator (0.05, 0.2 s; ref. 21 ). This discrepancy suggests that the decay constants in these models act as heuristic rather than accurate biophysical parameters.

Default CASCADE performed better (0.75 (0.69, 0.78)) than the default version of OASIS and MLSpike ( P = 2.3 × 10 −4 and 8.6 × 10 −4 , repeated-measures analysis of variance (ANOVA)) but was surpassed by the fine-tuned version of MLSpike ( P = 6.0 × 10 −8 ). GC8-tuned CASCADE, on the other hand, performed as well as Fine-tuned MLSpike (0.82 (0.77, 0.87), P = 0.83) and outperformed all other approaches ( P = 6.0 × 10 −8 for all comparisons). Fine-tuning for specific GCaMP8 variants improved the performance compared to Fine-tuned MLSpike or GC8-tuned CASCADE only to a minor extent, if at all (0.84 (0.77, 0.89); P = 0.62 and 0.95; Fig. 1e ). We noticed that CASCADE trained on all GCaMP8 variants also performed well for GCaMP7f ground-truth (Extended Data Fig. 3 ). In addition, we noticed that spike inference yielded more accurate results across GCaMP8 variants compared to datasets obtained with GCaMP6 (Extended Data Fig. 4 ). However, this result requires careful interpretation due to potentially different recording conditions. Of note, the retrained models were not universally better; they performed better for GCaMP8 variants but worse for datasets with previous indicators (Extended Data Fig. 2c ). These results demonstrate that spike inference with GCaMP8 improves when specifically adapted to GCaMP8 data.

The quality of spike inference is limited not only by the indicator and the algorithm but also by the recording quality, in particular the shot noise level 27 , 28 . We evaluated all models for both low and high noise levels, and found no major difference in the relative performances of the different algorithms (Fig. 1e and Extended Data Fig. 1b ); however, low noise data allowed for more reliable detection of isolated spikes (Fig. 1f ). Furthermore, spike inference improved more substantially for noisier data, reflected by a larger performance increase ∆ c across neurons relative to baseline performance (∆ F / F ) for high noise (∆ c = 0.39 (0.29, 0.46)) compared to low noise (∆ c = 0.24 (0.19, 0.3); Fig. 1f,g ). This finding expands on the well-established observation that spike inference effectively denoises calcium imaging data 10 , 11 .

It has been previously shown that GCaMP8 variants, in particular GCaMP8m/s, are more linear than GCaMP6 (ref. 21 ). We performed a quantitative nonlinearity analysis using transfer functions between true and inferred spike rates (Supplementary Note 1 ). We observed that the nonlinearity of GCaMP6 is captured by Default CASCADE, resulting in distorted predictions when applied to data from all GCaMP8 variants. In contrast, CASCADE models trained with data from GCaMP8 variants exhibited a higher linearity, demonstrating that the calcium indicators GCaMP8m/s, as well as the models trained on them, behave more linearly than previous indicators and models (Supplementary Note 1 ).

Next, we investigated how specific spike patterns are affected by spike inference for GCaMP8 variants. The relationship between fluorescence and calcium concentration can be described by a Hill equation, with the Hill coefficient n determining the sigmoidal shape and the dissociation constant ( K d ) determining the inflection point of the sigmoid. The baseline calcium concentration of neurons (40, 80 nM; refs. 29 , 30 , 31 ) and the typical spike-evoked calcium changes (~40 nM; ref. 30 ) suggest that a calcium indicator with a K d value between 50 and 100 nM would be ideal to detect single APs, which fits well with the K d values of GCaM