Abstract
In complex biological systems, simple individual-level behavioral rules can give rise to emergent group-level behavior. While such collective behavior has been well studied in cells and larger organisms, the mesoscopic scale is less understood, as it is unclear which sensory inputs and physical processes matter a priori. Here, we investigate collective feeding in the roundworm C. elegans at this intermediate scale, using quantitative phenotyping and agent-based modeling to identify behavioral rules underlying both aggregation and swarming—a dynamic phenotype only observed at longer timescales. Using fluorescent multi-worm tracking, we quantify aggregation behavior in terms of individual dynamics and population-level statistics. Based on our quantification, we use agent-based simulations and approximate Bayesian inference to identify three key behavioral rules that give rise to aggregation: cluster-edge reversals, a density-dependent switch between crawling speeds, and taxis towards neighboring worms. Our simulations suggest that swarming is simply driven by local food depletion but otherwise employs the same behavioral mechanisms as the initial aggregation. Hence, mesoscopic C. elegans uses mechanisms familiar from microscopic systems for aggregation, but implemented via more complex behaviors characteristic of macroscopic organisms.
Introduction
Collective behavior has been widely studied in living and non-living systems. While very different in their details, shared principles have begun to emerge, such as the importance of alignment for flocking behavior in both theoretical models and birds (Bialek et al., 2012; Pearce et al., 2014; Reynolds, 1987). Until now, the study of collective behavior has mainly focused on cells and active particles at the microscale, controlled by molecule diffusion and direct contact between cells or particles (Köhler et al., 2011; Palo et al., 2017; Peruani et al., 2012; Starruss et al., 2012), and on animals at the macroscale, aided by long-range visual cues (Bialek et al., 2012; Katz et al., 2011; Pearce et al., 2014). Collective behavior at the intermediate mesoscale is less well-studied, as it is unclear what processes to include a priori. At the mesoscale, sensory cues and motility may still be limited by the physics of diffusion and low Reynolds numbers, respectively, yet the inclusion of nervous systems allows for increased signal processing and a greater behavioral repertoire. Do the rules governing collective behavior at this intermediate scale resemble those at the micro-or the macro-scale, some mixture of both, or are new principles required?
C. elegans collective behavior can contribute to bridging this scale gap. Some strains of this 1 mm-long roundworm are known to aggregate into groups on food (de Bono & Bargmann 1998); here we also report an additional dynamic swarming phenotype that occurs over longer time periods. C. elegans represents an intermediate scale not only in physical size but also in behavioral complexity—crawling with negligible inertia, limited to touch and chemical sensing, yet possessing a compact nervous system with 302 neurons (White et al., 1986) that supports a complex behavioral repertoire (Hart, 2006; Schwarz et al., 2015). Wild C. elegans form clusters on food at ambient oxygen concentrations, as do loss-of-function neuropeptide receptor 1 (npr-1) mutants. The laboratory reference strain N2, on the other hand, has a gain-of-function mutation in the npr-1 gene that suppresses aggregation (de Bono and Bargmann, 1998), rendering N2 animals solitary feeders. Thus, a small genetic difference (just two base pairs in one gene for the npr-1(ad609lf) mutant) has a big effect on the population-level behavioral phenotype. Previous research on collective feeding has focused primarily on the genetics and neural circuits that govern aggregation (Bretscher et al., 2008; Busch et al., 2012; Chang et al., 2006; Cheung et al., 2005; de Bono et al., 2002; de Bono and Bargmann, 1998; Gray et al., 2004; Jang et al., 2017; Macosko et al., 2009), rather than on a detailed understanding of the behavior itself. Rogers et al. (2006) is a notable exception and includes an investigation of the behavioral motifs that might lead to cluster formation including direction reversals at the edge of clusters. However, we do not know whether these candidate motifs are sufficient to produce aggregation nor whether aggregation at short times and swarming at longer times are distinct behaviors or different emergent properties of the same underlying phenomenon.
In this paper, we use fluorescence imaging and multi-worm tracking to examine individual behavior inside aggregates. We present new and systematic quantification of the aggregation behavior in hyper-social npr-1(ad609lf) mutants (henceforth referred to as npr-1 mutants) and hypo-social N2 worms. Next, we draw on the concept of motility-induced phase transitions to explain aggregation as an emergent phenomenon by modulating only a few biophysical parameters. Unlike aggregation driven by attractive forces, in motility-induced phase transitions individuals can also aggregate simply due to their active movement and non-attractive interactions, such as volume exclusion (avoidance of direct overlap) (Redner et al., 2013a). For instance, this concept has contributed understanding to the aggregation of rod-shaped Myxococcus xanthus bacteria, which, similar to C. elegans, also exhibit reversals during aggregation (Mercier and Mignot, 2016; Peruani et al., 2012; Starruss et al., 2012). We build an agent-based phenomenological model of simplified worm motility and interactions. By mapping out a phase diagram of behavioral phenotypes, we show that modulating cluster-edge reversals and a density-dependent switch between crawling speeds are sufficient to produce some aggregation, but not the compact clusters observed in experiments. We found that medium-range taxis towards neighboring worms is necessary to tighten clusters and increase persistence. Finally, combining this model with food depletion gives rise to swarming over time, suggesting that the same behavioral rules that lead to the initial formation of aggregates also underlie the dynamic swarming reported here.
Results
Dynamic swarming occurs in social worms at long time scales
Aggregation has most often been characterized as the fraction of worms inside clusters, where individual worms can move in and out of clusters. Here we report an additional dynamic phenotype, which we call swarming, that occurs on a timescale of hours. A high number of npr-1 mutants not only aggregate into dense clusters, but also swarm together across the bacteria lawn over time (Figure 1A, Supplementary Movie S1). Because of the long timescale, this behavior is not obvious from manual observations of worms on a plate, but becomes clear in time lapse videos (Figure 1B and 1C, npr-1 panels).
Dynamic swarming occurs with just 40 npr-1 mutants (Figure 1B, top row), making it experimentally feasible to study. It is not observed with N2 worms (Figure 1B, bottom row). Under our experimental conditions at atmospheric oxygen levels, usually a single npr-1 aggregate forms on the food patch and then moves around the lawn in a persistent but not necessarily directed manner (Figure 1C, left; Supplementary Figure S1A), at a steady speed (Figure 1D). The onset of this collective movement appears to coincide with local food depletion, and continues until complete food depletion, at which time the cluster disperses. More than one moving cluster may coexist, and occasionally a cluster may disperse and form elsewhere when it crosses its previous path (Supplementary Figure S1A), presumably due to local food depletion. The observed pattern of npr-1 cluster motion is reminiscent of a self-avoiding, persistent random walk (i.e. not returning to areas that the worms have previously been where there is no food left). By contrast, after initially forming transient clusters on the lawn, N2 worms move radially outwards with no collective movement (Figure 1C, right).
Fluorescence imaging and automated animal tracking allows quantification of dynamics inside and outside of aggregates
Based on our observation that swarming appears to be driven by food depletion, we hypothesize the phenomenon may be a dynamic extension of the initial aggregation that occurs before depletion. To test this idea, we first sought to identify the mechanisms underlying aggregation.
The presence of aggregates is clear in bright field images, but it is difficult to track individual animals in these strongly overlapping groups for quantitative behavioral analysis. We therefore labeled the pharynx of worms with green fluorescent protein (GFP) and used fluorescence imaging in order to minimize overlap between animals, making it possible to track most individuals even when they are inside a dense cluster (Figure 2A). We also labeled a small number of worms (1-3 animals out of 40 per experiment) with a red fluorescent protein (RFP)-tagged body wall muscle marker instead of pharynx-GFP. These RFP-labeled worms were recorded on a separate channel during simultaneous two-color imaging (Figure 2B), thus allowing both longer trajectories and the full posture to be obtained in a subset of animals. We wrote a custom module for Tierpsy Tracker (Javer et al., 2018) to segment light objects on a dark background and to identify the anterior end of the marked animals automatically, in order to extract trajectories and skeletons of multiple worms from our data (Figure 2C).
Ascarosides and direct adhesion are unlikely to drive different aggregation phenotypes
We first considered long-range chemotaxis driven by food or diffusible ascaroside pheromone signals as a potential behavioral mechanism. Chemotaxis towards food can likely be ignored as our experiments were performed on thin, even bacterial lawns. Although ascarosides are important for processes such as mating and dauer formation in C. elegans (Srinivasan et al., 2008), it is less clear whether long-range signaling via pheromones plays a role in aggregation (de Bono et al., 2002; Macosko et al., 2009). daf-22(m130) mutants do not produce ascarosides, but daf-22;npr-1 double mutants aggregate similarly to npr-1 single mutants (Supplementary Figure S2A), consistent with the observation that the hermaphrodite-attractive pheromone icas#3 is attractive to both N2 animals and npr-1 mutants (Srinivasan et al., 2012) and is thus unlikely to explain the difference in their propensity to aggregate. Moreover, attraction between moving objects is known to produce aggregation in active matter systems (Redner et al., 2013a), but it is not known whether this applies to worms. Short-range attraction between worms may exist in the form of adhesion mediated through a liquid film (Gart et al. 2011), but we have no reason to believe this would differ between npr-1 and N2 strains.
Reversal rates and speed depend on neighbor density more strongly in npr-1 mutants than in N2
Having considered long-range food- or ascaroside-mediated attraction and short-range adhesion, we next focused on behavioral responses to nearby neighbors. While postural changes do not seem to be a main driver of aggregation as principal component analysis of lone versus in-cluster npr-1 worms revealed similar amplitudes in the posture modes (Supplementary Figure S2B), we found experimental evidence for density-dependence of both reversal rates and speed and that these differ between the two strains we studied.
Reversals have been previously suggested as a behavior that may enable npr-1 worms to stay in aggregates (Rogers et al., 2006). To avoid cluster definitions based on thresholding the distance between worms, we quantified individual worm behavior as a function of local density (Figure 3A) instead. Calculating the reversal rates relative to that of worms at low densities, we found that npr-1 mutants reverse more at increased neighbor densities, while N2 animals do not (Figure 3B).
Next we calculated the speed distributions of individual worms, binned by local neighbor density. We found that both strains slow down when surrounded by many other worms, but the shift is more pronounced for npr-1 animals. npr-1 worms move faster than N2 at low densities, showing a distinct peak at high speeds. As neighbor density increases, this high speed peak gradually becomes replaced by a peak at low speeds, so that the overall speed distribution for npr-1 resembles that of N2 at very high densities. Thus, npr-1 and N2 animals show different density-dependent changes in their respective speed profiles (Figure 3C).
Since the observed transition of the speed profiles could occur due to active behavioral changes as well as restricted movement in clusters, we also considered tracks of individual worms. Using body wall muscle-marked worms allowed us to obtain longer trajectories that could be joined for the duration of an entire movie, including cluster entry and exit events. We compared the speed of these tracks with visual assessment of when a worm entered or exited a cluster based on the proximity to pharynx-labeled worms. We found that worms are able to move inside of clusters and observed that speed changes can occur prior to cluster entry and exit events (Figure 3D, Supplementary Movies S3 and S4). This change of speed is neither purely mechanical nor a deterministic response to a certain neighbor density, and suggests a mechanism in which worms probabilistically switch between different speeds.
Spatial statistics show group-level differences between npr-1 and N2 animals
The differences in aggregation behavior between npr-1 and N2 are visually striking, but previous quantification has typically been limited to the fraction of animals in clusters. Using the tracked positions of pharynx-labeled worms (Figure 4A), we calculated the pair-correlation function (Figure 4B), commonly used to quantify aggregation in cellular and physical systems (Gurry et al., 2009). We also computed a hierarchical clustering of worm positions (Figure 4C), which is calculated from the same pairwise distances but emphasizes larger scale structure. Using both measures, we found that as a population, npr-1 animals show quantifiably higher levels of aggregation than N2, especially at scales up to 1 mm (pair-correlation “S1”, Figure 4D) and 2 mm (hierarchical clustering “S2”, Figure 4E). We also quantified aggregation using scalar spatial statistics, namely the average standard deviation (“S3”) and kurtosis (“S4”) of the distribution of positions. This confirms that the positions of npr-1 worms are less spread-out and more heavy-tailed than those of N2 (Figure 4D).
Agent-based model captures different aggregation phenotypes
To test whether the individual behavioral differences measured between npr-1 and N2 worms are sufficient to give rise to the observed differences in aggregation, we constructed a phenomenological model of worm movement and interactions. The model is made up of self-propelled agents (Figure 5A), and includes density-dependent interactions motivated by the experimental data, namely reversals at the edge of a cluster (Figure 5B) and a switch between movement at different speeds (Figure 5C). As a model of collective behavior this differs from those commonly considered in the literature, such as the Vicsek model (Vicsek et al., 1995) and its many related variants (Vicsek and Zafeiris, 2012; Yates et al., 2009). Such models typically feature attractive forces or align the direction of motion at ranges much longer than the size of the moving objects, and result in flocking or clustering with global alignment (Figure 5D), which we do not observe in our experimental data. In contrast, our model needs to produce dynamic, disordered aggregates (Figure 1B, Figure 2A and Supplementary Movie S2), and should primarily rely on short-range interactions that are motivated by behaviors measured in our data.
The density-dependence of the reversal rate and speed switching is implemented as follows: The rate of reversals increases linearly with density with slope r’, which is a free parameter, and is thus given by rrev = r’ ρ. The reversal rate at zero density is zero as we ignored spontaneous reversals outside of clusters as these were only rarely observed under our experimental conditions (see Supplementary Methods for further discussion of the model construction). This parameterization of the reversal rate may be unbounded, but we can prevent unrealistically high reversal rates for a given maximum worm number by choosing our prior distribution of the parameter r’. The rate of slowing down is similarly approximated as a linear function of density, with free parameter ks’, and is given by kslow = ks0 + ks’ ρ, where ks0 is the slowing rate at zero-density. The rate of speeding up is given by kfast = kf0 exp[-kf’ ρ], where the exponential decay is chosen to ensure positivity of the rate, and kf0 is the rate at zero density. The rates of slowing down and speeding up at zero density (ks0, kf0) were obtained from published single-worm experimental data (Javer et al., 2018; Yemini et al., 2013).
We initially ran a coarse parameter sweep, sampling uniformly in the two-dimensional parameter space associated with the density-dependence of reversals and speed switching. As a simplifying assumption, the density-dependence of the speeding-up and slowing-down rates was set equal (k’s = k’f = k’). The remaining parameters, r’ and k’, were varied to explore the global model behavior. This demonstrates that our model can capture different aggregation phenotypes from solitary movement to aggregation (Figure 5E) by varying just two free parameters, and provides important general insights. Inspection of the model simulations shows that each behavior alone (just reversals or slowing) does not give the same level of aggregation as when both parameters are modulated (Figure 5E), so that using both behavioral components proves important. Quantifying the aggregation and comparing it to the npr-1 experiment, however, highlights incomplete quantitative agreement with both the pair correlation function and hierarchical clustering distribution (Figure 5F). Thus, we reasoned additional interactions may be required to match the experimentally observed behaviors.
Adding a medium-range taxis interaction promotes stronger aggregation
To explore improvements in clustering, we extended the model by an attractive taxis interaction. Attraction should intuitively improve clustering, but we knew from our model exploration that an attractive potential between bodies produces undesirable cluster shapes (Figure 5D) and reasoned that a long-range interaction may be unrealistic (Supplementary Figure S2A). Thus, we include taxis towards neighboring worms and model worm movement as an attractive persistent random walk. The taxis contribution to a worm’s motile force has an overall strength controlled by parameter ft, with multiple nearby neighbors contributing cumulatively, weighted by 1/r, where r is the distance to a neighboring worm. Neighboring worms beyond a cutoff distance equal to the length of a worm have no contribution. Thus, this taxis interaction is acting at a natural intermediate length scale of our system (see Supplementary Methods for details).
The resulting extended model has four free parameters: density-dependent reversals (r′), speed-switching rates (ks′, kf′) and taxis (ft). To find the parameter combinations that best describe each strain, as well as the uncertainty in the parameter values, we used an approximate Bayesian inference approach (see Supplementary Methods). To increase the computational efficiency of our inference pipeline, we excluded infeasible regions of parameter space to reduce the prior distribution of parameters that we need to sample from (Supplementary Figure S3) (see Supplementary Methods). We then selected the closest matching simulations from about 27,000 simulations for npr-1 and about 13,000 simulations for N2, equally weighting all four summary statistics. Results from our extended model (Figure 6A, Supplementary Movies S5 and S6) show markedly improved quantitative agreement with the experiments (Figure 6B). The approximated posterior distributions of the parameters (Figure 6C-D) show the most likely values of the parameters for each strain, as well as the uncertainty associated with the individual and joint marginal parameter distributions. In particular, to achieve npr-1-like aggregation, the reversal (r’) and taxis (ft) parameters need to be higher than for N2, albeit not too high. The density-dependence of the slowing rate (k’s) is only subtly different between the two strains, while the dependence of the speeding up rate (k’f) is greater in npr-1, but with broader uncertainty.
Extending the model with food-depletion captures dynamic swarming
Since we hypothesize that the swarming we observed at longer time scales may be explained as aggregation under food depletion conditions, we further extended the model to allow the local depletion of food. Food is initially distributed uniformly, and becomes depleted locally by worm feeding (see Supplementary Methods for details). Absence of food suppresses the switch to slow speeds, thus causing worms to speed up when food is locally depleted. As a result, we hypothesize that worm clusters begin to disperse but reform on nearby food, leading to sweeping.
Selecting the parameter combination best matching the npr-1 strain (Figure 6) and an appropriate food depletion rate (chosen such that all food was depleted no faster than observed in experiments), the resulting simulation produced long-time dynamics qualitatively representative of the experimentally observed swarming (Figure 7A-B, Supplementary Movie S7). Worm clusters undergo a persistent but not necessarily directed random walk, can disperse and re-form elsewhere, and multiple clusters may co-exist, all of which we observe experimentally. Tracking the centroid of worms in our simulations, we find a comparable cluster speed as the median experimental value of 172 μm/min (Figure 1D) for a range of feeding rates (Figure 7C) (feeding rate is an unknown parameter as our model only accounts for relative food concentration). Thus, the model indicates that dynamic swarming of npr-1 aggregates may be explained as an emergent phenomenon resulting from individual locomotion, and that the same behavioral mechanisms that produce the initial aggregates, when coupled with local food depletion, give rise to the observed swarming behavior.
Discussion
We have investigated the mechanisms of aggregation and swarming in C. elegans collective feeding using quantitative imaging and computational modeling. We show that while a combination of increased reversals upon leaving aggregates and a neighbor density-dependent increase in speed switching rates is sufficient to produce aggregation, the addition of taxis towards neighbors improves the quantitative agreement between simulations and experiments. This taxis might be driven by a shallow O2 or CO2 gradient created by a worm cluster (discussed further below), to additional chemical signals unaffected by daf-22 loss of function, or to another unknown mechanism. By extending the aggregation model to include food depletion, we show that the same behavioral mechanisms also underlie dynamic swarming in the hyper-social C. elegans strain, reminiscent of wild fires and other self-avoiding dynamics. To our knowledge, this swarming phenotype has not been reported in C. elegans previously, presumably as it requires much longer observation times (hours) and is more visually striking at large worm numbers (hundreds to thousands).
We focused on identifying phenomenological behavioral components giving rise to aggregation, while remaining agnostic as to the sensory cues causing the behaviors. The density-dependent interactions could arise from local molecular signaling, or be mediated through contact-sensing, and the 1/r dependence of the taxis interaction is compatible with a diffusible, non-degrading factor (such as CO2, or O2 depletion; dependence would likely be different for a pheromone depending on its degradation rate). Given that aggregates break up when ambient O2 concentration is reduced to 7% (Gray et al., 2004), the preferred concentration of npr-1 mutants, the most obvious candidate for the sensory cue guiding aggregation is O2 (Rogers et al., 2006). A simple hypothesis would be that oxygen consumption by worms locally lowers O2 concentration to the 5-12% preferred by npr-1 mutants, promoting their aggregation. To support this, Rogers et al. (2006) report low O2 concentrations inside worm clusters. However, non-aggregating N2 worms also prefer O2 concentrations lower than atmospheric (5-15%) (Gray et al., 2004). Furthermore, a strong reduction of oxygen concentration inside an aggregate to near 7% is unlikely based on reaction-diffusion calculations: the diffusion of oxygen through worm tissue, or their oxygen consumption, would need to be several orders of magnitude different from estimated values to create O2 gradients as steep as reported by Rogers et al. (Supplementary Figure S4). However, as worms have been reported to respond even to small changes in oxygen concentration (McGrath et al., 2009), aggregation may still be mediated through a shallower local oxygen gradient. In this scenario, high ambient O2 concentration serves as a permissive signal for aggregation and a shallow oxygen gradient helps worms to stay inside aggregates. Our agent-based simulations are entirely compatible with this picture. Further work quantifying the behavior of individual worms at different oxygen concentrations may help to distinguish oxygen as a direct cue or part of the “sensory triggers that can initiate social behavior by activating chemotaxis or mechanotaxis” (Gray et al., 2004).
Despite its extensive study in the lab, it is still unclear whether aggregation and swarming have a function in the wild. It is possible that social versus solitary foraging strategies may confer selective advantages in different food abundance, food quality, and population density environments (de Bono and Bargmann, 1998; Muhle et al., submitted). The observation that aggregating strains are less fit in laboratory conditions (Andersen et al., 2014) suggested that social feeding is not an efficient strategy at least in abundant food conditions. However, the observed fitness difference between aggregating and non-aggregating strains is actually dissociable from the feeding strategy in the lab (Zhao et al., 2018), leaving the question unresolved. Furthermore, in other systems, social feeding can increase fitness in natural environments via improved food detection and intake (Cvikel et al., 2015; Li et al., 2014; Snijders et al., 2018). It would be time consuming to experimentally measure the feeding efficiency of different behavioral strategies for a wide range of food patch sizes, distributions, and qualities. The agent-based model used in this study presents an opportunity to use a complementary approach to finding conditions that may favor social feeding.
C. elegans bridges the gap between the commonly studied micro- and macro-scales, and finding the behavioral rules underlying this mesoscale system allows us to consider principles governing collective behavior across scales. Indeed, key behavioral rules identified here for C. elegans aggregation have been observed at other scales. Spontaneous reversals have been implicated in bacterial aggregation at the microscale (Mercier and Mignot, 2016; Starruss et al., 2012; Thutupalli et al., 2015). By contrast, aggregating worms reverse mainly in response to leaving a cluster rather than spontaneously, thus requiring more complex sensory processing and behavioral response than seen in bacterial systems. Furthermore, changes in movement speed are a common feature in motility-induced phase transitions (Großmann et al., 2016; Redner et al., 2013b; Velasco et al., 2018). The emergent phenomena observed in models of interacting particles generally range from diffusion-limited aggregation to jamming at high volume fractions to flocking of self-propelled rods through volume exclusion (in two-dimensions). In contrast, aggregation in C. elegans occurs at much lower numbers of objects (tens of worms) and lower densities (area fraction of 4-6%) than typically studied in this field (thousands of objects at area fractions of 20-80%), and the density dependence of motility changes again emphasizes the role of more complex sensing and behavioral modulations common in macroscale animal groups such as fish shoals (Ward et al., 2011). Thus, collective behavior of C. elegans at the mesoscale indeed draws from both ends of the size scale and complexity spectrum, linking the physical mechanisms familiar from microscopic cellular and active matter systems with the behavioral repertoire of larger multicellular organisms.
Our approach of decomposing aggregation into component behaviors through modelling may also have applications in quantitative genetics beyond the scope of our current study. Wild isolates of C. elegans aggregate to different degrees (de Bono & Bargmann 1998) and previous work has shown that even a very small increase in the phenotypic dimensionality (from one to two) can reveal independent behavior-modifying loci (Bendesky et al., 2012). The parameters of a generative model that recapitulates the observed behavioral variation across strains might serve as a powerful set of traits for finding further behavior-modifying loci.
Acknowledgments
We thank Camille Straboni for her contributions in the early stages of this project, Mario de Bono for his gift of strain AX994, Richard Morimoto for his gift of strain AM1065, Chad Whilding and Dirk Dormann for help with setting up the imaging system, Ivan Croydon Veleslavov for contributing to the code for parameter inference, Jochen Kursawe for helpful discussions, and Suhail Islam for computational support. Some strains were provided by the CGC, which is funded by NIH Office of Research Infrastructure Programs (P40 OD010440). This work was supported by the BBSRC through grant BB/N00065X/1 to AEXB and RGE.
Competing interests
The authors declare no competing interests.
Materials and Methods
Animal maintenance and synchronization
C. elegans strains used in this study are listed in Supplementary Table 1. All animals were grown on E. coli OP50 at 20°C as mixed-stage cultures and maintained as described (Brenner, 1974). All animals used in imaging experiments were synchronized young adults obtained by bleaching gravid hermaphrodites grown on E. coli OP50 under uncrowded and unstarved conditions, allowing isolated eggs to hatch and enter L1 diapause on unseeded plates overnight, and re-feeding starved L1’s for 65-72 hours on OP50.
Bright field high-number swarming imaging
The strain used here (Figure 1A) is DA609. On imaging day, synchronized adults were collected and washed in M9 buffer twice before several hundred animals were transferred to a seeded 90 mm NGM plate using a glass pipette. After M9 is absorbed into the media, ten-hour time-lapse recordings were taken with a Dino-Lite camera (AM-7013MT) at room temperature (20°C) using the DinoCapture 2.0 software (v1.5.3.c) for maximal field of view. Two independent replicates were performed.
Bright field standard swarming imaging
The strains used here (Figure 1B) are DA609 and N2. Prior to collecting the full dataset, a single batch of OP50 was grown overnight, diluted to OD600 = 0.75, aliquoted for use on each imaging day, and stored at 4°C until use. Imaging plates were 35 mm Petri dishes containing 3.5 mL low peptone (0.013% Difco Bacto) NGM agar (2% Bio/Agar, BioGene) to limit bacteria growth. A separate batch of plates was poured exactly seven days before each imaging day, stored at 4°C, and dried at 37°C overnight with the agar side down before imaging. The center of an imaging plate was seeded with a single 20 μL spot of cold diluted OP50 one to three hours before imaging. The overnight plate drying step allowed the bacteria to quickly dry atop the media in order to achieve a more uniform lawn by minimizing the “coffee ring” effect that would thicken the circular edge of the bacteria lawn. For each imaging day, synchronized young adults were collected and washed in M9 buffer twice before 40 animals were transferred to a seeded imaging plate using a glass pipette.
Imaging commenced immediately following animal transfer in a liquid drop, on a custom-built six-camera rig equipped with Dalsa Genie cameras (G2-GM10-T2041). Seven-hour recordings with red illumination (630 nm LED illumination, CCS Inc.) were taken at 25 Hz using Gecko software (v2.0.3.1), whilst the rig maintained the imaging plates at 20°C throughout the recording durations. Images were segmented in real time by the Gecko software. The recordings were manually truncated post-acquisition to retain aggregation and swarming dynamics only. The start time was defined as the moment when the liquid dried and the all the worms crawled out from the initial location of the drop, and the end time was when the food was depleted and worms dispersed with increased crawling speed. Twelve independent replicates were performed for each strain.
Bright field big patch swarming imaging
The experiments here (Supplementary Figure S1A) are identical to those in the bright field standard swarming imaging, except for two differences. First, the imaging plates were seeded with a 75 μL spot of diluted OP50 (OD600 = 0.38) and allowed to inoculate overnight at room temperature before being used for imaging the next day. Second, recordings were taken over 20 hours instead of seven. Eight independent replicates were performed for each strain.
Bright field pheromone imaging
The strains used here (Supplementary Figure 2A) are DA609, N2, DR476, and AX994. Bacteria aliquots and imaging plates were prepared as in the bright field standard swarming imaging assay. For each imaging day, synchronized young adults were collected and washed in M9 buffer twice before 40 animals were transferred to a seeded imaging plate using a glass pipette. After M9 was absorbed into the media following worm transfer in liquid, imaging plates containing the animals were subjected to a gentle vibration at 600 rpm for 10 s on a Vortex Genie 2 shaker (Scientific Industries) to disburse animals and synchronize aggregation start across replicates. Imaging commenced 20 s after the vibration finish, using the same rig setup as swarming imaging above, except one-hour recordings were taken. Images were segmented in real time by the Gecko software. At least eight independent replicates were performed for each strain. Automated animal tracking was performed post-acquisition using Tierpsy Tracker software (http://ver228.github.io/tierpsy-tracker/, v1.3), which we developed in-house (Javer et al., 2018). Images with were tracked with customized parameters to create centroid trajectories, 49-point worm skeletons, and a battery of features.
Fluorescence aggregation imaging
The strains used here (Figure 2) are OMG2, OMG10, OMG19, and OMG24. One-color imaging consisted of pharynx-GFP labeled worms only, whereas two-color imaging also included a small number of body wall muscle-RFP labeled worms that were recorded simultaneously on a separate channel (thus readily segmented from the rest of the worms). The latter was necessary to follow individuals over a long period of time, particularly while inside a cluster, as frequent pharynx collisions inside clusters lead to lost individual identities and broken trajectories. For two-color imaging, animals with different fluorescent markers were mixed in desired proportion (1-3 red animals out of 40 per experiment) during the washing stage before being transferred together for imaging.
The data collection paradigm was identical to the bright field pheromone imaging assay in terms of bacteria aliquots, imaging plate preparation, and vibration implementation following animal transfer. The difference is that image acquisition was performed on a DMI6000 inverted microscope (Leica) equipped with a 1.25x PL Fluotar objective (Leica), a TwinCam LS image splitter (Cairn) with a dichroic cube (Cairn), and two Zyla 5.5 cameras (Andor) to enable simultaneous green-red imaging with maximal field of view. One-hour recordings were taken with constant blue (470 nm, 0.8A) and green (cool white, 1.4A) OptoLED illumination (Cairn), and images were acquired with 100 ms exposure at 9 Hz using Andor Solis software (v4.29.30005.0). The microscopy room was maintained at 21°C throughout the recording durations. Ten or more independent replicates were performed for each strain. We were able to reproduce stereotyped aggregation dynamics across replicates under our experimental paradigm (Supplementary Figure S1B). Image segmentation and automated animal tracking was performed post-acquisition using Tierpsy Tracker software (v1.3) with customized parameters, to create centroid trajectories, obtain two-point skeleton from pharynx-labeled individuals and 49-point midline skeletons from body wall muscle-marked ones, and extract various features. For body wall muscle-marked animals, trajectories were manually joined where broken due to tracking errors.
Fluorescence aggregation tracking data analysis
Tracked blobs were filtered for minimum fluorescence intensity and maximum area, to exclude any larvae and tracking artifacts, respectively, which appeared on the occasional plate. Local worm densities around each individual were calculated using k-nearest neighbor density estimation, where the density is k divided by the area of a circle encompassing the k-th nearest neighbor. We chose k = 6 ≈ √2 and verified based on visual assessment that the overall distribution of local densities changes very little with increasing k.
Reversals were detected based on a change of sign of speed from positive to negative, which was calculated from the dot-product of the skeleton vector (of the pharynx) and the velocity vector, and smoothed with a moving average over half a second. We only counted reversals that were at least 50 µm in length, and that moved at least half a pixel per frame before and after the reversal. Reversal events thus detected where binned by their local density. For each density bin, reversal rate was estimated as the number of events divided by the time spent in forward motion for that bin. The variability was estimated using a subsampling bootstrap: the reversal rate was estimated 100 times, sampling worm-frames with replacement, and estimating mean and standard deviation.
Speed profiles were generated by binning the measured speed values for local density, and then creating a histogram of speed values for each density bin.
Summary statistics of aggregation, such as pair-correlation and hierarchical clustering, where calculated as described in Supplementary Methods.
Supplementary Figures
Supplementary Movie Captions
Supplementary Movies can be viewed at https://tinyurl.com/ybmdsnag.
Supplementary Movie S1. Sample movie showing npr-1 collective feeding dynamics (bright field high-number swarming imaging). The movie plays at 300x the normal speed.
Supplementary Movie S2. Sample movie showing npr-1 collective feeding dynamics (fluorescence 40 worm aggregation imaging). The movie plays at 90x the normal speed.
Supplementary Movie S3. A single event showing switch from high to low motility state prior to cluster entry. The red worm at the bottom (arrow) decreases speed before entering a cluster. Inset: midbody absolute speed of that individual with respect to time 0 as the point of the head entering a cluster; open blue circle shows the current speed matched to the movie frame.
Supplementary Movie S4. A single event showing switch from low to high motility state prior to cluster exit. The red worm increases speed before exiting a cluster. Inset: midbody absolute speed of that individual with respect to time 0 as the point of the head exiting a cluster; open blue circle shows the current speed matched to the movie frame.
Supplementary Movie S5. Sample model (with taxis) simulation describing npr-1 mutants. The movie plays at 30x the normal speed.
Supplementary Movie S6. Sample model (with taxis) simulation describing N2.
The movie plays at 30x the normal speed.
Supplementary Movie S7. Sample swarming simulation describing npr-1 mutants. The movie plays at 30x the normal speed.