Semiautomated analysis of an optical ATP indicator in neurons

Abstract. Significance The firefly enzyme luciferase has been used in a wide range of biological assays, including bioluminescence imaging of adenosine triphosphate (ATP). The biosensor Syn-ATP utilizes subcellular targeting of luciferase to nerve terminals for optical measurement of ATP in this compartment. Manual analysis of Syn-ATP signals is challenging due to signal heterogeneity and cellular motion in long imaging sessions. Here, we have leveraged machine learning tools to develop a method for analysis of bioluminescence images. Aim Our goal was to create a semiautomated pipeline for analysis of bioluminescence imaging to improve measurements of ATP content in nerve terminals. Approach We developed an image analysis pipeline that applies machine learning toolkits to distinguish neurons from background signals and excludes neural cell bodies, while also incorporating user input. Results Side-by-side comparison of manual and semiautomated image analysis demonstrated that the latter improves precision and accuracy of ATP measurements. Conclusions Our method streamlines data analysis and reduces user-introduced bias, thus enhancing the reproducibility and reliability of quantitative ATP imaging in nerve terminals.


Introduction
In nature, living organisms as diverse as bacteria, fireflies, copepods, and sea pansies produce natural light through bioluminescence. 1 These organisms express the enzyme luciferase that emits visible light when it catalyzes the oxidation of its substrate luciferin powered by adenosine triphosphate (ATP). Bioluminescence imaging is a sensitive technique that relies on the detection of light emitted from the luciferase reaction. 2 At saturating luciferin concentrations, luciferase light emission is proportional to ATP level, thus luciferase can be used as a sensitive cellular ATP sensor. Similar to fluorescence, electrons are excited to a higher energy level and emit photons as they return to their resting level. 3 However, the excitation energy in bioluminescence is provided by the chemical reaction rather than by exogenous illumination, as in fluorescence [ Fig. 1(a)]. As a result, bioluminescence does not suffer from photobleaching of excited molecules or phototoxicity. In fluorescence imaging, biological materials emit significant endogenous fluorescence signals (autofluorescence), particularly in the green emission range. In contrast, bioluminescence does not suffer from this limitation as autoluminescence of most cells is negligibly low. 4 Therefore, any signal that is reliably detected can be attributed to luminescence rather than background noise. As such, bioluminescence imaging, despite dimmer signals, is ideally suited for sensitive assays of biological activity.
The first practical application of bioluminescence was the development of a reporter for gene expression using the North American firefly (Photinus pyralis) luciferase, which emits yellowgreen light (emission peak at 557 nm). 5,6 Since then, mutant bioluminescent reporters emitting red light (>600 nm) have been engineered to improve tissue penetration for in vivo bioluminescence imaging. 7 Further modifications to luciferase thermostability and catalytic activity have led to the development of ATP sensors for monitoring subcellular ATP levels. 8 Capitalizing on these improvements, a presynaptic ATP sensor, "Syn-ATP," was developed to monitor ATP levels in the nerve terminals of cultured hippocampal neurons, particularly to investigate the energetic demands of electrical activity. 9 Syn-ATP is a genetically encoded optical reporter of ATP, available on Addgene (plasmid # 51819; RRID: Addgene_51819) in which luciferase is targeted to synaptic vesicles through fusion with synaptophysin and additionally tagged with the fluorophore mCherry to normalize for reporter expression level [ Fig. 1(b)].
Since its development, imaging data from Syn-ATP assays have been analyzed manually with the software Image J and Microsoft Excel. In this method, In the method, regions of interest (ROIs) corresponding to individual nerve terminals are individually selected, followed by calculation of signal intensity of fluorescence and luminescence over multiple time frames. Raw signal intensities are then subjected to background subtraction. Background-corrected luminescence intensities of individual terminals are then normalized to mCherry fluorescence to correct for variability in Syn-ATP expression and/or changes in the focal plane during imaging. To optimize performance, users need to select the maximal number of mCherry-positive terminals in a recorded field while excluding cell bodies or large cellular clumps. As described above, manual analysis is undesirable because it is time-consuming and subject to user bias. In addition, cellular motion and frame-to-frame movement of the selected ROIs in lengthy (several minutes) experiments complicates data analysis. To address the limitations of manual analysis, we have developed a semiautomated analysis pipeline based on machine-learning algorithms that measures Syn-ATP luminescence signals in individual neurons with appropriate background correction and normalization to fluorescence signals.

Materials and Methods
All animal experiments were performed using wild-type rats of the Sprague-Dawley strain in accordance with protocols approved by the IACUC at Washington University School of Medicine in St. Louis. Hippocampi were dissected from 0 to 2 days-old neonatal rats of a mixed (male and female) litter, dissociated, and plated on poly-ornithine coated coverslips as previously described. 10 Hippocampal neurons at DIV 14-20 were mounted in a laminar flow perfusion chamber, maintained at 37°C with an OkoLab stage top incubator in Tyrode's buffer containing (in mM) 119 NaCl, 2.5 KCl, 2 CaCl 2 , 2 MgCl 2 , 50 HEPES (pH 7.4), 2 D-Luciferin potassium salt (Gold Biotechnology), 1.25 lactate and 1.25 pyruvate, supplemented with 10 μM 6-cyano-7nitroquinoxalibe-2, 3-dione (CNQX), and 50 μM DL-2-amino-5phosphonovaleric acid (APV) to inhibit postsynaptic responses. Live imaging of the hippocampal neurons was performed on a custom-built, inverted Olympus IX83 epifluorescence microscope equipped for luminescence and fluorescence imaging. Fluorescence excitation of mCherry was achieved with the TTLcontrolled Cy3 channel of a Lumencor Aura III light engine. Both mCherry emission and Syn-ATP luminescence were directed through a Chroma 590-nm long-pass filter and an Olympus UPlan Fluorite 40X 1.3 NA objective. Image acquisition was performed with an Andor iXon Ultra 897 camera, cooled to −95°C to minimize the camera detection noise. Platinum-iridium electrodes were used to evoke action potentials with 1 ms electrical pulses creating field potentials of ∼10 V∕cm. In each experiment, data were collected from at least 10 coverslips from three independent cultures prepared from separate litters. Unless otherwise indicated, all chemicals were obtained from Sigma-Aldrich. Image analysis was performed with Image J Time Series Analyzer (manual analysis) or the proposed semiautomated algorithm coded in python programming language, using Jupyter notebook, and scikit-learn machine learning library. 11,12 Data visualization and statistical analysis were performed in GraphPad Prism v9.0.

Results
Hippocampal neurons expressing the Syn-ATP sensor were imaged for mCherry fluorescence using Cy3 excitation light (10 seconds at 2 Hz frame cycle, camera exposure: 20 ms), followed by a single luminescence frame collected with exposure time of 60 s. Emission light from luminescence and fluorescence were directed through a 590-nm long-pass filter, instead of a conventional emission filter, to maximize luminescence photon collection [ Fig. 1(c)]. The alternating acquisition of fluorescence and luminescence images was repeated throughout the experiment to constitute multiple timepoints. The 20-frame fluorescence movie was averaged into a single image, hereafter referred to as the fluorescence image [ Fig. 1(d)].
Given that a large and labeled dataset of bioluminescent cells was not publicly available, we decided to implement unsupervised machine learning algorithms for analysis of Syn-ATP images rather than supervised algorithms for detection of individual nerve terminals. Our analysis pipeline is composed of three main steps: (1) background detection, (2) cell body detection, and (3) signal estimation. To improve consistency, user input is requested to modify the model's output for several steps of the process. Our images have two channels (mCherry fluorescence and luminescence) and we used the luminescence channel for background and cell body detection due to its low background signal. We then applied onto fluorescence images the background and cell body masks obtained from the luminescence channel. Details of this semiautomated image analysis pipeline and evaluation of its performance are outlined below.

Development of a Semiautomated Analysis Pipeline
The first step of the proposed pipeline was to distinguish neurons from the background. The luminescence frame was used as the input image and is downsampled from its original size of 512 × 512 pixels to 128 × 128 pixels. Since the real pixel size of this camera is 16.4 μm, with a 40× objective lens, nerve terminals are about 1.5 μm (∼4 pixels) in diameter. Therefore, downsampling of images helps to reduce the likelihood of misidentification of noise as nerve terminals. The resultant image was then divided into regions of 4 × 4 pixels, which corresponds to ∼6.4 × 6.4 μm squares. Each region is then represented by its median pixel value.
In the next step, pixel intensities were transformed into a one-dimensional vector of size 16,384 (128 × 128). K-means clustering from the scikit-learn python library was applied to this vector to produce two clusters, one corresponding to the image background, and the other corresponding (to the ROIs.) 12,13 Since K-means is an unsupervised machine learning algorithm, it does not require any training prior to application. We observed that this clustering scheme accurately distinguished background from ROIs [ Fig. 2(a)]. We used luminescence images to create a background mask and applied the same mask on fluorescence images [ Fig. 2(b)]. Background signal in each channel was then calculated as the average intensity of the background pixels.
Syn-ATP is first synthesized in neural cell bodies where it enters the secretory pathway for trafficking to terminals. However, inclusion of Syn-ATP data from the cell body may be confounding because ATP metabolism in this compartment may differ from nerve terminals. Therefore, the second step in our algorithm was to detect the neural cell body and exclude it from further analysis. In this step, the user provides input to set the custom width (d) of the cell body. Alternatively, the default preset value is set at 32 pixels, which corresponds to 50 μm in our setup. A square of size d × d pixels was then moved one pixel at a time, and the mean pixel intensity was calculated for each region. The region with the highest mean intensity was defined as the cell body [ Fig. 2(a)]. Since neural cell bodies have variable shapes and sizes, and a cell body is not captured in some images, the user is asked to provide their input determining whether the cell body is accurately detected. Otherwise, the user has the option to manually set a custom-sized bounding box to cover the cell body. Once detected, the cell body was masked,  as was done for the background, and omitted from further analysis in both luminescence and fluorescence images. The final step in our pipeline was the determination of signal intensity from masked images. The total intensity of pixels in each of the luminescence and fluorescence images was calculated, followed by subtraction of background intensity to determine net luminescence and fluorescence intensities. This process was iterated for each imaging time point. The L∕F value was plotted against time to represent the ATP content of nerve terminals in a single neuron over time: E Q -T A R G E T ; t e m p : i n t r a l i n k -; s e c 3 . 1 ; 1 1 6 ; 6 5 1 Luminescence or fluorescence signals that are too close to the detection limit of the camera are unreliable. Therefore, the pipeline provides a quality control check for the reported signals where the check is passed if values considered as signal by k-means clustering are at least three times higher than the variance of the dark current from EMCCD cameras. Since this is driven by the specific properties of the camera used in experiments, it can be modified by the user.
It is important to note that while L∕F is directly proportional to ATP concentration in nerve terminals, the absolute L∕F value is dependent on image acquisition parameters that may need to be modified during a project. For modifications that produce a linear change in signal intensity, such as adjustments to camera electron-multiplying (EM) gain settings, we introduced a simple true/false argument to adjust calculations of ATP levels by a coefficient factor.

Performance Evaluation
To evaluate the performance of our analysis pipeline, raw fluorescence and luminescence images from neural samples (n ¼ 26 neurons) were analyzed both manually and with our semiautomated tool. The experiment consisted of four baseline 1-min time points, followed by 1 min of electrical stimulation at 10 Hz applied between time points 4 and 5. Neurons were imaged for three additional time points after stimulation. The reduction in L∕F values [ Fig. 3(a)] during electrical stimulation was previously attributed to acidification of the cytosol which reduces the enzymatic activity of luciferase given that its pKa (7.03) is close to the cytosolic pKa (6.8). Indeed, both manual and semiautomated analysis methods detect a decline in L∕F values during activity which can be fully corrected by taking into account the pH effects using previously described correction factors [ Fig. 3(b)]. 9 Compared to manual analysis, our semiautomatic method generated higher L∕F values [ Fig. 3(c)]. We speculated this was at least partly due to the more precise determination of background signals through our clustering algorithm. In fact, we examined this hypothesis with a subset of randomly selected neurons from our dataset and demonstrated that background fluorescence values calculated with our semiautomated pipeline were ∼20% higher than manual analysis. The mean intensity for manual and semiautomated were 1120 AE 142 and 921 AE 87 units, respectively (p-value ¼ 0.002) [ Fig. 3(d)]. In contrast, background luminescence values were not significantly different in the two methods (p-value ¼ 0.08) [ Fig. 3(d)]. The higher fluorescence background values would result in lower background-subtracted F values when using the semiautomated pipeline thus raising the L∕F compared with manual measurements as we observed [ Fig. 3(c)].
A major challenge in manual analysis of Syn-ATP is the high variability in L∕F measurements of the same neuron over time. To determine whether semiautomated yields more consistent values, we compared the variability of L∕F measurements obtained from our semiautomated pipeline to manual analysis. In our experiments, the time points prior to stimulation represent baseline ATP levels with minimal biological variation. We calculated the L∕F values of the initial three timepoints using both methods and determined the measurement variability (ΔL∕F) as % deviation from the mean baseline L∕F value for each neuron. The semiautomated approach significantly decreased measurement variabilities (p-value ¼ 0.001) thus increasing the reliability of Syn-ATP analysis. The variation among the three baseline data points across cells (n ¼ 52) was 3.4 AE 0.9% and 6.8 AE 0.6% in semiautomated and manual analysis, respectively [ Fig. 3(e)].
These findings demonstrate that our pipeline improves measurement consistency by minimizing user sampling bias.
We then sought to assess the validity of the semiautomated pipeline in correctly identifying differences in L∕F levels in distinct neural populations. Syn-ATP experiments were performed in a population of control neurons and neurons carrying a mitochondrial mutation that impairs mitochondrial ATP production. Following determination of baseline L∕F values as in Fig. 3(c), the two populations were combined, mean and standard deviation of baseline L∕F values were calculated, and the z-score of each neuron was determined. Comparison of z-scores for control and mutant neurons revealed significantly lower z-scores in the mutant (control: 0.027 AE 0.17, mutant: −1.81 AE −0.17, p-value ¼ 0.001) Therefore, we conclude that our semiautomated method successfully distinguishes differences in Syn-ATP L/F values of distinct genotypes [ Fig. 3(f)].

Discussions and Conclusions
Syn-ATP represents a powerful and robust application of bioluminescence imaging for measurement of ATP levels in nerve terminals. However, analysis of Syn-ATP data has been challenging due to the potential for user selection bias. Standardizing image analysis through advanced computational methods, particularly machine learning, would improve data accuracy and reproducibility. Here, we developed a semiautomated pipeline that facilitates the analysis of dual fluorescence and luminescence images. First, our pipeline enables the user to determine background signals in both channels in an unbiased manner. Second, it enables the user to mask specified regions such as the cell body of a neuron. In imaging sessions that last for several minutes, axonal movement shifts the position of nerve terminals in the field of view and poses challenges for manual tracking of several data points in an image stack. Our approach circumvents this problem by analyzing the entire image rather than individual user-selected ROIs representing nerve terminals. Despite its advantages, we acknowledge that our semiautomated approach has its own limitations. For example, sudden changes in the background signal interfere with the code and reduce the reliability of the results. Furthermore, user input is required to validate selection of the cell body. Our future endeavors with expanded datasets would be directed toward full automation of the code as well as resolving technical issues that arise from faulty image acquisition.
In summary, we have developed a semiautomated pipeline for analysis of dual fluorescence/ luminescence imaging of ATP in nerve terminals. Our pipeline analyzes signals in the entire field of view thereby reducing user sampling error. It also standardizes background signal measurement and reduces variability in measurement of ATP level in nerve terminals.
The code is publicly available on the GitHub repository: https://github.com/ashrafilab/ SynATP-Analysis and can be modified for customized bioluminescence image analysis.

Disclosure
The authors declare no competing interests.