CRUMB: a shiny-based app to analyze rhythmic feeding in Drosophila using the FLIC system

Rhythmic feeding activity has become an important research area for circadian biologists as it is now clear that metabolic input is critical for regulating circadian rhythms, and chrononutrition has been shown to promote health span. In contrast to locomotor activity rhythm, studies conducting high throughput analysis of Drosophila rhythmic food intake have been limited and few monitoring system options are available. One monitoring system, the Fly Liquid-Food Interaction Counter (FLIC) has become popular, but there is a lack of efficient analysis toolkits to facilitate scalability and ensure reproducibility by using unified parameters for data analysis. Here, we developed Circadian Rhythm Using Mealtime Behavior (CRUMB), a user-friendly Shiny app to analyze data collected using the FLIC system. CRUMB leverages the ‘plotly’ and ‘DT’ packages to enable interactive raw data review as well as the generation of easily manipulable graphs and data tables. We used the main features of the FLIC master code provided with the system to retrieve feeding events and provide a simplified pipeline to conduct circadian analysis. We also replaced the use of base functions in time-consuming processes such as ‘rle’ and ‘read.csv’ with faster versions available from other packages to optimize computing time. We expect CRUMB to facilitate analysis of feeding-fasting rhythm as a robust output of the circadian clock.


Introduction
The fly Drosophila melanogaster has been used for several decades to understand the molecular and neuronal basis of behavior. 1,2 This animal has been instrumental in the description of the circadian clock, 3-10 the machinery that allows animals to maintain daily rhythms in physiology and behavior. A common behavioral output used to assess circadian rhythmicity is locomotor activity, which is considered by many as a gold standard. Commercial options such as the Trikinetics Drosophila Activity Monitoring System (DAMS) have made it possible to conduct high throughput screening of clock mutants [11][12][13] and functional experiments to dissect molecular and cellular mechanisms regulating circadian rhythms. 14,15 Nonetheless, this behavior is only one example of circadian clock behavioral output. Feeding-fasting rhythm is also strongly regulated by the clock, although mechanisms required for maintaining food intake rhythm differ from those used in the regulation of circadian locomotion. [16][17][18][19][20] In contrast to locomotor activity rhythms, technical advances to assay feeding rhythms have lagged. A popular option is the Capillary Feeder (CAFE) assay, which allows for the quantification of the amount of feeding by means of measuring the movement of a meniscus along a capillary tube. 21 This assay has proven useful in capturing the feeding rhythms of groups of flies; however, the distance of the meniscus is only evident when a significant amount of liquid food has been consumed and thus its temporal resolution is limited. In 2014, Scott Pletcher's lab developed FLIC (Fly Liquid-Food Interaction Counter), a new system to assess feeding which allows for continuous monitoring (millisecond scale) and scalability, promising high throughput recordings. 22 Since then, several other groups have adopted the system and used it to address different biological questions including rhythmic feeding and metabolic homeostasis. 18, [23][24][25][26][27][28][29][30][31][32] Available options of software to analyze locomotor activity from DAMS have multiplied over the years, offering different user interphases and developed in different coding languages [33][34][35][36][37][38][39][40][41][42] (summarized in Cai et al. 15 ). In contrast, due to its recent implementation, user-friendly tools to analyze FLIC data are still scarce, 23 and available scripts require the user to understand and use R coding syntax. Here we present CRUMB (Circadian Rhythm Using Mealtime Behavior), a shiny app based on the popular DAMS Shiny app Shiny-R DAM combined with the core FLIC code master scripts provided with the equipment (GitHub FLIC R code). CRUMB leverages features from several packages including 'plotly' 43 and 'DT', 44 to generate easily manipulable graphs and data tables. CRUMB also uses some of the versatile tools offered by the 'zeitgebr' package 35,45 to enable easy and comprehensive circadian analysis-all of this wrapped in a simple Graphical user interface (GUI) provided by the 'shiny' 46 package.

Implementation Initialization
Initialization of the app must be conducted from the 'app.R' script. On the first usage, if 'shiny' or any other package is not installed, running this script will prompt a message indicating the list of missing packages and asking for installation. Following this process, CRUMB will be started and ready to run. The tabs on this app are organized in the required order of use, meaning that processes in the tab 'File loading & QC' are required for the subsequent tab 'Initial Survey', which then is required for subsequent tabs and so forth.

REVISED Amendments from Version 1
In the new version of the article, we have updated the text to address the reviewers' suggestions. New references were added to include newly developed tools for the analysis of DAMS data. Additionally, we expanded our explanation regarding the use of the baselining method Asymmetric Least Squares (ALS) as an alternative to Running Median (RM), as the latter requires the users' input. To support this point, we added new results comparing the use of the two methods on sample data ( Figure 1C-D). This dataset is available to download as part of the software's source code.
We provided clarifications on the limitations of the current version of CRUMB in analyzing LD and DD data separately while providing practical options to analyze larger datasets by data trimming. Importantly, and promoted by the suggestions of the reviewers, we demonstrated the utility of this approach by comparing the day and night differences in feeding events under LD and DD conditions between control and clock mutant flies. Our analysis uncovered differences that correlate to previous data on locomotor activity rhythm in these same mutants.
Any further responses from the reviewers can be found at the end of the article

Input files
The current version of CRUMB supports the original, unedited CSV files from the FLIC-MCU-2 system (Sable Systems International, NV). Further testing is needed to determine its suitability for other versions of the FLIC-MCU system. Given that the time resolution provided by FLIC monitors is in the scale of milliseconds, file sizes are correlated to the length of the recordings. For a full day of recordings, the file size is 44.4 MB. Although CRUMB is designed to analyze the data of several consecutive days, shorter recordings/files can be used as input but some functionalities (i.e., circadian analysis) will not be available.
To load the files, use the 'Browse' button. Select the file or files, from one or several different monitors. After loading, use 'Cache data & Populate dates' to engage the files and populate the dates of the experiments and monitor numbers ( Figure 1A).

Baseline data & QC
Feeding events are calculated from the baselined data obtained from FLIC monitors. If desired, data can be trimmed by choosing the start and end date. This trimming is made to the raw data, preventing unnecessary processing, and therefore reducing computation time. For visualization purposes, a binning interval and a binning function are needed. By default, these values are set to '1 hour' and 'Sum', respectively ( Figure 1A). Note that if recordings are shorter than this interval, the data will be represented as a unique point. The binning used in this tab is for graphing purposes only and the calculation of feeding events in subsequent tabs is carried out from the full, non-binned data. Once these parameters are set, press 'Baseline data!'. Graphs are compiled using the 'plotly' package, an interactive interface that permits easy inspection of the graphs, allowing the selection of individual points and areas within the plots ( Figure 1B). The isolation of tracks in 'plotly' graphs can thus be used to visualize individual flies to look for anomalies or drifting in the baseline due to liquid food overfill.
In CRUMB, baselined can be calculated using one of two functions: running median (RM) or asymmetric least squares (ALS). 47 The running median is the original method used in the FLIC master code, adopted by CRUMB, and requires a moving window in minutes to calculate the median for subtraction. In contrast, ALS does not require user input, thus automatizing the baselining process and promoting reproducibility in data analysis. Using ALS does not appear to compromise the downstream processing. As an example, we used data from w 1118 under 12 hours light and 12 hours dark cycles. The events obtained by using RM and ALS are comparable ( Figure 1C), evidenced by the high correlation between data obtained with RM and ALS ( Figure 1D). It is important to notice that one major downside of the use of ALS is the computing time, as this method requires almost twice the time compared to RM, which can be a problem considering the size of the dataset we deal with in these analyses. Thus, we suggest ALS to be considered in a caseto-case basis.

Initial survey
The tab in Figure 2A ('Initial Survey') allows assigning names and colors to the different conditions present in the experiment. Given that CRUMB allows input from several FLIC monitors, an option to choose the monitor is available. This is populated with the monitor number extracted from the filenames. We recommend that the users use two or more conditions per monitor to account for variability between monitors. Because of this, CRUMB allows assigning wells from the same monitor to different conditions. Use the boxes on the right to check or uncheck the wells. If the same condition is repeated in different monitors (i.e., flies from the same genotype in two or three monitors), adding another condition with the same name will allow the pooling of the data in subsequent analyses ( Figure 2A). If no names are assigned, fields will be populated automatically with the default name "Condition".
The FLIC system is designed so events that meet certain criteria can be considered feeding events (Figure 2A). These parameters correspond to the feeding minimum (minimum value of the baselined signal to consider an interaction), feeding threshold (threshold value that consecutive interactions need to pass to consider the event as feeding), number of consecutive licks (minimum number of interactions required to define a feeding event) and gap (time between events to consider consecutive events as one single event). The setting of these parameters can be tuned and tailored to each monitor and need to be determined empirically.
Once parameters are defined, clicking 'Get Events!' will initiate the calculations. This process is the most machinedemanding of the entire analysis, and the time spent on it correlates with the length of the input files. Additionally, permissive parameters will result in more events being considered, increasing the processing time.
The output summary is composed of four main elements that allow the inspection of the data ( Figure 2B). First, an 'Individual Stats' table and a 'Group Stats' table are displayed to show the total number of events per fly and the average, standard deviation (SD), and standard error of the mean (SEM) for the groups indicated in the previous step, respectively. Second, two graphs are displayed, a boxplot of the total events per condition showing individual points and a graph of events per day throughout the duration of the experiment. Given the variability of the data, it is possible to enable or disable normalization, which divides the binned events of each fly by the sum of all the events per fly. This will impact the display of the feeding events and average event profiles in the next tab, 'Feeding Analysis', and the calculations in the 'Circadian Analysis' tab. Step 2 allows the selection of the parameters required to calculate feeding events based on the baseline data. The 'Parameter Description' image (modified from FLIC code master) provides definitions for these factors. (B) After the calculation, the summary section displays the processed data as individual events per fly/well (top left), average events per group (top right and bottom left), and the number of events across days for each fly (bottom right). The feeding activity of each well can be scaled to the highest value of that well throughout the duration of the experiment by using the normalization switch. This selection is inheritable, meaning that the rest of the analysis will be conducted with the normalized data. Additionally, users can select outliers from the 'Individual Stats' table to exclude them from the rest of the analysis.
The function of this summary is two-fold: 1) it allows for inspection of the data for each individual fly and pooled data and 2) allows for the exclusion of dead flies. The criterion to consider dead individuals may vary but data from this section can provide guidance. For example, from the 'Individual Stats' table, flies that fail to show any events above a threshold defined by the experimenter can be excluded. Also, the boxplot of total events facilitates the determination of outliers as they will be marked by a black dot next to the data point. Finally, flies that do not survive for the entire experiment can be excluded. This information can be extracted from the 'Events per day' graph. To exclude individuals from the rest of the analyses, simply select them in the 'Individual Stats' table by clicking them.

Feeding analysis
The 'Feeding Analysis' tab ( Figure 3) displays binned events across several days of recordings and average daily events (feeding profile). To access these, the user must indicate a binning interval (1 min, 30 min, or 1 hour), binning function (Sum or Mean), and descriptive statistic represented by the error bars (SEM, SD, or None) (Figure 3). The generated graphs are also interactive and allow the resizing of the axis and zoom of particular windows within the graph. As the binning interval functions as a lowpass filter, the definition of these parameters needs to be carefully selected. Summing or averaging the data in shorter bins increases noise, which impacts the calculation of rhythmicity statistics. On the other hand, the use of longer bins might result in the loss of the shape of feeding activity rhythm. Thus, 30-min to 1-hour bins are recommended. CRUMB also provides the option of 1 min bins, but this is designed for short-term (< 1 day) recordings. The daily feeding events are averaged and displayed as an activity profile graph (middle graph) with gray backgrounds indicating when the lights are off. The duration of day and night can be selected under 'Light Transition' from the left panel where the region between the two sliders is when the light is on (red line). This selection also serves to calculate the daytime feeding events (bottom left graph and table) and nighttime feeding events (bottom right graph and table) per well. Error bars for the top two graphs can be defined by the user as Standard Error of the Mean (SEM), Standard Deviation (SD), or can be omitted if desired, by selecting 'None'. Additionally, data are available as CSV files for download using the download buttons below each graph. Note that average daily events, day, and nighttime events are calculated on the complete dataset. The current version of CRUMB does not differentiate between light-dark cycles (LD) and constant darkness (DD). If you need investigate the difference between these conditions, we suggest trimming the data in the baselining step to get only the LD or the DD days. We applied this approach in the 'Use Cases' section below.
The user can indicate the time of lights on and off using the light transition feature. This information is used to determine which events occurred during the day and which events occurred during the night. This information is summarized in data tables and in boxplots (Figure 3).

Circadian analysis
The circadian analysis is carried out in the 'Circadian Analysis' tab, and the current version of CRUMB allows the setting of the start and end date of the constant darkness (DD) period and a slider to choose the range of periods (in hours) that are included in the circadian analysis ( Figure 4). CRUMB uses the autocorrelation function estimation to get the period and power for rhythmicity from the 'stats' package wrapped in the periodogram function from the 'zeitgebr' package.
The output of this analysis is a periodogram graph, showing the period over the power from the autocorrelation function and a boxplot of the highest power for each condition. Finally, a table (exportable as CSV) is obtained with the period, the highest power for each fly, and the p-value for that period estimation. The significant threshold (signif_threshold) is also shown in the table and is displayed as dotted lines in the periodogram and the power graphs ( Figure 4). Operation (minimal system requirements needed to run the software) CRUMB was developed with R version 4.0.3 using the FLIC master code version 4.0 from the Pletcher lab as a backbone, modified and wrapped in a shiny app to manage the GUI using Shiny version 1.7.4. No internet connection is required to run the app but if any required package is missing, the user will be prompted with the option to download and install them from CRAN, and the completion of these actions requires internet access. Output graphs can be obtained from 'plotly' features as PNG files.
Output tables are in CSV format and can be opened using any compatible spreadsheet application including Microsoft Excel, Apple Numbers, or any other spreadsheet application.

Use cases
Default: determining rhythmicity CRUMB can be used to determine differences in the number of feeding events as a means to understand the motivation and innate status of flies or survey rhythmic feeding behavior to understand circadian control of feeding. Here we show one example of CRUMB used to determine feeding rhythmicity in a control strain (w 1118 ) compared with mutant flies with a defective circadian clock (w 1118 ; clk out ; annotated as clk out ). 48 In this example, CSV files collected from FLIC Monitor 1 across 7 full days were used as input (2021-07-01 to 2021-07-07). Wells from 1 to 6 correspond to clk out flies Figure 5. Feeding activity of an arrhythmic mutant calculated using CRUMB. (A) Feeding activity was recorded for 3 days under 12:12 light-dark cycles followed by 4 days in constant darkness (DD) for a circadian mutant (clk out , red) and control flies (w 1118 , black). (B) Average feeding activity across LD days for control flies shows increased feeding activity anticipating lights on (09:00, blue arrow) and lights off (21:00, blue arrow), which is absent in mutant flies. The dark period is represented as a grey area on the graph. While no changes in the average number of (C) daytime feeding events were observed, there is an increase in the (D) nighttime feeding events under LD. while wells 7 to 12 correspond to w 1118 flies. Further, the following parameters were used; a threshold of 5 was set as the minimum and 15 was chosen as the top limit, the number of consecutive licks was set to 2, and the link was set to 5. Flies were kept in 12 hours light:12 hours dark (12:12 LD) cycles for three days (2021-07-01 to 2021-07-03), with lights on at 09:00 am and lights off at 09:00 pm, and then changed to constant darkness for four days (2021-07-04 to 2021-07-07) ( Figure 5A). As expected, feeding events for w 1118 flies peak close to the light transition, both at dawn and dusk under LD conditions ( Figure 5B; blue arrows). Although this is different from reports showing only a single peak at dawn using the CAFE assay, 20,49,50 this result is consistent with other articles using the FLIC assay. 18,22,32 This discrepancy highlights the advantage of using an assay with high time resolution such as FLIC. Interestingly, while no differences in the daytime feeding events are observed, a significant increase in the nighttime events was found in clk out mutants ( Figure 5C and 5D, respectively). This is consistent with previous studies showing that the nighttime locomotor activity is increased in these flies. 51,52 Under DD, w 1118 retained both morning and evening peaks of feeding as observed in the average feeding profile, while no observable peaks are observed in mutant flies ( Figure 5E). Additionally, no differences were found in the daytime ( Figure 5F) or nighttime feeding ( Figure 5G). Consistent with previous studies, 49 w 1118 flies show a circa 24 period in feeding behavior ( Figure 5H; black line, blue arrow) while clk out mutants display arrhythmic feeding behavior ( Figure 5H; red line). Interestingly, at first sight, the maximum power of rhythmicity is not different between genotypes ( Figure 5I; p = 0.093). Close inspection of the graph shows an outlier identified by CRUMB and flagged with an overlapping black dot ( Figure 5I; red dotted circle). If removed, the comparison now achieves statistical significance ( Figure 5J; p = 0.017). It is important to notice, however, that using four days on DD might not be sufficient to get robust rhythmicity statistics. We recommend using > 5 days, as routinely used for DAM assays. Even considering this and that the number of animals used is small (n = 6 per genotype), the differences observed are consistent with previous data and highlight the utility of CRUMB.

Conclusions
The development of FLIC offers a new, high throughput option for continuous measurement of feeding events. 22 In contrast to DAMS for locomotor activity, FLIC system lacks easy-to-use options for data analysis. Here, we addressed this gap by developing CRUMB, a Shiny-based app for FLIC data analysis. Our platform offers a pipeline to analyze feeding events over several days and extract key rhythmic data such as day and night feeding events and feeding rhythmicity.
CRUMB uses the FLIC master code backbone, which offers compatibility with previous analysis. Also, we increased calculation speed by dropping some collected data, such as the number of licks or time of feeding events. We believe that this trade-off is crucial when analyzing long recordings necessary for circadian rhythm analysis, which require longer computing time. Although these parameters have been used in other studies, 31,32 obtaining the number of events allows for the extraction of key circadian features of the feeding behavior, such as period and rhythmicity. Future versions could include these data points as selectable options, to adjust to the experimenters' needs.
Although our app offers in-site statistical analysis, output files can be obtained from all the analysis, allowing the export of processed data to other statistical software such as GraphPad Prism or Matlab. This could be particularly useful if in-depth statistical analysis is required, a feat that CRUMB is unable to achieve.
Finally, CRUMB is open-access, and the code is freely available, which hopefully will promote the use of this tool as a backbone for other functions required for the community. Although CRUMB was initially conceived with circadian analysis of feeding in mind, the app can be expanded to include analysis of food choices, also available in the FLIC system.

Data availability
Example data used in this paper are available as part of the CRUMB app on GitHub (CRUMB GitHub).

Open Peer Review
developed for real-time monitoring of Drosophila interactions with a liquid food source. These interactions have previously been demonstrated to be highly correlated with feeding events, which allows for an automated assessment of feeding behavior over extended periods of time.
The FLIC system therefore provides the opportunity to uncover the genetic and cellular underpinnings of circadian control of feeding behavior. This is important as it is becoming increasingly clear that circadian rhythms of feeding and metabolism have tremendous impact on overall organismal health and wellbeing.
A current limitation of the FLIC system is the absence of user-friendly analysis tools. Existing analysis tools for the FLIC system require knowledge of the R programming language. Hidalgo and Chiu have therefore created CRUMB, a Shiny app that provides an easy-to-use Graphical user interface that performs standard FLIC analysis to identify feeding events and apply statistical methods to determine whether the data exhibit circadian patterns. This program will be extremely useful to the growing community of researchers using the FLIC system to monitor for circadian feeding patterns. CRUMB does an excellent job of producing intuitive data output files and graphs for data visualization. It also provides a streamlined pipeline that should enable speedier data processing compared with existing FLIC analysis programs. CRUMB could also serve to standardize data analysis, which will facilitate comparison of results across labs. A few small changes, detailed below, could make CRUMB even more useful: Data are extracted as feeding 'events' occurring within a user-defined bin length. As defined, events can be quite variable in length, potentially obscuring differences in total feeding time across the day. I recommend extracting 'lick' data in addition to events, and allowing the option to use binned 'lick' data in subsequent circadian analysis, as this will better capture dynamic changes in overall feeding throughout the day.

○
One argument for the use of CRUMB is to standardize analysis across labs. It should be noted that the parameters shown in Figure 2A under "Select threshold for feeding events" are extremely important for accurate identification of feeding events. We found that parameter settings had to be determined empirically for our setup-for example, these differed significantly when moving from the original FLIC-MCU-1 to the FLIC-MCU-2. Although this would entail significant additional work on the authors' part, it would be beneficial to build in an analysis that allows users to compare raw data to identified feeding events, to make sure that most apparent events are being captured with the parameter settings.

○
Currently, statistical analysis of circadian rhythmicity is limited to autocorrelation testing. To allow for more direct comparison with locomotor activity data, it would be helpful to also offer chi-square periodogram, since the vast majority of papers reporting locomotor activity rhythms in Drosophila use this test. This would be beneficial but not essential, as the authors already note that data output files are available as CSV files, which can then be used for circadian analysis with other programs that offer more extensive circadian statistics.

Is the rationale for developing the new software tool clearly explained? Yes
Is the description of the software tool technically sound? Yes Baseline data and QC section: If I understand correctly, due to some constraints imposed by the detection system, some baselining is required. The authors talk about two ways of baselining the raw data, i.e., running median and asymmetric least squares. It is important for the authors to describe how these two are different and under what circumstances one should choose one or the other method. For this manuscript to be a standalone resource for analyzing FLIC data, such clarification is critical. Also, in my opinion while the binning interval is intuitive and obvious, it may not be particularly clear as to when using 'mean' binning function would be biologically meaningful/relevant. The authors are requested to clarify these and provide examples of when one choice would make more sense than the other.

○
In the parameter selection section, the authors talk about how the minimum threshold, feeding threshold, number of consecutive licks and gaps must be tailored to each monitor and need to be determined empirically. This is not clear to me. Based on what should one determine what is an acceptable parameter value? Are there example citations? The authors should cite and/or describe the influence of these settings on outcomes of the analyses and how this could affect downstream interpretations. Maybe some examples would help. For a reader coming across this paper, that would be crucial information.

○
In the third section (Figure 3), there is an additional tab for binning length and binning function. I don't see any description of how this is different from the same input in section 1. For example, can the binning length and function be different in sections 1 and 3? Either way, it is important for the authors to state it explicitly.
○ Also, the daytime and nighttime feature is great. But how is the computation carried out for subjective day and nighttime under constant conditions if the users have provided longterm DD recording? If this is not possible at the moment, a cautionary note would be important.

○
In the 'Use Case' section, I am assuming that the autocorrelation period analysis is being performed for the four days in DD. This is not clearly described in the text. If this is indeed the case, the authors must clarify, while adding a disclaimer that four days is anyway too short for using time-series methods robustly. If the authors have long-term (7-day) recording and they can use it, that would be great. But it's absolutely fine if they don't have that.
○ Also, in panels C and D, is the data considered only from LD? If so, there is some other interesting thing going on here: if this is in LD, and there is no difference between day and nighttime feeding events in the clock mutant; does that mean that feeding rhythms, unlike locomotor activity, does not mask to light/dark transitions? I think this may be worth pointing out because this adds a new dimension to the behavior that you have been able to identify using your new tool. Also, I think showing the time-course of feeding activity over the entire duration of seven days may be useful to the reader.

○
There also seems to be some discrepancy between the text and figure legend. The text says three days in LD and four days in DD, and the legend says two days in LD and four days in DD. Please clarify. ○