1 Simulating hyperspectral fiber photometry signals
A recap of the basic model for fluorescence signals from protein indicators.
The challenges for in vivo fiber photometry data analysis are highlighted in Simpson et al. (2023):
In theory, or in a test tube or flow cell, dose-response curves make the relationship between ligand concentration and fluorescence intensity appear straightforward. However, measuring ligand modulated fluorescence in vivo, where photometric signals are neither linear nor absolute measures, is more complicated. Signals are influenced by native factors, including local fluctuations in pH and hemodynamics, and technical factors including the expression level and localization of the sensors, excitation wavelengths, potential photobleaching, and the stability of the optical path, each of which will be discussed.
We are interested in the case where there there are multiple lasers exciting the samples at different wavelengths (time-division illumination), and the full emission spectrum can be observed.
1.1 Signal from indicators
Assumptions / caveats
- We may ignore spatial variation (e.g. related to illumination/ detection)
- We may assume bound fraction is small (f \ll 1)
- We may assume that \frac{\Delta F}{F} \ll (\frac{\Delta F}{F})_\textrm{max}
Indicator bleaching
The total number of indicator molecules that can fluoresce reduces over time and this is referred to as bleaching. Here we model bleaching as a sum of exponentials, one with a fast time constant and one with a slow time constant. C(t) = C_\textrm{slow} e^{-\frac{t}{\tau_\textrm{slow}}} + C_\textrm{fast} e^{-\frac{t}{\tau_\textrm{fast}}}
Indicator signal
The fluorescing indicator molecules can exist in one of two states, bound to ligand or free. Let the fraction of the bound indicator be f_{\textrm{b}}(t). Assuming emission spectra S_\textrm{b}(\lambda) and S_\textrm{f}(\lambda) for the different indicator states, power of the jth laser P(j,t), and efficiency of the laser to excite populations w_\textrm{b}(j) and w_\textrm{f}(j), the fluorescence readout F(t,\lambda,j) is modeled as:
\begin{align*} F(t,\lambda,j) = & \textcolor{40bf9a}{f_{\textrm{b}}(t) C(t) S_\textrm{b}(\lambda)w_\textrm{b}(j) P(j,t)} + \\ & \textcolor{63a7ff}{(1 - f_{\textrm{b}}(t)) C(t) S_\textrm{f}(\lambda)w_\textrm{f}(j) P(j,t)} \end{align*} \tag{1.1}
Equation 1.1 is analogous to the setup in and in Helmchen (2011). In the following we refer to f_{\textrm{b}} as just f. Assuming a positive indicator (where the bound state is brighter than free state), define F_{\max} and F_{\min} as the signal when f=0 and f=1 respectively. We’ll pack terms other than f in Equation 1.1 into \eta_\textrm{b} and \eta_\textrm{f} for the bound and free components, and drop the arguments t, \lambda, j for now. Then:
\begin{align*} F &= \eta_{\textrm{b}}f + \eta_{\textrm{f}}(1-f)\\ &= F_{\min} + (\eta_{\textrm{b}} - \eta_{\textrm{f}})f \\ &= F_{\max} − (\eta_{\textrm{b}} − \eta_{\textrm{f}})(1-f) \\ \implies \frac{f}{1-f} &= \frac{F - F_{\min}}{F_{\max} - F} \\ \end{align*} \tag{1.2}
Defining R := {F_{\max}}/{F_{\min}}, we can rewrite Equation 1.2 as: \frac{f}{1-f} = \frac{F / F_{\max} − 1 / R}{1 − F / F_{\max}} \tag{1.3}
Equation 1.3 only contains ratios of fluorosence; these terms are invariant to indicator concentration and laser power as in Equation 1.1.
Relating ligand concentration to fluorescence
This section is based on discussions in Helmchen (2011) and Grynkiewicz, Poenie, and Tsien (1985) to relate observed signal to ligand (\textrm{Ca}^{2+} in these studies) concentration in imaging experiments.
For indicator protein P and the ligand L, assuming 1:1 complexation (i.e. 1 molecule of P binds to 1 molecule of L):
L + P \xrightleftharpoons[k_{d}]{k_{a}} LP
At equilibrium: k_d[LP] = k_a[L][P]
The dissociation constant K is defined as \frac{k_d}{k_a}:
K = \frac{[L][P]}{[LP]} \qquad [P] = \frac{K[LP]}{[L]}
The fraction of bound indicator f: f = \frac{[LP]}{[P] + [LP]} = \frac{[L]}{K + [L]}
Then [L] can be expressed as a function of f, and using Equation 1.2, we relate the ligand concentration to the observed fluoresence signal. [L] = K\frac{f}{1-f} = K\frac{F - F_{\min}}{F_{\max} - F} = K\frac{F / F_{\max} − 1 / R}{1 − F / F_{\max}} \tag{1.4}
As a further simplification, for f \ll 1 (Taylor expansion of \frac{f}{1-f} around f=0)
[L] \approx Kf \tag{1.5}
Relating ligand concentration to \Delta F / F
Measuring F_{\min} can be a problem, because of the presence of a baseline ligand concentration [L]_\textrm{rest}, which is associated with a baseline fluorescence signal F_\textrm{rest}. Using the equation derived in the section above:
\begin{align*} [L]_\textrm{rest} &= K\frac{F_\textrm{rest} - F_{\min}}{F_{\max} - F_\textrm{rest}} \\ F_{\min} &= F_\textrm{rest} - \frac{[L]_\textrm{rest}({F_{\max} - F_\textrm{rest}})}{K} \\ \end{align*}
Replace F_{\min} in the expression for [L]:
\begin{align*} [L] &= K\frac{F - F_{\min}}{F_{\max} - F} \\ &= K\frac{F - (F_\textrm{rest} - \frac{[L]_\textrm{rest}({F_{\max} - F_\textrm{rest}})}{K})}{F_{\max} - F} \\ &= \frac{K(F - F_\textrm{rest}) + [L]_\textrm{rest}({F_{\max} - F_\textrm{rest}})}{F_{\max} - F} \\ &= \frac{[L]_\textrm{rest} + K\frac{F - F_\textrm{rest}}{F_{\max} - F_\textrm{rest}}}{ 1-\frac{F - F_\textrm{rest}}{F_{\max} - F_\textrm{rest}}} \\ \end{align*}
Define \frac{\Delta F}{F} := \frac{F-F_\textrm{rest}}{F_\textrm{rest}} and (\frac{\Delta F}{F})_{\max} := \frac{F_{\max}-F_\textrm{rest}}{F_\textrm{rest}}. Then we can rewrite [L] in terms of these quantities:
\begin{align*} [L] &= \frac{[L]_\textrm{rest} + K (\frac{\Delta F}{F}) / (\frac{\Delta F}{F})_{\max}}{ 1-(\frac{\Delta F}{F}) / (\frac{\Delta F}{F})_{\max}} \\ \end{align*} \tag{1.6}
This equation is of the form f(x) = \frac{a + bx}{1-x}. For small x, the Taylor series expansion around 0 is a+(a+b)x+\mathcal{O}(x)^{2}.
Therefore for small (\frac{\Delta F}{F}) / (\frac{\Delta F}{F})_{\max}
\begin{align*} [L] & \approx [L]_\textrm{rest} + ([L]_\textrm{rest} + ({K} / (\frac{\Delta F}{F})_{\max})\frac{\Delta F}{F} \\ \Delta [L] & := [L] - [L]_\textrm{rest} \\ & \approx ([L]_\textrm{rest} + {K} / (\frac{\Delta F}{F})_{\max})\frac{\Delta F}{F} \\ & \approx \textrm{constant} \times \frac{\Delta F}{F} \end{align*} \tag{1.7}
The constant has terms [L]_\textrm{rest} (depends on cell/region being imaged), K (property of the indicator) and (\frac{\Delta F}{F})_{\max} (depends on the indicator and optical setup).
Multiple indicators
For experiments involving one indicator excited by a single laser and measured in a particular region of the emission spectrum, \Delta f(t) \propto {\Delta F}/{F} according to Equation 1.5 and Equation 1.7.
With multiple indicators, the fluorescence signal would consist of multiple indicator-specific terms as shown for one indicator in Equation 1.1.
Depending on the emission spectrum of the indicators, the signal at particular \lambda would be expected to be dominated by a single indicator. We’ll treat this approach to analyzing the data as a baseline strategy.
1.2 Autofluorescence
In calculating \Delta F / F, we assumed that the baseline fluorescence signal F_\textrm{rest} is only due to a non-zero ligand concentration. Autofluorescence is an important, time dependent source of noise to this end.
The time dependence is related to metabolic activity within cells, which dynamically alters concentration of NADH and FAD molecules. These molecules are considered as the main source of autofluoresence. The excitation and emision spectra for these molecules has been measured in earlier work, see Hickl co. (2022) and Islam et al. (2013).
1.3 Isosbestic control
Isosbestic control signal I refers to a signal that is independent of the ligand bound fraction f. Any variation in I can be viewed as noise, and removing components of the signal that are related to I would help denoise fiber photometry data, Simpson et al. (2023).
Let \lambda^{\textrm{exc}} refer to a particular excitation wavelength. From indicator characterization experiments, we have access to the following:
- Excitation spectrum for the bound state, w_\textrm{b}(\lambda^{\textrm{exc}}).
- Excitation spectrum for the free state, w_\textrm{f}(\lambda^{\textrm{exc}}), relative to w_\textrm{b}(\lambda^{\textrm{exc}}).
- Bound and free states emission spectra S_\textrm{b}(\lambda) and S_\textrm{f}(\lambda), normalized so that \int{S_\textrm{f}(\lambda) d\lambda} = 1 and \int{S_\textrm{b}(\lambda) d\lambda} = 1.
Consider emission at two distinct wavelengths \lambda and \lambda' invoked by exciting the sample at \lambda_{1}^{\textrm{{exc}}} and \lambda_{2}^{\textrm{{exc}}} respectively. Each excitation wavelength corresponds to a different laser j:
Following Equation 1.1,
\begin{align*} F_{1}(\lambda) &={f_{\textrm{b}}S_{\textrm{b}}(\lambda)w_{\textrm{b}}(\lambda_{1}^{\textrm{{exc}}})P(\lambda_{1}^{\textrm{{exc}}})}+{(1-f_{\textrm{b}})S_{\textrm{f}}(\lambda)w_{\textrm{f}}(\lambda_{1}^{\textrm{{exc}}})P(\lambda_{1}^{\textrm{{exc}}})} \\ F_{2}(\lambda') &={f_{\textrm{b}}S_{\textrm{b}}(\lambda')w_{\textrm{b}}(\lambda_{2}^{\textrm{{exc}}})P(\lambda_{2}^{\textrm{{exc}}})}+{(1-f_{\textrm{b}})S_{\textrm{f}}(\lambda')w_{\textrm{f}}(\lambda_{2}^{\textrm{{exc}}})P(\lambda_{2}^{\textrm{{exc}}})} \end{align*}
We make a few notation changes to make things a bit more obvious:
\begin{align*} a_{1} &=S_{\textrm{b}}(\lambda)w_{\textrm{b}}(\lambda_{1}^{\textrm{{exc}}})P(\lambda_{1}^{\textrm{{exc}}}) \\ b_{1} &=S_{\textrm{f}}(\lambda)w_{\textrm{f}}(\lambda_{1}^{\textrm{{exc}}})P(\lambda_{1}^{\textrm{{exc}}}) \\ a_{2} &=S_{\textrm{b}}(\lambda')w_{\textrm{b}}(\lambda_{2}^{\textrm{{exc}}})P(\lambda_{2}^{\textrm{{exc}}}) \\ b_{2} &=S_{\textrm{f}}(\lambda')w_{\textrm{f}}(\lambda_{2}^{\textrm{{exc}}})P(\lambda_{2}^{\textrm{{exc}}}) \\ x(t) &= f_\textrm{b}(t) \\ y(t) &= 1-f_\textrm{b}(t) \\ \end{align*}
Then for observations at two different emission wavelengths \lambda and \lambda', we have:
\begin{align*} F_{1}(\lambda) &= {x(t)a_{1}}+{y(t)b_{1}} \\ F_{2}(\lambda') &= {x(t)a_{2}}+{y(t)b_{2}} \\ x(t)+y(t) &= 1 \\ \end{align*}
Consider a linear combination of the observations:
mF_{1}(\lambda)+nF_{2}(\lambda') = x(t)(a_{1}m+a_{2}n)+y(t)(b_{1}m+b_{2}n) \tag{1.8}
This would be independent of f(t) if and only if m, n are not both zero, and:
\begin{align*} a_{1}m+a_{2}n &= b_{1}m+b_{2}n \\ \end{align*}
Then the condition for such a linear combination to be considered as the isosbestic control signal is:
\frac{m}{n} = \frac{b_2-a_2}{a_1-b_1} =\frac{S_{\textrm{f}}(\lambda')w_{\textrm{f}}(\lambda_{2}^{\textrm{{exc}}})P(\lambda_{2}^{\textrm{{exc}}})-S_{\textrm{b}}(\lambda')w_{\textrm{b}}(\lambda_{2}^{\textrm{{exc}}})P(\lambda_{2}^{\textrm{{exc}}})}{S_{\textrm{b}}(\lambda)w_{\textrm{b}}(\lambda_{1}^{\textrm{{exc}}})P(\lambda_{1}^{\textrm{{exc}}})-S_{\textrm{f}}(\lambda)w_{\textrm{f}}(\lambda_{1}^{\textrm{{exc}}})P(\lambda_{1}^{\textrm{{exc}}})} \tag{1.9}
Signals obtained in vivo will also contain other, additive sources (e.g. autofluoresence and other other signals from other indicators, if present). We’ve ignored those in the above analysis. We also implicitly set C(t) to 1 everywhere - thus ignoring the effect of bleaching. Both bleaching and hemodynamics are multiplicative effects, which will persist in the isosbestic signal.
Motion-related artifacts are a common source of noise in fiber photometry experiments. Motion (e.g. head movements) disturbs the optical path (e.g. bending of the fiber), and typically attenuates the signal. This is a multiplicative effect which also affects the isosbestic control signal. Regressing out the component common to the isosbestic control signal and the indicator signal can reduce severity of this artifact, see Simpson et al. (2023) for an overview and Keevers, McNally, and Jean-Richard-dit-Bressel (2023) for an implementation of such a procedure.
Creamer et al. (2022) discuss motion-related artifacts in a different system but may provide inspiration for solutions in mouse fiber photometry experiments.
1.4 Hemodynamics
Absorption by hemoglobin corrupts the signal. For in vivo measurements, the total cerebral blood volume, and fraction of oxygenated to deoxygenated hemoglobin are dynamic quantities. Oxygenated and deoxygenated hemoglobin have different absorption spectra. The Beer-Lambert law can used to model this effect in the generative model above. A similar approach is considered in Zhang et al. (2022).
Previous work in Ma et al. (2016) may also be relevant to this problem.
- \varepsilon: extinction coefficient (in {\textrm{cm}}^{-1}{\textrm{mole}}^{-1}{L}), see Prahl (1998). This is a function of \lambda
- h: concentration (100 to 200 gL^{-1} for Hemoglobin in brain, is a function of time, and linked to brain region-specific neuron activity
- l: effective cuvette length in the Beer-Lambert law. We set this to 1 \textrm{cm}, and assume no dependence on \lambda here.
- M_{\textrm{Hb}}: molar mass of Hemoglobin = 64,500 g\textrm{mole}^{-1}
- A: absorbance, calculated as per Beer-Lambert’s law A = \frac{\varepsilon \times h \times {l}}{M_{\textrm{Hb}}}
- Let f(t) be fraction of hemoglobin in the oxygenated state. Define h_{\textrm{HbO}}, h_{\textrm{HbR}}, \mu_{\textrm{HbO}} and \mu_{\textrm{HbR}} as:
\begin{align*} h_\textrm{HbO}(t) &= f(t)h_{\textrm{HbT}}(t) \\ h_\textrm{HbR}(t) &= (1 - f(t))h_{\textrm{HbT}}(t) \\ \mu_\textrm{HbO}(\lambda) &= \tfrac{\varepsilon_{\textrm{HbO}}(\lambda)}{M_{\textrm{Hg}}} \\ \mu_\textrm{HbR}(\lambda) &= \tfrac{\varepsilon_{\textrm{HbR}}(\lambda)}{M_{\textrm{Hg}}} \end{align*}
- Replacing A in the definition of absorbance: \frac{I}{I_o} = e^{-A}: I(\lambda, t) = I_o(\lambda, t) e^{-(\mu_{\textrm{HbO}}(\lambda)h_{\textrm{HbO}}(t) + \mu_{\textrm{HbR}}(\lambda)h_{\textrm{HbR}}(t))}
1.5 Blooming and notch filters
Large power incident at any particular camera pixel can saturate that pixel, and also cause a spill-over effect at neighboring pixels referred to as blooming.
For measurements where the camera pixels correspond to different emission wavelengths, the problem is particularly severe around the value of the excitation laser wavelength.
Notch filters can be used to attenuate the signal at particular wavelengths on it’s way back from the brain to the camera.
1.6 Previous approach to modeling the signal
\begin{align} O(t,\lambda,j) &= [ \left( \sum_{i \in \{\textrm{I},\textrm{AF}\}}{a(i,t) s(i,\lambda) w(i,j)} \right) H(t, \lambda) m(t) + b(\lambda,j) ] n(t,j) \\ H(t, \lambda) &= e^{-(\mu_{\textrm{HbO}(\lambda)}h_{\textrm{HbO}}(t) + \mu_{\textrm{HbR}(\lambda)}h_{\textrm{HbR}}(t))} \end{align} \tag{1.10}
- a(i,t) for i \in \textrm{I} has fast and slow components
- a(t) = c\{f(t)s_\textrm{bound}(\lambda) + (1-f(t))s_\textrm{free}(\lambda)\} : an indicator with concentration c exists in two states (e.g. bright, dark or bound, free) that have their own emission spectra.
- Isosbestic point is the particular \lambda where the two populations cannot be distinguished. This does not always exist for all indicators, but when it does exist it might be possible to use it for corrections related to Hemodynamics, see Zhang et al. (2022)
- h_{\textrm{HbO}}(t), h_{\textrm{HbR}}(t) : Blood concentration of oxygenated and deoxygenated hemoglobin over time
- a(i,t) is multiplied by a decay term d(i,t) associated with bleaching. d(i,t) = d_\textrm{fast}(i)e^{-\frac{t}{\tau_\textrm{fast}}} + d_\textrm{slow}(i)e^{-\frac{t}{\tau_\textrm{slow}}} + d_\textrm{constant}(i)
1.7 Experiment proposals
(Under development)
- Dead sensor experiment: Fluorescence would be independent of neuron activity. Autofluoresence and hemodynamics would be present. Fluctuation in indicator signal could be attributed to motion, hemodynamics, bleaching. Utility: validation of F_0 estimation, bleaching correction, motion correction.
- Triggered activity experiment: Activity could be treated as known. Activity-dependent hemodynamic effects could also be considered as known, and used to validate hemodynamic fit.
- Direct blood volume measurements as in Zhang et al. (2022).
- EYFP expressed in primary somatosensory cortex (using AAV) of the forelimb region.
- Intravenously administered Rhodamine B for CBV measurements.
- Electrical stimulation of the contralateral forepaw to trigger activity.