Abstract
Two-photon calcium imaging is often used with genetically encoded calcium indicators (GECIs) to investigate neural dynamics, but the relationship between fluorescence and action potentials (spikes) remains unclear. Pioneering work linked electrophysiology and calcium imaging in vivo with viral GECI expression, albeit in a small number of cells. Here we characterized the spike-fluorescence transfer function in vivo of 91 layer 2/3 pyramidal neurons in primary visual cortex in four transgenic mouse lines expressing GCaMP6s or GCaMP6f. We found that GCaMP6s cells have spike-triggered fluorescence responses of larger amplitude, lower variability and greater single-spike detectability than GCaMP6f cells. Single spike detection rates differed substantially across neurons in each line. They declined from ∼40-90% at 5% false positive rate under high-resolution imaging to ∼10-15% when imaging hundreds of neurons across a larger field of view. Our dataset thus provides quantitative insights to support more refined inference of neuronal activity from calcium imaging data.
Introduction
Genetically encoded calcium indicators (GECIs) are widely used with two-photon (2-p) laser scanning microscopy to report neuronal activity within local populations in vivo (Luo et al., 2018). By reporting changes in calcium-dependent fluorescence, this optical approach is minimally invasive and enables simultaneous measurement of activity from hundreds or even thousands of neurons at single-cell resolution. As such, calcium imaging has become an attractive alternative to extracellular electrophysiology for surveying large neuronal populations of genetically identified cells, in particular over multiple sessions. Indeed, using a newly developed GECI such as GCaMP6s, fluorescence changes associated with isolated single spikes (action potentials) in vivo can be reliably detected when imaged at sufficiently high spatiotemporal resolution (Chen et al., 2013).
However, despite recent advances in imaging approaches and GECI development, calcium imaging remains an indirect measure of a neuron’s spiking activity. Inferring the underlying spike train or firing rate from calcium imaging remains challenging (Theis et al., 2016; Berens et al., 2018), in part because the relationship between spiking activity and calcium dynamics is complex and has not been fully characterized. The spike-to-calcium fluorescence transfer function depends on several factors, including (1) the relationship between changes in GECI fluorescence and changes in intracellular calcium concentration, and buffering effects (Rose et al., 2014); (2) the neuronal cell types expressing the GECI, due to differences in intracellular calcium dynamics; (3) GECI expression level (e.g. differential viral uptake and expression when using viral GECI delivery); and (4) the behavioral state of the animal, due to changes in calcium dynamics, e.g. by neuromodulators (Nadim and Bucher, 2014). Together, these variables underlie the difficulty of linking calcium imaging studies to the large body of existing knowledge concerning spiking activity.
Compared to viral expression, transgenic mouse lines offer convenience (e.g. bypassing virus injection and associated procedures) and achieve more uniform GECI expression in genetically defined neuronal populations (Madisen et al., 2015; Daigle et al., 2018). This should permit a more straightforward comparison of activity across cells and animals. Using our intersectional transgenic mouse lines that enable Cre recombinase-dependent expression of GCaMP6s or GCaMP6f, we simultaneously characterized the spiking activity and fluorescence of individual GECI-expressing pyramidal neurons in layer (L) 2/3 of mouse primary visual cortex (V1). Consisting of 91 neurons from 4 mainstream transgenic lines, this ground truth dataset provides quantitative insight into the relationship between in vivo spiking activity and observed fluorescence signals, and will aid the interpretation of existing and future calcium imaging datasets.
Results
Dataset overview
To characterize the single-cell transfer function between observed fluorescence signals and underlying spikes in vivo, we performed simultaneous calcium imaging and cell-attached recordings in V1 L2/3 excitatory pyramidal neurons in anesthetized mice (Figure 1A, see Methods). The mice were from 4 transgenic lines, including 2 GCaMP6s-expressing lines, Emx1-IRES-Cre;Camk2a-tTA;Ai94 (referred to as Emx1-s in this study) and Camk2a-tTA;tetO-GCaMP6s (tetO-s), and 2 GCaMP6f-expressing lines, Emx1-IRES-Cre;Camk2a-tTA;Ai93 (Emx1-f) and Cux2-CreERT2;Camk2a-tTA;Ai93 (Cux2-f) (Table 1). A total of 237 neurons, all of which had apparent baseline fluorescence which was clearly excluded from the nuclei, were randomly selected to record and image for spontaneous activity or visually-evoked responses. To directly compare our results to virally-expressed GCaMP6f and GCaMP6s (Chen et al., 2013), calcium imaging was performed at high optical zoom focused on individual cells (field of view of ∼20 × 20 µm at ∼158 frames per second; fps). We also patched and imaged a subset of these neurons at a lower zoom factor, i.e. one at which the responses of many neurons can be characterized in parallel (field of view of ∼400 × 400 µm at ∼30 fps), allowing direct comparison of calcium fluorescence responses acquired at higher spatiotemporal resolution with that more commonly employed by other studies including our Brain Observatory dataset (de Vries et al., 2019).
A large number (>550) of individual recording/imaging sessions, 2-4 min each, were obtained from these 237 cells (multiple sessions were collected for some cells in cases where the patch remained stable). Upon careful inspection of these sessions, we selected 91 cells with high-quality recording and imaging conditions from the 4 mouse lines (Table 1) for analysis, each with only one recording/imaging session for unbiased sampling.
Constructing single-cell spike-to-calcium fluorescence response curves
Throughout the manuscript, “spike” and “spiking activity” always refer to fast, presumably Na+ mediated, all-or-none electrical events. To delineate the relationship between spiking activity and GCaMP6 fluorescence, we focused on isolated spiking events whose calcium responses were well-separated from, and thus minimally contaminated by, those of adjacent spikes. A spiking event is defined as a group of spikes within a spike summation window (150 ms and 50 ms for GCaMP6s and GCaMP6f, respectively) with no spikes in the pre-event and post-event exclusion windows (150 ms and 50 ms pre and post respectively for GCaMP6s, and 50 ms both pre and post (after the last spike) for GCaMP6f) (Figure 1B). We summed the number of spikes within each spiking event, aligned fluorescence responses to the first spike within the event, and computed the peak fluorescence change (dF/F peak) during the calcium response window (200 ms for GCaMP6s, 50 ms or 75 ms for GCaMP6f in single-spike or multi-spike events) (Figure 1B-D; see Methods for spike exclusion, spike summation, and calcium response windows). Spiking events were binned based on the number of spikes within each event. Following this approach, we constructed single-cell spike-to-calcium fluorescence response curves (dF/F peak as a function of the number of spikes, with a minimum requirement of 3 events per bin; Figure 2). Events with >5 spikes were excluded from analysis due to the low frequency of such events (e.g., ≥3 6-spike events were observed in 2 out of 32 Emx1-s cells, 0 out of 6 tetO-s cells, 5 out of 26 Emx1-f cells, and 1 out of 27 Cux2-f cells; also see Figure 6C, i below).
For calcium imaging data, we first examined the effect of fluorescence background subtraction on the peak dF/F signal. Following methods for virally expressed GCaMP6 (Chen et al., 2013), the background neuropil signal was estimated as the mean fluorescence of all pixels within 20-µm from the cell center, excluding the selected cell, and neuropil subtraction was performed as: Fcorrected(t) = Fmeasured(t) – r × Fneuropil(t), where r was the neuropil contamination ratio (Figure 2– figure supplement 1). Neuropil subtraction using a constant r-value for all cells (ranging from 0.1 to 0.7, where 0.7 was used for virally expressed GCaMP6) did not consistently decrease within-cell variability of dF/F peak (i.e. variability across spiking events) (Figure 2–figure supplement 1D). Given the potential for artificially boosting dF/F due to lower baseline fluorescence (see example cell in Figure 2–figure supplement 1B-C), we chose not to perform neuropil correction in this study (however, see Figure 3–figure supplement 3 and Figure 5– figure supplement 3 below).
Population spike-to-calcium fluorescence response curves
To compare the relationship between spikes and fluorescence for the 4 mouse lines, population response curves were constructed by averaging together responses of individual neurons (Figure 3A). Spontaneous and visually-evoked responses were similar (Figure 3–figure supplement 1) even though they were not recorded from the same cell and/or animal, and were therefore pooled in the population responses. Data from mice anesthetized with isoflurane (n = 77 cells from 18 mice) and urethane (n = 14 cells from 4 mice; see Methods) were also pooled as their response curves and firing rates were consistent with each other (Figure 3–figure supplement 2).
Of the 4 mouse lines, tetO-s exhibited the largest single-spike fluorescence response (dF/F peak: 13.6±3.7%, mean ± sd), followed by Emx1-s (7.8±2.6%), Cux2-f (6.0±1.6%), and Emx1-f (4.5±1.6%) (Figure 3A-D). The response curve slopes (representing the average dF/F increase per spike, computed from linear regression of dF/F peak against the number of spikes) of the 4 lines were comparable to each other, with tetO-s being somewhat higher (Figure 3E).
For a more direct comparison with that of viral GCaMP6 (Chen et al., 2013), we additionally analyzed our data using a neuropil contamination ratio of 0.7 (Figure 3–figure supplement 3). Aggregating spiking events across cells, mean dF/F peak in response to 5-spike events within 150 ms and 50 ms for GCaMP6s and GCaMp6f, respectively, was 135% for Emx1-s, 117% for tetO-s (130% in response to 4-spike events), 130% for Emx1-f, and 93% for Cux2-f. In comparison, Chen et al. reported ∼200% and ∼100% mean dF/F peak in response to 5-spike events within 250 ms for viral GCaMP6s and GCaMP6f, respectively. Without neuropil subtraction, mean dF/F peak in response to 5-spike events was 62% for Emx1-s, 73% for tetO-s, 62% for Emx1-f, and 52% for Cux2-f (Figure 3B, bottom).
Fluorescence response variability
Within-cell variability of dF/F peak, as measured by the mean coefficient of variation across all spiking events, was significantly larger in GCaMP6f-expressing cells compared to that in GCaMP6s (Figure 4A). Likewise, within-cell variability for single-spike events was significantly larger in GCaMP6f-expressing cells compared to that in GCaMP6s. In GCaMP6f-expressing cells (but not GCaMP6s-expressing cells), single-spike events exhibited significantly larger within-cell variability compared to multi-spike events (Figure 4B). Between-cell (cell-to-cell) variability of dF/F peak was generally similar across the 4 lines (Figure 4C).
To determine the signal-to-noise ratio (SNR) and whether single-spike events could be distinguished from zero-spike events (imaging noise), we first identified no-spike intervals of ≥1 s, separated by ≥4 s and ≥1 s from previous and subsequent spikes, respectively, for analysis (Figure 4–figure supplement 1A). We then randomly sampled the corresponding calcium fluorescence traces to obtain snippets of fluorescence with the same length as single-spike events, and computed dF/F peak and the standard deviation of dF/F (an estimate of the noise floor) using the same calcium response windows as single-spike events (50 ms and 200 ms for GCaMP6f and GCaMp6s, respectively; Figure 4–figure supplement 1B). The mean single-spike response was different from the mean imaging noise in 90% or 27 out of 30 Emx1-s cells with at least 1 no-spike interval (out of 32 total cells), 100% or 4 out of 4 tetO-s cells with at least 1 no-spike interval (out of 6 total cells), 96% or 22 out of 23 Emx1-f cells with at least 1 no-spike interval (out of 26 total cells), and 83% or 19 out of 23 Cux-f cells with least 1 no-spike interval (out of 27 total cells) (Figure 4–figure supplement 1C-E).
Emx1-f and tetO-s cells exhibited the lowest and highest noise floor, respectively. Normalizing the single-spike dF/F peak by the noise floor, the single-spike SNR for GCaMP6s was significantly larger than that of GCaMP6f (Figure 4–figure supplement 2A), although a difference in single-spike SNR was not observed between Emx1-s and tetO-s as in the single-spike dF/F peak (Figure 3D). The population response curve expressed in SNR (Figure 4– figure supplement 2B) largely resembled that expressed in dF/F peak (Figure 3B), with the exception of tetO-s cells, whose SNR was lower due to a higher noise floor. However, tetO-s, with a small sample size (n = 4 cells with at least 1 no-spike interval), also had few multi-spike events (e.g. only 1 cell with 4-spike events).
Spike detection
We next examined spike detection at the single-trial level. Mean (± sd) detection rates were 63±25% and 94±11% for Emx1-s, 87±15% and 100% for tetO-s, 48±21% and 82±26% for Emx1-f, and 40±27% and 74±22% for Cux2-f for single-spike and 2-spike events, respectively, at 5% false positive rate (Figure 5). Spike detection rates differed substantially between cells, from 0 to 100% for isolated spikes detected with GCaMP6s at 1% false positive rate (Figure 5). Single-spike detection rate was ≥90% in 13% (4 of 30) Emx1-s cells, 75% (3 of 4) tetO-s cells, 4% (1 of 23) Emx1-f cells and 0% (0 of 22) Cux2-f cells, at 5% false positive rate with no neuropil subtraction.
Previous studies have documented substantial contamination of somatic traces with fluorescence from the surrounding neuropil, due to the extended nature of the microscope point spread function. Neuropil contamination is often removed by subtracting a scaled version of the neuropil fluorescence from the somatic fluorescence. The scale factor is often referred to as the r-value and many studies employ the same r-value, often 0.7, for all neurons (Akerboom et al., 2012). For each neuron, we found the optimum r-value, defined as the r-value which resulted in the maximum number of detected spikes at the minimum false positive rate and calculated as the r-value that maximized the area under the ROC curve. Optimal r-values differed greatly between cells. Mean±sd optimal r-values were 0.39±0.30 for Emx1-s (range 0 to 0.8, with r<0.5 in 14 of 30 cells or 47%), 0.28±0.31 for tetO-s (range 0 to 0.7, with r<0.5 in 3 of 4 cells or 75%), 0.43±0.33 for Emx1-f (range 0 to 1, with r<0.5 in 13 of 22 cells or 59%), and 0.33±0.36 for Cux2-f (range 0 to 1, with r<0.5 in 15 of 22 cells or 68%) (Figure 5–figure supplement 1). In the Allen Brain Observatory, r-values were calculated individually for each neuron and follow similar distributions to these optimal r-values. At optimal r-values, the single-spike detection rate at 5% false positive rate was 76±21% (mean±sd) for Emx1-s, 92±11% for tetO-s, 52±23% for Emx1-f, and 40±27% for Cux2-f.
Spiking characteristics
Spontaneous or visually evoked firing rates of individual cells, computed from the total number of spikes detected during a recording, were similar across mouse lines (Emx1-s: 1.17±0.71 Hz, mean±sd; tetO-s: 0.96±0.40; Emx1-f: 1.52±1.34; Cux2-f: 1.47±1.43; referred to as spikes detected in Figure 6A). After preprocessing (selecting isolated spiking events with ≤5 spikes within spike summation windows of 150 ms and 50 ms for GCaMP6s and GCaMP6f, respectively, and excluding atypical spiking events - see Methods), 70-78% of detected spikes were included in the response curve analysis (Figure 6B; referred to as spikes analyzed in Figure 6A). For all mouse lines, >50% of analyzed spikes occurred in multi-spike events and not as isolated single spikes (Figure 6C; see Figure 6–figure supplement 1 for a comparison of spiking characteristics between spontaneous and visually-evoked cells). The fraction of single-spike events within spike summation windows was largest in Cux2-f (48%), followed by tetO-s (37%), Emx1-s (32%), and Emx1-f (23%).
In multi-spike events, we assessed whether variability in dF/F peak could be attributed to the mean inter-spike interval (ISI) within the spiking event (here, the maximum ISI corresponded to the spike summation window: 150 ms and 50 ms for GCaMP6s and GCaMP6f, respectively). Pooling multi-spike events from all cells, the mean ISI was negatively correlated with dF/F but explained little of its variance (R2 ranging from 0.03 to 0.21; Figure 6–figure supplement 2). Breaking this down into individual cells, we found a small fraction of cells having spiking events with significant correlation coefficients of dF/F peak and mean ISI (Figure 6–figure supplement 3A-B). Within these cells, a negative correlation between mean ISI and dF/F peak was observed, and for 4- and 5-spike events, R2 ranged from ∼0.4 to 0.9 (Figure 6–figure supplement 3C), likely contributing to the overall negative correlation at the population level.
Comparing spike-to-calcium fluorescence response curves imaged at high and low spatiotemporal resolutions
For a subset of cells, we performed calcium imaging at both high zoom (focusing on individual cells; ∼20 × 20 μm field of view at 0.2 μm per pixel and ∼158 fps) and low zoom (population imaging; ∼400 × 400 μm field of view at 0.8 μm per pixel and ∼30 fps, with 1 Emx1-f cell at 1.6 μm per pixel and ∼60 fps) (Table 1, Figure 7A), enabling a direct comparison of their spike-to-calcium fluorescence response curves (Figure 7B). For Emx1-f and Cux2-f, the slope of the spike-to-calcium fluorescence response curve was significantly smaller when imaged at lower spatiotemporal resolution, despite no detected difference in mean firing rates between groups (Figure 7C-D; Figure 7–figure supplement 1A). A similar trend was observed in Emx1-s cells (p = 0.05, paired t-test) between response curve slopes at high- and low-zoom. Across all 3 lines, imaging at low-zoom consistently resulted in higher variability of dF/F peak, both within individual cells (Figure 7B, Figure 7–figure supplement 1B-C) and between cells (Figure 7– figure supplement 1D). Furthermore, the mean single-spike response was different from the mean imaging noise in fewer cells at low-zoom compared to that at high-zoom for all mouse lines (Figure 7–figure supplement 1E), with higher noise floors and lower SNRs (Figure 7– figure supplement 1F).
At the single-trial level, detection of single-spikes was 15±12% for Emx1-s (compared to 52±28% for the same cells imaged at high-zoom), 15±8% for Emx1-f (47±18% at high-zoom), and 9±7% for Cux2-f (42±26% at high-zoom) at 5% false positive rate (Figure 7–figure supplement 2). For 2-spike events, detection rate at low-zoom was 36±22% for Emx1-s (compared to 92±16% for the same cells imaged at high-zoom), 16±11% for Emx1-f (86±23% at high-zoom), and 19±12% for Cux-f (73±24% at high-zoom) at 5% false positive rate.
Discussion
Calcium imaging is widely used to report neuronal spiking activity in vivo. However, accurate spike inference from calcium imaging remains a challenge, and there are relatively few ground truth datasets with simultaneous calcium imaging and electrophysiology to aid the development of more accurate spike inference algorithms. In a recent challenge (Spike Finder; http://spikefinder.codeneuro.org/) (Berens et al., 2018), ∼40 algorithms were trained and tested on datasets consisting of 37 GCaMP6-expressing cells, underscoring the need for additional GCaMP6 calibration data. In addition to supporting efforts toward spike inference, an improved understanding of the relationship between spiking and observed fluorescence signals is necessary to further broaden the utility and impact of calcium imaging. To these ends, we contribute a ground truth dataset consisting of 91 V1 L2/3 excitatory neurons recorded at single-cell resolution (available at https://brain-map.org/explore/circuits/oephys), and characterized their spike-to-calcium fluorescence transfer function. Complementing existing datasets with viral GECI expression (Chen et al., 2013; Theis et al., 2016; Dana et al., 2016), our work facilitates interpretation of existing and future calcium imaging studies using mainstream transgenic mouse lines, such as the Allen Institute’s Brain Observatory Visual Coding dataset (http://observatory.brain-map.org/visualcoding) (de Vries et al., 2019).
We used the same ROI extraction and neuropil correction methods as Chen et al. to compare our results in transgenic mice to that of virally expressed GCaMP6 (Chen et al., 2013). To avoid contamination of fluorescence responses by subsequent spiking events, we used spike summation windows of 150 ms and 50 ms for GCaMP6s and GCaMP6f, respectively, instead of 250 ms as reported in Chen et al., a change that was necessitated by differences in firing rates between our dataset and theirs. Choosing a constant neuropil contamination ratio of 0.7, dF/F magnitudes of Emx1-f and Cux2-f were comparable to that of viral GCaMP6f (∼100% for 5-spike events in viral GCaMP6f), whereas Emx1-s and tetO-s were lower than that of viral GCaMP6s (∼200% for 5-spike events in viral GCaMP6s). To avoid potential confounding factors associated with choosing a constant neuropil contamination ratio for all cells (e.g. increased within-cell variability and artificially boosted dF/F magnitude), we chose not to perform neuropil subtraction in subsequent analyses, except to quantify the relationship between neuropil contamination ratio and the efficiency of detecting single-trial spiking events (discussed below).
Consistent with viral GCaMP6 (Chen et al., 2013), GCaMP6s cells in transgenic mice produced a larger single-spike dF/F peak compared to that of GCaMP6f. Additionally, GCaMP6s cells exhibited lower within-cell variability compared to GCaMP6f, both for single-spikes and multi-spike events. Interestingly, tetO-s cells exhibited a larger single-spike dF/F peak and a larger response curve slope compared to that of Emx1-s (albeit with a small sample size of n=6 cells). However, tetO-s cells exhibited a higher noise floor (standard deviation of dF/F during no-spike intervals) compared to that of Exm1-s, such that no difference in single-spike SNR was detected between the two GCaMP6s lines. For multi-spike events, SNR for tetO-s was lower than that of Emx1-s and Emx1-f, which could be attributed to a smaller sample size and fewer mutli-spike events in the tetO-s cells with no-spike intervals (n=4 cells with no-spike intervals out of 6 total cells). Nevertheless, with the large dF/F response shown here and previous work showing comparable expression levels to Emx1-s and no observed epileptiform events (Steinmetz et al., 2017), the tetO-s line represents an alternative to Emx1-s for expressing GCaMP6s.
Spike detection at the single-trial level was the most accurate in tetO-s, with mean single-spike detection rate of 87±15% (mean±sd) at 5% false positive rate, or 85±16% at 1% false positive rate. Thus, single spikes could be reliably detected in transgenic mouse lines expressing GCaMP6s, and in tetO-s the detection rate was not far short of that reported for viral GCaMP6s (99% at 1% false positive rate) (Chen et al., 2013). The difference in reported values could be partially attributed to the different spike exclusion windows used: 150/200 ms (pre and post) in this study and 1 s in Chen et al. Although spike detection rates were variable across cells, we observed single-spike detection rates of ≥90% in a number of neurons (including 1 Emx1-f cell), thus validating our experimental setup. Additionally, we found that spike detection rate, similar to dF/F magnitude, was dependent on the neuropil contamination ratio r. We found optimal r-values for maximizing single-spike detection rates in individual cells, by maximizing the area under the ROC curve for classifying spiking events. The effect of optimizing r-values on spike detection rate was most pronounced in Emx1-s, with an increase of 36±62% per cell compared to r = 0 (at 5% false positive rate; the corresponding mean single-spike detection rate increased from 63±25% to 76±20%). These data highlight the potential benefit of tuning r-values for individual neurons, as was done for our Brain Observatory dataset (de Vries et al., 2019), over the traditional method of selecting a constant r-value for the population. However, it is worth noting that increased r-values also typically resulted in increased within-cell variability of dF/F peak and increased dF/F magnitude, as discussed above.
2-p calcium imaging of large neuronal populations in parallel is typically performed on the order of 30 fps, providing a small fraction (∼20% in this study) of the number of temporal samples of that imaged at high-zoom. Additionally, assuming an 8 × 8 µm square cell, the number of pixels at low-zoom was 6.25% (102/402) of that at high-zoom. Coupled with differences in the number of samples per pixel (13 or 18 at high-zoom and 3 at low-zoom), the number of spatial samples at low-zoom was ∼1.5% of that at high-zoom. Not surprisingly, we observed reduced response curve slope, higher variability, and lower SNR when imaging at the lower spatiotemporal resolution. Furthermore, single-spike detection rates (at 5% false positive rate) dropped from ∼40-50% when imaged at high-zoom to ∼10-15% at low-zoom in the same cells. At low-zoom, detection of 2-spike events remained unreliable: <40% for Emx1-s and <20% for Emx1-f and Cux2-f. Due to the nature of our experiments (e.g. acute surgical preparation, with brain motion controlled through agarose, and the presence of a recording micropipette), our low-zoom data may be underestimating the data quality for a typical population imaging session (a chronic, more stable preparation with a coverslip cranial window, no micropipette and associated tissue damage). Nevertheless, these data from the same cells offer a point of comparison between data acquired under high-zoom and population imaging conditions.
In summary, in this study we present a ground truth dataset with simultaneous electrophysiology and calcium imaging. This unique dataset allowed us to systematically compare multiple aspects of spike-response properties between different GECIs (GCaMP6s and GCaMP6f) and among several transgenic lines. For example, we found that GCaMP6s and GCaMP6f cells have similar spike-fluorescence response curves, but GCaMP6f cells have greater variability and lower single-spike detection probability than GCaMP6s cells. While both GCaMP6f and GCaMP6s cells have reasonably good SNR and single-spike detectability at high-zoom conditions, both types of properties deteriorate substantially under the commonly used low-zoom population imaging conditions, with single-spike detection probabilities dropping to 4-20% (at 1-10% false positive rates). This finding has important implications for the interpretation of many large-scale in vivo calcium imaging datasets. By making our data freely available, we hope that it will serve the community as a further resource to better understand quantitatively the link between calcium-evoked fluorescent imaging signals and spiking activity.
Materials and Methods
Experimental procedures were in accordance with NIH guidelines and approved by the Institutional Animal Care and Use Committee (IACUC) of the Allen Institute for Brain Science. All experiments were conducted at the Allen Institute for Brain Science.
Mice
2-p-targeted electrophysiology and 2-p calcium imaging was conducted in adult transgenic mice (2-6 months old, both sexes, n = 22), including Emx1-IRES-Cre;Camk2a-tTA;Ai94 (simplified as Emx1-s, n = 7), Camk2a-tTA;tetO-GCaMP6s (Wekselblatt et al., 2016) (simplified as tetO-s, n = 2), Emx1-IRES-Cre;Camk2a-tTA;Ai93 (simplified as Emx1-f, n = 6), and CreERT2;Camk2a-tTA;Ai93 (simplified as Cux2-f, n = 7). Ai93 and Ai94 containing mice (Madisen et al., 2015) included in this dataset did not show behavioral signs for epileptic brain activity (Steinmetz et al., 2017).
Surgery
Mice were anesthetized with either isoflurane (0.75-1.5% in O2) or urethane (1.5 g/kg, 30% aqueous solution, intraperitoneal injection), then implanted with a metal head-post. A circular craniotomy was performed with skull thinning over the left V1 centering on 1.3 mm anterior and 2.6 mm lateral to the Lambda. During surgery, the craniotomy was filled with Artificial Cerebrospinal Fluid (ACSF) containing (in mM): NaCl 126, KCl 2.5, NaH2PO4 1.25, MgCl2 1, NaHCO3 26, glucose 10, CaCl2 2, in ddH2O; 290 mOsm; pH was adjusted to 7.3 with NaOH to keep the exposed V1 region from overheating or drying. Durotomy was performed to expose V1 regions of interest that were free of major blood vessels to facilitate the penetration of recording micropipettes. A thin layer of low melting-point agarose (1-1.3% in ACSF, Sigma-Aldrich) was then applied to the craniotomy to control brain motion. The mouse body temperature was maintained at 37°C with a feedback-controlled animal heating pad (Harvard Apparatus).
Calcium imaging
Individual GCaMP6+ neurons within ∼100-300 µm underneath the pial surface were visualized under adequate depth of anesthesia (Stage III-3) using a Bruker (Prairie) 2-p microscope with 8 kHz resonant-galvo scanners, coupled with a Chameleon Ultra II Ti:sapphire laser system (Coherent). Fluorescence excited at 920 nm wavelength, with <70 mW laser power measured after the objective, was collected in two spectral channels using green (510/42 nm) and red (641/75 nm) emission filters (Semrock) to visualize GCaMP6 and the Alexa Fluor 594-containing micropipette, respectively. Fluorescence images were acquired at various framerates (117.6-158.3 fps) through a 16x water-immersion objective lens (Nikon, NA 0.8), with or without visual stimulations.
Electrophysiology
2-p targeted cell-attached recording was performed following established protocols (Margrie et al., 2003; Kitamura et al., 2008; Knoblich et al., 2019). Long-shank borosilicate (KG-33, King Precision Glass) micropipettes (5-10 MΩ) were pulled with a P-97 puller (Sutter) and filled with ACSF and Alexa Fluor 594 to perform cell-attached recordings on GCaMP6+ neurons. Micropipettes were installed on a MultiClamp 700B headstage (Molecular Devices), which was mounted onto a Patchstar micromanipulator (Scientifica) with an approaching angle of 31 degrees from horizontal plane. Minimal seal resistance was 20 MΩ. Data were acquired under “I = 0” mode (zero current injection) with a Multiclamp 700B, recorded at 40 kHz using Multifunction I/O Devices (National Instruments) and custom software written in LabVIEW (National Instruments) and MATLAB (MathWorks). Isoflurane level was intentionally adjusted during recording sessions to keep the anesthesia depth as light as possible, resulting in fluctuation of the firing rates of recorded neurons.
Visual stimulation
Whole-screen sinusoidal static and drifting gratings were presented on a calibrated LCD monitor spanning 60° in elevation and 130° in azimuth to the contralateral eye. The mouse’s eye was positioned ∼22 cm away from the center of the monitor. For static gratings, the stimulus consisted of 4 orientations (45° increment), 4 spatial frequencies (0.02, 0.04, 0.08, and 0.16 cycles per degree), and 4 phases (0, 0.25, 0.5, 0.75) at 80% contrast in a random sequence with 10 repetitions. Each static grating was presented for 0.25 seconds, with no inter-stimulus interval. A gray screen at mean illuminance was presented randomly a total of 60 times. For drifting gratings, the stimulus consisted of 8 orientations (45° increment), 4 spatial frequency (0.02, 0.04, 0.08, and 0.16 cycle per degree) and 1 temporal frequency (2 Hz), at 80% contrast in a random sequence with up to 5 repetitions. Each drifting grating lasted for 2 seconds with an inter-stimulus interval of 2 seconds. A gray screen at mean illuminance was presented randomly for up to 15 times.
Data analysis
Electrophysiology and calcium imaging data were analyzed using custom MATLAB and Python scripts. For electrophysiology, Vm was filtered between 250 Hz and 5 kHz, and automated spike detection was performed using a threshold criterion (5×std of Vm). Unusually prolonged transient increases in calcium fluorescence were excluded from analysis with an adaptive Vm threshold: 0.25×Vbaseline+(Vpeak-Vbaseline), where Vbaseline was the mean Vm over 2 ms before the first spike of the spiking event and Vpeak was the amplitude of the first spike of the spiking event. The cumulative time above this Vm threshold was compared against a time threshold (6 ms × the number of spikes within the spiking event), and the fluorescence associated with spiking events with cumulative time above the time threshold were not analyzed.
For calcium imaging, in-plane motion artifacts were corrected (Dombeck et al., 2007), and cell/region of interest (ROI) selection was performed using a semi-automatic algorithm (Chen et al., 2013) (kindly provided by Karel Svoboda, Janelia Research Campus). Ring-shaped ROIs were used to select GCaMP6+ excitatory neurons, with GCaMP6 expression typically excluded from the nucleus and restricted to the cytoplasm. For 2 of 91 cells, a satisfactory ring-shaped ROI could not be found automatically, and a circular ROI covering the entire soma was used instead. Calcium imaging data was smoothed using a local regression method using weighted linear least squares and a 1st degree polynomial model (built-in “smooth” function in MATLAB with “rlowess” method), and an averaging window of 5 frames.
To construct spike-calcium fluorescence response curves, we first identified all isolated spiking events regardless of the number of spikes they contained. For GCaMP6s, spiking events were separated from previous and subsequent spiking events by >150 ms and >50 ms, respectively, due to the higher firing rates in our study. The 50 ms post-event exclusion window ensured the absence of additional spikes in the calcium response window of 200 ms. For GCaMP6f, spiking events were separated from previous and subsequent spiking events by >50 ms. Within each spiking event, spike summation windows were 150 ms and 50 ms for GCaMP6s and GCaMP6f, respectively, chosen based on the rise time of the GECIs (Chen et al., 2013). To determine spike-triggered calcium fluorescence responses, fluorescence traces were aligned to the first spike in each spiking event. The change in fluorescence, dF/F, for each spiking event was calculated as (F-F0)/F0, where F0 was computed locally as the mean fluorescence over 50 ms and 20 ms before the first spike for GCaMP6s and GCaMP6f, respectively. For GCaMP6s, peak dF/F was found within 200 ms after the first spike. For GCaMP6f, a variable calcium response window was used: peak dF/F was found within 50 ms and 75 ms after the first spike for single-spike and multi-spike events, respectively. Bursts of >5 spikes were excluded from analysis due to the low frequency of such events. Alignment jitter intrinsic to the imaging frame rate was ≤6.3 ms in 86 of 91 cells (imaged at 158.7 fps), with mean expected error of 3.2 ms, and between ≤5.6 ms to ≤8.5 ms in others (imaged at 117.6-178.6 fps), with mean expected error of 2.8 to 4.3 ms.
To compare mean single-spike dF/F peak responses to imaging noise, imaging noise was estimated as follows: we found no-spike intervals of ≥1 s, separated by ≥4 s and ≥1 s from previous and subsequent spikes, respectively, and randomly sampled the m corresponding calcium fluorescence traces n times, where m×n approximately matched the number of single-spike events. Noise (zero-spike) dF/F peak was computed using the same calcium response windows as single-spike events (50 ms and 200 ms for GCaMP6f and GCaMp6s, respectively).
To quantify the efficiency of detecting spiking events at a single-trial level, we compared dF/F traces of the response (single-spike events or 2-spike events) to that of imaging noise. To estimate imaging noise, calcium fluorescence traces during no-spike intervals were randomly sampled as described above, for a minimum of 25 times. For each cell, the mean response trace was used as the template vector. The template vector was normalized after subtracting the mean to create the unit vector, and the scalar results of projecting the response and noise traces on the unit vector were computed: ri and ni for response and noise scalars, respectively. The detection threshold was defined as the xth percentile of ni values, where 1-x represented the false positive rate (e.g., x = 95 for 95th percentile or 5% false positive rate), and the detection rate (true positive rate) was the fraction of ri values above the detection threshold.
Author contributions
CK, HZ, RCR conceived the project. LL, UK, LH performed experiments. LL, LH, UK, PL, JW, JL, SEJdV, MAB, GJM analyzed data. LL, HZ, CK, RCR, MAB, GJM supervised the project. LH wrote the paper with input from all co-authors.
Competing interests
The authors declare no competing financial interests.
Data availability
The dataset is available at https://brain-map.org/explore/circuits/oephys.
Acknowledgements
We are grateful for the Animal Care, Transgenic Colony Management, and Lab Animal Services teams for mouse husbandry, and Carol Thompson and John Phillips for providing project management support. We thank Karel Svoboda, Hod Dana and Tsai-Wen Chen for sharing analysis software. This work was also supported by grants from National Natural Science Foundation of China (NSFC31871055) and Guangdong Science and Technology Department (2017B030314026) to L.L. We thank the Allen Institute founders, Paul G. Allen and Jody Allen, for their vision, encouragement, and support.