An automated compound screening for anti-aging effects on the function of C. elegans sensory neurons

Discovery of molecular targets or compounds that alter neuronal function can lead to therapeutic advances that ameliorate age-related neurodegenerative pathologies. Currently, there is a lack of in vivo screening technologies for the discovery of compounds that affect the age-dependent neuronal physiology. Here, we present a high-throughput, microfluidic-based assay for automated manipulation and on-chip monitoring and analysis of stimulus-evoked calcium responses of intact C. elegans at various life stages. First, we successfully applied our technology to quantify the effects of aging and age-related genetic and chemical factors in the calcium transients of the ASH sensory neuron. We then performed a large-scale screen of a library of 107 FDA-approved compounds to identify hits that prevented the age-dependent functional deterioration of ASH. The robust performance of our assay makes it a valuable tool for future high-throughput applications based on in vivo functional imaging.

Supplementary Figure  indicates the total number of worms imaged in each case. *p <0.05, **p <0.01, one-way ANOVA followed by t-test pairwise analysis to compare each compound treatment to control.

Supplementary Note
Autofocus Algorithm. Depending on ASH soma shape and fluorescent intensity, and for autofocus analysis purposes we classified Day 1 to Day 4 adults as 'young worms' and Day 5 to Day 12 worms as 'old worms'. The ASH neuron is visibly much brighter in the young worms compared to the old ones. In cases of old worms, the background can be as bright as the ASH neuron. Also, young worms are more mobile in the traps so the position of the neuron changes frequently as the z stage moves. This frequent shift in position leads to a small but perceptible change in the shape and appearance of the ASH neuron. The older worms are much thicker and therefore sit more securely in the worm traps. Thus, the position of the ASH neuron remains fairly constant and the shape is retained. For each worm in the batch, the z stage performs a vertical scan (maximum range of 100 µm) and acquires a number of frames corresponding to sequential increments from the reference position on the z axis, as specified by the user at the start of each experiment. These numbers may be modified in the middle of the batch but cannot be altered in the middle of the recording. The objective of the autofocus algorithm is to choose the best focus frame from the total number of frames acquired after a new worm is loaded into the microfluidic trap.
The primary method employed in the autofocus algorithm is template-based object recognition applied to grayscale images. A convolution or template mask is used which is  The scores are normalized to fall within a range of 0 to 1 with values below 0.5 representing low correlation and values above 0.5 representing moderate to high correlation. The highest correlation score form each frame is stored in a vector and displayed in the front panel as the correlation matrix. Therefore, for a given worm, the number of stacks equals the number of elements in the correlation score matrix. The z position corresponding to the maximum correlation score is termed as the 'actual focal plane'. For the first worm in the batch, the approximate focal plane is the same as the actual focal plane as this worm is used to define the template ASH neuron.
The highest correlation score is also found to be about 0.995 indicating a nearly perfect correlation. For the next worms, the highest correlation score is lower than 0.9 as the neurons do not exactly match the template. If the highest correlation score is below the threshold specified by the user, the worm is flushed out. The correlation threshold is however adjustable by the user in the middle of a batch. Also, positioning the slider at the approximate focal plane at the start of the experiment expedites ASH focusing for subsequent worms within ten steps of z stage movement. This is based on our observation that the 'actual focal plane' for worms of roughly the same age correspond in position with each other. Rotation and scaling affects template-matching adversely leading to inexact matches and low correlation scores. For old worms, there is not much variability in the appearance of the neuron so template-matching gives relatively high correlation scores (0.7-0.8). For younger worms however, there is a fair amount of variability in both position and shape of the ASH neuron. Thereby, the resulting correlation scores generated by the template matching algorithm are lower. For this purpose, an edge detection code using the Sobel method was written in MATLAB and applied to all the acquired frames for a given worm. The MATLAB function 'edge' takes each grayscale image (search image for each of the frames) as its input, and returns a binary image of the same size, with 1's where the function finds edges and 0's at all other positions. The Sobel function automatically determines the sensitivity threshold so it ignores all edges which are below the threshold. As the ASH neuron is the brightest object in the field of view, especially in young worms, the edges of the neuron are always selected. It was noted that the frame with the highest Sobel threshold value was closest to the actual focal plane (best focus frame). The edge detection method works better than template-matching based on highest correlation scores for young worms, whereas the template-matching method is more suitable for old worms. The user can select either of the two methods using a toggle control on the front panel.
In a newest version of the LabVIEW automation code, the autofocus algorithm combines both the edge detection and the template-matching methods to determine best focus plane which works both for old and young worms. For each worm, the frames with the ten highest correlation scores are extracted after the z scan is run. The Sobel edge detection operator is applied to these ten frames and the one with the highest Sobel threshold is then selected as the best focus frame. This algorithm seemed to work fairly well with both young and old worms after preliminary experiments but still needs to be tested on worms of varying age groups. Automation Explorer). Once the smart shutter is initialized, the white light shutter is opened. The z stage is controlled by a RS 232 serial connection via a USB interface.

LabVIEW
The user moves the slider and controls the vertical movement of the z stage. Before the first worm is loaded into the trap, the user has to focus in the live trap image and then press the 'Click proceed after focusing the image' control button to continue. When the user chooses to proceed, LabVIEW prompts the user to define a rectangular region enclosing the ASH neuron, or the search region with a cross hair cursor. The coordinates of the search region are registered and for every worm which is subsequently loaded in the batch and the algorithm (Supplementary Note 1) searches for the ASH neuron in the same area of the image. LabVIEW also prompts the user to define a background area.
The IMAQ light meter rectangle is used to find the mean background intensity.
Frame 2 of the main loop. This frame introduces a 60 s delay (wait VI) before the next worm is loaded.
Frame 3 of the main loop. An additional stacked frame sequence which allows manual loading of worms is introduced. The first frame in the stacked sequence has a while loop.
In the loop, if the 'Press to manually load worms into the vial' is activated, the inlet valve is opened. When the 'Press when done manual loading' is enabled, the inlet valve closes followed by a 3ms delay. There is also a case structure, where the 'true' condition corresponds to the first worm that is loaded. In this case, LabVIEW prompts the user to select the 'Worm entrance area' followed by the 'Region near the end of the trap'. The standard deviation of the pixel intensities in the background region, worm entrance region and the region near the end of the trap as defined by the user is calculated using the IMAQ Light Meter (Rectangle) VI. The standard deviation of the background intensity is subtracted from the standard deviation of the entrance region and the region near the end of the trap. If the difference is greater than the 'Threshold cut off to recognize the worm', specified by the user, and the 'Manual Control Pressure Inlet' is disabled, then the pressure is released at the inlet trap and the worm is flushed out. Otherwise, the worm is positioned at the end of the trap by the inlet valves. A count is run from 0 to 50 and if the worm is still in the trap, then the inlet pressure is applied for 250 ms and then released. Otherwise, the inlet pressure continues to be applied and the worm is flushed out. Loading process for each worm is activated once the wait time, specified by the user using the control 'Enter time to wait before new sample load, runs out. The while loop is terminated after the worm is loaded in the trap. The second frame in the stacked sequence contains subVIs, Robotic Arm Control (SubVI) and NIQmx DAQ express VI, for controlling the robotic arm. The latter VI also alerts the user in the case the robotic arm is not functioning properly e.g. due to bubbles in the tubing system. The user defined controls for the robotic arm are the stirring and the vacuum time.

Frame 4 of the main loop:
For the first worm, the user has to bring the ASH neuron in focus by adjusting the slider on the front panel. The ASH neuron for the first worm serves as the template image for the autofocus algorithm. This frame has a case structure placed in a while loop. The case structure is further divided into stacked sequences.
Before adjusting the slider to focus the neuron, the user must enable the control 'Define Template' which is the true condition for the outer case structure. When 'Define Template' is enabled, CFP fluorescence is turned on and the white light shutter is closed.
The slider controls the vertical movement of the microscope z stage via a RS232 serial connection and LabVIEW serial read and write VISA drivers. Before moving the z stage, the serial port is configured (baud rate, data bits, parity, stop bits and flow control). The best focus z stage position is displayed as the 'Initial focus z position'. The instructions for controlling the z stage with the slider are in a while loop. When the user enables the control 'Click when ready to define the template', the while loop is terminated and control moves on the next stacked sequence in the case structure where the 'Initial focus z position' is read from the z stage controller. In the next frame of the inner stacked sequence, the CFP fluorescence is turned off. LabVIEW prompts the user to define a template where the user needs to box the focused ASH neuron using a cross hair cursor.
The LabVIEW subVIs used in this case are the IMAQ Select Rectangle, IMAQ Extract, IMAQ Array to Image and IMAQ Image to Array. Once the template has been defined, the main while loop is terminated and control moves on to frame 5. If the user enables 'Do not define template', for the first worm in the trap, which is the false condition for the case structure, then the template image matrix is padded with zeros and control moves onto frame 5. If the 'Do not define template' is enabled for the subsequent worms in the batch, then the template defined on the first worm continues to be used as the template image. The most recently defined template is always the one used for generating the correlation scores in a later portion of the code.
Frame 5 of main loop. This frame has a main case structure. If the worm is loaded, then the true Boolean value of the case is satisfied. The true case has two nested loops. The outer loop executes the inner loop twice. The number of times the inner loop runs is half the number of stacks specified by the user. During the first execution of the outer loop, the z stage moves n/2 number of stacks above the 'Initial focus z position' with an increment of 'Z distance between frames' which is defined by the user and where n is number of stacks. In the second execution of the outer loop, the z stage moves n/2 number of stacks below the 'Initial focus of z position' in steps of the distance between the frames specified. If n is odd, then a correction is applied to get a valid value of n/2.
The inner loop contains a stacked sequence structure whose first frame writes to the serial port of the z stage controller thereby making the z stage move incrementally depending upon the number of frames specified and the distance between frames. The second frame switches on the CFP fluorescence with a wait period of 300 ms. The live image is obtained and the fluorescence is turned off. The minimum background intensity is estimated form the pixel intensity values in the region defined as background in Frame 1 of the main loop. In the third frame, the maximum intensity of the pixels in the region enclosing the ASH, as defined by the user in Frame 1 of the main loop, is estimated. The live image is converted to a binary image using the IMAQ threshold VI. Two thresholds are applied, with the lower threshold being the mean of the background intensity the upper threshold being the maximum intensity. The pixels that lie between these thresholds are set to 1 and the rest to 0. The binary live image is then dilated and eroded using the IMAQ gray morphology VI. The grayscale live image and the segmented binary image are then multiplied using the IMAQ Multiply VI. The thresholded gray scale image and the template image are inputs to the MATLAB script window which contains the template matching code to generate the correlation scores. The correlation scores are calculated for each pixel location in the search image for every frame in the stack as previously described. The output of the MATLAB script window is the maximum correlation value in a matrix of correlation scores corresponding to every pixel location in the search image matrix. If this value is greater than the threshold specified by the user, then the neuron is set to be detected and a bounding box is generated around the ASH neuron. If it is lower than the threshold specified, then the neuron does not get detected and the worm is flushed out as no bounding box is generated. The correlation scores generated and the z scan locations are stored in arrays. The two arrays are of the same size as every frame along the z axis has a corresponding maximum correlation score.
The position of the z axis corresponding to the maximum correlation score is the best focus position for any given worm in the batch. There is a toggle button that enables the user to choose the edge detection method instead of the template matching method for younger worms. For this method, every z stage position corresponds to the Sobel edge threshold value instead of a correlation score and the frame with the highest threshold is considered to be the best focus frame. For the algorithm that combines both methods, the ten highest correlation scores are extracted and edge detection is performed on the search images corresponding to these ten scores. The frame with the highest edge threshold is then selected as the best focus position. The z stage moves to the best focus location at the end of the z scan using the serial port LabVIEW VISA VIs.
Frame 6 of the main loop. The CFP fluorescence is turned on and the neuron is subject to photobleaching with an exposure time specified by the user. If the 'Manual cancellation of recording' control is not enabled, the execution moves on to a stacked sequence structure. The first frame of this structure contains VIs that help specify the name and paths of the stored files. The 'File number to start the recording from' and the 'Folder for storing data' are specified by the user. The recorded frames are stored as '.tif' images in the specified folder with the given file names. Recording takes place in the next frame. The number of images acquired depends on the recording and the exposure time. After recording is completed, fluorescence is turned off. The files that were opened to save the recorded frames are closed in the next frame. There is a 'Program Status' indicator on the front panel that displays where the data have been saved. If the 'Manual cancellation of recording' control is enabled, photobleaching is stopped, no recording takes place and fluorescence is turned off.
Frame 7 of the main loop. Frame 7 contains a stacked sequence with 3 frames. In the first frame, the white light shutter is opened. The next frame contains a while loop and the difference in standard deviation between the background intensity and the intensity of the worm area is calculated. If this value is less than the 'Threshold count' specified by the user and the 'Manual control pressure inlet' control is disabled, valve lines 2, 5 and 7 are turned off. Otherwise, line 5 is enabled and the rest disabled. The worm is unloaded till the 'Stop unloading' control is selected or till the loop times out. There is an indicator on the front panel which confirms the worm's exit. The next frame adjusts the position of the robotic arm for loading the next worm batch.
Frame 8 of the main loop. The valve control lines 2, 5 and 7 are disabled. If the 'Stop the process' control is selected, the camera is stopped and the VISA sessions to the robotic arm, z stage, shutter and FW are closed. The image frames are also deleted.