Automatically tracking feeding behavior in populations of foraging C. elegans

  1. Elsa Bonnard
  2. Jun Liu
  3. Nicolina Zjacic
  4. Luis Alvarez
  5. Monika Scholz  Is a corresponding author
  1. Max Planck Research Group Neural Information Flow, Max Planck Institute for Neurobiology of Behavior – caesar, Germany
  2. Institute of Medical Genetics, University of Zurich, Switzerland

Abstract

Caenorhabditis elegans feeds on bacteria and other small microorganisms which it ingests using its pharynx, a neuromuscular pump. Currently, measuring feeding behavior requires tracking a single animal, indirectly estimating food intake from population-level metrics, or using restrained animals. To enable large throughput feeding measurements of unrestrained, crawling worms on agarose plates at a single worm resolution, we developed an imaging protocol and a complementary image analysis tool called PharaGlow. We image up to 50 unrestrained crawling worms simultaneously and extract locomotion and feeding behaviors. We demonstrate the tool’s robustness and high-throughput capabilities by measuring feeding in different use-case scenarios, such as through development, with genetic and chemical perturbations that result in faster and slower pumping, and in the presence or absence of food. Finally, we demonstrate that our tool is capable of long-term imaging by showing behavioral dynamics of mating animals and worms with different genetic backgrounds. The low-resolution fluorescence microscopes required are readily available in C. elegans laboratories, and in combination with our python-based analysis workflow makes this methodology easily accessible. PharaGlow therefore enables the observation and analysis of the temporal dynamics of feeding and locomotory behaviors with high-throughput and precision in a user-friendly system.

Editor's evaluation

In this study, Bonnard and colleagues report a new method to assay feeding rates in C. elegans. Imaging fluorescence in the pharynx with subsequent image processing steps they make it possible to record pharyngeal pumping across freely behaving animal populations over periods up to 3 hs. They validate their method in different behavioural paradigms and with various feeding mutants.

https://doi.org/10.7554/eLife.77252.sa0

eLife digest

A small worm called C. elegans is constantly hungry. It spends all its time looking for food or eating. Hunger and environmental factors, like light, influence its feeding behavior. Studying these worms has helped scientists learn how feeding affects health, longevity, and aging. Feeding studies might also help scientists learn how the nervous system works and how it controls feeding.

Most studies have used one of two approaches. Scientists may measure how much food a group of C. elegans eat by measuring food before and after it is offered to the worms. Or they restrain individual worms and measure the movement of a tube-like muscle, called the pharynx, which the animals use to vacuum up food. Restraining the worms can alter their behavior or brain activity, and studying group feeding habits may miss individual differences, so neither is optimal. Ideally, scientists could measure the feeding activity of many free-ranging worms, but because the movements of the pharynx are small, that too can be a challenge.

Bonnard, Liu et al. developed a software tool that automatically detects and measures feeding behavior in a group of about 30 free-ranging C. elegans simultaneously. In the experiments, Bonnard, Liu et al. genetically engineered worms expressing a fluorescent protein in their pharynx, making it possible to measure its movements with a microscope. They used the microscope to capture images of 30-50 animals at a time as they foraged for food in a dish. Then, they used the software to analyze the data they collected. Over three days and five imaging sessions, Bonnard and Liu et al. tracked the feeding behavior of about 1,000 animals under different conditions. The experiments show that the pharynx grows rapidly during early worm development when the worms quadruple their length, but the rate of pharynx muscle contractions stays the same. They also showed the technique could measure feeding behaviors in animals with different genetic backgrounds, ages, or those engaged in behaviors like mating.

The tool allows for larger and longer-term studies of worm feeding behaviors than previous approaches. Bonnard, Liu et al. made their software, called PharaGlow, available for use by other researchers. The tool may make feeding measurements a routine part of C. elegans studies. It will allow scientists to gain new insights into the role of feeding in a range of processes, including aging, fitness, mating, and overall health. Follow-up studies could determine if these findings are general strategies that also apply to other animals.

Introduction

Feeding is important for animal physiology, affecting energy balance, longevity, healthspan, or aging (Fontana and Partridge, 2015; Trepanowski et al., 2011; Balasubramanian et al., 2017). Accurate measurements of feeding behavior are required to assess these physiological effects. Thanks to its fully sequenced and annotated genome that shares at least 50% homology with human genome and the availability of advanced genome editing tools, short life cycle and transparency, the roundworm Caenorhabditis elegans is a powerful model to study feeding. Research in C. elegans has shed light on how internal states such as hunger, peptidergic, and bioaminergic regulation (Avery and Horvitz, 1990; You et al., 2006; You et al., 2008; Lee et al., 2017; Song and Avery, 2012; Scholz et al., 2017; Kang and Avery, 2021; Srinivasan et al., 2008; Hobson et al., 2006), and decision making affect feeding (Katzen et al., 1983; Shtonda and Avery, 2006). Being able to detect feeding in large populations at single-animal resolution would enable further insight into inter-animal variability, internal states and subtle modulatory effects in the temporal dynamics of feeding. To understand the coupling of multiple behaviors, such as locomotion and feeding, it is required to allow animals to roam freely while feeding and assess both behaviors at the same time. Here, we propose a method to measure the feeding activity in unrestrained populations of C. elegans with sufficient temporal resolution to observe single feeding events.

C. elegans feeds on bacteria and other small microorganisms by drawing in a suspension of food particles from the environment. The bacteria are ingested and separated from the liquid by the pumping action of its powerful pharyngeal muscles (Seymour et al., 1983; Avery and Shtonda, 2003; Fang-Yen et al., 2009). Transport of the bacteria proceeds with occasional peristaltic contractions that move food further toward the terminal bulb where a hard cuticular structure, the grinder, crushes the bacteria before they are pushed into the intestine (Albertson and Thomson, 1976). Pumping is the limiting step for food intake that is, the total food consumed is the product of pumping rate and external food concentration (Seymour et al., 1983; Avery and Shtonda, 2003; Fang-Yen et al., 2009). Pumping is inherently a stochastic process (Lee et al., 2017). It has been suggested that stochastic pumping results from a decision making process that serves to regulate pumping based on food availability (Scholz et al., 2017). Even in the absence of food, pumping has been observed and interpreted as a mechanism for food sampling (Lee et al., 2017; Scholz et al., 2017; Trojanowski et al., 2016). On average, pumping occurs up to 300 times per minute when food is abundant (Lee et al., 2017; Song and Avery, 2012; Scholz et al., 2016). Pumping rates are altered in response to the type, concentration, size, and familiarity of the surrounding bacteria (Lee et al., 2017; Avery and Shtonda, 2003; Scholz et al., 2016; Song et al., 2013). The behavioral and metabolic context, such as hunger, satiety, and mating drive also influence the rate of food intake (Avery and Horvitz, 1990; You et al., 2006; You et al., 2008; Gruninger et al., 2006). Feeding behavior is thus regulated at different time scales ranging from immediate neuro-muscular activity (Trojanowski et al., 2016; Raizen et al., 1995; McKay et al., 2004; Raizen and Avery, 1994), to the intermediate scales of food choice and foraging (Scholz et al., 2017; Katzen et al., 1983; Li et al., 2012), to longer-term life history traits and behavioral state changes of the animal (Avery and Horvitz, 1990; Cermak et al., 2020).

Because of the transparent body of C. elegans, the pharynx can be directly observed through light microscopy, which in principle enables simultaneous detection of food particles (bacteria), muscular motion, and locomotion (Fang-Yen et al., 2009). However, these experiments are often performed in immobilized animals, which can introduce artifacts in the observed behavior, as the activity of the body wall muscles feedbacks to the pharynx via parallel synaptic and hormonal routes (Takahashi and Takagi, 2017; Izquierdo et al., 2022). While desirable, imaging feeding in unrestrained animals, especially in large populations, is challenging due to the disparate time- and length scales of the motions involved. While worms move over centimeters within minutes (Ramot et al., 2008; Swierczek et al., 2011), the observable pharyngeal contractions are over µm within ms (Fang-Yen et al., 2009), making large-scale foraging experiments technically challenging.

Existing techniques to measure feeding fall broadly into two categories. The first focuses on indirect measures of population food intake, and the second detects each pumping contraction (Table 1). Indirect food intake measures rely either on labeling the food intake of the worm, for example using bioluminescent bacteria (Ding et al., 2020), fluorescent bacteria (You et al., 2008; Andersen et al., 2014), or fluorescent beads (Fang-Yen et al., 2009; Kiyama et al., 2020), or by measuring the remaining food concentration over time in large liquid cultures of worms (Gomez-Amaro et al., 2020). However, liquid culture neither allows direct measure of pumping activity nor of feeding related behavior such as locomotion toward food. Resolving single pump information can be achieved by combining bright-field microscopy with live worm tracking to remove center of mass motion and enable imaging of the grinder (Li et al., 2012; Cermak et al., 2020; Zou et al., 2018), or alternatively by constraining animals in microfluidics. In tracking and constrained configurations, one can read out pumps by directly following the grinder motion in the pharynx (Lee et al., 2017; Scholz et al., 2016). A complementary technique relies on recording electropharyngeograms that detect the signature of muscular contractions in a small population of constrained animals without requiring a tracking microscope (Lockery et al., 2012). Despite these numerous approaches, what is lacking is a method that allows time-resolved pumping detection in large populations of unrestrained crawling animals.

Table 1
Comparison of methods for measuring pumping.
TechniqueSingle pumpSingle wormAnimals/ setupMethodLabelConstrainedSource
Bioluminescent bacteriaNoNo100–1000MicroscopyNoNoDing et al., 2020
Luciferase expressing wormsNoYes100MicroscopyYesNoRodríguez-Palero et al., 2018
Optical densityNoNo100–1000AbsorptionNoNoGomez-Amaro et al., 2020
Tracking microscopeYesYes1MicroscopyNoNoLi et al., 2012; Cermak et al., 2020; Zou et al., 2018
pWarpYesYes4MicroscopyNomicrofluidicScholz et al., 2016
NemaChipYesYes8Electrophysiology / EPGNomicrofluidicLockery et al., 2012
Manual countingYesYes1MicroscopyNoNoSong and Avery, 2012; Dallière et al., 2016; Bhatla et al., 2015 and many others
PharaGlowYesYes1–50MicroscopyYesNoThis work

We wanted to fill the gap to allow imaging of pumping activity at high-throughput with single-pump temporal resolution in unrestrained animals, while using only optical setups already available in most C. elegans laboratories. Our method is based on epi-fluorescence microscopy of the pharyngeal muscle with a cost effective, large chip camera that enables imaging of many worms as they explore freely on an agarose plate. We determined that the method is relatively insensitive to the optical instrument used, and does not require high-end or custom optics. The accompanying analysis software (PharaGlow) is written in Python and can be accessed using beginner friendly semi-graphical jupyter notebooks. PharaGlow is available under a permissive open source license. We demonstrate the usability and throughput of the method for multiple use cases, including those not previously possible in restrained animals, such as repeated imaging of a population of developing animals and investigating the coupling of locomotion and pumping rates. Finally, we demonstrate the utility of our approach by imaging a pair of mating animals over more than 1 hr.

Results

Detection of pumping rates in crawling animals

To enable automated, high-throughput detection of pumping in animals crawling on culture plates, we combined epi-fluorescence microscopy with a large area scan camera (Figure 1A). Typically, pumping is detected by manual or automated counting using high magnification to resolve the motion of the grinder in the terminal bulb (Dallière et al., 2016; Bhatla et al., 2015). Using animals expressing a fluorescent protein in the pharyngeal muscle allowed us to image at a lower magnification compared to the resolution required for bright-field imaging of the grinder. Specifically, we image animals expressing YFP under the pharyngeal myosin promoter myo-2p (gnaIs1 [myo-2p::yfp]), which is present in all pharyngeal muscles except pm1 and pm2 (Okkema et al., 1993; Okkema and Fire, 1994).

High-throughput optical detection of pharyngeal pumping in moving worms.

(A) Hundreds of animals expressing myo-2p::YFP are washed in M9 and pipetted onto the assay plate before imaging with an epi-fluorescence microscope at x1 magnification resulting in a full field of view of 7 by 5 mm. (B) Workflow of using the PharaGlow image analysis pipeline. Animal center of mass tracking can be substituted with any available tracker, but subsequent steps are specific to tracking pumping. (C) Representative trajectory of an animal after tracking. (D) Processing steps followed for detection of pharyngeal pumping. Example of a fluorescent image (left; 2x magnification). Segmentation of pharyngeal contour, centerline, and widths (middle) calculated for virtual straightening along the anterior-posterior axis (A–P) and the resulting straightened animal (right). (E) Three straightened frames of an animal before, during, and after a pump and their dorso-ventral variation in brightness along the A-P axis. (F) The metric that is used to detect pumping events. Bottom, a portion of the top trace (orange). Highlighted time points correspond to the images in (E). (G) Average of all images during a detected pump (‘Pump’) and for all remaining timepoints (‘Off’). The difference image (‘Diff’) shows that pumps are characterized by the opening of the lumen and terminal bulb contraction. Colorbar indicates brightness difference (a.u.). (H) Example image sequence of a pharynx recorded at 10 x using bright-field (left) and in epi-fluorescence (right) microscopy before, during, and after a pump. Arrows denote changes in the terminal bulb (cyan) and corpus (orange). (I) Correlation between the average pumping rates for the expert annotator and PharaGlow (N=11 animals). (J) Deviation of the number of events between the expert and PharaGlow reported as the number of events in 10 s, a typical time period used in manually counted experiments.

By using a low magnification of 1x, we could image a field of view of 7 by 5 mm, corresponding to multiple body lengths of the worms (Figure 1A). We simultaneously imaged tens of animals (typically 30–50) as they crawled and analyzed their behavior off-line using our custom analysis software (Figure 1B; Video 1). The analysis pipeline combines a particle-tracking workflow with custom shape segmentation of the fluorescent pharynx (Figure 1C). After detecting and tracking the pharynges in the field of view, the contour and centerlines are fitted. The centerline and width are used to virtually straighten the animal (Figure 1D). We then extract a pump metric from the straightened images based on the standard deviation of the fluorescence along the dorso-ventral axis (DV-axis) of the animal, which reflects pumping events (Figure 1E and F). By averaging images during these putative detected pumping events, we determined that this metric is sensitive to the opening of the pharyngeal lumen and contraction of the terminal bulb and thus indeed corresponds to pumping events (Figure 1G).

Video 1
GRU101 worm pumping with the pumping metric shown.

Although the low magnification (1x) we use to image the animals allows us to increase the number of observed animals, this could compromise pumping detection. To determine how accurate our software detects pumping in these imaging conditions, we compared the results of our automated method and a manual annotator. Since manual annotation of pumping rates is still widely used, but practiced at higher magnifications, we simultaneously imaged worms at a magnification of 10x (pixel size 240 nm/px) in bright field and fluorescence (Figure 1H; Video 2). A human expert counted pumps in the videos acquired using the bright-field channel. We then ran our automated analysis on the video acquired on the fluorescence channel, but downscaled to 1x (pixel size 2.4 µm/px). We found that PharaGlow was able to accurately detect pumping in these videos, and the resulting rate and counts were in agreement with the human expert. Both methods result in a comparable mean pumping rate for the animals counted (Figure 1I), with a deviation between the human and automated results of less than 2 pumps per 10 s (Figure 1J). To score a typical experiment of 30 animals over 5 min of recording time, the human experimenter would need, at best, to count for at least 150 min of data (real time). This time is regularly longer, as accurate counting often requires scrutinizing the recordings in slow motion or visualizing the same part of the recording several times. PharaGlow is therefore able to automatically and reliably detect pumping in low-resolution, large field of view images, enhancing the number of animals which can be scored simultaneously.

Video 2
Simultaneous bright-field (top-left) and fluorescence imaging (top-right) of a freely moving GRU101 worm at ×10 magnification.

Downscaled fluorescent images (×1 magnification; bottom-left) and resulting pumping events detected by PharaGlow (bottom-right).

Developmental pumping

Having developed this new high-throughput method which enables accurate measurements of many animals simultaneously, we wondered how pumping changes over the course of development, where the animal changes its size and its energy needs. During development, the pharynx grows with the body (Knight et al., 2002), but the ratio between pharynx and body length decreases from L1 stage to adulthood (Avery and Shtonda, 2003). To investigate how pumping rates change during development, we imaged cohorts of synchronized worms consecutively over three days in the middle of each of the four larval stages and as young adults (YA). Animals were imaged directly on their culturing plates while moving freely in the field of view (Figure 2A). We accounted for the growing pharynx by adapting the magnification of our imaging system to achieve approximately the same spatial sampling of the pharynx at each stage (Figure 2B). Under these conditions, we were able to sample at least 150 trajectories per developmental stage. Altogether, more than 1000 animal tracks remained after filtering animals that spend less than one minute in the field of view. Filtering leads to over-proportionally reducing young adult trajectories since these animals traverse the field of view quickly despite the spatially proportional scaling. Nevertheless, we obtain large samples of animals due to new animals continually entering, with a total measured time of four animal-hours for the adult stage, and more than 10 animal-hours for the L1 stage. The average track duration is well over one minute with 1.9 ± 0.9 min (mean ±s.d.) for L1 and 1.6 ± 0.6 min for adults (Figure 2—figure supplement 1). These data represent up to two orders of magnitude more single worm pumping data than is obtainable with conventional methods (see Table 1).

Figure 2 with 6 supplements see all
Changes in pumping and locomotion during larval development.

(A) Trajectories of 10 randomly selected animals at different larval stages (L1–L4) and young adults (YA). All scale bars correspond to 1 mm (top). (B) Size of the larvae and YA at the same scale (outlines, top) compared to the equal sizing achieved by adjusting the magnification (bottom). The image corresponds to the red track from (A). (C–E) Time-averaged mean velocity (C), (D) mean pumping rate, and reversals (E) for all animals. The boxplots follow Tukey’s rule where the middle line indicates the median, the box denotes the first and third quartiles, and the whiskers show the 1.5 interquartile range above and below the box. The number of tracklets per developmental stage are shown in (E), with N=6 independent replicates per condition. (F) Relative change in the animal’s area compared to the mean area of the YA stage (top) and relative change in velocity (blue) and pumping rate (orange) across development compared to the mean of the YA stage (bottom). Error bars denote s.d. (G) Pumping rate distribution for all larval stages as calculated by counting pumping events in a sliding window of width = 10 s and combining data from all animals of the same stage. The YA pumping rate distribution is underlaid in gray. (H) Pumping frequency distribution of individual worms for different developmental stages and YA.

We find that on-food pumping rates increase slightly over the course of the larval stages, but much less dramatically than the velocity increases over development, despite the substantial growth of both the body and the pharyngeal muscles (Figure 2C–F). Owing to time resolution and the large number of individual worms that can be analyzed using PharaGlow, it is possible to generate smooth probability density functions of pumping across the different larval stages (Figure 2G). A small fraction of animals did not show pumping during our recording (Figure 2H, 5 animal tracks in L1 with <0.5 Hz, <1% for all other conditions). We wondered if we had captured animals during lethargus, the period of sleep preceding each molt despite choosing the imaging time points in the middle of each larval stage and working with an age synchronized population. However, lethargus is incompatible with the observed velocities of these animals. Alternatively, it is possible that these animals transiently show satiety quiescence, which might be absent under these conditions in the larger YA population (You et al., 2008; Gallagher et al., 2013; Davis et al., 2018).

As we image unrestrained animals, we can simultaneously assess pumping and locomotor behaviors. Animals move forward on agar by generating waves of muscular contraction through their body. When the animals reverse the direction of these waves, they move backwards. Such spontaneous reversals are rare events, but can be triggered by diverse stimuli, such as nose touch (Chalfie et al., 1985) or heat (Zhao et al., 2003). The reversal rate depends also on the food condition and the developmental stage of the animal. In the absence of food, the reversal rate is higher in young adults than in larvae (about 45 events vs 30 events in 10 min), but constant throughout larval development (Chiba and Rankin, 1990). In our on-food measurements, we find some significant differences in reversal rates, however, the effect size is small (e.g. corresponding to a rate of 47 vs 49 pumps/10 min between L2 and L3 animals). The only strong difference appears between the earlier larvae L1-L3 and the later L4/young adult stages with a difference of approximately 10 reversals /10 min (Figure 2—figure supplement 2).

We investigated whether extended exposure to light might affect worm behaviors by monitoring the amount of reversals, pumping rate, and speed. Our results suggest that there is a mild light avoidance reaction (5–25%) which depends on the developmental stage (Figure 2—figure supplement 3). Repeated exposure did not affect behavior in most developmental stages, except for the young adult stage, for which a higher velocity was observed when exposed to light multiple times (Figure 2—figure supplement 4). Additionally, we tested whether light exposure caused phototoxic effects. Long-term exposure (up to 5 hr) did not affect worm viability. Lastly, different excitation light did not affect the pumping rate, but had a mild impact on velocity (Figure 2—figure supplement 5; see Appendix for details).

Overall, we find that our imaging approach can be adapted to larvae by increasing the magnification, and our analysis pipeline is capable of handling data from hundreds of animals. While there are small deviations between the automated detection and human counted data (Figure 2—figure supplement 6), we accurately detect both mean and individual rates for all stages, with a median of error between experts and our method of less than 10%. Over the course of three days and five imaging sessions, more than 1000 animals were tracked, significantly more than can be achieved with comparable methods (Table 1).

Food intake is modulated by starvation

Next, we wanted to determine if our method was robust to changes in locomotion and plate context, allowing a wider range of applications such as investigating starvation or different pharmacological treatments without the presence of a bacterial food source. Off-food locomotion is faster (Dillon et al., 2016; Gray et al., 2005), and pumping irregular (Lee et al., 2017; Scholz et al., 2016), which could potentially be more challenging for detecting pumping. Prior work showed that pumping rates off food are lower, but increase over the course of starvation and that this increase is mediated by a cholinergic pathway (You et al., 2006). We track animals either on-, or off food over an increasing amount of starvation time and extract behavioral dynamics (Figure 3A–D). We confirm that pumping is dependent on the starvation duration, with a reduction in pumping rate over the course of three hours (Figure 3B, D). Beyond the first time point, our data are consistent with prior data (You et al., 2006), showing a sustained rate of around 2–2.5 Hz (Figure 3E). Previously, rates measured immediately after transferring worms off food (<30 min of starvation) were very low, possibly due to a lasting pumping suppression after harsh touch (Keane and Avery, 2003), which we avoid by washing worms off plates instead of picking (see Methods).

Figure 3 with 1 supplement see all
Pumping is modulated by starvation.

(A) Example trajectories of worms after 30 min starvation (blue) or 30 min continuously on food (red), N=10. (B) The pumping rate distributions for the conditions in (A) for all animals (Nstarved = 33, NonFood = 111). (C) Same as (A) but for animals starved, or kept on food for 210 min. (D) The pumping rate distributions corresponding to (C; Nstarved = 33, NonFood = 85). (E) Velocity, reversal rate, and pumping rate for animals starved and on-food controls. The sample size is given in the bottom panel. *** indicates P<0.001 (Welch’s unequal variance two-tailed t-test). The sample size is given in parentheses in the bottom panel. (F) Joint distribution of velocity and pumping rate for increasing starvation times. The cross indicates the mean (red) and standard deviation (white). The density is normalized by sample number. (G) Distribution of instantaneous pumping rates for each animal (tracklet). Rows are sorted by the mean pumping rate to aid visualization.

As we are able to measure pumping and locomotion behaviors simultaneously, we wanted to see if we could observe co-regulation of locomotion and feeding off-food. When taken off of food, C. elegans displays a restricted area search (local area search) which is characterized by frequent turns and reversals and an elevated speed (Gray et al., 2005; Hills et al., 2004; Sawin et al., 2000; Calhoun et al., 2014). This behavior lasts between 30 and 60 min, after which animals switch to longer runs that cover more area, which is a strategy for dispersal (Hills et al., 2004; Wakabayashi et al., 2004). Interestingly, for starved worms at 30 and 90 min, the joint distribution of pumping rates and velocities show distinct sub-populations (Figure 3F). For longer starvation durations, the population becomes homogeneous with a well-defined mean pumping rate and speed. For the shortest starvation time point we sampled, we see a mixed population with distinct speeds and pumping rates, possibly reflecting some animals that are still performing a local search and others that are not. This is consistent with the fact that these distinct populations are not apparent in worm populations that stay on food (Figure 3—figure supplement 1).

To further investigate the origin of the two sub-populations observed at short starvation time, we analyzed the pumping rate distributions of individual animals (Figure 3G). Taken together, the data suggests that at 30 min starvation, a fraction of the animals show low speeds and pumping rates, and the remainder are in a high-speed, high pumping state (Figure 3F, G). This suggests two possible interpretations. First, it is possible that, with increasing starvation time, a subset of animals transitions to lower pumping rates until all animals show a similar pumping rate distribution with an average of ~2 Hz. Alternatively, the two sub-populations could result from transient behavioral changes among animals to high pumping rates. These transitions would occur less frequently with increasing starvation time. To discern among these two possibilities would require measuring single animals over longer periods of time. Further studies are required to reveal these population dynamics upon starvation.

Long-term recording of mating animals

Having established that PharaGlow can robustly detect locomotion and pumping behaviors across a range of conditions, we wanted to test if it is a suitable tool for long-term recordings. As a proof of principle, we imaged the interactions of a male and a hermaphrodite over the course of 74 min at 30 fps (Figure 4A and B).

Figure 4 with 1 supplement see all
Long-term imaging of mating animals.

(A) Composite image of the two animals in the arena while exposed to bright-field illumination and exciting fluorescence of YFP using green light. On the right, the hermaphrodite, on the left the male identifiable by its smaller size and its tail with sensory rays and fan. (B) Trajectories obtained from the full recording of the male (blue) and hermaphrodite (red). (C) Example mating events. (D) Behavioral measures for 1 hr of data. The distance between the animals, the reversal events, pumping rate, and velocity are shown for the hermaphrodite and the male. The male shows an extended period of quiescence (orange arrow). (E) Behavioral measures for 10 min of data and (F) 100 s of data corresponding to the mating event 1 in panel (C). (G) Velocity distribution and (H) pumping rate distribution for the male and hermaphrodite.

As the resulting data volume would have been prohibitive, we implemented a live segmentation method that allowed us to only store the animals coordinates and the region of interest around each animal (Videos 3 and 4; Methods). We then calculated the distance between the animals, allowing us to identify mating events (Figure 4C and D). We find that the animals frequently interact over the course of 1 h with multiple close encounters (Figure 4D). The male also showed a long period of quiescence in both locomotion and pumping rate. Overall, the animals are closer at the beginning of the recording, but later spend time at larger distances (Figure 4E, left and right panels). Despite the long imaging duration, we still observe pumping at the end of the recording, indicating that we have sufficient signal remaining to detect pumping events. We confirm this observation by calculating photo-bleaching curves. We find that the decay time of the signal is 410±47 min (Figure 4—figure supplement 1), which indicates that it is possible to do continuous imaging over multiple hours. In this case, the recording was limited by the male escaping the enclosure, rather than loss of signal.

Video 3
eat-18 worm pumping.
Video 4
Live segmentation of worms.

The program stores only the segmented worms from individual images and their xyzt coordinates to reduce storage requirements by several orders of magnitude thus allowing uninterrupted recordings for hours at 30 FPS.

Having this multi-scale data allows observing both large-scale structure and smaller events in the data. We further examined the mating event displayed in Figure 4C. During the encounter, the male shows a larger velocity and performs many long reversals when the animals are close, as is typical for a mating attempt. It is also interesting to note that pumping does not completely cease during the attempt (Figure 4F). Despite being in the same arena, and covering most of the enclosure during the recording (Figure 4B), the velocity and pumping distributions differ strongly between the two animals (Figure 4G and H). While the distributions of the male are dominated by the long quiescence period, the hermaphrodite overall shows a bi-modal rate distribution with some infrequent pumping at 4 Hz. PharaGlow is therefore able to track behavior over more than an hour, and keep the identity of animals given that these are constrained to the field of view.

Feeding mutants

A desired capability for a high-throughput feeding tool is the ability to faithfully detect pumping rates in mutant animals which might have different pharyngeal contraction patterns and body motion, potentially increasing the difficulty of detecting pumping events. To determine if PharaGlow could faithfully detect pumping and locomotion in mutant animals, we wanted to assay a range of feeding and locomotion phenotypes. We therefore selected mutants with reported constitutively high (unc-31) or reduced (eat-18) pumping rates and different locomotory patterns (Raizen et al., 1995; McKay et al., 2004; Avery et al., 1993). UNC-31 is involved in dense-core vesicle release, and unc-31 mutant animals display reduced, uncoordinated locomotion on food (Figure 5A). We confirm that unc-31(e928) and unc-31(n1304) animals pump at rates comparable to wildtype. However, we see a bimodal distribution of rates with a fraction of animals showing markedly lower rates (Figure 5B). By looking at the individual animals' pumping rates, we find that unc-31 animals show long pauses in pumping, unlike wt animals (Figure 5F).

Figure 5 with 2 supplements see all
Automated pumping detection in feeding mutants.

(A) Example trajectories of tracked animals (N=20, except N=18 for eat-18(ad820)). (B) Velocity, reversal rate and pumping rate for all genotypes. The sample size is given in parentheses in the bottom panel. (C) Mean and standard deviation of the pharyngeal areas relative to wt. (D) Pumping metric for a representative sample animal per genotype. Arrows in the eat-18(ad820) trace denote slow contractions. (E) Average peak shape of the pumping signal for wt (blue) and eat-18(ad820) (orange). The shaded area denotes s.d. (F) Pumping rate distributions. The wt pumping rate distribution is underlaid in dark blue. (G) Heatmap of the pumping rates for animals recorded over 2 h. (H) Heatmap thresholded to determine ‘fast pumping’ (defined as pumping rate >2.5 Hz) and ‘slow’ states. (I) Fraction of time spent in fast pumping of each animal and (J) the number of state transitions (slow to fast and fast to slow) for each animal in (H). Significant differences between a mutant and wt are indicated as * (p<0.05), *** (p<0.001) and **** (p<0.0001). Welch’s unequal variance two-tailed t-test was for the large sample size measurements (B, C). For (I–J) significance differences were assessed with the Mann-Whitney-U test.

In contrast to unc-31, eat-18 mutant animals have no previously reported locomotor defects, but pump slower than wildtype (McKay et al., 2004). EAT-18 is expressed in the pharyngeal muscle and interacts with a nAChR subunit EAT-2 to form a functional acetylcholine receptor (Raizen et al., 1995; Choudhary et al., 2020). Feeding impaired mutants were previously reported to have reduced body lengths and widths (Mörck and Pilon, 2006). As expected, we found that eat-18 animals were smaller (Figure 5C) and developed more slowly (approximately 91 hr from egg to adulthood compared to 63 hr for wildtype). While we detected pumping events at an average rate of 1 Hz, the animals showed a different contraction pattern and timing than either unc-31 or wt animals (Figure 5D and E). We confirmed that eat-18(ad820) animals lack the ability to perform fast pumping bursts (Figure 5B and F) and the duration of a pharyngeal contraction is approximately doubled compared to wt (Figure 5E, Figure 5—figure supplement 1, Video 3). We do observe a higher pumping rate than previously reported for eat-18, where animals were reported to rarely pump during experiments (<0.5 Hz, Raizen et al., 1995; McKay et al., 2004). To verify that the detected motion is pumping and not peristaltic movements or other non-pharyngeal muscular motion, we verified the rate by inspecting individual videos. When verifying these sample animals, we did observe slow pumping bursts at the 1–2 Hz rates indicated by PharaGlow, suggesting that these animals are able to pump at this frequency (Figure 5E, arrows and Video 3). We also found that eat-18 animals showed significantly fewer reversals than wildtype, indicating a role for the nAch receptor in modulating reversals. This is likely mediated by extrapharyngeally located neurons, since eat-18 is reported to show expression not only in the pharyngeal muscle, but also in some unidentified somatic neurons (McKay et al., 2004).

Considering the split distribution of mean pumping rates we observed for unc-31 in our short term (5 min) recordings (Figure 5B), we wondered if these distributions reflect a persistent difference between animals or if instead the animals perform infrequent switches between high - and low pumping rate states. We therefore tracked animals for at least three hours on food, restrained to our field of view using a copper enclosure. By confining only a few animals (<5 in the field of view), we were able to maintain animal identity over the course of the experiment (see Methods) and quantify their pumping rate over at least 2 hr (Figure 5G). If the population reflects a snapshot of the overall dynamics, a large population measured for a short period of time should result in similar pumping rates as a few animals measured over long time periods. To test this hypothesis, we quantified the autocorrelation of the pumping rate for single worms revealing that pumping rates were correlated for different time scales for wt and unc-31 mutants, with the unc-31 mutants showing a more persistent pumping behavior (τ=9.6 min for unc-31(e928) and τ=11.0 min for unc-31(n1304)) compared to wt (τ=7.9 min) (Figure 5—figure supplement 2). These data indicate that on-food pumping rates are autocorrelated over multi-minute time-scales.

To further investigate the different persistence of pumping across the different animals, we quantified the transitions between states of pumping and no or low pumping rates. We define a ‘fast’ state as a period at which the animals pump at >2.5 Hz and ‘off’ states as the converse (see also a similar analysis in Lee et al., 2017). Wild-type animals displayed frequent switching between low and high pumping rates (Figure 5H and J). In contrast, unc-31 animals displayed infrequent switches, consistent with prior reports of constitutive pumping (Avery et al., 1993) and the role of neuropeptides such as PDF in regulating switches between foraging states (Flavell et al., 2013). Taken together, these results show that studying the underlying behaviors and dynamics in a worm population requires large statistics and long recordings. Depending on the desired data, both long-term recordings and short-term high-throughput measurements are accessible with PharaGlow.

Limitations and requirements

Using a combination of low-magnification fluorescence imaging and dedicated analysis software, we show that it is possible to perform high-throughput, automated pumping detection of worms crawling on standard culture plates. There are some limitations to the method that are due to the reliance on a fluorescent indicator in the pharyngeal muscle and the handling of the large datasets that are generated. We find that uneven plates or improper focus leads to low signal-to-noise ratios. With careful focusing, imaging the center of evenly poured plates and using our custom peak detection method that is adaptive to the image quality (see Methods), these pitfalls can be mitigated. Additionally, once at focus, small variations of the worm height do not affect the result, as low-magnification imaging results in a large depth of field.

As it is necessary for our approach to label the pharynx, mutant characterization with our tool would require crossing all possible mutants with a fluorescent reporter strain, and albeit labor intensive this is nonetheless still a standard genetic practice when a reporter is used. While most experiments in this paper were performed with a homozygous, integrated reporter background (gnaIs1), we have also used extrachromosomal arrays with success (Figure 2—figure supplement 5), which allows the use of animals that have a myo-2 reporter as a co-injection marker, for example. In addition, since our tool relies on the detection of fluorescent protein, siblings losing the transgene on the plate will not interfere with the analysis.

To maximize the field of view, we have chosen the smallest spatial resolution at which we could reliably detect pumping in wildtype adults. To ensure detection in smaller animals, increasing the magnification in these cases is recommended, as we did to detect pumping in larvae. The final requirement is related to data management and handling. While the hardware requirements are restricted to equipment commonly available in many laboratories (a fluorescence dissecting microscope or a epifluorescence microscope and a Megapixel camera are needed), the data rate of the large area scan cameras is >6 GB/min. On a 4-core laptop, the expected analysis time is approximately 8 hr for 150 worm-minutes of data. While the analysis can be run on a laptop or desktop computer, runtime is much improved when using a computing cluster (see Supplementary materials).

Discussion

We developed a microscopy protocol and customized image analysis software that enables simultaneous measurements of locomotion and feeding in unrestrained animals. We are able to accurately detect pumping rates in populations of animals on plates at single-worm, single-pump resolution. Our fully automatic method provides an increase in throughput by more than one order of magnitude, and does not require any laborious handling of the animals or microfluidic devices. As our imaging does not adversely affect worms, animals can be imaged multiple times, as we demonstrated by following pumping in a population of developing animals or can be imaged continuously for hours as shown for the mating animals. In addition, by enabling measurements of unrestrained animals directly on agarose plates, our approach creates opportunities for studying novel behaviors, such as foraging in complex environments (Ding et al., 2020; Iwanir et al., 2016) or behavioral coordination (Cermak et al., 2020; Hardaker et al., 2001).

Using our method, we were able to detect quiescent episodes in all four larval stages that were absent in the young adult. It will be interesting to study the food needs at different stages and how feeding is regulated on the scale of minutes. To understand the neural basis of feeding, resolving the decisions underlying feeding behavior is required (Scholz et al., 2017; Katzen et al., 1983). However, current bulk methods capable of extracting population averages of pumping rates are insufficient to understand underlying neural activity, as the data lack the temporal resolution to correlate pumping with neural activity. Additionally, it is desirable to image animals in their normal culturing environments to compare feeding behaviors to established baselines for example, for velocity and reversals. Our method enables the quantification of pumping activity, in multiple animals simultaneously, as a marker of feeding behavior in C. elegans.

An essential requirement for the broad applicability of such a tool is its use for genetic and pharmacological screens. We demonstrated the suitability of our tool for studying the pumping and locomotory behaviors of unc-31 and eat-18 animals. We could identify a bimodal distribution of pumping rates for unc-31 mutants with some animals showing low rates for the duration of the recording. This indicates that while these animals are capable of fast pumping, they do not show the same temporal regulation as N2 animals, which show rapid transitions between slow and fast pumping, and pump fast most of the time at high food levels (Scholz et al., 2017). We could also reveal a previously unreported alteration in pump duration for eat-18 animals. Surprisingly, during confirmation of the feeding defect, we also discovered a previously unreported locomotion defect, hinting at a broader function for eat-18 possibly outside of the pharynx.

Additionally, PharaGlow enables easy pharmacological screens on plates, by allowing experimenters to directly apply compounds to culture plates without requiring microfluidics or immobilization. Immobilization often requires the addition of serotonin (5-HT) to stimulate pumping, as pumping is suppressed in restrained animals (Takahashi and Takagi, 2017). It is likely that observed feeding defects differ between crawling, food-stimulated animals and serotonin-stimulated animals (Lee et al., 2017), and that new experiments will be effective in identifying phenotypes that went unnoticed in immobilized preparations.

To mimic realistic foraging situations would require extending the foraging arena by supplying variable patches of food, and providing a more interesting landscape rather than a homogenous 2D plate environment. Patch foraging has been extensively studied in C. elegans, both with respect to entry into single patches (Katzen et al., 1983; Flavell et al., 2013; Iwanir et al., 2016) and food choice (Katzen et al., 1983; Milward et al., 2011; Dal Bello et al., 2021), although these studies focused on locomotion rather than pumping rates. Testing models of patch foraging and their predictions (Davidson and El Hady, 2019) while explicitly including measured food intake will help better define the limits in which simple models of foraging are applicable. Moreover, this would ideally expand our understanding of the underlying strategies learned or inherited by worms living in different environments. Technically, current imaging limitations, such as the field of view, can be extended by using larger camera arrays, which will enable scanning across multiple centimeter-sized fields of view. These experiments would also require long-term imaging of the animals to observe transitions between food patches, which is possible using our method.

A further extension of this work would be to image pumping activity in related species, either Caenorhabditis nematodes collected from different field sites, or even predatory nematodes like Pristionchus pacificus, which has a bacterial feeding mode similar to C. elegans, and additionally a predatory mode when killing the larvae of other nematodes. While the requirement for labeling the muscle is a prerequisite of our method, the myo-2 gene is a myosin heavy chain that is conserved among nematodes and will likely show similar expression in closely related species. A strain with the myo-2 promoter construct for the closely related C. briggsae is already available at the CGC. Our tool opens new venues to study feeding behaviors at multiple scales. We envision that its application will lead to new insights into worm behavior.

Materials and methods

Key resources table
Reagent type (species) or resourceDesignationSource or referenceIdentifiersAdditional information
Strain, strain background (Escherichia coli OP50)OP50CGCCGC:OP50
Recombinant DNA reagentmyo-2p mCherry unc-54 3’utrAddgenepCFJ905 ng/µl injected into N2
Recombinant DNA reagentpPHA2 GFP-FGift from Marc PilonpMS1750 ng/µl injected into N2
Strain, strain background (C. elegans)N2CGCN2Background for INF30
Strain, strain background (C. elegans)gnaIs1[myo-2p::yfp]CGCGRU101
Strain, strain background (C. elegans)nonEx9[pPHA2 GFP-F myo-2p::mCherry::unc-54 3’utr]This publicationINF305 ng/ul of pMS17 and 5 ng/ul of pCFJ90 injected into N2; Figure 2—figure supplement 4
Strain, strain background (C. elegans)unc-31(e928) gnaIs1 IVThis publicationINF5Cross of unc-31(e928) with GRU101; Figure 3
Strain, strain background (C. elegans)unc-31(n1304) gnaIs1 IVThis publicationINF17Cross of unc-31(n1304) with GRU101; Figure 3
Strain, strain background (C. elegans)eat-18(ad820) I; gnaIs1 IVThis publicationINF44Cross of eat-18(ad820) with GRU101; Figure 3
Software, algorithmPharaGlowThis publicationhttps://github.com/scholz-lab/PharaGlow; Scholz, 2022.

C. elegans maintenance

Request a detailed protocol

C. elegans were grown on NGM plates at 20 °C. Worms were synchronized by letting adult gravid animals lay eggs for 2–3 hr, then removing the adults. The average time from egg to young adult stage for strain GRU101 (gnaIs1[myo-2p::yfp]) was 63 hr. Before the experiment, synchronized adults were washed off the culture plates with 1 ml of M9 and collected in an Eppendorf tube. Worms were allowed to settle for 1 min, the supernatant was removed and the tube was refilled with M9. Washing was repeated two more times. The washing was sufficient in that we did not observe animals remaining in the spots containing the remainder of M9 on the assay plates, suggesting that the bacterial amount was too diluted to induce dwelling behavior.

Imaging setup

Request a detailed protocol

Imaging of worms at ×1 magnification was performed using a commercial upright epi-fluorescence microscope (Axio Zoom V16; Zeiss) equipped with a 1 x objective (PlanNeoFluar Z 1.0 x/N.A. 0.25). For imaging of YFP fluorescence, light from an LED lamp (X-Cite XYLIS) was reflected towards the sample using a dichroic mirror (FT 515; Zeiss) and filtered (BP 500/25; Zeiss). Emitted light was filtered using a band-pass filter (BP 535/30; Zeiss) and focused onto the camera sensor (acA3088-57um; BASLER) using a camera adapter with an additional 0.5 x magnification (60 N-C ⅔’’ 0.5 x; Zeiss). The power density of fluorescence excitation at the focal plane (0.24 mW/mm2 at 500 nm) was measured using a power meter sensor (PS19Q; Coherent) with the corresponding controller (PowerMax; Coherent). Animals were imaged at 30 fps for 5 min unless otherwise indicated. For imaging of mCherry, the filter cube was replaced with a commercial filter set (64 HE; Zeiss). The resulting power density using this cube was 0.76 mW/mm2 at the focal plane.

Long-term imaging

Request a detailed protocol

For long-term imaging, stroboscopic illumination (5ms light pulses) were used to reduce bleaching. Excitation light was synchronized with the camera exposure using the GPIO camera line and the TTL input of the LED lamp. Frames were collected using a custom software (LabVIEW). To reduce the amount of stored data and allow continuous recording using a standard computer (Celsius W520; Fujitsu), images were segmented automatically and only areas containing worms, and their coordinates within the image, were stored. This procedure allowed a data reduction by approximately 1000 fold. For imaging, a copper frame (5.3 x 3.75 x 1 mm) was filled with 2% low melting point agarose (Sigma Aldrich) in M9 and 2–5 µl of a 10-fold concentrated overnight OP50 culture was seeded on top. The frame was deposited into a 10 cm NGM plate, and worms were transferred to the agarose arena. To preserve the moisture of the preparation and prevent shrinking of the gel, about ⅓ of the agar at the outer rim of the plate was removed using a scalpel and the space was filled with 6 ml of M9. Animals were recorded for at least 3 hr and all animals that were continuously tracked for at least 2 hr were included in the analyses in Figure 5.

Dual bright-field and fluorescence imaging

Request a detailed protocol

Dual imaging was performed using an upright microscope (BX51WI; Olympus) and a 10 x objective (UplanSApo, NA 0.4; Olympus). For bright-field imaging, light emanating from a near-infrared (780 nm) LED (M780LP1 and driver LEDD1B; Thorlabs) was filtered using a (785/62 BrightLine HC; Semrock) and projected onto the sample via the bright-field illumination condenser. To excite fluorescence, the Teal line from an LED lamp (Spectra X light engine; Lumencor) was filtered (513/17 BrightLine HC; Semrock) and projected onto the sample using a 520 nm long-pass dichroic (FF520-Di02; Semrock). Transmitted and emitted light were filtered using a 532 long-pass filter (BLP01-532R; Semrock). To simultaneously record images in bright-field and fluorescence, a dual-camera device was used (DC2; Photometrics). Light was split into two channels using a 695 long-pass dichroic mirror (695DCXRUV; Photometrics) and images were projected into two cameras (acA3088-57um; BASLER). Fluorescent light was band-pass filtered (550/49 Brightline HC; Semrock) before reaching the camera sensor. The exposure time (6ms) of one camera served to synchronize the acquisition of the second camera and the Lumencor light engine. Individual worms were manually tracked using a 3-axis motorized stage (X-LSM150A; Zaber).

Developmental pumping experiments

Request a detailed protocol

Worms were pre-synchronized by hypochlorite bleaching, allowed to hatch overnight in M9 and then cultured on NGM plates with OP50 at 20 °C. On day 3 after pre-synchronization, worms were synchronized again by letting 20 gravid animals lay eggs for 2 hr per assay plate, then removing the adults and letting embryos grow for specific durations to reach the appropriate larval or adult stage (19 hr for mid-L1, 31 hr for mid-L2, 39 hr for mid-L3, 50 hr for mid-L4, 65 hr for young adults). For the assay plates, 40 µl of E. coli OP50 culture was spotted onto an empty 6 cm NGM plate a few hours before the synchronization and left to dry. Synchronized worms were imaged directly on their assay plates as described in section ‘Imaging setup’. The magnification for each stage was chosen to achieve an approximate pharynx length of ~60 pixels (2 x (1.18 µm/px) for L1, 1.5 x (1.57 µm/px) for L2, 1.4 x (1.69 µm/px) for L3, 1.3 x (1.81 µm/px) for L4 and the standard 1 x (2.36 µm/px) for young adults). Three assay plates were imaged once per stage, and three additional plates were imaged at each stage to test for photo-sensitivity.

Starvation experiments

Request a detailed protocol

Washed animals were transferred to the center of an empty 6 cm NGM plate at room temperature and left to recover for 15 min before imaging. The same plate was imaged at defined time points for progressively more starved animals (at 30 min, 90 min, 150 min and 210 min after being taken off food). The field of view was chosen randomly on the plate but was required to contain at minimum 3 worms at the beginning of the recording. For control, washed animals were transferred close to a 40 µl of E. coli OP50 lawn, which was spotted onto an empty 6 cm NGM plate a few hours before the recordings and allowed to dry. Acclimation time and recording are similar for starved animals.

Automated analysis

Pharyngeal pumping - fluorescence data

Request a detailed protocol

Animals were tracked using our custom python analysis package PharaGlow which is freely available under a permissive GPL 3.0 license. In brief, PharaGlow runs a three-step analysis: 1. center of mass tracking and collision detection, 2. linking detected objects to trajectories and 3. extracting centerline, contour, width, and other parameters of the shape to allow extracting pharyngeal pumping events. Tracking uses the soft matter package (Allan et al., 2019). The code is fully modular and any existing tracking code could in principle be used for the first two steps provided the input data is formatted to PharaGlow standards. We provide example data and example jupyter notebooks to help users make use of our package both in personal computer and high-performance cluster settings. The resulting files contain the position, and the straightened images which are further processed to extract the behavioral measures as described in Figure 1 and section ‘Pharyngeal pumping - postprocessing’’.

Pharyngeal pumping - postprocessing

Request a detailed protocol

To obtain pumping traces from straightened animals, the inverted maximum of the dorso-ventral standard deviation of brightness is calculated for each straightened frame per animal (Figure 1E). This metric is sensitive to the opening of the pharyngeal lumen and terminal bulb contractions. Peaks in the resulting trace correspond to pumping events. Due to the animal motion, uneven illumination or defocusing can modify the baseline of the pumping metric. We correct for baseline fluctuations and spurious fluorescence changes by subtracting the background fluctuations using a rolling mean filter of 1 s (except for eat-18 mutants, where we use 3 s otherwise the slow contractions were removed too). To the remaining signal we apply a smoothing filter of width = 66 ms (2 frames). We detect peaks using AMPD, an algorithm for peak detection in quasi-periodic signals (Scholkmann et al., 2012). We also require the peak distances to obey physiologically reasonable rates i.e., the peaks can not be closer than dmin= 132 ms (4 frames). To automatically establish the noise level of the trace, we compare the incidence of intervals between detected peaks that violate the assumption dmin> 132 ms and select the minimal prominence required, such that the fraction of violating intervals is lower than a sensitivity parameter s. For all dataset with 5-min recordings, we set s=0.999.

In the long-term recordings, we use a hampel filter with a width of 300 frames to remove spurious outliers in the signal which affect peak detection and set s=0.9999.

Depending on the purpose, pumping rates have been calculated as follows: To determine the average pumping rate per track, we calculate the number of pumping events/ total track duration (e.g. Figure 3F, box plots). To obtain pumping rate distributions, we calculate the number of pumps in a sliding window of 10 s and combine data from all tracks. The ‘instantaneous pumping rate’ is defined as 1/Δt between pumps. We use the instantaneous rate when a higher temporal resolution is desired. Which rate metric is used is indicated in the caption.

Assigning high and low pumping rate states

Request a detailed protocol

Pumping rates were calculated from the detected pumping events in a 30 s block window. The resulting rates were thresholded with a threshold of 2.5 Hz to discriminate between fast and slow pumping. The binary heatmap was filtered with a rolling median filter of width 5 min, which removes spurious events and allows extraction of longer term dynamics.

Autocorrelation of pumping rates

Request a detailed protocol

The autocorrelation of the pumping rates for the 2 hr recordings was calculated from the 10 s average pumping rates (see Pharyngeal pumping - postprocessing). The decay time of the autocorrelation was determined using a one-sided t-test for each timepoint and calculating if the sample mean of the autocorrelation for each animal differed from 0. To determine the uncertainty of the decay time, we ran leave-one-out bootstrapping and report the mean and s.t.d. of the leave-one-out testing.

Other behavioral parameters

Request a detailed protocol

Velocity was calculated from the tracked center of mass of the labeled pharynx. Reversals were calculated based on the angle between the pharynx and the animal’s nose tip direction. To avoid spurious reversals, the nose tip trajectories are coarse-grained to 6 Hz, and the angle between the nose tip and pharynx is smoothed with a window of width = 1 s (30 frames). Timepoints with angles exceeding 120° were annotated as reversals. Reversals shorter than 0.5 s are removed. The estimation of the pharyngeal area is based on an automated threshold of the pharynx.

Animal selection

Request a detailed protocol

All animals that were successfully tracked for at least 60 s (Figures 13) were included. No other filtering or outlier removal was performed. Due to age synchronization, all animals in the field of view were of similar size in the wildtype experiments. For eat-18 mutants, the size and developmental stage of the animals were more dispersed and only animals that had the appropriate size for their stage were included (Figure 5). In the starvation experiments, animals that were successfully tracked for at least 20 s were included due to the larger velocity in this condition (Figure 3).

Manual annotation of pumping behavior

Request a detailed protocol

Movies for individual animals were created from a large field of view and expert annotators counted pumps by displaying the movie using the cell counter tool in Fiji (Schindelin et al., 2012). The annotators were blinded to the movie conditions and to the other experts’ results.

Data and code availability statement

Request a detailed protocol

The data from this manuscript is available at https://osf.io/fy4ed/. The code repository for the PharaGlow package can be found at https://github.com/scholz-lab/PharaGlow (Scholz, 2022). Imaging software can be found at https://github.com/scholz-lab/Acquisition_PharaGlow, (Bonnard, 2022 copy archived at swh:1:rev:29ae8971f66fa0722f4914deb4b70b7d53f76f07).

Appendix 1

Collision detection and effective number of independent animals in the field-of-view

PharaGlow detects all fluorescent objects in the field of view. The experimenter should choose a minimal and maximal size to allow only tracking objects that are single worms. If animals touch, an object that is larger than the maximally allowed size (maxSize) will be detected. In this case, the program automatically re-segments the region and attempts to separate the large object into multiple smaller objects using repeated filtering and thresholding. If this process is successful and two or more objects of the correct size can be separated, the program will continue tracking these animals. This approach is successful when animals touch, but do not overlap. We are unable to resolve crossings where animals are physically overlapping.

To determine the effect of collisions on tracking, we determine the number of detected objects in the field-of-view and compare it to the number of tracks obtained. Analysis of the track duration shows that average tracks are two min, and this duration depends on the velocity (Figure 2—figure supplement 1). We find that these two measures correlate well, supporting the view that animal tracks are not frequently broken into small tracklets (Figure 2—figure supplement 1B).

Computational cost and scaling

We benchmarked the performance and scaling of the software using perfplot. Appendix 1—table 1 details the pure computation time as run on a 1000 frame demo recording (available for download at the data repository). We find that parallelization improves performance for the object detection for up to 8 workers, and continues improving for >16 workers in the segmentation step. In our implementation, this option is already provided based on the python package multiprocessing. As the different steps depend on the details of the imaging, we have decided to report processing time per step.

  1. Object detection

    The object detection step uses a full frame and does masking and object detection for each individual object. For this case, computational cost scales with the number of frames and can be easily parallelized to enable a faster speed. The average single-core computation time per frame is 300ms, which includes I/O, as we employ lazy data loading, which allows analyses of data that are much larger than the RAM available. Of note, this step can be omitted if our acquisition software is used (see Methods) as single worms are segmented already during acquisition.

  2. Tracking and trajectory interpolation

    The tracking step is based on trackpy and here the scaling depends on the search range (how far can an object move between frames) and the memory (how many subsequent frames can an object be unobserved). Typically, this step is much faster than the other two as it does not handle large I/O or image processing.

  3. Segmentation, centerline detection, straightening, and pump detection

    In this step, the previously detected images of detected pharynx are further processed. The total compute time here depends on the product between the number of objects and the number of recording frames. We therefore provide a per-object assessment of the processing time.

Appendix 1—table 1
Benchmarking of the typical computing times.

Full frames are the multi-animal images with 3088x2064 px. Mini-frames are small regions of interest with one animal (Figure 1D).

Compute time**Intel(R) Xeon(R) Gold 6230 CPU @ 2.10 GHz
Step1 worker4 workers16 workers
Object detection186.6 ms / full frame81.2 ms / full frame57.4 ms / full frame
Tracking and trajectory interpolation1 ms / miniframe1 ms / miniframe1 ms / miniframe
Segmentation etc.378 ms / mini-frame104 ms / miniframe32 ms / miniframe
Typical recording 150 worm minutes of data (9000 full frames, 30 worms)1.2 days8.2 h3 h

Effects of light exposure

C. elegans are known to sense and react to light by initiating reversals and suppressing pumping. These reactions occur more frequently at short wavelengths and high power densities (Ward et al., 2008; Bhatla et al., 2015; Bhatla and Horvitz, 2015). To determine if our imaging conditions affected behavior, we measured the light intensity and the leaving rates of animals during imaging. We used excitation light centered at 500 nm, and measured an effective intensity of only 0.24 mW/mm2 in the field-of-view, 54 times lower than the reported intensity that induces pumping inhibition or spitting3. We observed 5–25% of animals leaving the field-of-view during recordings, indicating a mild avoidance reaction which depends on the developmental stage (Figure 2—figure supplement 3).

To control for photo-toxic effects, we split our developmental cohort into two groups. One group of animals was imaged consecutively at each larval stage (multiple exposures), the other group was left to grow under the same conditions, but only ever imaged once (single exposure). We find that during all larval stages, the behavioral results of the two groups are similar, but not in young adults (Figure 2—figure supplement 4). For the young adult cohort, the animals that were repeatedly imaged show a higher velocity compared to the single-exposure group, as well as differences in all other behavioral metrics we report. We speculate that this could be due to differences in drying of the plates during repeated imaging, or a possible light-induced chronic effect.

Over longer time scales, exposure to light can reduce the worms’ lifespan (De Magalhaes Filho et al., 2018). To test for chronic photo-toxic effects, we tested the viability of worms after long exposure to 500 nm light. We continuously illuminated 30 young adult GRU101 worms for five hours using the same illumination intensity as our PharaGlow assay (0.24 mW/mm2 at the focal plane). We employed a copper frame to prevent the worms from escaping the illuminated area. A plate not exposed to the 500 nm light was placed on the same bench close to the microscope as our negative control. After five hours, the copper frame was removed and worms were scored for viability both immediately and after overnight recovery in a 20 °C incubator. All worms were viable and able to move upon gentle tapping on the plates immediately after illumination. Further checking after overnight recovery confirmed their continued viability. This suggests that exposure to this light level does not cause observable photo-toxic effects.

To further assess the impact of the excitation light on behavior, we measured on-food pumping in adult animals expressing the red fluorophore mCherry compared to the strain expressing YFP, which is used throughout the paper. If the impact of the wavelength is non-negligible, the red fluorophore mCherry (excitation centered at 587 nm) should result in fewer reversals or accelerations compared to YFP, as these responses are wave-length dependent (Ward et al., 2008; Bhatla et al., 2015; Bhatla and Horvitz, 2015). As expected, we find an increase in the velocity for the green light exposed animals (Figure 2—figure supplement 5A). However, we find that pumping rates between the two populations are not significantly different (Figure 2—figure supplement 5B), suggesting that these light intensities do not affect pumping behavior. We note that the differential effects of excitation light on behavior should be taken into account when investigating the coupling between e.g., locomotory and feeding behaviors.

Data availability

The data from this manuscript is available at https://osf.io/fy4ed/. The code repository for the PharaGlow package can be found at https://github.com/scholz-lab/PharaGlow.

The following data sets were generated
    1. Scholz M
    2. Bonnard E
    3. Liu J
    (2022) Open Science Framework
    ID fy4ed. Automatically tracking feeding behavior in populations of foraging worms.

References

    1. Albertson DG
    2. Thomson JN
    (1976) The pharynx of Caenorhabditis elegans
    Philosophical Transactions of the Royal Society of London. Series B, Biological Sciences 275:299–325.
    https://doi.org/10.1098/rstb.1976.0085
    1. Chalfie M
    2. Sulston JE
    3. White JG
    4. Southgate E
    5. Thomson JN
    6. Brenner S
    (1985)
    The neural circuit for touch sensitivity in Caenorhabditis elegans
    The Journal of Neuroscience 5:956–964.
    1. Zhao B
    2. Khare P
    3. Feldman L
    4. Dent JA
    (2003)
    Reversal frequency in Caenorhabditis elegans represents an integrated response to the state of the animal and its environment
    The Journal of Neuroscience 23:5319–5328.

Decision letter

  1. Manuel Zimmer
    Reviewing Editor; University of Vienna, Austria
  2. Ronald L Calabrese
    Senior Editor; Emory University, United States
  3. Serena Ding
    Reviewer

Our editorial process produces two outputs: (i) public reviews designed to be posted alongside the preprint for the benefit of readers; (ii) feedback on the manuscript for the authors, including requests for revisions, shown below. We also include an acceptance summary that explains what the editors found interesting or important about the work.

Decision letter after peer review:

[Editors’ note: the authors submitted for reconsideration following the decision after peer review. What follows is the decision letter after the first round of review.]

Thank you for submitting the paper "Automatically tracking feeding behavior in populations of foraging worms" for consideration by eLife. Your article has been reviewed by 3 peer reviewers, one of whom is a member of our Board of Reviewing Editors, and the evaluation has been overseen by a Senior Editor. The following individual involved in the review of your submission has agreed to reveal their identity: Serena Ding (Reviewer #2).

Comments to the Authors:

We are sorry to say that, after consultation with the reviewers, we have decided that this work will not be considered further for publication by eLife. The reviewers found your work of high quality, and upon some revisions could represent a useful technique to study feeding behaviors in worms. However, the consensus of the reviewers was that your new method is useful only for this small circle of C. elegans researchers and therefore does not address the broader audience of eLife readers.

Please find their detailed comments and recommendations below.

Reviewer #1 (Recommendations for the authors):

(1) I think the authors did not fully exploit the great potential to perform long term observations in individual worms. I wonder whether they could perform experiments on single or few worms restricted to the imaging field of view so that they cannot collide and escape; thus, single worm identity is kept. How long is it possible to record without bleaching the pharyngeal marker? Is it possible to record over extended episodes, like feeding quiescence during lethargus or upon stress induction?

(2) Related to the above. Pumping rates in general show spread distributions, which I believe are not due to noise, please clarify. And under some conditions distributions show interesting bi-modality or skew e.g. Figure 4B (30min starvation) or unc-31 mutants (Figure 5F). Are inter-pump intervals autocorrelated and change smoothly in fed WT animals, and if yes on which timescales? Do 30min starved animals and unc-31 mutants switch between discrete states of high/low pumping rates and if yes, on which timescales. The authors report that they observed episodes of feeding quiescence, perhaps related to satiety quiescence. They could be more quantitative about this observation describing the time-scales and frequencies of these observations.

(3) The authors should be clearer about what n-numbers / sample sizes represent. Individual assays, worms used in assays (which would be less than data in the field of view), tracklets (which can be more than observed worms, see methods: 20-30s tracklets, meaning that many track interruptions could artificially blow-up the n-numbers) … ? E.g., in Figure 3 n numbers are in the hundreds; in Figure 3E two numbers are given in brackest. Please indicate these unambiguously in the Figure captions.

(3a) Depending on this, n numbers might be inaccurate in describing the real number of datapoints; or datapoints might not be independent of each other (e.g. many tracklets from the same worm). This affects the right choice of statistical testing procedures. Most figure panels that show comparisons lack any statistics.

(4) The authors state that a simple laptop/desktop would be sufficient but it seemed they used an HPC to generate the data in the manuscript. Please be clear about what the requirements really are and if the analyses are really feasible in a reasonable time using a standard computer. What were the CPU hours required to generate the data in this study?

(5) … "also find that similar to off-food reversals, which are constant throughout

larval development"… prior to this section the authors should explain better the general C. elegans behaviours known as some readers might not know what reversals are etc. For them, this comes out of nowhere.

(6) Figure 5D: the different contraction patterns should be qualitatively better described in the text so that readers get a better intuition of what causes the differences in the mean change images.

(7) The authors discuss a future outlook applying their method to 3D behaviour. For me, it is hard to imagine how this could ever work. Be precise, how this could be achieved realistically or remove this statement.

(8) …" using a rolling mean filter of 1 s and a smoothing filter of width =

66 ms (2 frames)": please be precise what the smoothing filter was, and why was this needed, since there is already a 1s rolling mean applied.?

Reviewer #2 (Recommendations for the authors):

– This new method directly measures the pumping of the pharyngeal muscles as a proxy for feeding. However, worms are also known to pump their pharynx without actual food intake, such as when off-food. The authors should be more explicit about this limitation to their method and take care when using "pumping" and "feeding" interchangeably.

– One key advantage of this new method is that pumping and locomotion behaviour can be simultaneously detected to generate new insights e.g. regarding behavioural modularity and coordination. However, the authors report that while the pumping rates remain the same whether imaging with YFP or mCherry, other locomotion metrics such as velocity are different. This result thus calls for careful interpretation in future studies that link both types of behaviours using this method.

– The first sentence of the introduction (p.1) "Animals must forage… and provide for their young" is perhaps too generalised. There are animals that do not provide for their young, so I suggest removing this part of the sentence.

– Page 8, middle paragraph: multiple exposure vs. single exposure experimental differences "could be due to … different remaining food levels". Why would this be, if the experiments and feeding rates are reported to be the same in both cases?

– "Pharaglow" is capitalised in some cases and not others.

– Perhaps the authors could also comment on what happens when animals overlap during the experiment, especially in the context of large scale foraging experiments.

Reviewer #3 (Recommendations for the authors):

Detailed comments:

The term "worm" is highly nonspecific, encompassing 3 phyla.

"C. elegans" or better yet "Caenorhabditis elegans" should be in the title.

The Introduction focuses somewhat narrowly on studies of foraging strategies and food intake. In addition to these interesting topics, the authors could discuss how assessment of feeding is used in studies of behavioral genetics, quiescence, and aging.

I found the description of pharyngeal pumping in the introduction to be quite confusing. The authors should strive to use standard anatomical and behavioral terms and explain them for the naive reader. For example, the sentence "Transport proceeds with occasional peristaltic contractions that move food further toward the intestine where a hard cuticular structure, the grinder, crushes the bacteria before they are pushed into the intestine" needs to be rephrased. The peristaltic motion is called isthmus peristalsis. It moves food particles to the terminal bulb which contains the grinder.

"Of these motions, pumping is the most frequent contraction that is also the limiting step for food intake". I am lost as to what was intended here.

Figure 1F: Why is the y axis given as arbitrary units? I would like to see how large the variation in standard deviation is during pharyngeal pumping.

The comparison between automated assessment and expert manual assessment is weak because both were done with low-resolution fluorescence data. If the goal is to compare with how pharyngeal pumping is normally assessed, the authors should use high-resolution bright field or DIC images, as

Another problem with the automated/manual comparison is that the pumping rate varied over a fairly narrow range. As the authors acknowledge, pumping is modulated by many different factors, so it is not difficult to prepare worms with a wide range of pumping rates. Doing this would help assess linearity of the method, especially at low pump rates.

The sections describing various applications of the method (development, starvation, and mutants) are poorly motivated and written in a confusing manner. For each section the authors need to briefly introduce the questions being addressed and why they are important. Similarly, the results should be briefly discussed in light of the questions being asked.

Page 7: "We find that on-food pumping rates increase slightly over the course of the larval stages, but much less dramatically than the velocity." Why are the authors comparing the increase in pumping rate with velocity? These are like apples and oranges.

The authors cite results showing that long-term exposure to light reduces lifespan. But to test for phototoxicity, the authors measure not lifespan but feeding rate! This seems odd. A simple experiment would be to keep the illumination on until all the animals have died. This would give some indication of how close to a lethal dose is being delivered to the worms.

Figure 3: The ordering of the panels here is confusing.

3C,3D: Specific Y axis labels would be better here. Why not measure area in µm^2? Why not have axes for pumping rate in Hz and velocity in mm/s?

Page 10: "…the distributions of both pumping rates and velocities show distinct sub-populations". I see no evidence of subpopulations in velocity. There are some local maxima and minima in the pumping rate, but without further analyses these effects seem quite preliminary.

Page 12. "It is possible that some of the detected pumps in our measurements are either peristaltic movements or other non-productive muscular motion". The authors imply that isthmus peristalsis is "non-productive", which does not make sense to me. Have the authors observed isthmus peristalsis in their images? It should be straightforward to see if isthmus peristalsis is reflected in the traces shown in Figure 1F.

Page 16: "labeling parts of the pharynx with lipophilic dyes would be a possibility to extend the usage of this tool beyond species that are genetically tractable". I do not understand how lipophilic dyes, which label certain structures but not the pharynx, would be useful here.

[Editors’ note: further revisions were suggested prior to acceptance, as described below.]

Thank you for resubmitting your work entitled "Automatically tracking feeding behavior in populations of foraging worms" for further consideration by eLife. Your revised article has been evaluated by Ronald Calabrese (Senior Editor) and a Reviewing Editor. I am happy to tell you that all reviewers are now very enthusiastic about your manuscript, which has been significantly improved. However, there are some remaining issues raised by reviewer #1 that need to be addressed, as outlined below.

Reviewer #1 (Recommendations for the authors):

In this revision, the authors have made some efforts to address my review points. My main point, however, which was to prove the suitability of their approach for long term observations with subsequent analyses is only partially addressed.

(1) It is very promising to see that there is almost no bleaching of the pharyngeal signal; this does not mean however that these experiments work practically for extended recording times of more than one hour (see #2 below). I suggest being more careful with the conclusions.

(2) The authors show an impressive example of male-hermaphrodite interactions recording behaviors over a period of 1h. This is great, but unfortunately just one example. Is this the best outcome the authors could have ever achieved or is it representative for many experiments? With the male-hermaphrodite paradigm, the authors go beyond what I was requesting. If their approach works as they claim, it should be feasible to perform a sufficient amount of single animal recordings.

(3) The authors attempted to address one of my points showing pumping rate distributions of individual animals (2H, 3G). I disagree with the authors statement that PharaGlow can "produce large animal statistics while preserving single worm behavioral information". This ability is hampered by the short tracklet durations. One cannot conclude from e.g. 3G left panel whether individuals differ in an idiosyncratic way versus transient changes that are randomly captured in the short tracklet episodes. Hence, my previous request to perform statistics on longer recordings. Figure 5D indicates that the animals exhibit minutes lasting episodes of high and low pumping rates. More 1h recordings on individuals like in Figure 5 (perhaps no need to do male plus hermaphrodite) will enable the authors to perform the requested analyses. As mentioned above, if PharaGlow performs as the authors claim, these revisions should be doable with reasonable effort.

Reviewer #2 (Recommendations for the authors):

The authors have thoroughly and effectively responded to previous reviews, resulting in a significantly improved manuscript. It is now clear that the method is broadly applicable using common imaging microscopes and computing resources, and that it is suitable for studying pumping behaviour in populations of unrestrained animals across various time- and space- scales. The method affords novel observations not directly feasible with previous methods, for instance, exemplified by the authors' recent addition of pumping dynamics during mating events.

Reviewer #3 (Recommendations for the authors):

The statistical tests added to the paper were not reported correctly. There are multiple instances of "p<0.000" and ""p=0.000" in the figures and captions. In fact every single p value given in Figure 4 and its caption is either zero or negative! Similarly in Figure S2.2A , S2.5A.

But in general the revised manuscript is much improved compared to the original.

https://doi.org/10.7554/eLife.77252.sa1

Author response

[Editors’ note: The authors appealed the original decision. What follows is the authors’ response to the first round of review.]

Reviewer #1 (Recommendations for the authors):

(1) I think the authors did not fully exploit the great potential to perform long term observations in individual worms. I wonder whether they could perform experiments on single or few worms restricted to the imaging field of view so that they cannot collide and escape; thus, single worm identity is kept. How long is it possible to record without bleaching the pharyngeal marker? Is it possible to record over extended episodes, like feeding quiescence during lethargus or upon stress induction?

We thank the reviewer for this important suggestion, which we now added to the manuscript. Due to the large data rate of these recordings, we combined a live-segmentation with our down-stream analysis. The results are now presented as Figure 5 of the revised manuscript.

Furthermore, we provide additional data characterizing photo-bleaching. This data shows that continuous recordings for extended periods of time (> 5 hrs) are feasible using this approach (Figure S5.1).

(2) Related to the above. Pumping rates in general show spread distributions, which I believe are not due to noise, please clarify. And under some conditions distributions show interesting bi-modality or skew e.g. Figure 4B (30min starvation) or unc-31 mutants (Figure 5F). Are inter-pump intervals autocorrelated and change smoothly in fed WT animals, and if yes on which timescales?

We thank the reviewer for bringing up an important point regarding the stochasticity observed in pumping, and we discuss this now in more detail in the introduction. Off-food and low food pumping rates show interesting inter-pump dynamics (see e.g., Scholz et al., PNAS 2017) and also Figure 4 of this manuscript. In contrast, the on-food behavior shows mostly steady pumping at constant rates, as can be seen from the on-food pumping rate distribution in Figure S3.1. Broader distributions in on-food conditions arise from inter-animal variability in the peak rates and brief pauses in pumping, or in the case of unc-31 due to effects of the mutant background. To illustrate individual animal data, we have added histograms for individual animals off-food as well as individual animal timeseries to Figures 2 and 3. We now introduce previous work highlighting the inherent stochasticity of pumping. Additionally, we describe in more detail in the methods section how we calculate pumping rates, as there is some variation depending if average pumps/ unit time or instantaneous rates are reported.

Do 30min starved animals and unc-31 mutants switch between discrete states of high/low pumping rates and if yes, on which timescales.

The reviewer raises an interesting question. To examine if there are switches between high and low pumping rates, we now present the pumping rate distributions for individual animals. For our experiments, animals appear to show distinct mean rates and not switch on the timescale of minutes (Figures 2H and 3G).

Understanding the timescale on which switches would occur and how this might differ in mutant animals would make for an interesting follow up study when combined with our long-term imaging (Figure 5).

The authors report that they observed episodes of feeding quiescence, perhaps related to satiety quiescence. They could be more quantitative about this observation describing the time-scales and frequencies of these observations.

As the reviewer recommends, we have added a quantification of the observed non-pumpers (<1% for most recordings). Interestingly, we also observe long feeding quiescence in Figure 5 (male), indicating regulation at the tens of minutes timescale.

(3) The authors should be clearer about what n-numbers / sample sizes represent. Individual assays, worms used in assays (which would be less than data in the field of view), tracklets (which can be more than observed worms, see methods: 20-30s tracklets, meaning that many track interruptions could artificially blow-up the n-numbers) … ? E.g., in Figure 3 n numbers are in the hundreds; in Figure 3E two numbers are given in brackest. Please indicate these unambiguously in the Figure captions.

We thank the reviewer for pointing out this potentially confusing wording. We now state that the N numbers indicate animal tracks when referring to automatically analyzed data and have clarified the positioning and description of our N in the figures and captions. We would like to re-emphasize that we indeed record hundreds of animals in the experiments described in Figure 3. We record over 30 individuals in one field of view, and repeat this for 6 independent plates. We believe the large sample size is a major strength of our method and have altered the text to reflect this.

We have additionally added a section to the supplementary information showing the average track duration and how it relates to the number of individuals we record (Figure S3.6). As we state in the text, we only consider tracklets that are at least 1 min, except for the starvation data. However, this does not mean we only track for such short periods of time. Instead, our average track length is ~ 2 min (5 min recording time) and scales with velocity, indicating that leaving the field-of-view, rather than crossings, is what limits the tracking duration (Figure S2.1). We also describe how the tracker resolves crossings, which we are successful in doing except when worms are physically overlapping.

(3a) Depending on this, n numbers might be inaccurate in describing the real number of datapoints; or datapoints might not be independent of each other (e.g. many tracklets from the same worm). This affects the right choice of statistical testing procedures. Most figure panels that show comparisons lack any statistics.

Given the sample size and the additional analyses of track-length and track numbers as detailed above, we are confident that we are not vastly over-estimating our sample size and that our chosen tests are appropriate. We have added p-values to all pertinent figures (3,4,5 and supplementary).

(4) The authors state that a simple laptop/desktop would be sufficient but it seemed they used an HPC to generate the data in the manuscript. Please be clear about what the requirements really are and if the analyses are really feasible in a reasonable time using a standard computer. What were the CPU hours required to generate the data in this study?

We appreciate the reviewer’s suggestions regarding additional analyses of the required compute times. We have added a benchmarking of the PharaGlow analysis in the supplementary information, showing expected times for both an end user laptop (single core and 4 core), as well as on a typical HPC. Data analysis, as we state in the manuscript, is possible on a normal laptop, and one can expect analysis to take around ~ 8 h for a 4-fold parallelization on CPU for a typical dataset presented in this paper of 3 worm*hours of data (see Table TS1 for comparison and performance in different scenarios).

However, due to the total scale of our datasets we have chosen to use a central storage and compute cluster. Our benchmarking shows that parallelization is very effective.

(5) … "also find that similar to off-food reversals, which are constant throughout

larval development"… prior to this section the authors should explain better the general C. elegans behaviours known as some readers might not know what reversals are etc. For them, this comes out of nowhere.

We thank the reviewer for this comment. In response, we have expanded our discussion of locomotory behaviors and provided more context for the reversal measurements. We now include reversal rates in Figure 3, as well as the rescaled measurements to match other studies’ measurements in Figure S2.2. We have also included the following description in the text: “Animals move forward on agar by generating waves of muscular contraction through their body. When the animals reverse the direction of these waves, they move backwards”

(6) Figure 5D: the different contraction patterns should be qualitatively better described in the text so that readers get a better intuition of what causes the differences in the mean change images.

We appreciate the reviewer's suggestion to describe the contraction patterns. We discuss this in the text and now show the average peak shape in Figure 4E and S4.1 which highlights the slower, longer duration contractions in the eat-18 mutant.

(7) The authors discuss a future outlook applying their method to 3D behaviour. For me, it is hard to imagine how this could ever work. Be precise, how this could be achieved realistically or remove this statement.

We envisioned using fast 3D imaging, e.g., using multifocal imaging, which could in principle enable such measurements at the required rates. However, to keep the discussion focused and considering our emphasis on simple imaging techniques, we have removed this statement.

(8) …" using a rolling mean filter of 1 s and a smoothing filter of width = 66 ms (2 frames)": please be precise what the smoothing filter was, and why was this needed, since there is already a 1s rolling mean applied.?

We thank the reviewer for pointing out the misleading wording of this sentence. It now reads: We correct for baseline fluctuations and spurious fluorescence changes by subtracting the background fluctuations using a rolling mean filter of 1 s. To the remaining signal we apply a smoothing filter of width = 66 ms (2 frames).

Reviewer #2 (Recommendations for the authors):

– This new method directly measures the pumping of the pharyngeal muscles as a proxy for feeding. However, worms are also known to pump their pharynx without actual food intake, such as when off-food. The authors should be more explicit about this limitation to their method and take care when using "pumping" and "feeding" interchangeably.

We thank the reviewer for bringing up this important point of nomenclature, and have corrected the manuscript to read “pumping” throughout when we refer to our measurements.

– One key advantage of this new method is that pumping and locomotion behaviour can be simultaneously detected to generate new insights e.g. regarding behavioural modularity and coordination. However, the authors report that while the pumping rates remain the same whether imaging with YFP or mCherry, other locomotion metrics such as velocity are different. This result thus calls for careful interpretation in future studies that link both types of behaviours using this method.

We appreciate the reviewer highlighting this differential effect of light on different behaviors. The light effects on locomotor behaviors are well established, and we agree that these have to be carefully controlled. To emphasize this in our manuscript we now state: We note that the differential effects of excitation light on behavior should be taken into account when investigating the coupling between e.g., locomotory and feeding behaviors.

– The first sentence of the introduction (p.1) "Animals must forage… and provide for their young" is perhaps too generalised. There are animals that do not provide for their young, so I suggest removing this part of the sentence.

We thank the reviewer for this suggestion, and have removed this statement as suggested.

– Page 8, middle paragraph: multiple exposure vs. single exposure experimental differences "could be due to … different remaining food levels". Why would this be, if the experiments and feeding rates are reported to be the same in both cases?

We thank the reviewer for pointing this out, we have removed this statement.

– "Pharaglow" is capitalised in some cases and not others.

We thank the reviewer for pointing out the inconsistency, we have now formatted all instances to on spelling.

– Perhaps the authors could also comment on what happens when animals overlap during the experiment, especially in the context of large scale foraging experiments.

We thank the reviewer for this suggestion. We have added a section to the supplementary information demonstrating how our software deals with collisions and overlaps, and how this impacts tracking. In brief, we employ collision detection and attempt to resolve objects where two or more animals touch. This is successful when animals touch, however we can not yet resolve overlapping animals (and the pumping signals obtained from these animals would be uninterpretable).

Reviewer #3 (Recommendations for the authors):

Detailed comments:

The term "worm" is highly nonspecific, encompassing 3 phyla.

"C. elegans" or better yet "Caenorhabditis elegans" should be in the title.

We agree with the reviewer and have changed the title to specify C. elegans.

The Introduction focuses somewhat narrowly on studies of foraging strategies and food intake. In addition to these interesting topics, the authors could discuss how assessment of feeding is used in studies of behavioral genetics, quiescence, and aging.

We thank the reviewer for this helpful suggestion. In the revised version we extend the introduction and include references to pertinent studies across subfields, including behavioral genetics, quiescence, aging, and pharmacological screens, that use feeding behavior as a read-out.

I found the description of pharyngeal pumping in the introduction to be quite confusing. The authors should strive to use standard anatomical and behavioral terms and explain them for the naive reader. For example, the sentence "Transport proceeds with occasional peristaltic contractions that move food further toward the intestine where a hard cuticular structure, the grinder, crushes the bacteria before they are pushed into the intestine" needs to be rephrased. The peristaltic motion is called isthmus peristalsis. It moves food particles to the terminal bulb which contains the grinder.

We thank the reviewer for pointing out this editing mistake. The corrected sentence reads as follows: ‘Transport of the bacteria proceeds with occasional peristaltic contractions that move food further toward the terminal bulb, where a hard cuticular structure, the grinder, crushes the bacteria before they are pushed into the intestine.

"Of these motions, pumping is the most frequent contraction that is also the limiting step for food intake". I am lost as to what was intended here.

In light of this comment and a related comment by reviewer 2, we have expanded our discussion of the terms feeding and pumping as used in the field.

Figure 1F: Why is the y axis given as arbitrary units? I would like to see how large the variation in standard deviation is during pharyngeal pumping.

We thank the reviewer for pointing this out. In response to the reviewer’s suggestion we have added a scale bar to the y-axis. We would like to point out that the D-V variation scales with the average brightness and its absolute magnitude can therefore vary depending on expression level, camera settings and excitation light.

The comparison between automated assessment and expert manual assessment is weak because both were done with low-resolution fluorescence data. If the goal is to compare with how pharyngeal pumping is normally assessed, the authors should use high-resolution bright field or DIC images, as

We would like to emphasize that resolution, rather than magnification, is relevant here. We report manual counts in Figure 2 of the original submission at a pixel sizeof 1.2 µm/px and a resolution, based on the Rayleigh criterion of ~1.3 µm, which easily resolves the opening of the lumen of the corpus. However, as we state in response to the next comment, we have provided additional data at higher magnification (10x) for a range of pumping rates to demonstrate the accuracy of the method (see new Video2).

Another problem with the automated/manual comparison is that the pumping rate varied over a fairly narrow range. As the authors acknowledge, pumping is modulated by many different factors, so it is not difficult to prepare worms with a wide range of pumping rates. Doing this would help assess linearity of the method, especially at low pump rates.

We thank the reviewer for this suggestion to help strengthen our conclusion by additional verification of the method at a larger range of pumping rates than what was shown in Figure 2 and Figure S3.4. We now provide additional support for the accuracy of our method by showing data from simultaneous bright-field and fluorescence recordings of worms in a wide range of conditions to elicit different pumping rates. We find that Pharaglow accurately detects pumps across the relevant physiological range. These data are now shown as Figure 1H-J.

The sections describing various applications of the method (development, starvation, and mutants) are poorly motivated and written in a confusing manner. For each section the authors need to briefly introduce the questions being addressed and why they are important. Similarly, the results should be briefly discussed in light of the questions being asked.

We appreciate this suggestion by the reviewer to improve the readability of our manuscript. We have revised these sections accordingly.

Page 7: "We find that on-food pumping rates increase slightly over the course of the larval stages, but much less dramatically than the velocity." Why are the authors comparing the increase in pumping rate with velocity? These are like apples and oranges.

In response to the reviewer's comment we have rephrased this sentence to read:

We find that on-food pumping rates increase slightly over the course of the larval stages, but much less dramatically than the velocity increases over development, despite the substantial growth of both the body and the pharyngeal muscle.

We hope this clarifies our intent to emphasize that some behaviors are altered by the changes and added muscle mass during development, but others are unaffected.

The authors cite results showing that long-term exposure to light reduces lifespan. But to test for phototoxicity, the authors measure not lifespan but feeding rate! This seems odd. A simple experiment would be to keep the illumination on until all the animals have died. This would give some indication of how close to a lethal dose is being delivered to the worms.

We appreciate this suggestion. In response to this question, we have re-organized the results section to separate acute and long-term photo-toxic effects. We have employed a long-term exposure of five hours continuous illumination and found that longer exposure to this level of light does not cause life-threatening phototoxic effects.

We thank the reviewer for their comments and suggestions about a life span experiment. It would be interesting to see the effect of long exposure but it is outside the current scope of our manuscript. We have demonstrated in Figures 3 and 5 that normal/extended exposure times of light have no impact on measured phenomena.

Figure 3: The ordering of the panels here is confusing.

We thank the reviewer for this point. We have revised Figure 3 with a clearer layout.

3C,3D: Specific Y axis labels would be better here. Why not measure area in µm^2? Why not have axes for pumping rate in Hz and velocity in mm/s?

We would like to point out that the data with appropriate units are present in Figure 3, as the box plot and the normalized panels are from the same dataset, but these two visualizations serve different purposes. We find that the normalized data are useful to compare rates with the adult stage, which is behaviorally most well characterized.

We have also added the area measurements in um^2 to the supplementary information in Figure S3.1.

Page 10: "…the distributions of both pumping rates and velocities show distinct sub-populations". I see no evidence of subpopulations in velocity. There are some local maxima and minima in the pumping rate, but without further analyses these effects seem quite preliminary.

We thank the reviewer for pointing out this inaccuracy in our language. We have revised the sentence and corresponding figure reference to clearly indicate the joint distribution in panel 4F, and have added additional panels demonstrating the sub-populations more convincingly using single-animal data.

Page 12. "It is possible that some of the detected pumps in our measurements are either peristaltic movements or other non-productive muscular motion". The authors imply that isthmus peristalsis is "non-productive", which does not make sense to me. Have the authors observed isthmus peristalsis in their images? It should be straightforward to see if isthmus peristalsis is reflected in the traces shown in Figure 1F.

We have not investigated the presence of isthmus peristalsis in our images and this would be beyond the scope and goal of this paper. We have revised the corresponding section to avoid appraising the productive value of peristalsis. We thank the reviewer for pointing this out.

Page 16: "labeling parts of the pharynx with lipophilic dyes would be a possibility to extend the usage of this tool beyond species that are genetically tractable". I do not understand how lipophilic dyes, which label certain structures but not the pharynx, would be useful here.

We have removed this sentence from the discussion.

[Editors’ note: what follows is the authors’ response to the second round of review.]

Reviewer #1 (Recommendations for the authors):

In this revision, the authors have made some efforts to address my review points. My main point, however, which was to prove the suitability of their approach for long term observations with subsequent analyses is only partially addressed.

(1) It is very promising to see that there is almost no bleaching of the pharyngeal signal; this does not mean however that these experiments work practically for extended recording times of more than one hour (see #2 below). I suggest being more careful with the conclusions.

We appreciate the reviewer's comments regarding the interpretation of the bleaching curves. We have since added a larger number of longer recordings (3h) to support our statements (see responses below).

(2) The authors show an impressive example of male-hermaphrodite interactions recording behaviors over a period of 1h. This is great, but unfortunately just one example. Is this the best outcome the authors could have ever achieved or is it representative for many experiments? With the male-hermaphrodite paradigm, the authors go beyond what I was requesting. If their approach works as they claim, it should be feasible to perform a sufficient amount of single animal recordings.

We agree with the reviewer and have added a substantial number of long-term recordings to this revised manuscript (a total of 37 recordings over 3 genotypes, recording time of 3 h, we selected tracks of > 2 h duration). We wanted this data to be meaningful beyond observing wild type behavior, and have therefore decided to also assay the long-term pumping behavior of the unc-31 mutants. We believe these data demonstrate the feasibility of the method for at least 2h long recordings. New data is provided on panels 5G-J.

(3) The authors attempted to address one of my points showing pumping rate distributions of individual animals (2H, 3G). I disagree with the authors statement that PharaGlow can "produce large animal statistics while preserving single worm behavioral information". This ability is hampered by the short tracklet durations. One cannot conclude from e.g. 3G left panel whether individuals differ in an idiosyncratic way versus transient changes that are randomly captured in the short tracklet episodes. Hence, my previous request to perform statistics on longer recordings. Figure 5D indicates that the animals exhibit minutes lasting episodes of high and low pumping rates. More 1h recordings on individuals like in Figure 5 (perhaps no need to do male plus hermaphrodite) will enable the authors to perform the requested analyses. As mentioned above, if PharaGlow performs as the authors claim, these revisions should be doable with reasonable effort.

We thank the reviewer for pointing out this interesting aspect of animal behavioral dynamics. Based on the fact that we use isogenic, age-synchronized animals with the same life-history, we could expect that the short-term sampling of many animals corresponds to long-term sampling of one animal (assumption of ergodicity). We agree however, that given the animal individuality reported in e.g., C. elegans and D. melanogaster, this assumption likely does not fully hold. To address the question whether there are state switches in animal behavior as seen for the mating pair in Figure 5 and as suggested by the statistics shown in Figure 3, we have performed long-term recordings of wt and unc-31 mutant animals. We analyzed tracks that are at least 2 hours long. We observe that unc-31 animals switch between a high/low pumping state less frequently than wildtype. Additionally, we now state “Taken together, these results show that studying the underlying behaviors and dynamics in a worm population requires large statistics and long recordings. Depending on the desired data, both long-term recordings and short-term high-throughput measurements are accessible with PharaGlow.” We appreciate the suggestion of the reviewer.

Reviewer #3 (Recommendations for the authors):

The statistical tests added to the paper were not reported correctly. There are multiple instances of "p<0.000" and ""p=0.000" in the figures and captions. In fact every single p value given in Figure 4 and its caption is either zero or negative! Similarly in Figure S2.2A , S2.5A.

But in general the revised manuscript is much improved compared to the original.

We thank the reviewer for detecting this issue. We have now reformatted the p-values to the expected format e.g., p < 0.001 or p < 0.0001 or all figures and captions. We apologize for the confusion.

https://doi.org/10.7554/eLife.77252.sa2

Article and author information

Author details

  1. Elsa Bonnard

    Max Planck Research Group Neural Information Flow, Max Planck Institute for Neurobiology of Behavior – caesar, Bonn, Germany
    Contribution
    Data curation, Investigation, Methodology, Writing – review and editing
    Contributed equally with
    Jun Liu
    Competing interests
    No competing interests declared
    ORCID icon "This ORCID iD identifies the author of this article:" 0000-0001-6363-1684
  2. Jun Liu

    Max Planck Research Group Neural Information Flow, Max Planck Institute for Neurobiology of Behavior – caesar, Bonn, Germany
    Contribution
    Resources, Data curation, Investigation, Writing – review and editing
    Contributed equally with
    Elsa Bonnard
    Competing interests
    No competing interests declared
    ORCID icon "This ORCID iD identifies the author of this article:" 0000-0001-6472-3871
  3. Nicolina Zjacic

    1. Max Planck Research Group Neural Information Flow, Max Planck Institute for Neurobiology of Behavior – caesar, Bonn, Germany
    2. Institute of Medical Genetics, University of Zurich, Zurich, Switzerland
    Contribution
    Data curation, Investigation, Writing – review and editing
    Competing interests
    No competing interests declared
    ORCID icon "This ORCID iD identifies the author of this article:" 0000-0002-6413-7386
  4. Luis Alvarez

    Max Planck Research Group Neural Information Flow, Max Planck Institute for Neurobiology of Behavior – caesar, Bonn, Germany
    Contribution
    Resources, Investigation, Writing – review and editing, Software
    Competing interests
    No competing interests declared
    ORCID icon "This ORCID iD identifies the author of this article:" 0000-0002-1027-2291
  5. Monika Scholz

    Max Planck Research Group Neural Information Flow, Max Planck Institute for Neurobiology of Behavior – caesar, Bonn, Germany
    Contribution
    Conceptualization, Software, Funding acquisition, Methodology, Writing - original draft, Project administration, Writing – review and editing
    For correspondence
    monika.scholz@mpinb.mpg.de
    Competing interests
    No competing interests declared
    ORCID icon "This ORCID iD identifies the author of this article:" 0000-0003-2186-410X

Funding

Max Planck institute for Neurobiology of Behavior — caesar (Open access funding)

  • Monika Scholz

The funders had no role in study design, data collection and interpretation, or the decision to submit the work for publication.

Acknowledgements

We thank James Lightfoot and Shawn Lockery for helpful comments. We wish to acknowledge Omar Valerio Minero (MPINB HPC) for assistance with benchmarking. We thank Marc Pilon for giving us a plasmid. Some strains were provided by the CGC, which is funded by NIH Office of Research Infrastructure Programs (P40 OD010440). Some figure panels were created with biorender.com.

Senior Editor

  1. Ronald L Calabrese, Emory University, United States

Reviewing Editor

  1. Manuel Zimmer, University of Vienna, Austria

Reviewer

  1. Serena Ding

Publication history

  1. Received: January 21, 2022
  2. Preprint posted: January 22, 2022 (view preprint)
  3. Accepted: August 15, 2022
  4. Version of Record published: September 9, 2022 (version 1)
  5. Version of Record updated: September 12, 2022 (version 2)

Copyright

© 2022, Bonnard, Liu et al.

This article is distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use and redistribution provided that the original author and source are credited.

Metrics

  • 455
    Page views
  • 132
    Downloads
  • 0
    Citations

Article citation count generated by polling the highest count across the following sources: Crossref, PubMed Central, Scopus.

Download links

A two-part list of links to download the article, or parts of the article, in various formats.

Downloads (link to download the article as PDF)

Open citations (links to open the citations from this article in various online reference manager services)

Cite this article (links to download the citations from this article in formats compatible with various reference manager tools)

  1. Elsa Bonnard
  2. Jun Liu
  3. Nicolina Zjacic
  4. Luis Alvarez
  5. Monika Scholz
(2022)
Automatically tracking feeding behavior in populations of foraging C. elegans
eLife 11:e77252.
https://doi.org/10.7554/eLife.77252

Further reading

    1. Computational and Systems Biology
    Felix Proulx-Giraldeau, Jan M Skotheim, Paul François
    Research Article

    Cell size is controlled to be within a specific range to support physiological function. To control their size, cells use diverse mechanisms ranging from ‘sizers’, in which differences in cell size are compensated for in a single cell division cycle, to ‘adders’, in which a constant amount of cell growth occurs in each cell cycle. This diversity raises the question why a particular cell would implement one rather than another mechanism? To address this question, we performed a series of simulations evolving cell size control networks. The size control mechanism that evolved was influenced by both cell cycle structure and specific selection pressures. Moreover, evolved networks recapitulated known size control properties of naturally occurring networks. If the mechanism is based on a G1 size control and an S/G2/M timer, as found for budding yeast and some human cells, adders likely evolve. But, if the G1 phase is significantly longer than the S/G2/M phase, as is often the case in mammalian cells in vivo, sizers become more likely. Sizers also evolve when the cell cycle structure is inverted so that G1 is a timer, while S/G2/M performs size control, as is the case for the fission yeast S. pombe. For some size control networks, cell size consistently decreases in each cycle until a burst of cell cycle inhibitor drives an extended G1 phase much like the cell division cycle of the green algae Chlamydomonas. That these size control networks evolved such self-organized criticality shows how the evolution of complex systems can drive the emergence of critical processes.

    1. Computational and Systems Biology
    2. Neuroscience
    Kiri Choi, Won Kyu Kim, Changbong Hyeon
    Research Article

    The projection neurons (PNs), reconstructed from electron microscope (EM) images of the Drosophila olfactory system, offer a detailed view of neuronal anatomy, providing glimpses into information flow in the brain. About 150 uPNs constituting 58 glomeruli in the antennal lobe (AL) are bundled together in the axonal extension, routing the olfactory signal received at AL to mushroom body (MB) calyx and lateral horn (LH). Here we quantify the neuronal organization in terms of the inter-PN distances and examine its relationship with the odor types sensed by Drosophila. The homotypic uPNs that constitute glomeruli are tightly bundled and stereotyped in position throughout the neuropils, even though the glomerular PN organization in AL is no longer sustained in the higher brain center. Instead, odor-type dependent clusters consisting of multiple homotypes innervate the MB calyx and LH. Pheromone-encoding and hygro/thermo-sensing homotypes are spatially segregated in MB calyx, whereas two distinct clusters of food-related homotypes are found in LH in addition to the segregation of pheromone-encoding and hygro/thermo-sensing homotypes. We find that there are statistically significant associations between the spatial organization among a group of homotypic uPNs and certain stereotyped olfactory responses. Additionally, the signals from some of the tightly bundled homotypes converge to a specific group of lateral horn neurons (LHNs), which indicates that homotype (or odor type) specific integration of signals occurs at the synaptic interface between PNs and LHNs. Our findings suggest that before neural computation in the inner brain, some of the olfactory information are already encoded in the spatial organization of uPNs, illuminating that a certain degree of labeled-line strategy is at work in the Drosophila olfactory system.