Accept–reject decision-making revealed via a quantitative and ethological study of C. elegans foraging

  1. Jessica A Haley
  2. Tianyi Chen
  3. Mikio Aoi  Is a corresponding author
  4. Sreekanth H Chalasani  Is a corresponding author
  1. Neurosciences Graduate Program, University of California, San Diego, United States
  2. Molecular Neurobiology Laboratory, Salk Institute for Biological Studies, United States
  3. Halıcıoğlu Data Science Institute, University of California, San Diego, United States
  4. Department of Neurobiology, University of California, San Diego, United States
4 figures, 6 videos, 1 table and 1 additional file

Figures

Figure 1 with 5 supplements
C. elegans forage in a patchy environment with an explore-then-exploit strategy.

(A) An example animal’s midbody location (colored to represent time in the experiment) as it forages in an environment bounded by a large (30 mm diameter) arena containing 19 small (~1.8 mm diameter) bacterial patches (gray). Each patch was made by pipetting ~0.5 µl of OP50 E. coli diluted to OD600 ~10 and grown at room temperature for ~1 hr. (B) Distance between the example animal’s midbody position and the nearest patch edge (positive indicates inside patch) is plotted (black) for every time point. Putative encounters with a bacterial patch are indicated (gray). (C) Patch encounters (colored to represent the duration of the encounter) for 50 individuals foraging in these environments are plotted. (D) The number of total and unique patch encounters for each animal is shown. (E) Duration for each patch encounter was computed and classified as either short (0–2 min) or long (2–60 min) using a Gaussian mixture model. The distributions of all observed short and long encounters are plotted with duration binned logarithmically. (F) The observed start time of each patch encounter is shown for all short- and long-duration encounters. Long-duration encounters occur significantly later (one-tailed Mann–Whitney U-test). (G) The probability of residing on patch was computed for all worms across time (black) and compared to the probability of residing on patch if patch locations were semi-randomly permuted (pink). Smoothed median values are plotted with bootstrap-derived 2.5% and 97.5% quantiles shown in shaded regions. Time points where observed probabilities of residing on patch significantly exceed permuted probabilities are indicated by a black line (one-tailed Fisher’s exact test with Benjamini–Hochberg correction). (H) The track of the example animal in (A) is replotted with color used to represent the animal’s instantaneous velocity at each time point. (I) Velocity of the example animal over time is plotted (black) alongside patch encounters (gray) as previously identified in (B). Example encounters – one early, short duration (green) and one late, long duration (blue) – are indicated. (J, K) A 60-s time window surrounding the start of these example encounters is enlarged. (L) Velocity trajectories were aligned to patch entry for every encounter. Mean encounter-aligned (black/gray) and randomly aligned (pink) trajectories are plotted for each animal (light) and across all animals (dark). (M) Deceleration upon encounter with the patch edge is plotted for every encounter and grouped by duration type. Deceleration was significantly lower for encounter-aligned as compared to randomly aligned trajectories (pink) for all duration types (one-tailed Mann–Whitney U-tests with Bonferroni correction). (N) Mean velocity as a function of the distance from the edge of bacterial patches (computed for 50 μm bins) is shown for every animal (gray) and across all animals (black). (O) Each animal’s mean velocity during time spent on and off (midpoint at least –0.46 mm from patch edge) patch is shown. Velocity on patch was significantly slower than off patch (one-tailed paired-sample t-test). Sample data for one animal (worm #1) are shown in (AC, HK). Summary data for all animals (N = 50 worms) and encounters (N = 419 total encounters) are shown in (DG, LO). Violin plots in (D, F, M, O) give the kernel density estimate (KDE) and quartiles for each measure. Asterisks denote statistical significance (***p < 0.001). See also Figure 1—figure supplements 15 and Videos 14.

Figure 1—source data 1

Number of total and unique patch encounters in Figure 1D.

https://cdn.elifesciences.org/articles/103191/elife-103191-fig1-data1-v1.xlsx
Figure 1—source data 2

Duration of patch encounters in Figure 1E.

https://cdn.elifesciences.org/articles/103191/elife-103191-fig1-data2-v1.xlsx
Figure 1—source data 3

Start time of patch encounters in Figure 1F.

https://cdn.elifesciences.org/articles/103191/elife-103191-fig1-data3-v1.xlsx
Figure 1—source data 4

On-patch residence in Figure 1G.

https://cdn.elifesciences.org/articles/103191/elife-103191-fig1-data4-v1.xlsx
Figure 1—source data 5

Velocity of animals upon encounter with patch edge in Figure 1L.

https://cdn.elifesciences.org/articles/103191/elife-103191-fig1-data5-v1.xlsx
Figure 1—source data 6

Deceleration of animals upon encounter with patch edge in Figure 1M.

https://cdn.elifesciences.org/articles/103191/elife-103191-fig1-data6-v1.xlsx
Figure 1—source data 7

Velocity of animals upon encounter with patch edge in Figure 1N.

https://cdn.elifesciences.org/articles/103191/elife-103191-fig1-data7-v1.xlsx
Figure 1—source data 8

Velocity on and off patch in Figure 1O.

https://cdn.elifesciences.org/articles/103191/elife-103191-fig1-data8-v1.xlsx
Figure 1—figure supplement 1
Assay preparation, arena and patch detection, and behavioral tracking.

(A) Graphic describing the steps to prepare assay plates. Created with BioRender. (B) Example frames from a ‘contrast video’ showing how a piece of dark cardstock passed between the light source and the assay plate enables visualization of dilute bacterial patches. (C) An image of the bacterial patches is generated from the ‘contrast video’. (D) Masks of the arena (black) and bacterial patches (gray) were constructed using image processing techniques and, when applicable, subsequent manual corrections (see Bacterial patch location detection). Arena masks were used to calculate the image scale in pixels/mm. (E) Example frame from a behavior video containing four adult C. elegans is shown. (F) WormLab was used to identify the midbody location of animals in each frame (see Behavioral tracking). An inset shows detection of one of the four worms. (G) An example animal’s tracked location as it forages in this environment is plotted with color used to represent time (dark blue = 0 min; dark red = 60 min).

Figure 1—figure supplement 2
Defining a patch encounter using high-resolution behavioral recordings.

(A) Example frame from a behavior video containing one adult C. elegans is shown. (B) WormLab was used to track the body of the animal in each frame (see Behavioral tracking). (C) An example image showing the center spline of the example animal as well as the location of the bacterial patch (gray) and arena (black). The inset shows the animal’s center spline and bacterial patch superimposed on top of the raw image. (D) Example body postures/orientations (black) of an animal during frames when its head is on the patch edge. The distance (blue lines) between the head (black dot) and midpoint (blue dot) of the animal was calculated. A histogram of this head-to-midpoint distance is plotted, and the median value (blue) is indicated (N = 220 animals; 74,839 frames). The median head-to-midpoint distance was subsequently used as a threshold for detection of patch encounter and leaving events. For one example animal, the distance between the head (black) or midbody (blue) position and the nearest patch edge (positive = inside patch; negative = outside patch) is plotted for every time point. The edge of the patch (solid horizontal black line) and threshold for encounter detection (dashed -.- black line) are indicated. Putative patch encounter (green) and leaving (red) events are shown. (E) Example body postures/orientations of an animal when its head is on the patch. The distance between the midpoint of the animal and the patch edge (blue lines) was calculated. A histogram of this midpoint-to-patch distance is plotted, and the 1st percentile (blue) is indicated (N = 220 animals; 1,571,163 frames). This value is used as a threshold for excluding putative encounters where the animal’s midpoint never comes within 0.28768 mm of the patch edge. A 1.5-min time window of the example animal’s position in (D) is shown. The edge of the patch (solid line), threshold for encounter detection (dashed -.- line), and threshold for encounter exclusion (dashed – line) are indicated. Example putative encounters are shown. The first two sets of enter and exit events were excluded. The third set shown was included. The included encounter is shaded in gray. (F) The standard deviation of the distance between the location of the patch edge and the midpoint of the animal was calculated for every putative on-patch encounter and off-patch event (N = 220 animals; 2945 putative on-patch events; 2725 putative off-patch events). A subset of putative off-patch events had low standard deviations matching those of on-patch events. A one-dimensional Gaussian mixture model was fit to the off-patch standard deviation values, and a threshold was set where the posterior probability of events falling in the high or low variance cluster was 0.5. A 1.5-min time window of the example animal’s position in (D) is shown. Examples of two excluded off-patch events and one included event are shown.

Figure 1—figure supplement 3
Classifying encounters based on duration using a Gaussian mixture model (GMM).

(A) As in Figure 1E, duration for each patch encounter (N = 419 events; 50 worms) was computed and classified as either short or long using a GMM. The distributions of all observed short and long encounters are plotted with duration binned logarithmically. The probability density functions for the two component Gaussians are shown. (B) The posterior probabilities for classification as short or long are sorted for all encounters, highlighting the low posterior variance of the GMM. (C) Given that some patch encounters were not fully observed (i.e., ~22% of animals were already on patch at the start of the recording and ~96% of animals were on patch when the recording ended), we identified that ~14% of observed patch durations were left-censored (i.e., having actual duration ≥ observed duration). Thus, to confirm findings in Figure 1E, F, we re-classified only non-censored observations where both the entry and exit of a patch encounter were observed. As in Figure 1C, patch encounters for 50 individuals foraging in these patchy environments are plotted across time. Encounters that were uncensored (pink) and censored (gray) are indicated. (D) The distribution of the duration of only fully observed (uncensored) encounters (N = 360 events; 50 worms) is plotted. The component Gaussians for a GMM fitting this subset of data are shown. (E) Sorted posterior probabilities for the uncensored model are shown. (F) The observed start time of each uncensored patch encounter is shown for all short and long-duration encounters. Long-duration encounters occur significantly later (Mann–Whitney U-test, ***p < 0.001). Violin plots show the kernel density estimate (KDE) and quartiles for each duration type. (G) Posterior probabilities for classification in the long-duration cluster are shown for the two models. The uncensored data model results in a slight increase in posterior probabilities of long-duration classification but ultimately affected classification of only one of the 419 encounters.

Figure 1—figure supplement 4
Permuting patches to test for significance of the observed time-dependent increase in patch residence.

(A) Locations of bacterial patches (dark gray) are shown with the threshold for putative encounters (light gray) set at 0.46024 mm (as described in Figure 1—figure supplement 2 and Patch encounter detection). (B) Patches were permuted via randomized rotation and translation with the restriction that patches could not overlap with other patches nor with the arena. (C, D) Midbody location of the animal over time was overlaid on the original and semi-randomly permuted patches. (E, F) On-patch events were subsequently identified. This permutation procedure was repeated for 1000 replicates for every worm tested. Smoothed median values of the probability of worms residing on patch over time were compared for every time point in Figures 1G and 2F, Figure 2—figure supplement 5.

Figure 1—figure supplement 5
Analyzing deceleration upon encounter with a patch.

(A) To quantify the magnitude of slowdown upon encounter with the patch edge, we averaged the velocity trajectories across encounters (black) and found the velocity reached a maximum at 1.5 s before (green) and a minimum at 6 s after (red) the start of the encounter (gray). (B, C) Subsequently, for every encounter, a line (blue) was fit to the animal’s velocity (black) for that 8-s time window surrounding the start of the encounter. Deceleration was defined as the slope of this line. Examples matching (B) the short-duration encounter in Figure 1J and (C) the long-duration encounter in Figure 1K are shown.

Figure 2 with 8 supplements
The timing of the switch from explore-to-exploit is density dependent.

(A) The relative density (as estimated by fluorescently labeled OP50-GFP) is shown for small (~1.8 mm diameter) bacterial patches made by pipetting ~0.5 µl droplets of OP50 E. coli diluted in lysogeny broth (LB) to a range of optical densities OD600 = {0, 0.05, 0.1, 0.5, 1, 2, 3, 4, 5, 10} and controlling growth time at room temperature (hours = {1, 12, 48}). For (AG, LO), gray-scale color saturation is proportional to the relative density of each condition and corresponds to labels in (A). (B) The mean velocities of animals foraging in environments containing patches matching one of the 12 bacterial densities are plotted as a function of the distance from the edge of bacterial patches (computed for 50 μm bins). (C) Animals’ average on-patch velocity is plotted as a function of the relative density of bacteria. Compared to animals foraging among bacteria-free patches containing only LB (relative density 0), animals foraging on bacterial patches with relative density of 0.5 or greater display significantly slower on-patch velocities (one-tailed Mann–Whitney U-tests with Bonferroni correction). (D) The midbody location (colored to represent time in the experiment) of example animals foraging in environments containing patches (gray) of relative density 0, 1, 5, 10, and 200 is shown. (E) The total time each animal spent on patch is plotted as a function of the relative density of bacteria. Time on patch increased monotonically with increasing bacterial density (Kendall’s τ correlation, p < 0.001) following a sigmoidal trend. (F) Smoothed median values of the probability of worms residing on patch over time for each density condition are plotted. Time points where observed probabilities of residing on patch either match (pink) or significantly exceed (gray) the probability of residing on patch if patch locations were semi-randomly permuted are indicated (one-tailed Fisher’s exact test with Benjamini–Hochberg correction). (G) A kernel density estimate (KDE) of the distribution of encounter durations is plotted for each density condition. (H) For each encounter, the average velocity of the animal during the encounter and the duration of that encounter are plotted on a double-logarithmic plot with color representing the probabilities of clustering classification as search (orange), sample (green), or exploit (blue). Contours showing the first, second, and third standard deviation of the Gaussian mixture model (GMM) used to classify explore and exploit encounters are shown as shaded ellipses with saturation corresponding to standard deviation. KDEs for distributions of average on-patch velocity and encounter duration are plotted for each encounter type. (I) For each encounter, the minimum on-patch velocity and maximum change in velocity are plotted. Contours showing the separation of sensing and non-responding encounters as estimated by semi-supervised quadratic discriminant analysis (QDA) are indicated. A KDE for the distribution of the maximum change in velocity is plotted for each encounter type. (J) Features used to classify encounters as search, sample, or exploit are summarized. (K) KDEs of the distributions of animals’ velocities are shown for all time points during search off and on patch as well as during sample and exploit encounters. (L) Ethograms of patch encounters (colored to represent the probability of classification as search, sample, and exploit) are shown for 443 individuals. (M) The average proportion of each encounter type over time is plotted. (N) Time elapsed and (O) number of encounters occurring prior to the first exploitation event are plotted for every animal (blue). In the event that no exploitation event occurred, the maximum observed time and encounters are plotted (red-orange). Both time and encounter number before exploitation decrease monotonically with increasing patch density (Kendall’s τ correlation, p < 0.001) following a sigmoidal trend. Summary data for all animals (N = 443 total worms; N = 20–50 worms per condition) and encounters (N = 6560 total encounters; N = 46–876 encounters per condition) are shown in (AC, EI, KO). Asterisks denote statistical significance (***p < 0.001). See also Figure 2—figure supplements 18 and Videos 5 and 6.

Figure 2—source data 1

Relative density of bacterial patches in each condition in Figure 2A.

https://cdn.elifesciences.org/articles/103191/elife-103191-fig2-data1-v1.xlsx
Figure 2—source data 2

Velocity of animals upon encounter with patch edge in Figure 2B.

https://cdn.elifesciences.org/articles/103191/elife-103191-fig2-data2-v1.xlsx
Figure 2—source data 3

Velocity on patch in Figure 2C.

https://cdn.elifesciences.org/articles/103191/elife-103191-fig2-data3-v1.xlsx
Figure 2—source data 4

Time on patch in Figure 2E.

https://cdn.elifesciences.org/articles/103191/elife-103191-fig2-data4-v1.xlsx
Figure 2—source data 5

On-patch residence in Figure 2F.

https://cdn.elifesciences.org/articles/103191/elife-103191-fig2-data5-v1.xlsx
Figure 2—source data 6

Duration of patch encounters in Figure 2G.

https://cdn.elifesciences.org/articles/103191/elife-103191-fig2-data6-v1.xlsx
Figure 2—source data 7

Encounter classification as explore or exploit using a Gaussian mixture model (GMM) in Figure 2H.

https://cdn.elifesciences.org/articles/103191/elife-103191-fig2-data7-v1.xlsx
Figure 2—source data 8

Encounter classification as sense or no response using semi-supervised quadratic discriminant analysis (QDA) in Figure 2I.

https://cdn.elifesciences.org/articles/103191/elife-103191-fig2-data8-v1.xlsx
Figure 2—source data 9

Velocity during search, sample, and exploit behaviors in Figure 2K.

https://cdn.elifesciences.org/articles/103191/elife-103191-fig2-data9-v1.xlsx
Figure 2—source data 10

Encounter classification as explore or exploit and sense or no response in Figure 2L.

https://cdn.elifesciences.org/articles/103191/elife-103191-fig2-data10-v1.xlsx
Figure 2—source data 11

Probability of an encounter type over time in Figure 2M.

https://cdn.elifesciences.org/articles/103191/elife-103191-fig2-data11-v1.xlsx
Figure 2—source data 12

Time before first exploitation in Figure 2N.

https://cdn.elifesciences.org/articles/103191/elife-103191-fig2-data12-v1.xlsx
Figure 2—source data 13

Number of encounters before first exploitation in Figure 2O.

https://cdn.elifesciences.org/articles/103191/elife-103191-fig2-data13-v1.xlsx
Figure 2—figure supplement 1
Obtaining intensity profiles for fluorescent bacterial patches.

(A) Fluorescently labeled OP50-GFP bacterial patches were seeded onto agar plates under conditions matching those in the experimental assay. Small patches (0.5 µl) were pipetted in an isometric grid (6 mm center-to-center spacing) on a 16 × 25 mm rectangular template comparable to the one used in behavioral assays. Large patches (20 or 200 µl) were seeded directly onto agar plates. Brightfield and fluorescence images were acquired for every condition at multiple time points of bacterial growth. The fluorescence intensity profile of these images was obtained. (B) Due to uneven illumination within the field of view of our imaging system, matched fluorescence images of an empty agar plate were acquired at each time point. These ‘background’ images were smoothed using a two-dimensional averaging filter to remove noise. (C) Fluorescence images of the bacterial patches were normalized to these background images. (D) Locations of bacterial patches within the template were automatically detected using image processing techniques. Each patch was then radially segmented in bins of equal area. The mean pixel intensity value for each bin was computed and used to create an intensity profile of the patch. (E) The patch border and peak were detected using signal processing techniques. Specifically, the patch border was identified by finding a peak in the curvature κ of the edge profile. Border amplitude was defined as the magnitude of the difference between the patch border and peak. Relative border amplitude was defined as the border amplitude divided by the exposure time. A line was fit to the values of relative border amplitude across numerous time points and experiment days (five replicates shown as varying color points).

Figure 2—figure supplement 2
Example fluorescence profiles of bacterial patches under varied growth conditions.

Fluorescently labeled OP50-GFP bacterial patches were imaged (as described in Figure 2—figure supplement 1 and Bacterial patch density estimation). Inverted images (darker saturation = more bacteria) are shown here to highlight the range of bacterial densities tested in these experiments. All patches are shown on the same spatial scale and using one of the two linear saturation scales: (1) regular – normalized to show variance in high-density patches; (2) augmented (~22×) – normalized to show variance in low-density patches. Each patch shown is labeled with the optical density (OD600) at time of seeding and the approximate amount of time bacteria was grown for at room temperature (i.e., 1, 12, or 48 hr). (A) An example large (200 µl) bacterial patch of the type that animals experienced immediately prior to the assays in this paper. (B) Example small (0.5 µl) bacterial patches of greatest density. (C) Example small (0.5 µl) bacterial patches of lower density. The saturation of each image has been uniformly augmented to ~22× darker to the extent that the OD600 = 10 (1H) bacterial patch is the same patch as the one in (B). (D) Example small (0.5 µl) bacterial patches of lower density seeded on nematode growth medium (NGM) agar plates lacking peptone. (E) Example medium (20 µl) bacterial patches of greater density. (F) Example medium (20 µl) bacterial patches of lowest density. The OD600 = 1 (1H) bacterial patch is the same patch as the one shown in (E), but ~22× darker.

Figure 2—figure supplement 3
Quantifying the relative density of bacterial patches across conditions and time points.

(A) Relative density of OP50-GFP bacterial patches matched to all assay conditions in this paper is shown. Relative density represents the relative border amplitude (as defined in Figure 2—figure supplement 1 and Bacterial patch density estimation) normalized to the mean density of patches seeded with 0.5 µl of OD600 = 10 grown for 1 hr on plates with peptone (blue asterisk). In this manner, the bacterial patches experienced by animals in Figure 1 have been set to an average relative density of 10. Violin plots show the kernel density estimate (KDE) and quartiles for each condition. (B) Linear fits for the relative density of bacterial patches in each condition as a function of time are plotted. Saturation of each line corresponds to the relative density as depicted in (A). For each experimental plate, the relative density of bacterial patches was estimated by applying the coefficients from these linear regressions to the total amount of time the bacteria was grown at room temperature.

Figure 2—figure supplement 4
Example traces of animals foraging in environments with varying bacterial density.

Traces showing the midbody location of 12 example animals as they forage within a 30-mm arena are plotted with color used to represent time (dark blue = 0 min; dark red = 60 min). Locations of bacterial patches are indicated in gray. The relative density of bacterial patches in each environment is noted. Animals shown foraging on relative density 0, 1, 5, 10, and 200 are the same as those in Figure 2D.

Figure 2—figure supplement 5
Time- and density-dependent increase in patch residence.

Probability of residing on patch was computed for all worms across time (black) and compared to the probability of residing on patch for semi-randomly permuted patch locations (pink) (as described in Figure 1—figure supplement 4). Smoothed median values are plotted with bootstrap-derived 2.5% and 97.5% quantiles shown in shaded regions. Time points where observed probabilities of residing on patch significantly exceed permuted probabilities are indicated by a black line (one-tailed Fisher’s exact tests with Benjamini–Hochberg correction, ***p < 0.001). The smoothed median values for observed data are shown in Figure 2F. Data for relative density 10 match those in Figure 1G.

Figure 2—figure supplement 6
Classifying encounters as exploration or exploitation.

(A) A two-dimensional histogram shows the frequency of events for given pairs of values for the average velocity of the animal during an encounter and the duration of that encounter for all encounters in the paper. Probabilities are represented as a heat map of color. (B) The first principal component (PC1) for these two metrics was computed. The distribution of projections of the data onto PC1 is given by a histogram (gray). Kernel density estimates (KDEs) were computed using the bandwidth h^ defined by Silverman’s Rule of Thumb (blue) and using the critical bandwidth h (red-orange) at which the KDE is at the threshold between uni- and bi-modal (see Patch encounter classification as exploration or exploitation). (C) Critical bandwidth values were computed across 2000 smoothed bootstrap resamples. The distribution of these bootstrapped critical values is given as a histogram and compared against the critical bandwidth of the original data set (red-orange). (D) The average velocity of the animal during an encounter and the duration of that encounter are plotted for each encounter as visualized on a double-logarithmic plot. Contours showing the first, second, and third standard deviation of the two-dimensional Gaussian mixture model (GMM) are shown as shaded ellipses with saturation corresponding to standard deviation. Encounters for all data in the paper are individually plotted as in Figure 2H but with color representing the posterior probability of clustering classification as explore (green) or exploit (blue). (E) Posterior variance of the data as defined in Patch encounter classification as exploration or exploitation was calculated for 1000 replicates of GMMs with varied regularization value α. The classifier with minimum posterior variance (i.e., α=0.025) was used. (F) The posterior probabilities for classification as explore (green) or exploit (blue) are sorted for all encounters, highlighting the low posterior variance of the GMM. (G) Posterior probabilities for only the data in Figure 2 are shown.

Figure 2—figure supplement 7
Classifying encounters as sensing or non-responding.

(A) Minimum velocity (min. velocity on patch), maximum change in velocity (max. Δ velocity), and deceleration (Δ velocity) were calculated (as described in Patch encounter classification as sensing or non-responding). (B) Maximum change in velocity for every density condition is shown. Violin plots show the kernel density estimate (KDE) and quartiles for each condition. Two-dimensional histograms show the frequency of events for given pairs of values for (C) deceleration and minimum on-patch velocity and for (D) maximum change in velocity and minimum on-patch velocity for all encounters in the paper. Probabilities are represented as a heat map of color. (E) The first principal component (PC1) for these three metrics was computed. The distribution of projections of the data onto PC1 is given by a histogram (gray). KDEs were computed using the bandwidth h^ defined by Silverman’s Rule of Thumb (blue) and using the critical bandwidth h (red-orange) at which the KDE is at the threshold between uni- and bi-modal (see Patch encounter classification as sensing or non-responding). (F) Critical bandwidth values were computed across 2000 smoothed bootstrap resamples. The distribution of these bootstrapped critical values is given as a histogram and compared against the critical bandwidth of the original data set (red-orange).

Figure 2—figure supplement 8
Classifying encounters as sensing or non-responding.

(A) Deceleration upon encounter and minimum on-patch velocity during the encounter are plotted for each encounter. A three-dimensional parabolic boundary between sensing and non-responding clusters was fit using semi-supervised quadratic discriminant analysis (QDA) and a subset of labeled data (blue circles = sensing, dark orange circles = non-responding). Regions identified by the classifier as non-responding or sensing are indicated by colored contours (orange = non-responding, green = sensing). Encounters for all data in the paper are individually plotted as in Figure 2I but with color representing the conditional probability of clustering classification as non-responding (orange) or sensing (green). (B) Maximum change in velocity and minimum on-patch velocity during the encounter are plotted for each encounter in the paper as in (A). (C) Minimum velocity on patch, maximum change in velocity, and deceleration are shown for every encounter in the paper. See Video 5 for three-dimensional rotation of this plot. (D) The probabilities for classification as sensing (green) or non-responding (orange) are sorted for all encounters. (E) Probabilities for only the data in Figure 2 are shown. (F) For a subset of encounters that were censored (i.e., recording did not observe animals entering the patch), probabilities of sensing were estimated using the semi-supervised QDA approach as well as via marginalization over the conditional probabilities using only the observed minimum velocity on patch. Marginalized probabilities were used for these values (see Patch encounter classification as sensing or non-responding).

Figure 3 with 2 supplements
C. elegans explore first even when only one patch is available.

(A) Relative density of large (~8.3 mm diameter) and (B) small (~1.8 mm diameter) bacterial patches was varied by pipetting 20 and 0.5 µl, respectively, droplets of OP50 E. coli diluted in lysogeny broth (LB) to a range of optical densities OD600 = {0, 0.05, 0.1, 0.5, 1, 2, 3, 4, 5, 10} and controlling growth time at room temperature (hours = {1, 48}). (C) Large patches were formed in the center of 30-mm arenas while small patches were formed in the center of 9-mm arenas. The midbody location (colored to represent time in the experiment) of example animals foraging in environments containing a single (D) large or (E) small patch (gray) is shown. Ethograms of patch encounters (colored to represent the probability of classification as search, sample, and exploit) for (F) 144 individuals (8–15 per condition) foraging on a single large patch and (G) 191 individuals (27–38 per condition) foraging on a single small patch are shown. Time elapsed prior to the first exploitation event (blue) for animals foraging on (H) large and (I) small patches is plotted for every animal. When exploitation was not observed, time elapsed in the experiment is plotted (red-orange). Animals in large and small patch environments exploited higher-density patches significantly earlier (Kendall’s τ correlation, p < 0.001) following a sigmoidal trend. See also Figure 3—figure supplements 1 and 2.

Figure 3—source data 1

Relative density of large (20 μl) bacterial patches in Figure 3A.

https://cdn.elifesciences.org/articles/103191/elife-103191-fig3-data1-v1.xlsx
Figure 3—source data 2

Relative density of small (0.5 μl) bacterial patches in Figure 3B.

https://cdn.elifesciences.org/articles/103191/elife-103191-fig3-data2-v1.xlsx
Figure 3—source data 3

Encounter classification as explore or exploit and sense or no response in Figure 3F.

https://cdn.elifesciences.org/articles/103191/elife-103191-fig3-data3-v1.xlsx
Figure 3—source data 4

Encounter classification as explore or exploit and sense or no response in Figure 3G.

https://cdn.elifesciences.org/articles/103191/elife-103191-fig3-data4-v1.xlsx
Figure 3—source data 5

Time before first exploitation in Figure 3H.

https://cdn.elifesciences.org/articles/103191/elife-103191-fig3-data5-v1.xlsx
Figure 3—source data 6

Time before first exploitation in Figure 3I.

https://cdn.elifesciences.org/articles/103191/elife-103191-fig3-data6-v1.xlsx
Figure 3—figure supplement 1
Example traces of animals foraging in environments with one large bacterial patch.

Example traces showing the midbody location of 11 animals as they forage within a 30-mm arena are plotted with color used to represent time (dark blue = 0 min; dark red = 60 min). The location of bacterial patches is indicated in gray. The relative density of bacterial patches in each environment is noted. The animal shown foraging on relative density 10 is the same as that in Figure 3D.

Figure 3—figure supplement 2
Example traces of animals foraging in environments with one small bacterial patch.

Example traces showing the midbody location of six animals as they forage within a 9-mm arena are plotted with color used to represent time (dark blue = 0 min; dark red = 60 min). The location of bacterial patches is indicated in gray. The relative density of bacterial patches in each environment is noted. The animal shown foraging on relative density 10 is the same as that in Figure 2E.

Figure 4 with 5 supplements
Exploitation decisions are driven by available sensory information, satiety, and prior experience.

(A) Schematic of the covariates xk used in our logistic regression model to predict the probability of exploiting a patch upon any given encounter p(yk=1|βxk). xk includes the relative density of the encountered patch k (ρk), the duration of time spent off food since departing the last exploited patch (τs), the relative density of the patch encountered immediately before encounter k (ρk), and the relative density of the last exploited patch (ρe). (B) To account for uncertainty in our classification of sensation, we produced 100 sets of observations wherein we probabilistically included sensed encounters (vk=1) estimated from the distribution vk|wkBern(p(vk=1|wk)) where p(vk=1|wk) is the probability that the patch was sensed as estimated in Figure 2I. To account for uncertainty in our classification of exploitation, we substitute the response variable yk with our estimate of the probability that the patch was exploited p(yk=1|zk) as estimated in Figure 2H, a procedure analogous to including exploitations (yk=1) estimated from the distribution yk|zkBern(p(yk=1|zk)). A schematic of these procedures is shown (see Models of exploitation probability). (C) Coefficient values for each covariate in the GLM were estimated across 50,000 replicates (500 replicates of hierarchically bootstrapped animals in combination with 100 sets of probabilistically sensed encounters). All coefficients are significantly greater than or less than 0 (two-tailed, one-sample bootstrap hypothesis tests with Bonferroni correction). (D) Using observed pyk=1zk and estimated pyk=1βxk probabilities of exploitation, exploitation events were simulated from a Bernoulli distribution. Distributions of the probability of first exploiting as a function of the number of encounters as estimated by the model with covariates added one-by-one and as observed are shown for animals foraging in single-density, multi-patch environments of relative density 1 or 10. (E) A schematic of multi-density, multi-patch assays where animals foraged in environments containing small (~1.8 mm diameter) bacterial patches (gray) of varying combinations of OP50 E. coli with relative densities 1, 4, and 7 are shown. (F) The probability of exploitation as estimated with (pyk=1β0+βkρk+βsτs+βhρh+βeρe) and without (pyk=1β0+βkρk+βsτs) the history-dependent terms and as observed pyk=1zk is shown for every pairing of current patch density (ρk) combined with the density of recently encountered (ρh) or exploited (ρe) patches. Heat maps for observed values were interpolated between the nine patch density pairings tested. (G) Exploitation events were simulated from the distribution yk|zkBern(p(yk=1|zk)) and used to calculate the probability of observing exploitation for the first time as a function of the number of encounters for N2, mec-4, and osm-6 animals foraging in single-density, multi-patch environments of relative density 1 or 10. (H) Coefficient values for each covariate were estimated using ridge regression models for each strain across 50,000 replicates. A subset of these coefficients significantly varied between wild-type and mutant strains (mean of differences tests with Benjamini–Hochberg correction). Summary data for all animals (N = 443 total worms; N = 20–50 worms per condition) and encounters (μ = 2659.8, σ = 15.9) in the single-density, multi-patch assay are shown in (C, D). Summary data for all animals (N = 198 total worms; N = 20–40 worms per condition) and sensed encounters (μ = 1724.6, σ = 9.9) in the multi-density, multi-patch assay are shown in (F). Summary data for all wild-type and mutant animals (N = 221 total worms; N = 14–44 worms per condition) and encounters (N = 1352 total encounters) in a single-density, multi-patch assay are shown in (G, H). Violin plots in (C, H) show the kernel density estimate (KDE) and quartiles for each measure. Asterisks denote statistical significance (punadjusted < 0.05; *p < 0.05; **p < 0.01; ***p < 0.001). See also Figure 4—figure supplements 15.

Figure 4—source data 1

Coefficients of linear regression model in Figure 4C.

https://cdn.elifesciences.org/articles/103191/elife-103191-fig4-data1-v1.xlsx
Figure 4—source data 2

Probability of exploitation occurring for the first time as a function of the number of encounters in Figure 4D.

https://cdn.elifesciences.org/articles/103191/elife-103191-fig4-data2-v1.xlsx
Figure 4—source data 3

Observed and predicted (with and without history dependence) posterior probabilities of exploitation in Figure 4F.

https://cdn.elifesciences.org/articles/103191/elife-103191-fig4-data3-v1.xlsx
Figure 4—source data 4

Probability of exploitation occurring for the first time as a function of the number of encounters for animals with sensory mutations in Figure 4G.

https://cdn.elifesciences.org/articles/103191/elife-103191-fig4-data4-v1.xlsx
Figure 4—source data 5

Coefficients of linear regression model in Figure 4H.

https://cdn.elifesciences.org/articles/103191/elife-103191-fig4-data5-v1.xlsx
Figure 4—figure supplement 1
Model selection for nested GLMs.

(A) Values of log-likelihood, Aikake information criterion (AIC), and Bayesian information criterion (BIC) were computed for 50,000 replicates of the linear regression model described in Models of exploitation probability. The replicate-by-replicate difference in value of these metrics between the full model (i.e., βxk=β0+βkρk+βsτs+βhρh+βeρe) and every combination of covariate subsets is plotted here. Log-likelihood values less than zero and AIC or BIC values greater than zero indicate worse model performance of the partial term models as compared to the full model. Percentages indicate the proportion of replicates where the model performed best according to that criterion. Even using BIC, the strictest model criterion, the full model performs better than any other model on the majority of replicates. (B) To illustrate the replicate-by-replicate variance, log-likelihood, AIC, and BIC are plotted across all 100 replicates of ‘encounter samples’ (i.e., we removed encounters where the animal likely did not sense the encounter vk=0 as estimated from the distribution vk|wkBern(p(vk=1|wk))) and 500 replicates of hierarchically bootstrapped ‘worm samples’ (i.e., we resampled animals with replacement and included all encounters of the resampled animals). Values for each metric at each replicate are colored to match their respective color bar. Metrics are shown for this subset of models to illustrate the addition of each covariate to the model. Lower AIC and BIC values for the full model (i.e., βxk=β0+βkρk+βsτs+βhρh+βeρe) represent better model performance even with penalization for increasing the number of parameters. (C) Coefficients β for the null distribution (i.e., observations of the response variable p(yk=1|zk) shuffled relative to the covariates xk) are plotted. Only β0 was significantly greater than or less than 0 (two-tailed, one-sample bootstrap hypothesis tests with Bonferroni correction). These β represent the null distribution for the β in Figure 4C. Violin plots in (A, C) show the kernel density estimate (KDE) and quartiles for each covariate across the 50,000 replicates. Asterisks denote statistical significance (***p < 0.001).

Figure 4—figure supplement 2
Probability of first exploitation as a function of the number of encounters.

Histograms of the probability of first exploiting as a function of the number of encounters as estimated by the models and as observed are shown for animals foraging in single-density, multi-patch environments of all 12 density conditions. Exploitation events were simulated from a Bernoulli distribution with probability estimated by the model yk|xkBern(p(yk=1|βxk)) where covariates were added one at a time as well as from the observed probabilities estimated by the Gaussian mixture model classification yk|zkBern(p(yk=1|zk)) in Figure 2H. Histograms for relative densities 1 and 10 are the same as those in Figure 4D.

Figure 4—figure supplement 3
Exploitation decision of food-deprived animals is well predicted by the model.

(A) Schematic of experiments used to test satiety’s influence on the decision to exploit. As in all experiments, animals were acclimated to high-density (relative density ~200) patches for ~24 hr. Well-fed animals were then removed from these acclimation plates, cleaned of bacteria, and then immediately transferred to the assay plate with relative density 5. Food-deprived animals moved about a bacteria-free arena for 3 hr prior to the assay. Examples of animal behavior while foraging in acclimation-like, bacteria-free, and single-density, multi-patch environments of relative density 5 are shown. (B) Patch encounters for 28 food-deprived and 28 well-fed individuals are plotted across time. Each encounter is colored to match its probability of classification as search (orange), sample (green), and exploit (blue). (C) Coefficient values were re-estimated across 50,000 replicates as in Figure 4C for a model with the satiety term removed (i.e., pyk=1β0+βkρk+βhρh+βeρe). All coefficients are significantly greater than or less than 0 (two-tailed, one-sample bootstrap hypothesis tests with Bonferroni correction; ***p < 0.001). Violin plots show the kernel density estimate (KDE) and quartiles for each measure. (D) Histograms of the probability of first exploiting as a function of the number of encounters are shown for food-deprived and well-fed animals. Model predictions of exploitation events were simulated from a Bernoulli distribution yk|xkBern(p(yk=1|βxk)) where the coefficient values β corresponded to those previously estimated for our linear regression model with (Figure 4C) and without (Figure 4—figure supplement 3C) the satiety term using the data set shown in Figure 2 (i.e., the 443 well-fed animals foraging in one of 12 density conditions). Observed exploitations were simulated from a Bernoulli distribution using the probability of exploitation estimated by our Gaussian mixture model (GMM) classifier yk|zkBern(p(yk=1|zk)) in Figure 2H. Summary data for all animals (N = 56 total worms; N = 28 worms per condition) and encounters (N = 277 total encounters; N = 42–235 encounters per condition) are shown in (B, D).

Figure 4—figure supplement 4
Example traces and classified behavior of animals foraging in environments with multiple patch densities.

(A) Example traces showing the midbody location of seven animals as they forage within a 30-mm arena are plotted with color used to represent time (dark blue = 0 min; dark red = 60 min). Locations of bacterial patches are indicated in gray with saturation indicating the relative density. Environments contained combinations of patches with relative density 1, 4, and 7 as noted. (B) Patch encounters for 200 individuals (20–40 per condition) are plotted across time. Each encounter is colored to match its relative density. (C) Patch encounters are colored to match their probability of classification as search (orange), sample (green), and exploit (blue). (D) Coefficient values were estimated across 50,000 replicates for the multiple density data set for models containing only the satiety-related covariate (i.e., βxk=β0+βkρk+βsτs+βhρh+βeρe), only the transfer-related covariate (i.e., βxk=β0+βkρk+βtτt+βhρh+βeρe), and for both the satiety and transfer covariates (i.e., βxk=β0+βkρk+βsτs+βtτt+βhρh+βeρe). All coefficients are significantly greater than or less than 0 (two-tailed, one-sample bootstrap hypothesis tests with Bonferroni correction) with the exception of βt in the satiety and transfer model. (E) Coefficient values were re-estimated across 50,000 replicates for the original single-density data set as in Figure 4C for a model with the history-dependent terms removed (i.e., pyk=1β0+βkρk+βsτs). All coefficients are significantly greater than or less than 0 (two-tailed, one-sample bootstrap hypothesis tests with Bonferroni correction). Violin plots show the kernel density estimate (KDE) and quartiles for each measure. Summary data for all animals (N = 198 total worms; N = 20–40 worms per condition) and encounters (N = 3493 total encounters; N = 282–795 encounters per condition) are shown in (B, C). Asterisks denote statistical significance (*p<0.05; **p < 0.01; ***p < 0.001).

Figure 4—figure supplement 5
Example traces and classified behavior of animals with chemosensory or mechanosensory deficiencies.

(A) Example traces showing the midbody location of nine animals as they forage within a 30-mm arena are plotted with color used to represent time (dark blue = 0 min; dark red = 60 min). The location of bacterial patches is indicated in gray. The relative density of bacterial patches in each environment is noted. Three strains of C. elegans were tested (gray = N2, pink = mec-4, orange = osm-6) across three conditions of relative density (1, 5, and 10). (B) Patch encounters for 76 individuals (16–44 per density condition) of each strain are plotted across time. Each encounter is colored to match its probability of classification as search (orange), sample (green), and exploit (blue). (C). Histograms of the probability of first exploiting as a function of the number of encounters are shown for each strain and density condition. Observed exploitations were simulated from a Bernoulli distribution using the posterior probability of exploitation defined by our Gaussian mixture model (GMM) classifier yk|zkBern(p(yk=1|zk)) in Figure 2H. Histograms of each strain for relative density conditions 1 and 10 are the same as those in Figure 4G. (D) Coefficients β* for the null distribution (i.e., observations of the response variable pyk=1zk were shuffled relative to the covariates xk) are plotted. Violin plots show the kernel density estimate (KDE) and quartiles for each covariate across the 50,000 replicates. These β* represent the null distribution for the β in Figure 4H. (E) The ridge regression parameter λ was optimized for each strain to maximize the mean log-likelihood of the model. Summary data for all animals (N = 221 total worms; N = 14–44 worms per condition) and encounters (N = 1352 total encounters; N = 27–193 encounters per condition) are shown in (B, C).

Videos

Video 1
C. elegans foraging in a patchily distributed environment.

Four adult C. elegans forage for 1 hr in a 30-mm arena containing an isometric grid of small, low-density bacterial patches.

Video 2
Visualizing dilute bacterial patches using diffraction of light.

A piece of dark cardstock passed between the light source and the assay plate enables visualization of dilute bacterial patches.

Video 3
Tracking the midbody location of an animal foraging in a patchily distributed environment.

The midbody location of one of the four animals shown in Video 1 is shown as the animal forages for 1 hr in a 30-mm arena containing an isometric grid of small, low-density bacterial patches. The animal shown corresponds to the example animal observed in Figure 1A, B, H–K.

Video 4
Tracking the entire body of a foraging animal.

The position of the entire body of an animal is shown as the animal forages for 1 hr in a 9-mm arena containing one small, low-density bacterial patch. The head is indicated by a small dot. The animal shown corresponds to the example animal observed in Figure 3D.

Video 5
Classifying encounters as sensing based on quantification of slowdown.

Three metrics quantifying the magnitude of slowdown upon patch encounter were computed. A semi-self-supervised quadratic discriminant analysis was trained on a subset of labeled data and used to classify all encounters as sensing (green) or non-responding (orange). Data correspond with Figure 2I, Figure 2—figure supplement 8A–C.

Video 6
Foraging behavior of an animal with encounters labeled as search, sample, or exploit.

The midbody location of the animal in Video 3 is shown and labeled by the probability of classification as searching (i.e., off-patch exploration and patch encounters lacking a slowdown response), sampling (i.e., patch encounters that were sensed, but not exploited), and exploiting at every time point. The animal shown corresponds to the example animal observed in Figure 1A, B, H–K.

Tables

Key resources table
Reagent type (species) or resourceDesignationSource or referenceIdentifiersAdditional information
Strain, strain background (Escherichia coli)OP50Caenorhabditis Genetics CenterWBStrain00041969
Strain, strain background (Escherichia coli)OP50-GFPCaenorhabditis Genetics CenterWBStrain00041972
Strain, strain background (Caenorhabditis elegans)N2: wild isolateCaenorhabditis Genetics CenterWBStrain00000001
Strain, strain background (Caenorhabditis elegans)PR811: [osm-6(p811) V]Caenorhabditis Genetics CenterWBStrain00030796
Strain, strain background (Caenorhabditis elegans)TU253: [mec-4(u253) X]Caenorhabditis Genetics CenterWBStrain00035037
Software, algorithmStreamPix 8NorPixRRID:SCR_015773
Software, algorithmWormLabMBF BioscienceRRID:SCR_017669
Software, algorithmMATLAB 2024aMathworksRRID:SCR_001622
Software, algorithmPhotoshop 2024AdobeRRID:SCR_014199
Software, algorithmIllustrator 2024AdobeRRID:SCR_010279
Software, algorithmCode for analysishttps://github.com/shreklab/Haley-et-al-2024

Additional files

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. Jessica A Haley
  2. Tianyi Chen
  3. Mikio Aoi
  4. Sreekanth H Chalasani
(2025)
Accept–reject decision-making revealed via a quantitative and ethological study of C. elegans foraging
eLife 13:RP103191.
https://doi.org/10.7554/eLife.103191.4