1. Abstract
The ratiometric fluorescent calcium indicator Fura-2 plays a fundamental role in the investigation of cellular calcium dynamics. Despite of its widespread use in the last 30 years, only one publication [2] proposed a way of obtaining confidence intervals on fitted calcium dynamic model parameters from single ’calcium transients’. Shortcomings of this approach are its requirement for a ’3 wavelengths’ protocol (excitation at 340 and 380 nm as usual plus at 360 nm, the isosbectic point) as well as the need for an autofluorence / background fluorescence model at each wavelength. We propose here a simpler method that eliminates both shortcommings:
a precise estimation of the standard errors of the raw data is obtained first,
the standard error of the ratiometric calcium estimator (a function of the raw data values) is derived using both the propagation of uncertainty and a Monte-Carlo method.
Once meaningful standard errors for calcium estimates are available, standard errors on fitted model parameters follow directly from the use of nonlinear least-squares optimization algorithms.
How to get error bars on the ratiometric calcium estimator? The figure is to be read clockwise from the bottom right corner. The two measurements areas (region of interest, ROI, on the cell body and background measurement region, BMR, outside of the cell) are displayed on the frame corresponding to one actual experiment. Two measurements, one following an excitation at 340 nm and the other following an excitation at 380 nm are performed (at each ’time point’) from each region. The result is a set of four measures: adu340 (from the ROI), adu340B (from the BMR), adu380 and adu380B. These measurements are modeled as realizations of Gaussian random variables. The fact that the measurements as well as the subsequent quantities derived from them are random variable realization is conveyed throughout the figure by the use of Gaussian probability densities. The densities from the MRB are ’tighter’ because there are much more pixels in the MRB than in the ROI (the standard deviations of the densities shown on this figure have been enlarged for clarity, but their relative size has been preserved, the horizontal axis in black always starts at 0). The key result of the paper is that the standard deviation of the four Gaussian densities corresponding to the raw data (bottom of the figure) can be reliably estimated from the data alone, , where V is the product of the CCD chip gain squared by the number of pixels in the ROI by the CCD chip readout variance. The algebric operations leading to the estimator (top right) are explicitely displayed. The paper explains how to compute the standard deviation of the derived distributions obtained at each step of the calcium concentration estimation.
Method name Standard error for the ratiometric calcium estimator
3. Method overview
3.1. Rational
Since its introduction by [1], the ratiometric indicator Fura-2 has led to a revolution in our understanding of the role of calcium ions (Ca2+) in neuronal and cellular function. This indicator provides a straightforward estimation of the free Ca2+ concentration ([Ca2+]) in neurons and cells with a fine spatial and time resolution. The experimentalist must determin a ’region of interest’ (ROI) within which the [Ca2+] can be assumed uniform and is scientifically relevant. Fluorescence must be measured following excitation at two different wavelengths: typically around 340 and 380 nm; and, since cells exhibit autofluorescence or ’background fluorescence’ at those wavelengths, the measured fluorescence intensity is made of two sources: the Fura-2 linked fluorescence and the autofluorescence. The measured intensity within the ROI is therefore usually corrected by subtrating from it an estimation of the autofluorescence intensity obtained from simultaneous measurements from a ’background measurement region’ (BMR); that is, a nearby region where there is no Fura-2. At a given time the experimentalist will therefore collect a fluorescence intensity measurement from the ROI at 340 and 380 nm; we are going to write adu340 and adu380 these measurements, where ’adu’ stands for ’analog to digital unit’ and correspond to the raw output of the fluorescence measurement device, most frequently a charge-coupled device (CCD). The experimentalist will also collect intensity measurements from the BMR, measurements that we are going to write adu340B and adu380B. If P CCD pixels make the ROI and P_B pixels make the BMR and if the illumination time at 340 nm is T_340, while the illumination time at 380 nm is T_380 (both times are measured in s), the experimentalist starts by estimating the fluorescence intensity per pixel per time unit following an excitation by a light flash of wavelengths λ (λ = 340 or 380 nm) as:
where an assumption of autofluorescence uniformity is implicitly made. The following ratio is then computed:
This is an important and attractive feature of the method as well as the origin of its name. Since only ratios are subsequently used, geometric factors like the volume of the Fura loaded region under the ROI do not need to be estimated.
The estimated [Ca2+] that we will write for short (the
sign is used for marking estimated values) is then obtained, following [1, Eq. 5, p. 3447], with:
where Kef f (measured in µM), Rmin and Rmax are calibrated parameters (the last two parameters are ratios and are dimensionless).
If we now want to rigorously fit [Ca2+] dynamics models to sequences of , we need to get standard errors,
, on our estimates. This is where the ratiometric method gets ’more involved’, at least if we want standard errors from a single transient as opposed to a mean of many transients. Despite the ubiquity of ratiometric measurements in neuroscience and cell physiology, we are aware of a single paper–by some of us [2]–where the ’standard error question’ was directly addressed. The method proposed in [2] requires a 3 wavelengths protocol: measurements at 340, 380 and 360 (the isosbestic wavelength) nm; it drops, so to speak, the above advantage of working with a ratiometric estimator since it fits directly the adu340 and adu380 data (at the cost of estimating some geometry related parameters) and it requires a model of the autofluorescence dynamics if the latter is not stationnary. It therefore requires a slightly more complicated ’3 wavelengths’ recording protocol as well as a more involved fitting procedure. The dataset of the companion paper exhibits a clear but reversible autofluorescence rundown that cannot be ignored since autofluorescence accounts for half of the signal in the ROI. Rather that constructing / tailoring the accurate enough autofluorence models required by the ’direct approach’ of [2] we looked for an alternative method providing standard errors for the ratiometric estimator.
4. Ratiometric estimator variance
4.1. Fluorescence intensity
As detailed in [1, 2], the fluorescence intensities giving rise to the adu340, adu340B, adu380 and adu380B signals can be written as:
where FλB is the autofluorescence intensity per pixel per time unit at wavelength λ, KF ura is the Fura dissociation constant (a calibrated parameter measured in µM), [F ura]total, is the total (bound plus free) concentration of Fura in the cell (measured in µM) and ϕ is an experiment specific parameter (measured in 1/µM/s) lumping together the quantum efficiency, the neurite volume, etc (see [2] for details). When a ’3 wavelengths protocol’ is used (as was the case in the companion paper), it is easy to implement a self-consistency check based on these equations as explained in Sec. A.
4.2. Recorded signals adu340, adu340B, adu380 and adu380B
As detailed and discussed in [7, 2], the signal aduλ recorded with a CCD chip whose gain is G and whose read-out variance is can be modeled as the realization of a Gaussian random variable ADUλ with parameters:
with the obvious adaptation when dealing with the BMR signal: Iλ is replaced by IλB and P is replaced by PB.
4.3. Variance estimates for adu340, adu340B, adu380 and adu380B
So, to have the variance of ADUλ we need to know Iλ and for that we need to know [Ca2+] (Eq. 4 and 6) precisely what we want to estimate. But the expected value of ADUλ is G Iλ (Eq. 8), we can therefore use as a first approximation the observed value aduλ of ADUλ as a guess for G Iλ, so in Eq. 9 we plug-in aduλ for G Iλ, leading to:
In other words, we will use the observed aduλ as if it were the actual fluorescence intensity times the CCD chip gain, ADUλ = G Iλ, in order to estimate the variance. In doing so we will sometime slightly underestimate the actual variance (when the observed aduλ turns out to be smaller than ADUλ) and sometime slightly overestimate it (when the observed aduλ turns out to be larger than ADUλ). Since we are going to combine many such approximations, we expect–and we will substantiate this claim in Sec. 5–that overall the under-estimations will be compensated for by the over-estimations.
4.4. Variance estimate for 
Now that we have a we can work with-that is, an estimate from the data alone—, we want to get
(Eq. 2) and
. We can either use the propagation of uncertainty (also referred to as error propagation, compounding of errors or delta method) [6, 8] together with Eq. 2 and 3, or a ’quick’ Monte Carlo approach. We drop any explicit time index in the sequel in order to keep the equations more readable, but it should be clear that such variance estimates have to be obtained for each sampled point.
4.4.1. Propagation of uncertainty
This method requires, in the general case, an assumption of ’small enough’ standard error since it is based on a first order Taylor expansion (see Sec. B for details). It leads first to the following expression for the variance, , of fλ in Eq. 1:
The variance of r in Eq. 2 is then:
and the variance
of
in Eq. 3 is:
4.4.2. Monte-Carlo method
Here we draw, k quadruple of vectors
from four independent Gaussian distributions of the general form:
where aduλ is the observed value and
is drawn from a standard normal distribution. We then plug-in these quadruples into Eq. 1 leading to k couples:
These k couples are ’plugged-in Eq. 2’ leading to k r [j]:
before plugging in the latter into Eq. 3 to get
:
The empirical variance of these simulated observations will be our :
Since the Monte-Carlo method requires milder assumptions (the variances do not have to be small) and is easy to adapt, we tend to favor it, but both methods are working.
4.5. Comment
The present approach based on a estimation is slightly less rigorous than the ’direct approach’ of [2] but it is far more flexible since it does not require an independent estimation / measurement of [Fura]total. In the companion paper we also chose to consider the calibrated parameters Kef f, Rmin and Rmax as known, while only an estimation (necessarily imprecise since the calibration procedure is subject to errors) is known. But the same batch of Fura was used for all experiments that should then all exhibit the same (systematic) error. Since in the companion paper, we are not trying to get the exact standard error of the calcium dynamics parameters but to show difference between two protocols (’classical whole-cell’ versus beta-escin perforated whole-cell), ignoring the uncertainty on the calibrated parameters makes our estimates less variable and helps making the difference, if it exists, clearer. For a true calcium buffering capacity study, the errors on the calibrated parameters should be accounted for and it would be straightforward to do it with our approach, simply by working out the necessary derivatives if one works with the propagation of uncertainty method, or by drawing also Kef f, Rmin and Rmax values from Gaussian distributions centered on their respective estimates with a SD given by the standard errors if one works with the Monte-Carlo approach.
5. Empirical validation
5.1. Rational
Equations 4, 5, 6, 7, together with Eq. 8 and 9 can be viewed as a data generation model. This means that if we choose model parameters values as well as an arbitrary [Ca2+] time course, we can simulate measurements (adu) at both wavelengths in the ROI as well as in the BMR. We can then use these simulated adu exactly as we used the actual data, namely get r (ti) (Eq. 2) and (Eq. 3) as well as the (squared) standard errors
(Sec. 4.4).
Now if the are good approximations for the actual but unknown
, the distribution of the normalized residuals:
should be very close to a standard normal distribution. This is precisely what we are going to check.
5.2. Simulated data
We are going to use the first transient of dataset DA_121219_E1 of the companion paper. The ’static’ parameters–that is the parameters not link to the calcium dynamics–used for the simulation are the actual experimental parameters rounded to the third decimal (Table 1).
’Static’ parameters used for the simulation.
The simulated calcium dynamics is a monoexponential decay mimicking the tail of the transient:
and the parameter values (Table 2) are just a rounded version of the fitting procedure output (see companion paper).
Calcium dynamics parameters used for the simulation. Time 0 is when seal is obtained.
The simulated data obtained in that way are shown on Fig. 2 (blue traces) together with the actual data (red curves) they are supposed to mimic. At a qualitative level at least, our data generation model is able to produce realistic looking simulations.
Observed (red) and simulated (blue) ADU at 340 (left) and 380 nm (right) for the first transient (only the late phase of the transient was simulated).
5.3. Software and simulation details
The methodological details of the measurements to which the analysis presented in the present manuscript was applied are described in the companion paper.
The simulations, computations and figures of the present manuscript were done with Python 3 (https://www.python.org/), numpy (https://numpy.org/), scipy and matplotlib (https://matplotlib.org/). The Python codes and the data required to reproduce the simulations and figures presented in this manuscript can be downloaded from GitLab (https://gitlab.com/c_pouzat/getting-se-on-ratiometric-ca-estimator).
The use of scipy was kept to a bar minimum to maximize code lifeduration (scipy tends to evolve too fast with minimal concern for backward compatibility). The random number generators used were therefore the ones of numpy: the uniform random number generator derives from the Permuted Congruential Generator (64-bit, PCG64) (https://www.pcg-random.org/) [5] while the normal random number generator is an adaptation of the Ziggurat method [3] of Julia (https://docs.julialang.org/en/v1/); unfortunately one has to check the source code of both numpy and Julia to find that out.
5.4. Are the standard errors of ratiometric estimator accurate?
Since the two estimation methods, propagation of uncertainty and Monte-Carlo, agree at each time point within 2%, we illustrate in this section the results obtained with the Monte-Carlo method.
We take next the simulated data (blue curves on Fig. 2) together with the simulated background signals (not shown) as if they were actual data and we compute the ratiometric estimator and its standard error as described in Sec. 4.4, using k = 104 replicates. Figure 3 shows the standardized residuals as well as the simulated data together with the true [Ca2+], we know it since we used it to simulate the data!
Top: Simulated ratiometric estimator - ’actual’ [Ca2+] divided by ratiometric estimator standard error (if everything goes well we should see draws from a standard normal distribution); bottom: Simulated ratiometric estimator (with error bars given by the standard error) in black and ’actual’ [Ca2+] in red.
The upper part of Fig. 3 is only a qualitative way of checking that the normalized residuals follow a standard normal distribution. A quantitative assessment is provided by the Shapiro-Wilk W statistic, that is here: 0.987; giving a p-value of 0.128. There is therefore no ground for rejecting the null hypothesis that the normalized residuals are IID draws from a standard normal distribution.
As an additional, visual but less powerful test, we plot the empirical cumulative distribution function (ECDF) of the normalized residuals together with the theoretical (normal) one and with Kolmogorov’s confidence bands (Fig. 4). If the empirical ECDF arises from a normally distributed sample with mean 0 and SD 1, it should be completely contained in the 95% confidence band 95% of the time and in the 99% band, 99% of the time (these are confidence bands not collections of pointwise confidence intervals).
Empirical cumulative distribution function (ECDF) of the normalized residuals (red) together with 95% (grey) and 99% (blue) Kolomogorov confidence bands.
We conclude from these visual representations and formal tests that our normalized residuals follow the expected standard normal distribution, implying that our proposed method for getting the standard errors of the ratiometric estimator is fundamentally correct.
6. Discussion
We have presented a new and simple method for getting standard errors on calcium concentration estimates from ratiometric measurements. This method does not require any more data than what experimentalists using ratiometric dyes like Fura-2 are usually collecting: measurements at 340 and 380 nm both within a region of interest and within a background measurement region. Once the errors bars have been obtained, arbitrary models can be fitted to the calcium transients–by weighted nonlinear least-squares [4]–and meaningful confidence intervals for the parameters of these models will follow as illustrated in the companion paper. The present contribution is therefore best viewed a major simplification of the ’direct approach’ of [2]. In contrast to the latter, the new method does not require a ’3 wavelengths protocol’, it does not require either a precise fit of the autofluorescence dynamics at the three wavelengths and is therefore much easier to implement. Such a 3 wavelengths protocol can nevertheless be useful since it allows experimentalists to perform self-consistency checks and to detect potentially wrong calibration parameter (Sec. A). We provide moreover two independent implementations, one in C and one in Python, they are open source and freely available. The rather verbose Python implementation of the heart of the method (Sec. 4.4) requires 25 lines of code and nothing beyond basic numpy functions. We are therefore confident that this method could help experimental physiologists getting much more quantitative results at a very modest extra cost.
A. A Self-consistency check
A.1. Plug-in aduλ estimates
If we have data where a ’3 wavelengths protocol’ was implemented (that is, flashes at 340, 360 and 380 nm at each time point were made), we can use a self consistency check of the data generation model defined by Eq. 4, 6, 2 and 3. From the 6 measureed sequences:
{adu340(t1), …, adu340(tn)},
{adu340B(t1), …, adu340B(tn)},
{adu360(t1), …, adu360(tn)},
{adu360B(t1), …, adu360B(tn)},
{adu380(t1), …, adu380(tn)},
{adu380B(t1), …, adu380B(tn)},
we compute the sequence of ratiometric calcium estimates . If we also have a way of getting
such that:
where
is as estimate of the fluorescence intensity per pixel, per time unit due to Fura (we discuss in the next subsection how to obtain
), we will get:
,
where and
are ’plug-in’ estimates of I340 and I380 obtained from Eq. 4 and 6 by plugging in
:
with
The should then be comparable to the original {(adu340(ti), adu380(ti))}i=1,…,n. We have here a self-consistency criterion, not a test since we are using the measured aduλ(ti)
to get
.
A.2. Estimating 
We introduce
and define
as the argument minimizing RSS(ϕ). We just need to solve a nonlinear least-square problem.
A.3. Illustration
As an illustration we compute the plug-in estimators in two situations both based on the first transient of dataset DA_121219_E1. In the first case we use the calibrated values for Rmin and Rmax (left column on Fig. 5). In the second case we use an Rmin 20% smaller than the calibrated value and an Rmax 20% larger (right column on Fig. 5).
Observed (red) and plug-in (blue) ADU at 340 (top) and 380 nm (bottom) for the first transient. On the left, the calibrated parameters were used while on the right an Rmin underestimated by 20% and and Rmax overestimated by 20% were used.
We see that the plug-in estimator does indeed provide a self-consistency check (the plug-in estimator values follow closely the observed values on the left side of Fig. 5) and is sensitive to calibrated parameter deviations from their ’true’ values (the peak / valleys ’plug-in’ deviate from the observed values on the right side of Fig. 5).
B. Propagation of uncertainty
We outline in this section how to reach Eq. 11, 12 and 13 of Sec. 4.4.1. We first need to remember that is X and Y are two independent random variables with mean and
and variance
and
, then if Z = a + bX + cY (a, b, c ∈ ℝ) we have:
Eq. 11 is a direct consequence of the last equality. If X is (approximately) normally distributed with as well as Y, we can write: X ≈ µX + Z1σX and Y ≈ µY +Z2σY, where Z1 and Z2 are independent and follow a standard normal distribution,
. If now Z = f (X, Y) and the partial derivatives of f at (µX, µY) exist then:

This is just a first order Taylor expansion and that is where the ’small enough standard error’ assumption is necessary. Z is then (approximately) a linear combination of two independent standard normal random variables and we immediately get:

Eq. 12 follows directly by computing the necessary partial derivatives, while Eq. 13 requires the computation of a single derivative.
C. Auto-fluorescence dynamics
C.1. General features
The evolution of the aduλB is shown on Fig. 6. We see that the autofluorescence runs down when high frequency flashes are applied during the 3 transients, with a partial recovery between transients.
Autofluorescence at 3 excitation wavelengths, 340 nm (red), 360 (blue), 380 (brown). Both during low frequency stimaltions (four portions made of dots) and during the transients where a higher frequency stimulation was applied (3 groups with almost vertical lines).
C.2. Within transient dynamics
The ’direct method’ of [2] requires the knowledge of the autofluorescence value at each time point during a transient at both 340, 360 and 380 nm, since Eq. 4 and 6 are fitted directly to the recorded adu340 and adu380 and they depend on the total Fura concentration at transient time that is estimated from the difference of the 360 nm measurements in the ROI and the BMR. We therefore take a closer look a the autfluorescence dyanmics during the first transient (Fig. 7).
Normalized autofluorescence at 3 excitation wavelengths, 340 nm (red), 360 nm (blue) and 380 (brown) during the first transient. At each wavelength, the normalization is performed by dividing each value by the maximal one.
At that stage we can fit a straight line plus a cosine function whose period is the duration of a transient. That’s a good way to capture the main structure in the transient, but is still does not account for the full signal variability (Fig. 8). As can be seen from the normalized residuals–the residuals divided by the standard deviation–that should be very nearly independent random draws from a standard normal distribution if the model is correct, there are finer structures left (like the double valley on the 380 nm residuals) meaning that those fits won’t pass formal goodness of fit tests. Indeed if we apply Pearson’s χ2 tests to these stabilized residuals we get:
Bottom: Autofluorescence (red) at 340 nm (left), 360 nm (middle) and 380 nm (right) together with a straight line plus cosine function fit (blue). Top, the normalized residuals: .
at 340 nm a residual sum of squares (RSS) 326, leading to a
,
at 360 nm a RSS of 288, leading to a
,
at 380 nm a RSS of 275, leading to a
,
We are then left with three possibilities:
try to refine the ’straight line plus cosine function’ empirical model in order to get acceptable fits,
try to get a better understanding of the autofluorescence dynamics,
find another way to get error bars on our estimates.
Since we wanted to propose an ’as general and easy as possible’ method we chose the third approach in the present manuscript.