Generative model of fluorescence time series.

(A) Graphical representation of the generative model described in the main text. White circles denote unknown variables, grey circles denote measurements and bare variables are fixed prior hyperparameters. Plates denote groups of variables. (B) List of parameters and corresponding priors.

Validation of the spike inference approach with simulated data.

(A) Example trajectory simulated from the model (solid, black) with ground-truth spike times shown underneath (grey vertical lines). (B) Raster plot representing spike times for a thousand Monte Carlo samples. (C) Average spike counts over the Monte Carlo samples at each time frame. (D) Comparison between ground-truth counts over 1s bins (black dots, from the example trace in A) and the corresponding posterior distributions (red boxes). (E-F) Comparison of ground-truth firing state and baseline (solid, black) to estimated ones (blue). Shading indicates one standard deviation from posterior averages. (G) Posterior distributions of peak response upon a single spike, decay time, rise time, and noise level compared with true value (vertical lines in green).

Dependency of inference performance on noise and firing frequency and the bias of non-bursting models.

(A) Example fluorescence time series simulated at 5Hz and 50Hz bursting frequencies (top). The analysis of these traces using the bursting and non-bursting variant of the model highlights the large bias generated by the non-bursting model at high frequency (bottom). (B-D) Quantification of correlation with true spikes, average error, and bias at different levels of SNR and frequency. At increasing firing frequency, the correlation with ground-truth spikes generally increases. This is an effect of calculating correlations at fixed temporal resolution. The average error was quantified as the sum of the absolute deviation from the true spike counts divided by the number of time steps.

Comparison of PGBAR with existing methods using analysis of CASCADE benchmark data.

(A) Correlation between estimated and ground-truth firing rates filtered with a 200ms bandwidth Gaussian kernel (CASCADE dataset). The color code represents the different calcium indicators employed in each dataset.(B) Correlation with ground-truth spikes as a function of the standardized noise level (Rupprecht et al., 2021). (C) Comparison with existing methods. Correlation averaged across datasets and neurons.

Analysis of GCaMP6f recordings from the CASCADE dataset.

(A) example ∆F/F from the CASCADE dataset (#DS09, GCaMP6f, mouse visual cortex) with ground-truth spikes shown underneath fluorescence (top), comparison of spike counts within 1s time intervals (middle) and burst probability (bottom). Shading denotes uncertainty within one standard deviation. (B) Comparison between posterior distributions of the model parameters (histograms) and priors (continuous densities): maximal calcium response to single spikes (Amax), initial calcium level (c0), decay and rise time, noise level (σ2), bursting (r1) and baseline (r0) firing rates, transition rates between firing states (w0→1, w1→0).

Sensitivity of spike detection to sampling frequency and SNR level.

(A) Examples of simulated fluorescence traces with two spikes separated by 10ms (vertical lines) at low SNR (1.4, bottom) and high SNR (3.4, top). Shaded bands display denoised fits (calcium fluorescence plus baseline) within one standard deviation. (B) Posterior distributions of the inter-spike interval (ISI). Increasing SNR (from bottom to top) and sampling frequency (left to right) has the effect of reducing the ISI posterior variance, bringing the maximum-a-posteriori estimate (MAP) closer to the ground-truth. (C) Posterior probability of the ISI to be within an interval of 3ms centered around the ground truth ISI as a function of SNR and ground-truth ISI with sampling frequency of 1, 2 and 3kHz. (D) Trial-to-trial variability of ISI posterior distributions. We analyzed 12 simulated fluorescence traces with sampling frequency of 3kHz and two spikes separated by 5ms. Density plots have been smoothed with 1ms bandwith. For all simulations we used τr = 3.7ms and τd = 40ms.

High-speed 2-photon linescan calcium imaging.

(A) GCaMP8f virus injection in the cerebellar vermis. (B) Induction of action potentials to cerebellar granule cells by direct stimulation of the parallel fibers. (C) Single pulse stimulation to extract kinetic model parameters of GCaMP8f indicator. (D-E) High-speed (3kHz) 2-photon linescan calcium imaging of granule cell somata. (D) Representative fluorescence time series from a single trial and (E) heatmap showing fluorescence transients evoked using the same Poisson train across trials. Single-trial fluorescence (D) and denoised fit (calcium level plus baseline). (F) Spike detection for each trial. (G) 100 ms time window highlighting the first four stimulation-induced action potentials. Normalized fluorescence and denoised fit (top), average spike count (bottom). Orange vertical lines denote stimulation time points. (H) Comparison of the posterior distributions of the interval between the first two detected spikes across experimental trials. The solid vertical line at 5.3 ms denotes the time interval between the first two stimulations. (I) Comparison of the posterior modes of the inter-spike interval across trials between real data and simulations.

Temporal resolution analysis across somatic and bouton recordings.

(A) Average spike count estimated from 6 somata and 4 boutons (5 trials each). (B) Time from stimulus time predicted spike averaged across all 29 stimulations per trial. The comparison between somas and boutons shows that somatic transients are delayed by 1 ms. (C) Correlation between predicted spikes and stimulation events across time scales.