Skip to main content
eLife logoLink to eLife
. 2020 Jun 8;9:e57093. doi: 10.7554/eLife.57093

Whole-organism behavioral profiling reveals a role for dopamine in state-dependent motor program coupling in C. elegans

Nathan Cermak 1,, Stephanie K Yu 1,, Rebekah Clark 1,, Yung-Chi Huang 1, Saba N Baskoylu 1, Steven W Flavell 1,
Editors: Manuel Zimmer2, Ronald L Calabrese3
PMCID: PMC7347390  PMID: 32510332

Abstract

Animal behaviors are commonly organized into long-lasting states that coordinately impact the generation of diverse motor outputs such as feeding, locomotion, and grooming. However, the neural mechanisms that coordinate these distinct motor programs remain poorly understood. Here, we examine how the distinct motor programs of the nematode C. elegans are coupled together across behavioral states. We describe a new imaging platform that permits automated, simultaneous quantification of each of the main C. elegans motor programs over hours or days. Analysis of these whole-organism behavioral profiles shows that the motor programs coordinately change as animals switch behavioral states. Utilizing genetics, optogenetics, and calcium imaging, we identify a new role for dopamine in coupling locomotion and egg-laying together across states. These results provide new insights into how the diverse motor programs throughout an organism are coordinated and suggest that neuromodulators like dopamine can couple motor circuits together in a state-dependent manner.

Research organism: C. elegans

eLife digest

Animals generate many different motor programs (such as moving, feeding and grooming) that they can alter in response to internal needs and environmental cues. These motor programs are controlled by dedicated brain circuits that act on specific muscle groups.

However, little is known about how organisms coordinate these different motor programs to ensure that their resulting behavior is coherent and appropriate to the situation. This is difficult to investigate in large organisms with complex nervous systems, but with 302 brain cells that control 143 muscle cells, the small worm Caenorhabditis elegans provides a good system to examine this question.

Here, Cermak, Yu, Clark et al. devised imaging methods to record each type of motor program in C. elegans worms over long time periods, while also dissecting the underlying neural mechanisms that coordinate these motor programs. This constitutes one of the first efforts to capture and quantify all the behavioral outputs of an entire organism at once.

The experiments also showed that dopamine – a messenger molecule in the brain – links the neural circuits that control two motor programs: movement and egg-laying. A specific type of high-speed movement activates brain cells that release dopamine, which then transmits this information to the egg-laying circuit. This means that worms lay most of their eggs whilst traveling at high speed through a food source, so that their progeny can be distributed across a nutritive environment.

This work opens up the possibility to study how behaviors are coordinated at the level of the whole organism – a departure from the traditional way of focusing on how specific neural circuits generate specific behaviors. Ultimately, it will also be interesting to look at the role of dopamine in behavior coordination in a wide range of animals.

Introduction

As animals explore their environments, their nervous systems transition between a wide range of internal states that influence how sensory information is processed and how behaviors are generated (Anderson and Adolphs, 2014; Artiushin and Sehgal, 2017; Liu and Dan, 2019). These internal states of arousal, motivation, and mood typically alter many ongoing behaviors, impacting motor circuits that control diverse behavioral outputs such as feeding, grooming, and locomotion. A full understanding of how internal states are generated should explain how they coordinate the production of many complex motor outputs.

Neuromodulators play a central role in generating internal states. For example, neuropeptides like orexin and pigment dispersing factor (PDF) promote brain-wide states of wakefulness in mammals and flies, respectively (Saper et al., 2010; Taghert and Nitabach, 2012). In awake animals, norepinephrine controls arousal and attention (Aston-Jones and Cohen, 2005; Carter et al., 2010), the neuropeptides Tac2 and CRH induce states of heightened anxiety (Füzesi et al., 2016; Kormos and Gaszner, 2013; Zelikowsky et al., 2018), and the neuropeptides AgRP and NPY promote behaviors associated with hunger (Chen et al., 2019; Krashes et al., 2013). The anatomical organization of neuromodulatory systems makes them well-suited to impact a wide range of motor outputs: the projections of neuromodulator-producing neurons are typically very diffuse, targeting many brain regions. However, our mechanistic understanding of how neuromodulatory regulation of CNS circuits is propagated to diverse motor outputs remains limited.

In the simple nematode C. elegans, it should be feasible to determine how internal states influence every behavioral output of the animal. The C. elegans nervous system consists of 302 neurons, which act on 143 muscle cells (White et al., 1986). C. elegans generates a well-defined repertoire of motor programs, each with a devoted motor circuit and muscle group: locomotion, egg-laying, feeding, defecation, and postural changes of the head and body (de Bono and Maricq, 2005; Collins et al., 2016; Pirri et al., 2009; Schafer, 2005; Stephens et al., 2008). Quantitative studies of C. elegans locomotion have shown that animals switch between long-lasting behavioral states. In an extreme case, C. elegans animals cease all behaviors as they enter sleep-like states during development and after periods of stress (Nichols et al., 2017; Raizen et al., 2008; Van Buskirk and Sternberg, 2007). Awake animals in a food-rich environment switch between roaming and dwelling states, where they either rapidly explore the environment or restrict their movement to a small area (Ben Arous et al., 2009; Flavell et al., 2013; Fujiwara et al., 2002; Stern et al., 2017). After removal from food, C. elegans generates an area-restricted search state before switching to a dispersal state (Gray et al., 2005; Hills et al., 2004; López-Cruz et al., 2019; Wakabayashi et al., 2004). Like the internal states of mammals, these behavioral states in C. elegans last from minutes to hours and the transitions between states are abrupt. It remains unclear how the full repertoire of C. elegans behaviors is coordinated as awake C. elegans animals switch between behavioral states.

Neuromodulation in C. elegans plays a pivotal role in behavioral state control (Chase and Koelle, 2007; Li and Kim, 2008). Serotonin initiates and maintains dwelling states, while the neuropeptide PDF initiates and maintains roaming states (Choi et al., 2013; Flavell et al., 2013; Horvitz et al., 1982; Rhoades et al., 2019; Sawin et al., 2000; Stern et al., 2017). In addition, dopamine, tyramine, and octopamine influence behaviors associated with the presence or absence of food (Alkema et al., 2005; Chase et al., 2004; Horvitz et al., 1982; Sawin et al., 2000; Stern et al., 2017). The C. elegans sleep-like state is also strongly influenced by neuropeptides, including NLP-8, FLP-13, and FLP-24, and ligands for the NPR-1 receptor (Choi et al., 2013; Iannacone et al., 2017; Nath et al., 2016; Nelson et al., 2014). Command-like neurons that release neuromodulators are capable of driving state changes: the serotonergic NSM neurons induce dwelling states (Flavell et al., 2013; Rhoades et al., 2019) and the peptidergic ALA neuron evokes a sleep-like state (Hill et al., 2014; Nath et al., 2016; Nelson et al., 2014). However, there is not a one-to-one mapping between neuromodulators and specific states. For example, although serotonin release from NSM drives dwelling, serotonin release from ADF neurons has no apparent effect on dwelling and instead impacts other behaviors (Flavell et al., 2013). Likewise, ALA releases at least three neuropeptides that have unique yet overlapping functions to inhibit downstream behaviors during sleep (Nath et al., 2016). However, each of these neuropeptides is also produced by other neurons that do not induce sleep. Thus, individual neuromodulators may exert different effects during different states and their combinatorial actions might give rise to the widespread behavioral changes that accompany each state.

In this study, we examine how neuromodulation coordinates diverse behavioral outputs to give rise to state-dependent changes in behavior. First, we describe a new imaging platform that permits simultaneous, automated quantification of each of the main C. elegans motor programs. Then we analyze hours-long behavioral recordings to fully characterize the behavioral states of this animal. Finally, we identify a dopaminergic pathway that couples multiple motor programs together as animals switch behavioral states, revealing that dopamine promotes egg-laying in a locomotion state-dependent manner. Our study provides new insights into how the diverse motor programs throughout an organism are coordinated and suggests that neuromodulators like dopamine can couple motor circuits together in a state-dependent manner.

Results

The distinct motor programs in C. elegans are coordinated with one another

To examine how the distinct C. elegans motor programs are coordinated, we designed and constructed tracking microscopes and an accompanying software suite that permits simultaneous, automated measurement of numerous behaviors (Figure 1A; Figure 1—figure supplement 1). The microscope, which shares several design features with previously described microscopy platforms (Yemini et al., 2013; see also Faumont and Lockery, 2006; Nguyen et al., 2016; Venkatachalam et al., 2016), collects brightfield images of individual animals (Figure 1B) at a frequency of 20 Hz and resolution of 1.4 um/pixel, which is sufficient to capture the most rapid and small-scale movements of C. elegans, such as pharyngeal motion (Avery and You, 2012; Lockery et al., 2012). A closed-loop tracking system reliably keeps animals in view over hours or days, while live data compression makes storage of approximately 1.7 million images per animal per day feasible. Although the parameters for data collection that we use here are tailored to C. elegans recordings, this low-cost, open-source microscopy platform should be useful for recordings of many small animals (see Materials and methods for links to parts list and build tutorial).

Figure 1. Simultaneous measurement of the diverse C. elegans motor programs.

(A) Image of the tracking microscope. (B) Example image of a C. elegans animal from the tracking microscope. Green line denotes detected outline of worm; red line indicates worm’s centerline, obtained by thinning the thresholded image; blue line is the centerline as reconstructed from a spline-based 14-parameter representation. (C–E) Example dataset from the tracking microscope, showing the main C. elegans motor programs over 6 hr (C), 1 hr (D), or 10 min (E). (F) Average behaviors observed while animals travel at different velocities. Data are from 30 wild-type animals, and data points were separated into bins based on instantaneous velocity. The average motor outputs in each bin are plotted. For angular velocity and feeding rate, data are shown as medians, as well as 25th and 75th percentiles. For egg-laying rate and defecation rate, data are shown as mean event rates (gray lines indicate random samples). For posture, data were segregated into four bins ranging from −0.25 mm/sec to 0.25 mm/sec. For each bin, we analyzed posture in two ways: by identifying and displaying the four most commonly observed postures of the 100 compendium postures described in Figure 2 (top), or by plotting 2D histograms of the projection amplitudes of the four eigenworms (middle). Eigenworm analysis was conducted using the full datasets using previously described methods (Stephens et al., 2008; and see Materials and methods) and then the projection amplitudes in each velocity bin were plotted as 2D histograms.

Figure 1.

Figure 1—figure supplement 1. Schematic of the tracking microscope.

Figure 1—figure supplement 1.

An infrared LED trans-illuminates the sample from above via a diffuser and a condenser lens. Light from the sample (red line) is collected by a low-magnification objective underneath the sample, and relayed via mirrors through a tube lens and finally onto a CMOS camera. For clarity, this schematic omits a dichroic mirror, laser diode, and long-pass filter enabling optogenetic stimulation or fluorescence imaging. All the optics (including the transillumination LED, diffuser, and condenser lens) are mounted on a platform that can translate over 100 mm in the X and Y axes. The stage is mounted to a third linear actuator that moves up and down, providing focusing. All linear actuators are controlled by a driver board containing three stepper driver modules (one per axis). The driver board in turn is controlled by the computer, which adjusts the microscope’s motion based on the location of the worm in the camera image. The further the worm’s center of mass is from the middle of the image, the further the microscope is instructed to move.
Figure 1—figure supplement 2. Extraction of behavioral parameters from video recordings, and validation of methods.

Figure 1—figure supplement 2.

(A) Movement path of C. elegans animal during recording on tracking microscope. Path is color-coded by velocity (black is slow; red is fast; blue is reverse). (B) Example speed traces over a 6 hr recording of a wild-type animal. Gray shows speed calculated with a 1 s time step; red shows it calculated with a 10 s time step. (C) Body angles are accurately captured by 14-point parameterization. Data are body angles from a worm in one example frame. Centerline angles are compressed to a 14-point vector consisting of weights for a spline basis (basis functions shown as grey lines). (D) Body angles over a five-minute example dataset. Missing data (due to self-intersecting loops in body posture) are in black. (E) The defecation motor program (DMP) is detectable as a stereotyped pattern of body length contractions. Top line shows body length over 10 min. Bottom shows the data after filtering with a kernel approximating the shape of the DMP body contraction. The filter enables straightforward thresholding to detect defecation events (red dots). (F) Ten sequential defecation events are shown, revealing the stereotyped nature of body contractions during defecation events. (G) Validation of DMP detection. For three animals recorded on different microscopes, we compared the automated detection of DMP events to manual user annotation for a random 30 min segment of each video. Rasters indicate detected DMPs. Inset confusion matrix indicates accuracy. (H) Egg-laying events are detectable via instantaneous increases in body width. Example of an egg-laying event, with the widths of the dorsal and ventral sides of the body shown. Note that the width increases at the mid-body suddenly (arrowhead), reflecting the presence of an egg in this location, immediately adjacent to the animal’s body. This increase is limited to the ventral side, where the vulval muscles are located. (I) Image of a worm at the moment of an egg-laying event for the dataset in (H). (J) Validation of egg-laying detection. For three animals recorded on different microscopes, we compared the automated detection of egg-laying events to manual user annotation for all six hours of each video. Rasters indicate detected egg-laying events. Inset confusion matrix indicates accuracy. (K) Pharyngeal pumping is detected via movement of the grinder. Two sequential frames (50 ms apart) illustrating pharyngeal pumping. Pumping involves rapid retraction of the grinder, relative to the posterior end of the terminal bulb. (L) The grinder and posterior end of the terminal bulb can be detected as local minima in centerline brightness profiles. Heatmap shows brightness along the centerline for the first 160 μm of the worm’s length. Red and blue arrows show the positions of the grinder and posterior end of the terminal bulb, respectively. (M) Six sequential frames of the data in (L), plotted as line traces. Traces are offset for clarity. Red and blue dots denote the detected position of the grinder and the posterior end of the terminal bulb. (N) Pumping is clearly visible as negative peaks in the distance between the grinder and the posterior end of the terminal bulb. Plot is a time series of the distance between the grinder and posterior end of the terminal bulb, showing oscillations (pumps) at roughly 5 Hz. Red ticks at the bottom denote detected pumps. (O) Validation of pumping detection. For 35 short (20 s.) video segments (taken from 15 different recordings), we compared the automated detection of pumping rates to manual annotation by users watching videos in slow motion. R2 value is 0.9671, p<0.0001.
Figure 1—figure supplement 3. Event-triggered averages showing behavioral coordination surrounding egg-laying and DMP events.

Figure 1—figure supplement 3.

(A) Event-triggered behavioral averages surrounding egg-laying events. Velocity, angular velocity, feeding rate, and defecation rate are shown as medians ± 25th and 75th percentiles (gray lines indicate random samples of identical size). Average body posture is shown as a heatmap of angles along the body. (B) Event-triggered behavioral averages surrounding DMP events, shown as in (A). n = 30 animals.

We developed a software suite that allows us to automatically extract measurements of each of the main C. elegans motor programs from these video recordings. Because C. elegans is transparent, each animal movement – including movements inside the body, like those of the pharynx – is visible during brightfield imaging. Using this software suite, we are able to extract: body/head posture, locomotion, egg-laying, defecation, and pharyngeal pumping (i.e. feeding). Extracting body posture and locomotion was straightforward, except during omega bends (see Materials and methods) (Stephens et al., 2008Figure 1B; Figure 1—figure supplement 2A–D), However, the detection of egg-laying, defecation, and pumping required us to implement tailored machine vision algorithms (Figure 1—figure supplement 2E–O; see Materials and methods). To ensure the reliability of our measurements, we compared the automated scoring of egg-laying, defecation, and pumping to manually scored data and found a high level of concurrence (Figure 1—figure supplement 2G,J,O). These advances now allow us to extract near-comprehensive records of each animal’s behavior from hours-long recordings. The resulting datasets capture behavioral outputs over multiple timescales: from milliseconds-scale postural changes to hours-long behavioral states (Figure 1C–E shows an example dataset at multiple time resolutions).

To examine how the distinct motor programs of C. elegans are coordinated over time, we first analyzed the relationships between each behavioral variable. We examined data from 30 adult well-fed wild-type animals, each recorded for six hours on a homogenous E. coli food source. To determine how each behavioral output varies as a function of locomotion, we examined average behavioral outputs across different animal velocities (Figure 1F). Egg-laying events were predominant during rapid forward locomotion, while defecation events were most commonly observed during slow or reverse movement. We also examined typical body postures as a function of velocity in two ways. First, we identified the most commonly observed body postures at different velocities (top of Figure 1F shows most common postures out of 100 reference postures; see below). Second, we plotted 2D histograms of the eigenmodes of the angles along the body when animals traveled at different velocities (Figure 1F, middle) (Stephens et al., 2008). Differences in the amplitudes of the eigenmodes correspond to differences in body postures. From these histograms and from the set of most common body postures, it is evident that the postures that animals express co-vary considerably with velocity, suggesting that animals sample different body postures at different velocities (Figure 1F). We also examined average behaviors that surround egg-laying and defecation events by plotting event-triggered averages (Figure 1—figure supplement 3). These analyses revealed many of the same relationships between the behavioral outputs, but also showed that egg-laying and defecation events each occur during stereotyped posture and locomotion changes, as has been previously reported (Collins et al., 2016; Hardaker et al., 2001; Nagy et al., 2015). We conclude from these analyses that there is extensive coordination between the distinct C. elegans motor programs.

Unsupervised classification of C. elegans behavioral states based on postural changes

To understand how these behaviors are coupled together over longer time scales, we sought to identify the long-lasting behavioral states that wild-type animals generate, so that we could determine which motor outputs are observed in each state. Unsupervised learning can reveal the underlying states that generate observed behavioral variables (Berman et al., 2014; Marques et al., 2018; Wiltschko et al., 2015). We and others have previously applied hidden Markov models (HMMs) to C. elegans locomotion parameters, which identifies roaming and dwelling states, as well as quiescence/sleep under certain conditions (Flavell et al., 2013; Gallagher et al., 2013). However, there may be a broader set of behavioral states that differ along other behavioral axes. To identify such states, we performed unsupervised discovery on the animal’s body posture (Figure 2A), which is the most complex behavioral variable and is coordinated with the other motor programs.

Figure 2. Identifying behavioral states through time series analysis of C. elegans posture.

(A) Schematic showing that body posture is quantified as a vector of relative body angles, from head to tail. (B) Compendium of 100 reference postures that encompass the range of typical C. elegans postures. The compendium was derived by hierarchical clustering of many observed postures. (C) Transition matrix that shows probability of transitioning from each reference posture to the others. Self-transitions were excluded from this analysis. The rows of the matrix were clustered, and reference postures are sorted according to their cluster membership (eight clusters total; white boxes). (D) Average transition rates between postures within the same cluster, versus average transition rates between postures in different clusters. **p<0.01, Wilcoxon signed rank test. (E) Average behaviors in each hidden state. Velocity is shown as a violin plot, while other behaviors are shown as averages across 30 wild-type animals. Data are means ± standard error of the mean (SEM). ‘Average Motion’ here is defined as the average standard deviation of each of the 14 body angles over 2 s intervals throughout the state, which measures the degree to which body angles change over rapid timescales. Short reversals were backwards movements that lasted <4 s; long reversals lasted >4 s. **p<0.001, behaviors vary across states, Friedman test. (F) Average egg-laying frequency as a function of animal velocity, during roaming and dwelling states. Within each state, data points were segregated into bins based on ongoing animal velocity and egg-laying frequency was calculated across all the data points in each bin. Bins with <4 min of data per animal were excluded due to an insufficient quantity of data to warrant analysis. n = 30 animals. Error shading indicates 95% confidence intervals. **p<0.05, roaming vs dwelling, Bonferroni-corrected permutation test. *p<0.05, positive correlation of velocity versus egg-laying, empirical bootstrap test.

Figure 2.

Figure 2—figure supplement 1. Locomotion during the 100 compendium postures.

Figure 2—figure supplement 1.

Average animal velocity across 30 animals during each of the 100 compendium postures. Postures are ordered by posture group. Note that most posture groups (which contain different numbers of postures; see Figure 2C) contain a mixture of postures that are typically displayed during forwards and backwards movement.
Figure 2—figure supplement 2. Additional analyses related to Posture-HMM.

Figure 2—figure supplement 2.

(A) A compendium of reference postures can explain most of the variance of observed animal postures. Increasing the number of postures in the compendium leads to a higher percentage of variance explained, though the impact of adding more postures diminishes gradually (i.e. plateaus). Red diamond indicates the number of reference postures used in all related analyses in this study. (B) Clustering of the transition matrix between discrete body postures maximally separates posture groups when eight clusters (red diamond) are used. ‘Transition value’ is the average intra-group (i.e. intra-cluster) transition rate divided by the average inter-group transition rate. Based on this criterion, the optimal number of clusters was eight. (C) Silhouette value when clustering the 3 s binned posture data in preparation for HMM training. Based on this criterion, the optimal number of clusters was eight. (D) BIC value for HMMs trained with varying numbers of hidden states. Based on this criterion, the best fit to the data was with a nine-state HMM. (E) These plots assess the similarity of 200 different 9-state HMMs that were trained on recorded animal data. 100 of the HMMs were trained on data from one group of animals (animal group A) and the other 100 were trained on data from a separate group of animals (animal group B). The model parameters were initialized randomly for each of the HMMs, which could in principle impact the final model parameters. The two heat maps show the dissimilarity between each pair of models trained from the two groups of animals, providing an indication of how reliably the models converged to similar parameters when they were initialized with different starting conditions. Model dissimilarity is defined here as the average Euclidean distance between the rows of the emission matrices for the two HMMs being compared. A value of 0 (black) would indicate essentially identical model parameters. The 100 HMMs from each animal group are ordered along the x- and y-axes based on their fit to the full set of wild-type data, measured as the log-likelihood of the model given the observed animal data. Note that the best fit HMMs (at the left of the x-axis; and top of the y-axis) have very similar parameters to one another (black color). This suggests that HMMs trained from different starting conditions that provided a good fit to the animal data had very similar model parameters. Panel F compares the best fit HMMs trained from each group of animals. (F) Comparison of the best fit HMMs from animal group A and animal group B shows that the training converged to a very similar solution, despite having totally independent training datasets and different random initial conditions. Data are displayed as heatmaps depicting the transition and emission matrices of the two HMMs. HMM parameters from both states are depicted in each quadrant, separated by a diagonal line (as depicted).
Figure 2—figure supplement 3. Further characterization of behavioral states from Posture-HMM.

Figure 2—figure supplement 3.

(A) Top: for each state, the most common postures observed (out of the 100 compendium reference postures; Figure 2B) while animals are in the state are shown. The postures exhibited in each of the nine states are significantly different from those exhibited in all other states (p<0.05, Bonferroni-corrected permutation test). Middle: standard deviation of body angles from head to tail across all data points where animals were in the state, providing a measure of how much the body angles vary within the state. Bottom: HMM structure learned from behavioral recordings. Arrows between states depict transition probabilities, while arrows directed to posture groups depict emission probabilities. Arrow thickness indicate probabilities. (B) An example of quiescence behavior in a wild-type animal. Although the tracking approach that we use in the study is able to identify bouts of quiescence, these bouts were extremely infrequent (five bouts detected in 30 wild-type animals recorded for six hours each) under the experimental recording conditions used here.
Figure 2—figure supplement 4. Analysis of the dwelling sub-modes.

Figure 2—figure supplement 4.

(A) Example behavioral data from a wild-type animal showing raw posture data and an ethogram indicating the animal’s behavioral state, inferred from the posture-HMM. The color legend for the ethogram can be found in panel C. (B) Average durations of the nine HMM states. n = 30 animals. (C) Schematic indicating the transition probabilities between the nine HMM states. Arrow thickness indicates transition probability from the learned HMM parameters. For clarity, self-transitions and transitions with probabilities lower than 0.02 are excluded from the image. (D) Average time spent in each of the nine HMM states over the six hour duration of each recording. Data are averaged across 30 animals.
Figure 2—figure supplement 5. The posture-HMM generates posture sequences that resemble those from real animals.

Figure 2—figure supplement 5.

(A) Heat maps showing the differences between synthetic posture sequences and real posture sequences for three different models of postural transitions during dwelling (see Materials and methods for full description). Each datapoint in each heatmap indicates the absolute value of the difference between synthetic data and real animal data with regards to the average duration of time between two postures (indicated by rows and columns). Lower (blue) values indicate a closer match to real animal data. Plots were constructed the same way for the three alternative models. n = 2174 observations on average for each pair of postures across all real and synthetic data. (B) Average sum of the squares of the errors for the synthetic posture sequences generated by each indicated model, as compared to real animal posture sequences. Error here is defined as the difference between synthetic data and real animal data with regards to the average duration of time between two given postures. Thus, these values are essentially the sum of the squares of the values across the entire matrices in panel A. **p<0.001, Permutation test.
Figure 2—figure supplement 6. Locomotion surrounding egg-laying events.

Figure 2—figure supplement 6.

(A) Egg-laying rates over the durations of roaming states. All roaming states were ‘stretched’ so that they could be properly aligned (t = 0 is the onset of the roaming states), and then the normalized egg-laying rates over the durations of the states were plotted. Note that egg-laying rate are high during most of the roaming states. However, rates are not as high at the very beginnings of these state and the rates are still high for a short while after roaming states terminate. Data are from 1573 roaming states across 30 animals. (B) Event-triggered average of velocity, aligned to egg-laying events. This panel only shows data surrounding egg-laying events that were embedded in roaming states (animal roamed from −1 min to +1 min). (C) Event-triggered average of velocity, aligned to egg-laying events. This panel only shows data surrounding egg-laying events that were during dwelling states.
Figure 2—figure supplement 7. Stereotyped behavioral changes accompany state transitions.

Figure 2—figure supplement 7.

Event-triggered averages are shown for velocity, pumping, and DMPs surrounding the moments of specific types of posture-HMM state transitions, indicated by the rows and columns. Above: we show all data for transitions where we obtained >250 examples of the state transition, so that we excluded noisy measurements. Bottom: zoomed in example of one of the event-triggered averages. Statistical analysis was performed to compare average data values surrounding state transitions (−5 s to +5 s) to random samples of behaviors typical of each state. Measured data at actual state transitions were compared to random samples to determine an empirical p-value. The p-values were multiplied by 480 to correct for the large number of comparisons (three different behaviors, 40 state transitions, two data bins before and after state transitions). *p<0.01, after Bonferroni correction. Data are from 30 wild-type animals.

To describe postural changes in a compact manner, we used a previously described approach where we learned a compendium of reference postures that encompasses the broad range of body postures that animals display (Figure 2A–BSchwarz et al., 2015). To describe posture at any time point, we match the actual posture of an animal to its most similar match in the compendium. We then constructed a transition matrix that describes the probability of switching from each posture to the others (Figure 2C). Clustering the rows of this matrix revealed a striking, symmetric block-like structure, indicating that there are groups of postures, which we term ‘posture groups,’ that animals transition back and forth between (Figure 2C–D; 11.9-fold higher transition rate to postures within the same group). The postures within individual groups included those emitted during both forward and reverse movement (Figure 2—figure supplement 1), indicating that the time spent in a given posture group can span multiple forward-backward transitions. This organization suggests some degree of long-term stereotypy in how animals emit their postures while exploring a bacterial food lawn.

To more precisely characterize this long-term stereotypy, we fit an HMM where the emissions are essentially these posture groups (see Materials and methods; Figure 2—figure supplement 2A–C). Based on Bayesian information criteria (BIC) estimates, a model with nine hidden states provided the best fit to the recorded data (Figure 2—figure supplement 2D). Importantly, we reliably converged to the same model parameters, even when training was performed on different sets of animals and from different random starting conditions (Figure 2—figure supplement 2E–F). These results suggest that the posture-HMM can provide a reliable description of postural changes over time.

Posture-HMM identifies the roaming state and distinct sub-modes of dwelling

To understand the behavioral states that were captured by the HMM (Figure 2—figure supplement 3A), we first examined locomotion parameters in each of the states. One of these behavioral states consisted of high forward velocity, low angular speed and typically lasted from tens of seconds to many minutes (Figure 2E). Based on these parameters, this state is equivalent to the previously defined roaming state (Figure 2E; labeled ‘Roam’) (Ben Arous et al., 2009; Flavell et al., 2013; Fujiwara et al., 2002). Animals traveled at lower velocities during the other eight states, but, in contrast to quiescence/sleep states, they maintained high pumping and defecation rates in each (Figure 2E). To maintain consistency with previous literature, we describe these as dwelling sub-modes (Dwell1-8; see Video 1 for examples). Quiescence states were not recovered from this analysis because this state was almost never observed under our recording conditions (only five ~20 s bouts identified in ~180 hr of data; Figure 2—figure supplement 3B).

Video 1. Examples of behavioral states captured through posture-HMM.

Download video file (2.5MB, mp4)

This video shows examples of the nine different behavioral states identified through posture-HMM. Note that videos are of different durations and are looped.

Because these dwelling sub-modes had not been previously described, we characterized them further. Whereas five of these states (Dwell2,3,4,5,8) reflected almost completely paused movement, the other three states consisted of characteristic movements: animals displayed steady, slow forward locomotion in Dwell1 (Figure 2E; see movement direction and average motion), a high incidence of active reversing in Dwell7 (Figure 2E; see average motion and long reversal rates), and a wider range of head and neck movements in Dwell6 (Figure 2—figure supplement 3A; see standard deviation of angles along body); Moreover, animals displayed stereotyped body postures in each of the dwelling sub-modes that were significantly different from one another (Figure 2—figure supplement 3A; Video 1). For example, animals in Dwell4 displayed a reliably flat body posture with only very shallow bends (Figure 2—figure supplement 3A; see most common postures). The average duration of each sub-mode was ~10 s (Figure 2—figure supplement 4A–B) and animals transitioned between them in a non-random fashion: the transition rates between many sub-modes were close to zero, whereas other transition rates were quite high (Figure 2—figure supplement 4C–D). This suggests that animals transition between these distinct sub-modes of dwelling in an organized fashion.

We considered whether segmenting dwelling into these discrete sub-modes provides a better description of postural changes during dwelling than simpler models where animals continuously switch between postures without any further temporal structure. To investigate this, we asked whether posture sequences generated by the posture-HMM provided a better match to posture sequences from real animals, compared to simpler alternatives. We compared the posture-HMM to two alternative models: (1) a model involving continuous transitions between postures, where the probability of each posture transition was determined by our measurements from real animals (Figure 2C); and (2) a model involving continuous transitions between postures, where the probability of each posture transition was determined by the similarity between postures. We generated synthetic posture sequences from each model and quantified how well they matched the sequences from real animals by measuring the average duration of time between each of the 100 compendium postures in the synthetic and real animal data (Figure 2—figure supplement 5A). This metric captures the higher order patterns in which animals emit their postures, but does not assume any particular underlying structure. Based on this criterion, the posture sequences generated by the posture-HMM were a significantly better match to the sequences from actual animals, compared to the alternative models (Figure 2—figure supplement 5B). These results, together with the BIC analysis described above (Figure 2—figure supplement 2D), suggest that the posture-HMM provides a robust description of how animals transition between distinct postures during dwelling.

Coordinated changes in multiple motor programs during behavioral states and state transitions

Having examined how posture and locomotion differ across these distinct states, we next quantified the occurrence of other motor programs in roaming states and each dwelling sub-mode (Figure 2E). Egg-laying rates were highest during roaming, whereas the dwelling sub-modes had smaller, but significant, differences in their egg-laying rates. This is consistent with previous observations that egg-laying is often accompanied by increased movement (Hardaker et al., 2001; McCloskey et al., 2017). Previous work showed that animals display an acute reduction in speed immediately after egg-laying (Hardaker et al., 2001). We found that this rapid speed change is present after egg-laying events during roaming and dwelling, but is less pronounced when eggs are laid during roaming (Figure 2—figure supplement 6). Defecation rates were also significantly different between the nine states, but feeding rates were the same across the states (Figure 2E). Taken together, these data suggest that animals transition between a high-velocity/high-egg-laying roaming state and different sub-modes of dwelling in which they display distinct body postures and motor programs.

Animals also displayed stereotyped changes in multiple motor programs at the moments when they switched between behavioral states (Figure 2—figure supplement 7). We characterized these effects by examining event-triggered averages timed to each type of behavioral state transition. We found that the state transitions were accompanied by transient and reliable changes in velocity, pumping, and defecation rates (Figure 2—figure supplement 7). For example, transitions from Dwell2 to Dwell4 were preceded by a high incidence of defecation motor program (DMP) events (immediately before the transition), followed by a transient increase in velocity and a reduction in feeding. These observations further confirm that the posture-HMM identified state transitions that correspond to reliable changepoints in behavior and suggest that animals display reliable, multimodal behavioral trajectories as they switch between these stereotyped postural states.

Dopamine signaling promotes egg-laying during roaming states

We next sought to identify and characterize the neural circuits that allow animals to coordinate their motor programs across behavioral states. Here, we focused on the coupling between the roaming state and egg-laying, since this was the most robust form of motor program coupling that we detected and it could be easily measured using our new microscopy platform. We considered whether the increased frequency of egg-laying during roaming could be fully explained by animals laying eggs more frequently when they move faster. Thus, we examined egg-laying frequency as a function of velocity within roaming and within dwelling. While there was a positive correlation between velocity and egg-laying rate within each state, we observed a universally higher egg-laying rate during roaming compared to dwelling, even when matched for velocity (Figure 2F). These results suggest that animals lay more eggs while traveling at high speeds, particularly during high-speed roaming states.

To test whether neuromodulation is critical for the coupling between locomotion state and egg-laying, we examined mutants lacking biogenic amine and neuropeptide neuromodulators. For each mutant, we characterized the time spent in each behavioral state and the motor outputs within each state (Figure 3A). States were defined consistently across genotypes using parameters learned from wild-type animals. Serotonin-deficient tph-1 mutants displayed reduced dwelling, higher speeds during roaming, reduced feeding, and fewer egg-laying events, as has been previously described (Figure 3A–BAvery and You, 2012; Flavell et al., 2013; Hobson et al., 2006; Horvitz et al., 1982). However, the increase in egg-laying rates during roaming states was largely intact, suggesting that serotonin is dispensable for this form of motor program coupling. pdfr-1 mutants, deficient in PDF neuropeptide signaling, displayed a broad defect in roaming states: they spent less time roaming, traveled at lower velocity while roaming, and did not bias their egg-laying to the state as robustly as wild-type animals. Thus, although pdfr-1 mutants are defective in locomotion and egg-laying during roaming, this may be part of a general deficit in their ability to display roaming states (Flavell et al., 2013), rather than a specific deficit in motor program coupling. tdc-1 mutants that are defective in tyramine and octopamine displayed increased time in the roaming state. However, their egg-laying rates were still higher while roaming. tbh-1 mutants defective in octopamine synthesis showed a mild increase in their roaming velocity, but no deficit in egg-laying. Overall, these mutants point to important roles for neuromodulation in regulating behavioral states in C. elegans, but do not provide insights into the coupling of egg-laying with the roaming state.

Figure 3. Analysis of neuromodulation mutants reveals a role for dopamine in state-dependent egg-laying.

(A) Behavioral parameters of animals of the indicated genotypes across the posture-HMM states. Black dots indicate significant changes; *p<0.05, Bonferroni-corrected Mann-Whitney U test. The cat-2 mutant displayed here is the n4547 allele. (B) On food pharyngeal pumping rates in the neuromodulation mutants (data are pooled across all states). **p<0.001, Bonferroni-corrected Mann-Whitney U test. For (A–B), n = 10–30 animals per genotype. (C) Overall egg-laying rates in the cat-2 null mutants. *p<0.01, Mann-Whitney U test. (D) Egg-laying rates during roaming and dwelling states in two different dopamine-deficient cat-2 null mutant strains. *p<0.05, Mann-Whitney U test. **p<0.001, Mann-Whitney U test. For (C–D), n = 10–30 animals per genotype. (E) Egg-laying rates during roaming and dwelling for mutant animals lacking specific dopamine receptors. **p<0.01, Bonferroni-corrected Mann-Whitney U test. n = 9–30 animals. All data are shown as means ± SEM.

Figure 3.

Figure 3—figure supplement 1. Additional behavioral analysis of mutant strains.

Figure 3—figure supplement 1.

(A) The postures that cat-2 mutant animals display during roaming are similar to those displayed by wild-type. Data are histograms of percent time in each of the eight posture groups during roaming for the indicated genotypes. ANOVA shows no effect of genotype on posture group prevalence. (B) Behavioral parameters across the 9-states for animals of the indicated genotypes. Black dots indicate significant changes; *p<0.05, Bonferroni-corrected Mann-Whitney U test. (C) Introduction of cat-2 genomic fragment into cat-2(n4547) mutants elevates egg-laying rates during roaming. n = 10–30 animals per genotype. †p=0.0757, Mann-Whitney U test. (D) Egg-laying rates during roaming and dwelling for egl-1 mutant animals. **p<0.001, Mann-Whitney U test. n = 21 animals for egl-1 and n = 30 animals for WT. (E) Velocity of mutant animals lacking specific dopamine receptors. n = 9–30 animals per genotype. All data are shown as means ± SEM.
Figure 3—figure supplement 2. Full behavioral parameters of the dopamine receptor mutant animals.

Figure 3—figure supplement 2.

Behavioral parameters during each of nine HMM states are shown for animals of the indicated genotypes. Black dots indicate significant changes; *p<0.05, Bonferroni-corrected Mann-Whitney U test. All data are shown as means ± SEM.

In contrast, dopamine-deficient cat-2 mutants displayed a striking loss of coupling between egg-laying and the roaming state. Although these animals displayed robust roaming states, their egg-laying rate was dramatically reduced during roaming (Figure 3A). In contrast, their egg-laying rate during the dwelling state was unaltered. cat-2 animals travel at a higher velocity than wild-type animals while roaming (Figure 3A), but still display the same postures (Figure 3—figure supplement 1A), indicating that they are not broadly defective in the locomotor components of roaming (Sawin et al., 2000). Because they have unaltered egg-laying rates during dwelling, which is the more prevalent state, there is only a modest reduction in egg-laying overall in these mutant animals (Figure 3C). This suggests that they are not broadly defective in egg-laying, a finding that is consistent with the fact that they were not recovered as egg-laying defective (egl) in forward genetic screens. To ensure that this motor coupling phenotype was caused by the loss of the cat-2 gene, we examined a second, independent null allele of cat-2 and found that it caused a similar phenotype (Figure 3C–D; Figure 3—figure supplement 1B). In addition, we rescued cat-2 expression in the mutant via a transgene and found that this restored higher egg-laying rates during roaming (Figure 3—figure supplement 1C). These data suggest that dopamine is necessary for proper coupling of egg-laying to the roaming state and highlights the value of simultaneously quantifying multiple ongoing motor programs within the animal.

We considered whether the reduced egg-laying rates of cat-2 mutants during roaming, but not dwelling, might be due to a floor effect, where the egg-laying rates during dwelling cannot be further reduced. To test for potential floor effects, we recorded mutant animals with deficits in the egg-laying motor circuit (egl-1). These animals showed a dramatic reduction in egg-laying during both roaming and dwelling states (Figure 3—figure supplement 1D), suggesting that floor effects do not account for the cat-2 phenotype.

To further characterize the dopaminergic pathway that couples egg-laying and locomotion during roaming, we examined mutants lacking each of the seven known dopamine receptors in C. elegans (Figure 3E; Figure 3—figure supplement 1E; Figure 3—figure supplement 2). None of these single mutants showed any egg-laying phenotypes. However, we found that mutant animals lacking the two D2-like dopamine receptors, dop-2 and dop-3, displayed reduced egg-laying rates during roaming, but not dwelling, closely matching the cat-2 mutant phenotype. These results suggest that dop-2 and dop-3 act together to regulate egg-laying during the roaming state.

In analyzing these mutant datasets, we considered whether the egg-laying phenotypes of the dopamine mutants could be due to an indirect effect, where increased forward velocity during roaming in dopamine pathway mutants reduces egg-laying. However, an analysis of velocity and egg-laying rates across the receptor mutants suggests that this is not the case: dop-2;dop-3 double mutants display normal velocities during roaming (Figure 3—figure supplement 1E), but have dramatically reduced egg-laying rates during roaming (Figure 3E). This interpretation that the egg-laying effects are not due to locomotion changes is further corroborated by our optogenetics findings below. Altogether, these mutant analyses suggest that dopamine acts through the D2-like receptors DOP-2 and DOP-3 to promote egg-laying during the roaming state.

The coupling between egg-laying and roaming states enhances the dispersal of eggs across a food source

Animals might coordinate their locomotion and egg-laying in order to lay their eggs in locations that are advantageous for the survival of their progeny. For example, it might be adaptive for animals to broadly disperse their eggs across beneficial environments. We considered how the increased frequency of egg-laying during the roaming state might impact the spatial distribution in which eggs are laid as animals explore a food source. Specifically, we asked whether eggs laid during the roaming state are more dispersed throughout the environment than eggs laid during dwelling, and whether deficits in dopamine signaling reduce the dispersal of eggs. First, to examine the proximity of eggs to one another, we measured the average distance between each egg and its k nearest neighbors (varying the number of k from 1 to 10). As expected, we found that eggs laid during roaming were farther apart from other eggs compared to those laid during dwelling (Figure 4A). To gain a more complete view of how animals distributed their eggs, we next measured the extent to which animals dispersed their eggs across the entire area that they explored. This was quantified by virtually superimposing a grid on the animal’s movement path and counting the number of the squares where at least one egg was laid (normalized to the number of squares where the animal traveled; Figure 4B). This analysis also revealed a greater dispersal of eggs during roaming (Figure 4C). Moreover, dopamine-defective mutants (both cat-2 and dop-2;dop-3) displayed a significant reduction in egg dispersal (Figure 4C). Consistent with these results, cat-2 and dop-2; dop-3 mutants both laid a higher fraction of their eggs during dwelling, as compared to roaming (Figure 4—figure supplement 1). These data suggest that the coupling of egg-laying to the roaming state increases the dispersal of eggs across a food source, which could have important implications for the survival of an animal’s progeny.

Figure 4. The coupling between egg-laying and roaming states leads to greater dispersal of eggs along a food source.

(A) Average distance between a given egg and its k nearest eggs for wild-type animals, separated out for eggs laid while roaming and dwelling. *p<0.01, roaming versus dwelling for all k > 3, Bonferroni-corrected Wilcoxon ranked sign test. n = 30 animals. Data are means ± SEM. (B) Schematic of the assay for egg dispersal used in panel C. A grid is virtually superimposed upon the animal’s movement path and the number of squares that contain at least one egg is counted and divided by the number of squares where the animal explored. (C) Egg dispersal overall, as well as during roaming and dwelling, for WT (n = 30), cat-2(n4547) (n = 10), and dop-2;dop-3 (n = 19), quantified as the fraction of regions explored with egg-laying events. See panel B for a schematic of the assay. Data are means ± SEM. **p<0.0001, Wilcoxon signed rank test. *p<0.05, Mann-Whitney U test.

Figure 4.

Figure 4—figure supplement 1. Fraction of eggs laid per state in dopamine pathway mutants.

Figure 4—figure supplement 1.

Quantification of the fraction of eggs that were laid in each of the nine HMM states. Note that this measurement is distinct from egg-laying rate in each state, since this metric also takes into account the time spent in each state. *p<0.05, Bonferroni-corrected Mann-Whitney U test. All data are shown as means ± SEM.

Acute changes in dopaminergic neuron activity control state-dependent egg-laying

Our genetic analyses are consistent with the possibility that dopamine signaling plays a direct role in elevating egg-laying rates during the roaming state. To examine whether dopamine acutely regulates egg-laying, we performed optogenetic studies to alter the activity of the neurons that release dopamine. To silence dopaminergic neurons, we used the dat-1 promoter (Flames and Hobert, 2009; Jayanthi et al., 1998) to drive expression of the GtACR2 anion channel (Govorunova et al., 2015) in all four dopaminergic cell types: CEPV, CEPD, ADE, and PDE (no single-neuron promoters have been described for any of these four cell types). Exposing these animals to light caused them to display lower egg-laying rates that persisted until the light was terminated (Figure 5A; additional controls in Figure 5—figure supplement 1A). We asked whether this effect reflected a reduction in egg-laying during roaming, dwelling, or both states by separately analyzing egg-laying rates during each of the states during the lights-on period (Figure 5B). This analysis indicated that the silencing of dopaminergic neurons reduced egg-laying rates while animals were roaming, but only had a mild, non-significant effect during dwelling. We examined the other behaviors automatically quantified by the tracking microscopes but observed no significant effects of dopaminergic neuron silencing on feeding or defecation, and only a small, transient effect on locomotion (Figure 5—figure supplement 1B–E). These data corroborate our genetic findings and suggest that dopaminergic neurons function to acutely promote egg-laying in adult roaming animals.

Figure 5. Optogenetic control of dopaminergic neurons alters egg-laying.

(A) Inhibition of dopaminergic neurons via activation of dat-1::GtACR2 reduces egg-laying rates. Data are shown as egg-laying rates, normalized to pre-stimulation baseline rates. Gray lines show wild-type animals stimulated with the same light pattern. **p<0.0001, Wilcoxon signed rank test. (B) Average egg-laying rates during light exposure for dat-1::GtACR2 and wild-type animals. Data are shown as overall rates, as well as rates during roaming and dwelling states specifically. *p<0.05, Mann-Whitney U test. For (A–B), n = 416 light stimulation events across 12 animals for dat-1::GtACR2, and n = 769 light events across 22 animals for wild-type. (C–D) Activation of dopaminergic neurons via activation of dat-1::CoChR increases egg-laying rates. Data are shown as in (A–B). **p<0.001, Wilcoxon signed rank test. *p<0.05 Mann-Whitney U test. n = 1221 light stimulation events across 35 animals for dat-1::CoChR, and n = 769 light events across 22 animals for wild-type. (E–F) Effects of dat-1::CoChR activation in animals that are in the absence of food. Data are shown as in (A–B), except only overall egg-laying rates are shown since animals do not roam/dwell in the absence of food. *p<0.05, Mann-Whitney U test. **p<0.0001, Wilcoxon signed rank test. n = 387 light stimulation events across 44 animals for dat-1::CoChR, and n = 327 light events across 38 animals for wild-type. Data are means ± SEM.

Figure 5.

Figure 5—figure supplement 1. Additional optogenetic studies and analysis.

Figure 5—figure supplement 1.

(A) No effect of laser illumination on egg-laying rates in the absence of all-trans retinal (ATR) co-factor for dat-1::GtACR2 animals. n = 12 animals. (B) Average velocity during light exposure for wild-type, dat-1::CoChR, and dat-1::GtACR2 animals for experiments conducted in the presence of food. Note that the dat-1::CoChR and dat-1::GtACR2 groups have transient changes in velocity upon light activation and termination. These changes on their own cannot explain egg-laying effects, which are persistent during the lights-on period. n = 416–1221 light stimulation events across 12–35 animals for the three genotypes. (C) Average velocity for dat-1::GtACR2 animals during lights-off and lights-on periods. n = 12 animals. (D) Average pharyngeal pumping for dat-1::GtACR2 animals during lights-off and lights-on periods. n = 12 animals. (E) Average defecation rates for dat-1::GtACR2 animals during lights-off and lights-on periods. n = 12 animals. (F) Average velocity for dat-1::CoChR animals during lights-off and lights-on periods. n = 35 animals. (G) Average pharyngeal pumping for dat-1::CoChR animals during lights-off and lights-on periods. n = 35 animals. (H) Average defecation rates for dat-1::CoChR animals during lights-off and lights-on periods. n = 35 animals. (I) No effect of laser illumination on egg-laying rates in the absence of all-trans retinal (ATR) co-factor for dat-1::CoChR animals. n = 10 animals. (J) Effects of dat-1::CoChR activation on velocity in the absence of food. Consistent with previous studies, we observe a robust reduction in speed when dopaminergic neurons are activated in the absence of food. WT control shows no effect of the light alone. n = 327–385 light stimulation events across 38–44 animals. All data are shown as means ± SEM.

To examine whether exogenously increasing dopaminergic activity levels is sufficient to drive egg-laying, we acutely activated the four dopaminergic cell types. For these experiments, we used the dat-1 promoter to drive expression of CoChR, a light-gated cation channel (Klapoetke et al., 2014). Activation of dat-1::CoChR for three minute durations caused animals to display elevated egg-laying rates (Figure 5C; minimal effects on velocity, Figure 5—figure supplement 1B and F–H; additional controls in Figure 5—figure supplement 1I). This increase in the rate of egg-laying persisted throughout the period of light exposure and was not necessarily time-locked to the moment of light onset. By contrast, acute activation of the egg-laying motor neuron HSN is known to trigger egg-laying events within seconds of light exposure (Emtage et al., 2012; Leifer et al., 2011). These data suggest that increased dopaminergic neuron activity increases the frequency of egg-laying events.

The observation that dopamine is necessary for proper egg-laying rates during roaming, but not dwelling, might be explained by elevated dopamine release during roaming. Alternatively, dopaminergic activity might be similar across states, but downstream circuits might integrate their detection of dopamine with a locomotion state variable, such that dopamine only enhances egg-laying during roaming. To begin to distinguish between these possibilities, we asked whether the ectopic activation of dopaminergic neurons via optogenetics could increase egg-laying during roaming, dwelling, or both states. We found that light exposure to dat-1::CoChR animals elevated egg-laying during the dwelling state, but not during roaming (Figure 5D). The finding that the exogenous activation of dopaminergic neurons during dwelling is sufficient to increase egg-laying argues against a model where downstream circuits only respond to dopamine during roaming, but not dwelling. The finding that dat-1::CoChR activation does not further enhance egg-laying during roaming may reflect an occlusion effect, perhaps due to the already high egg-laying rates during roaming.

We again considered whether these effects of dopamine on egg-laying could be explained by an indirect effect on locomotion. We analyzed the velocity changes induced by optogenetic dopaminergic neuron silencing and activation. These two manipulations, which caused opposite effects on egg-laying, caused the same velocity change: a transient decrease in speed at light onset and a transient increase in speed at light offset (Figure 5—figure supplement 1A). Therefore, the effects of these opposing optogenetic manipulations on egg-laying cannot be plausibly explained as an indirect consequence of altering locomotion.

Animals have dramatically lower egg-laying rates when they are removed from their food source. Because dopamine signaling is thought to be elevated in the presence of food (Sawin et al., 2000; Tanimoto et al., 2016), we asked whether increasing dopaminergic neuron activity in the absence of food was sufficient to increase egg-laying rates. Strikingly, we found that activation of dat-1::CoChR could drive animals to lay eggs in the absence of food at significantly higher rates (Figure 5E–F; velocity in Figure 5—figure supplement 1J). Altogether, these data suggest that native dopaminergic neuron activity in adult animals increases the probability of egg-laying during roaming states, and that exogenous dopaminergic neuron activity during dwelling or in the absence of food is sufficient to enhance egg-laying rates.

Calcium dynamics in dopaminergic PDE neurons are phase-locked to egg-laying during roaming states

The above data suggest that dopamine release can enhance egg-laying and that native dopaminergic signaling in wild-type animals primarily promotes egg-laying during the roaming state. One possible explanation for these observations is that dopamine release might predominate during high-speed roaming. Thus, we next examined the native activity patterns of dopaminergic neurons in freely-moving animals. We constructed a transgenic strain expressing GCaMP6m under the dat-1 promoter and recorded GCaMP signals in freely-moving animals using widefield imaging, as has been previously described (Flavell et al., 2013; Rhoades et al., 2019). The CEPD, CEPV, and ADE classes of neurons appeared to have static calcium levels while animals explored food and did not display dynamics that were dependent on locomotion speed (Figure 6—figure supplement 1A). However, the dopaminergic PDE neurons displayed robust calcium dynamics as animals freely explored a food lawn (Figure 6A–B). PDE neurons have short ciliated sensory dendrites that protrude through the cuticle along the dorsal side of the animal in the posterior section of the body. The PDE axon travels along the ventral nerve cord, from the posterior to the anterior end of the animal. Notably, PDE is the only dopaminergic neuron whose neurite passes in close proximity to the egg-laying circuit and vulval muscles.

Figure 6. Dopaminergic PDE neurons display activity patterns phase-locked to egg-laying during roaming.

(A) PDE dynamics increase with animal speed. PDE dynamics here is defined as the absolute value of the time derivative of the PDE GCaMP signal. **p<0.001, empirical bootstrap test. (B) Example dataset from a wild-type animal, showing PDE::GCaMP6m signal, body posture (shown as body angles, from head to tail), and animal velocity. (C) Correlation coefficient of PDE activity with each of the 14 body angles. *p<0.05, empirical bootstrap test (Bonferroni-corrected). (D) Example dataset showing how PDE activity (indicated by color) changes as animals proceed through stereotyped forward propagating bends during roaming. Theta values on the polar plot correspond to the phase of the forward propagating bend; radius corresponds to the depth of the body bends (which was quantified as the standard deviation of the mean-subtracted body angles). Corresponding body postures and the direction of the trajectories during forward movement are indicated. Note that PDE activity reliably increases during a specific phase of the forward propagating bend. (E) Average PDE activity at different phases of the forward propagating bend. Theta values are defined as in (D) and the radius indicates the mean PDE GCaMP signal. **p<0.001, Mann-Whitney U test. (F) Histogram depicting frequency of egg-laying events for wild-type animals at different phases during the forward-propagating bend. **p<0.001, Rayleigh z test. (G) Histogram depicting frequency of egg-laying events for cat-2 mutants at different phases during the forward-propagating bend. *p<0.05 versus wild-type, Fisher’s exact test. For (A), (C), and (E), n = 39 animals and data are shown as means ± SEM. For (F) and (G), n = 30 and 10 animals, respectively.

Figure 6.

Figure 6—figure supplement 1. Additional analyses related to PDE activity and egg-laying.

Figure 6—figure supplement 1.

(A) Dynamics of ADE, CEPD, and CEPV do not vary with animal speed. Dynamics here is defined as the absolute value of the time derivative of the GCaMP signal for each neuron. n = 22–28 animals per condition. (B) Average PDE calcium dynamics for animals traveling at different speeds in different states. Calcium dynamics are defined here as the absolute value of the time derivative of the GCaMP signal. N = 39 animals. *p<0.001, roaming versus dwelling, Mann-Whitney U test. (C) Correlation between each of the body angles and PDE activity during dwelling states. N = 39 animals. *p<0.05, empirical bootstrap test (Bonferroni-corrected). (D) Average PDE GCaMP activity during forward-propagating bends for animals recorded in the absence of food. There is significantly reduced activity at the peak phase relative to animals on food (p<0.05, Mann-Whitney U test). n = 56 animals off food and n = 39 animals on food. (E) Average PDE GFP signal during forward-propagating bends for animals recorded in the presence of food. Compare to actual PDE::GCaMP signal in Figure 6E. n = 12. (F) Average correlations of PDE::GFP signal with body curvature. Compare to actual PDE::GCaMP signal in Figure 6C. n = 12. (G) Average postural changes for the five seconds that precede egg-laying events in roaming versus dwelling states. Data are shown as average trajectories through PCA space, where the two axes are the projection amplitudes of the third and fourth eigenworms (see Figure 1F for full 2D histograms; the third and fourth eigenworms are most relevant to undulatory locomotion). Note that the posture trajectories differ in the seconds preceding egg-laying, even though they converge to be almost the same at the moment of egg-laying. n = 30 animals. (H) Histogram depicting phases of the propagating forward bend that wild-type animals display overall, shown as same format as in Figure 6G–H. n = 30 animals. (I) Histogram depicting phases of the propagating forward bend that cat-2 mutants display overall. Note that there is no significant difference between wild-type and cat-2. n = 10 animals. For (A–G), data are shown as means ± SEM.

To quantify how PDE activity changes during locomotion, we first quantified the extent to which PDE dynamics depend on locomotion. We found that fluctuations in PDE calcium levels were significantly increased during high-speed movement (Figure 6A), particularly during roaming (Figure 6—figure supplement 1B), a relationship that resembles how animal movement is coupled to egg-laying (Figure 2F). As animals moved, PDE activity was highly correlated with the animal’s body curvature. PDE was most active when the dorsal body wall muscles were contracted on the posterior end of the body (Figure 6B shows an example; Figure 6C shows correlations). This correlation between posture and PDE activity was present during roaming and dwelling (Figure 6C; Figure 6—figure supplement 1C). However, when animals are roaming, repeating waves of muscle contractions pass through the body from head to tail. Thus, one result of the correlation between PDE activity and body curvature was that PDE activity oscillated during roaming and was significantly elevated during a specific phase of each sinusoidal propagating wave (Figure 6D shows an example; Figure 6E shows averages). Because PDE has an exposed sensory ending, we examined whether this activity pattern was impacted by the presence of bacterial food in the environment. Indeed, we found that PDE displayed significantly reduced dynamics during forward locomotion in the absence of food (Figure 6—figure supplement 1D). These relationships between PDE fluorescence and body posture were not observed when imaging PDE::GFP (instead of GCaMP), indicating that they were not due to motion artifacts (Figure 6—figure supplement 1E–F). These data indicate that PDE calcium levels oscillate during forward movement on food, with a reliable activity peak during a specific phase of the forward propagating wave during roaming.

Previous studies suggested that egg-laying events also depend on body curvature (Collins et al., 2016), so we also quantified the frequency of egg-laying events during each sinusoidal propagating wave of muscle contractions during roaming. Indeed, egg-laying events were strongly biased to a specific phase of the sinusoidal wave (Figure 6F). Notably, the phase of maximal PDE activity overlapped with and shortly preceded the phase of maximal egg-laying. These postural changes that preceded egg-laying during roaming were distinct from those during that preceded egg-laying events during dwelling, even though animals adopted similar postures in both states at the precise moment of egg-laying (Figure 6—figure supplement 1G). These data indicate that the animal’s gait during roaming leads to a unique coupling of body curvature to egg-laying, in a manner that causes PDE activity to shortly precede the typical body posture for egg-laying.

This relationship raised the possibility that dopamine release during roaming might not only promote egg-laying events overall, but might also bias them to occur during a specific phase of the sinusoidal wave. To test this possibility, we examined the distribution of egg-laying events in dopamine-deficient cat-2 mutants and found that there was a significant decrease in the phase-dependence of egg-laying (Figure 6G). This difference was not due to a general change in body postures during roaming, since wild-type animals and cat-2 mutants displayed similar postures during forward propagating waves while roaming (Figure 6—figure supplement 1H–I). Together, these data suggest that the activity of dopaminergic PDE neurons is phase-locked to egg-laying events during roaming and that dopamine signaling is required for proper coordination of body posture and egg-laying during roaming.

GABAergic signaling is required for dopamine-induced egg-laying

We next sought to identify the downstream circuits through which dopaminergic neurons act to elevate egg-laying rates. To begin to identify these downstream components, we examined whether specific neurons or neurotransmitters were necessary for dopamine-dependent egg-laying. Egg-laying in C. elegans requires contraction of the vulval muscles, which receive many synapses from HSN and VC neurons and a smaller number of synapses from cholinergic VA/VB neurons and GABAergic VD neurons. We optogenetically activated dopaminergic neurons in mutant animals lacking each of these four inputs: (1) egl-1 mutants lacking HSNs, (2) lin-39 mutants lacking VCs, (3) acr-2 mutants with reduced cholinergic neuron activity, and (4) unc-25 mutants with abolished GABAergic transmission (Figure 7A shows fold-change in egg-laying during lights-on, compared to lights-off). dat-1::CoChR activation still elevated egg-laying rates in acr-2 mutants, suggesting that cholinergic transmission in ventral cord neurons is not essential for these effects. However, dat-1::CoChR activation had a reduced effect in egl-1 and lin-39 mutants and failed to elevate egg-laying rates in unc-25 mutants. The finding that HSN and VCs are required for dopamine-induced egg-laying is not surprising, since these motor neurons are centrally involved in driving egg-laying, but the role of GABAergic signaling in egg-laying has not been well-studied, so we examined this interaction more closely.

Figure 7. Dopamine elevates egg-laying in a GABA-dependent manner.

Figure 7.

(A) Effects of dat-1::CoChR activation in genetic mutants with disrupted components of egg-laying circuitry. Data are shown as the fold increase in egg-laying during lights-on period, compared to lights-off period (a value of 1 indicates no effect of the light on egg-laying). *p<0.05, Mann-Whitney U test. n = 9–35 animals per genotype. (B) Two independent null mutants lacking unc-25, which is required for GABA synthesis, have an altered profile of egg-laying. Data are shown as average eggs laid per day, with the first day being the first 24 hr after L4. *p<0.05 and **p<0.01, effect of genotype in two-factor ANOVA and post-hoc pairwise Dunnett test. n = 5–10 animals per genotype. (C) Percent of eggs laid during roaming and dwelling for two independent null mutants of unc-25, which are defective in GABA synthesis. Here, we display data in this format to normalize for the reduced brood size in unc-25. *p<0.05, Mann-Whitney U test. **p<0.001, Mann-Whitney U test. n = 11–30 animals per genotype. (D) Egg-laying in the absence of food is elevated in unc-25 mutants. Data are shown as a ratio of eggs laid off food divided by eggs laid on food. **p<0.01 and †p<0.1 in ANOVA and post-hoc pairwise Dunnett test. n = 5–6 plates per genotype, each with 10 animals per plate.

In C. elegans, GABA is produced by a small set of neurons in the head and tail, and by the VD/DD motor neurons in the ventral cord. To clarify which neurons mediate dopamine-dependent egg-laying, we activated dat-1::CoChR in unc-30 mutants, which lack GABA in the VD/DD neurons, but not in the other GABAergic cell types in the head and tail (Figure 7A). We found that dat-1::CoChR failed to elevate egg-laying in unc-30 mutants, indicating that GABA production by VD/DD neurons is critical for this effect.

A previous study showed that application of muscimol, a GABAA receptor agonist, strongly inhibits egg-laying (Tanis et al., 2009), but the effects of reducing GABAergic signaling on egg-laying had not been previously examined. Thus, we performed experiments to clarify the role of native GABAergic signaling in egg-laying. Here, we compared wild-type animals to two independent unc-25 null mutant strains, which both have attenuated GABA synthesis. Compared to wild-type animals, unc-25 mutants had a slightly lower brood size (~220 eggs per animal vs. ~280 in wild-type) and laid their eggs over their first 5–6 days of adulthood, versus 3–4 days in wild-type animals (Figure 7B). As a result, unc-25 mutants displayed lower overall egg production during their first day of adulthood, but higher egg production as five- and six-day old adults (Figure 7B). We examined state-dependent egg-laying in these animals and found that, after adjusting for their lower egg production, one-day old unc-25 mutants displayed a relative increase in egg-laying during dwelling, as compared to roaming (Figure 7C). To test whether GABA also regulates egg-laying across environmental conditions, we examined egg-laying in the absence of food and found that unc-25 mutants displayed an elevated egg-laying rate off food, compared to wild-type animals (Figure 7D). Altogether, these results indicate that native GABAergic signaling regulates egg-laying, specifically playing an inhibitory role during dwelling and in the absence of food. This inhibitory role is consistent with the previous finding that muscimol inhibits egg-laying (Tanis et al., 2009). Given that GABAergic signaling is required for dopamine-dependent egg-laying, one possible explanation for these effects is that dopamine release may inhibit GABAergic neurons that function to inhibit egg-laying.

Discussion

Behavioral states impact the generation of diverse motor outputs, but the neural mechanisms that allow them to exert these widespread effects are poorly understood. To examine this problem at whole-organism scale, we developed a new method that permits simultaneous, automated quantification of diverse C. elegans motor programs over long time scales. Analysis of these near-comprehensive records of animal behavior show that there is extensive coordination between the different motor programs of this animal. By combining this approach with genetics and optogenetics, we uncovered a new role for dopamine in promoting egg-laying in a locomotion state-dependent manner. Our results provide new insights into how the diverse motor programs throughout an organism are coordinated and suggest that neuromodulators like dopamine can couple motor circuits together in a state-dependent manner.

To understand how internal states are represented in the brain, it is critical to obtain a quantitative description of the full repertoire of behaviors that are influenced by a given state. The transparency of C. elegans allows us to observe each of the motor actions of this animal, even the movements of internal muscle groups like the pharynx. Thus, by using tracking microscopes and machine vision software, we simultaneously quantified the diverse motor programs of this animal. These datasets revealed widespread coordination among distinct motor programs. For example, roaming and dwelling states that were previously described based on locomotion parameters also show robust differences in other motor programs, like egg-laying. Moreover, dwelling states can be segmented into different sub-modes based on reliable differences in body posture and other motor programs. We note that so far our analyses have been limited to well-fed adult animals exploring a homogeneous E. coli food source. The structure of C. elegans behavior could be quite different when animals are different ages (Stern et al., 2017), exposed to different stimuli, or in different physiological states. For example, quiescence/sleep was not observed under our recording conditions, but this state occurs frequently in other conditions. Several factors likely contribute to the coupling between diverse motor programs, such as: changing internal state variables and recruitment of neuromodulators (Donnelly et al., 2013; Flavell et al., 2013; Pirri et al., 2009; Raizen et al., 2008; Van Buskirk and Sternberg, 2007), corollary discharges and related motor signals that allow motor circuits to interact (Gordus et al., 2015; Liu et al., 2018), and proprioceptive or environmental feedback (Goodman and Sengupta, 2019; Hu et al., 2011; Li et al., 2006; Wen et al., 2012; Yeon et al., 2018). Combining the whole-organism behavioral profiling approach described here with recently-developed whole-brain calcium imaging approaches (Kato et al., 2015; Nguyen et al., 2016; Venkatachalam et al., 2016; Yemini and Hobert, 2020) could yield a more complete understanding of which neural mechanisms are at work.

To begin to clarify neural mechanisms that underlie the coordination between motor programs, we investigated a particularly robust form of motor program coupling: the increased frequency of egg-laying during high-speed roaming states. In wild-type animals exposed to a food source, egg-laying rates are approximately six-fold higher during roaming as compared to dwelling. Based on our analysis of the spatial distribution in which eggs are laid, this coupling allows animals to effectively disperse their eggs throughout a food resource. This might serve as an effective ‘bet-hedging’ strategy to increase the likelihood that at least some of the progeny develop in a beneficial environment. We found that dopamine signaling was required for motor program coupling: mutants with reduced dopamine levels had lower egg-laying rates during roaming but not dwelling. Previous work has shown that native dopamine signaling in C. elegans is involved in driving slow locomotion in response to a bacterial food lawn, an effect called the basal slowing response (Sawin et al., 2000). Indeed, we observed increased forward velocity in cat-2 mutants (Figure 3A). However, multiple lines of evidence suggest that the effects of dopamine on egg-laying are separable from those on locomotion: (1) dop-2; dop-3 dopamine receptor mutants have reduced egg-laying during roaming, but normal roaming velocities (Figure 3E; Figure 3—figure supplement 1E), and (2) optogenetic silencing and activation of dopaminergic neurons have opposite effects on egg-laying, even though they have the same modest effect on locomotion. We have not yet mapped out where the dop-2 and dop-3 receptors function to control egg-laying, though it is intriguing that dop-3 is known to be expressed in VD/DD neurons (Chase et al., 2004) in light of our observation that optogenetic dopaminergic neuron activation fails to elevate egg-laying in GABA-deficient mutants (Figure 7A). Further studies will be necessary to determine if dopamine acts directly on GABAergic neurons or signals to a different set of dop-2- and dop-3-expressing neurons to regulate egg-laying.

How does dopamine influence egg-laying rates during the roaming state, but not during dwelling? One possibility is that dopamine release dynamics differ in roaming compared to dwelling. Alternatively, downstream targets could integrate their detection of dopamine with a locomotion state variable, such that dopamine only enhances egg-laying during roaming. Our results argue against the latter, since elevating dopaminergic neuron activity during dwelling is sufficient to increase egg-laying. Moreover, in vivo calcium imaging revealed increased calcium fluctuations in dopaminergic PDE neurons during high-speed roaming. Specifically, we observed that PDE calcium levels oscillate during forward movement, peaking during a stereotyped phase of the forward propagating bend that overlaps with and shortly precedes the peak phase of egg-laying during roaming. We have not yet determined the underlying mechanism that drives these changes in PDE activity. However, since PDE is a ciliated sensory neuron that expresses mechanoreceptors like trp-4 (Kang et al., 2010; Li et al., 2011; Sawin et al., 2000), it is possible that PDE might be activated by the animal’s own movement or by the increased flow of external food along the body during high-velocity roaming. In favor of the latter possibility, we found that PDE dynamics were reduced in the absence of food. Thus, it is possible that PDE receives environmental feedback that indicates the degree of movement along a food source. This type of environmental feedback is known to occur for other sensory modalities – for example, optic flow provides animals with visual feedback of how they are progressing through a visual scene. Although the dopaminergic ADE, CEPV, and CEPD neurons did not display calcium dynamics correlated to behavioral changes, it is possible that tonic levels of dopamine release from these neurons could also play a functional role in egg-laying.

The egg-laying circuit consists of the HSN command neuron and VC, VB, and VD neurons that innervate the vulval muscles. We mapped out downstream effectors of dopamine by optogenetically activating dopaminergic neurons in mutant backgrounds lacking candidate neurons and neurotransmitters. These experiments showed that HSN and VC neurons are important for dopamine’s effects on egg-laying and that GABAergic signaling in VD/DD neurons is required for these effects. Recent studies have shown that GABA receptors are found on a multitude of C. elegans neurons that do not receive direct synaptic inputs from GABAergic neurons, including HSN and VCs (Yemini and Hobert, 2020). Given that VD/DD neurons have GABA release sites in close physical proximity to the egg-laying circuit, it is possible that GABA acts extrasynaptically to influence egg-laying.

It is widely appreciated that neuromodulation contributes to behavioral state control, but the widespread behavioral changes that occur across states make it challenging to understand each neuromodulatory system’s specific contribution. The systematic approach described here reveals that in C. elegans dopamine elevates egg-laying rates during the roaming state. Previous work showed that PDF neuropeptides drive high-speed locomotion typical of the state and have a more modest effect on egg-laying. The combined actions of these neuromodulators and others likely give rise to the full set of behavioral parameters that define the roaming state, though the nature of their interactions will require additional studies. Recent studies of mammalian anxiety states have shown that individual neuromodulators like Tac2 neuropeptides can themselves also function in parallel circuits to control different behaviors (Zelikowsky et al., 2018). Studies of fixed action patterns in invertebrates also revealed parallel functions of single neuropeptides in distinct circuits (Kim et al., 2006; Scheller et al., 1982). The whole-organism behavioral profiling approach that we describe here allows the behavioral changes that differ across states to be more fully characterized, as opposed to being analyzed one behavior at a time. Such a level of understanding will be essential to reveal the neural mechanisms that underlie the generation of these brain-wide states.

Materials and methods

Key resources table.

Reagent type
(species) or resource
Designation Source or reference Identifiers Additional information
Strain, strainbackground (E. coli) OP50 CGC ID_FlavellDatabase:OP50 OP50
Strain, strainbackground (C. elegans) MT13113 CGC ID_FlavellDatabase: MT13113 tdc-1(n3419)
Strain, strainbackground (C. elegans) MT15620 CGC ID_FlavellDatabase: MT15620 cat-2(n4547)
Strain, strainbackground (C. elegans) MT9455 CGC ID_FlavellDatabase: MT9455 tbh-1(n3247)
Strain, strainbackground (C. elegans) CX11078 Stern et al., 2017 ID_FlavellDatabase: CX11078 cat-2(e1112)
Strain, strainbackground (C. elegans) CX14295 CGC ID_FlavellDatabase: CX14295 pdfr-1(ok3425)
Strain, strainbackground (C. elegans) LX645 CGC ID_FlavellDatabase: LX645 dop-1(vs100)
Strain, strainbackground (C. elegans) LX702 CGC ID_FlavellDatabase: LX702 dop-2(vs105)
Strain, strainbackground (C. elegans) LX703 CGC ID_FlavellDatabase: LX703 dop-3 (vs106)
Strain, strainbackground (C. elegans) LX704 CGC ID_FlavellDatabase: LX704 dop-2(vs105); dop-3(vs106)
Strain, strainbackground (C. elegans) SWF261 this study ID_FlavellDatabase: SWF261 dop-4(ok1321); backcrossed to N2 8x
Strain, strainbackground (C. elegans) CX13111 this study ID_FlavellDatabase: CX13111 dop-5(ok568);
backcrossed to N2 3x
Strain, strainbackground (C. elegans) RB1680 CGC ID_FlavellDatabase: RB1680 dop-6(ok2070)
Strain, strainbackground (C. elegans) MT1082 CGC ID_FlavellDatabase: MT1082 egl-1(n487)
Strain, strainbackground (C. elegans) SWF266 this study ID_FlavellDatabase: SWF266 lgc-53(n4330); MT13952 was backcrossed to N2 4x
Strain, strainbackground (C. elegans) SWF181 this study ID_FlavellDatabase: SWF181 cat-2(n4547), flvEx87[cat-2 genomic PCR product, myo-3::mCherry]
Strain, strainbackground (C. elegans) SWF325 this study ID_FlavellDatabase: SWF325 flvEx133[dat-1::GtACR2-t2a-GFP,myo-3::mCherry]
Strain, strainbackground (C. elegans) SWF141 this study ID_FlavellDatabase: SWF141 flvEx74[dat-1::CoChR, myo-3::mCherry]
Strain, strainbackground (C. elegans) SWF207 this study ID_FlavellDatabase: SWF207 egl-1(n487); flvEx74[dat-1::CoChR, myo-3::mCherry]
Strain, strainbackground (C. elegans) SWF208 this study ID_FlavellDatabase: SWF208 lin-39(n709); flvEx74[dat-1::CoChR, myo-3::mCherry]
Strain, strainbackground (C. elegans) SWF258 this study ID_FlavellDatabase:
SWF258
acr-2(n2595 n2420); flvEx74[dat-1::CoChR, myo-3::mCherry]
Strain, strainbackground (C. elegans) SWF257 this study ID_FlavellDatabase: SWF257 unc-25(e156); flvEx74[dat-1::CoChR, myo-3::mCherry]
Strain, strainbackground (C. elegans) SWF314 this study ID_FlavellDatabase: SWF314 unc-30(e191); flvEx74[dat-1::CoChR, myo-3::mCherry]
Strain, strainbackground (C. elegans) SWF331 this study ID_FlavellDatabase: SWF331 flvEx127[dat-1::GCaMP6m, myo-3::mCherry]
Strain, strainbackground (C. elegans) BZ555 CGC ID_FlavellDatabase: BZ555 egIs1 [dat-1::GFP]
Strain, strainbackground (C. elegans) CX14453 Bendesky et al., 2012 ID_FlavellDatabase: CX14453 unc-25(n2324)
Strain, strainbackground (C. elegans) CX13851 Bendesky et al., 2012 ID_FlavellDatabase: CX13851 unc-25(e156)
Recombinant DNA reagent pYCH1 this study ID_FlavellDatabase: pYCH1 dat-1::GtACR2-sl2-GFP
Recombinant DNA reagent pSKY1 this study ID_FlavellDatabase: pSKY1 dat-1::CoChR
Recombinant DNA reagent pSKY2 this study ID_FlavellDatabase: pSKY2 dat-1::GCaMP6m
Software, algorithm ImageJ ImageJ (http://imagej.nih.gov/ij/) RRID:SCR_003070 Version 1.52
Software, algorithm GraphPad Prism GraphPad Prism
(graphpad.com)
RRID:SCR_002798 Version 7.03
Software, algorithm MATLAB MathWorks (www.mathworks.com) RRID:SCR_001622 Version 2019a
Software, algorithm National
Instruments
LabView
(www.ni.com/en-us/shop/labview.html)
RRID:SCR_014325 Version 16.0
Software, algorithm NIS Elements Nikon
(www.nikoninstruments.com/products/software)
RRID:SCR_014329 V4.51.01
Software, algorithm The R Project R (r-project.org) RRID:SCR_001905 v3.6.1
Software, algorithm R Studio R Studio (rstudio.com) RRID:SCR_000432 v1.2.1335

Growth conditions and handling

Nematode culture was conducted using standard methods (Brenner, 1974). Populations were maintained on NGM agar plates supplemented with E. coli OP50 bacteria. Wild-type was C. elegans Bristol strain N2. For genetic crosses, all genotypes were confirmed using PCR. Transgenic animals were generated by injecting DNA clones plus fluorescent co-injection marker into gonads of young adult hermaphrodites. All assays were conducted at room temperature (~22°C).

Behavioral recording conditions

Animals were staged approximately 72 hr prior to recording. 10 adult animals were picked to an NGM plate seeded with E. coli OP50 and left to lay eggs for approximately one hour. Adult animals were removed, and eggs were allowed to develop into adults at room temperature until recorded. For experiments that did not involve optogenetics, animals were left undisturbed for the entire developmental period. For experiments that included optogenetics, animals were picked as L4s to an NGM plate seeded with a bacterial lawn with 50 µM all-trans-retinal (ATR).

The assay plates were standard 10 cm diameter petri dishes, with low-peptone (0.2 g/L) NGM, seeded with 200 µL OP50. 50 µM ATR was added for recordings involving optogenetic stimulation. Roughly circular lawn shapes were created with a spreader, and plates were left to dry overnight at room temperature. We used low-peptone plates because they limited the extent of growth of the bacterial lawn. Thick bacterial lawns could obscure the worm and/or contain deep tracks in them, which reduced the quality of worm tracking. Thus, thin bacterial lawns were more desirable for these recordings.

For each on-food recording, a single 72 hr old adult animal was picked to a plate. Plates were taped onto the microscope stage open and face-down on top of 3 evenly placed spacers to prevent condensation on the stage. For animals recorded in the absence of food, a copper ring (with ~7 cm inner diameter) made of filter paper dipped in 0.02M copper chloride solution was positioned on the plate to prevent the animal from reaching the plate edge. For these recordings, animals were washed in M9 twice and placed on the no-food plate using a glass pipette. Kim wipes were used to remove any remaining liquid.

Recordings began 10 min after animals were positioned on the assay plate and were approximately six hours long for on-food recordings and 1–2 hr long for off-food recordings. Optogenetic stimulation was performed with a 532 nm laser at an intensity of 150 µW/mm2 for three minutes every ten minutes.

All data were included in analyses, except for a small number of datasets that had very poor quality. The criteria for exclusion, which were uniformly applied, were: (1) if the posture could not be determined in >10% of the frames, or (2) if the head vs tail could not be confidently assigned.

Tracking microscope

Overview

Recordings were made on three identical tracking microscopes. These microscopes that generate near-comprehensive records of C. elegans behavior were named after all-seeing figures: Santa Claus (‘he knows when you’ve been naughty or nice’), Sauron (‘the Great Eye is ever watchful’), and Cassandra (‘all that you foretell seems true to us’). The tracking microscopes and accompanying software suite were inspired by and share similarities to previous imaging platforms (Yemini et al., 2013). The complete bill of materials and build instructions for the tracking microscope are available in a git repository at https://bitbucket.org/natecermak/openautoscope. The image analysis code in R is also available at https://bitbucket.org/natecermak/wormimageanalysisr (copy archived at https://github.com/elifesciences-publications/wormImageAnalysisRCermak, 2020).

Microscope optics

The tracking microscope was built predominantly using optics and an optical cage system from Thorlabs. The basic optical path consists of a 4x NA 0.1 Olympus PLAN objective (Thorlabs #RMS4X) with a 150 mm tube lens (Thorlabs #AC254-150-A-ML), yielding a magnification of 3.33X. The image is collected on a monochrome Chameleon3 camera (FLIR, #CM3-U3-13Y3M), with a 1/2" sensor format and 1280 × 1021 pixels (4.8 μm/px at sensor plane, 1.44 μm/px at object plane). This yields a field of view of 1.84 × 1.47 mm. We illuminated the sample with a 780 nm, 18 mW IR LED (Thorlabs #LED780E) in a transillumination configuration. The LED was diffused using a ground glass diffuser (Thorlabs #DG10-120), and collimated onto the sample using a f=16 mm aspheric condenser lens (Thorlabs #ACL25416U) placed 16 mm from the diffuser surface.

The microscope path also included a 4.5 mW, 532 nm laser diode module (Thorlabs #CPS532) for optogenetic stimulation. The laser beam (3.5 mm diameter) was combined with the main optical path using a 550 nm dichroic (Thorlabs #DMLP550R), then focused on the back focal point of the objective using a f = 100 mm planoconvex lens (Thorlabs #LA1509-A-ML). This illuminated a circular region roughly 1.6 mm in the sample plane, with a calculated average intensity of 150 μW/mm2.

Microscope mechanics

We reasoned that mechanical motion of the stage might perturb the worm, so we designed our tracking microscope to move the optical components rather than the sample. We attached the optical train to a gantry on two motorized linear actuators, enabling translation of the optics in the X-Y plane (perpendicular to the optical axis). However, we moved the sample in the Z-axis for focusing.

We used motorized C-beam linear actuators from OpenBuilds Parts Store, which allow roughly 150 mm of travel distance in each axis. They use an 8 mm-pitch leadscrew to translate rotational into linear motion. We drove these leadscrews with NEMA23 stepper motors (Pololu, #1476). Because these motors have 200 steps per revolution and we drove them with 1/32 microstepping, the single-step resolution was 1.25 μm in each linear axis.

To control the motors, we used DRV8825 stepper controller ICs. These are common stepper motor driver ICs used in CNC and 3D-printing applications. The DRV8825 ICs were controlled by a Teensy 3.2 microcontroller with custom-written firmware, using the AccelStepper library for smooth stepping control. The Teensy 3.2 firmware communicates with the computer over a high-speed serial connection via USB, and continually broadcasts its current position at 200 Hz. The computer controls movement by sending strings to the Teensy telling it to move to a given absolute coordinate – for example ‘X200’ means go to position 200 in the X-axis, whereas ‘Z-3000’ means go to position −3000 in the Z-axis. Each axis was programmed to move at a maximum speed of 1000 microsteps/s (1.25 mm/s), with a maximum acceleration of 50,000 microsteps/s2 (62.5 mm/s2) for X and Y, and 5000 microsteps/s2 (6.25 mm/s2) for Z.

Tracking

Our tracking approach was similar to previous reports (Stephens et al., 2008). We wrote a custom LabView program (National Instruments; RRID:SCR_014325) to perform tracking. In this program, we acquired and processed images at ~20 Hz. For each frame, we thresholded the image, dilated and eroded the binary image to smooth the outline and fill small holes, and detected connected components. Connected components outside a given size range (typically 20,000–100,000 pixels) were discarded, and of the remaining components, the one nearest to the center of the frame was selected as the target. We calculated the unweighted centroid of that component, and used its deviation from the center of the frame as the error signal. We used a proportional-integral (PI) controller to ensure the worm stayed centered in the image. Typical P and I gains were 0.3 steps/pixel and 0.1 steps/(pixel*second), respectively. The feedback loop rate was set by the frame rate (20 Hz). While we could track worms equally well at faster frame rates (easily exceeding 40 Hz), we found 20 Hz both provided stable and robust tracking. Additionally, 20 Hz was near optimal for recording because below 20 Hz we were unable to accurately quantify pharyngeal pumping, and sampling faster than 20 Hz provided essentially no additional information about worm behavior.

During tracking, each frame was saved as a jpeg file. To reduce the file size, we did not save the entire frame, but instead cropped the image to the target component (described above), padded by 40 pixels in all directions. Typical frames were on the order of 20 kB after jpeg compression.

Because the agar surface is not perfectly level, the microscope must periodically refocus as the worm moves. To automatically focus, we performed a rapid z-series centered on the current z-plane and calculate the sharpness of the image at each z-position. Sharpness was calculated as the variance of the image after high-pass filtering with a Laplacian filter. The microscope then returned to the z-plane that yielded the sharpest image. The entire autofocus operation took ~2.5 s. Autofocusing was triggered 10 min after the previous autofocus, and every time the worm moved more than 2.5 mm from the position of the last autofocus.

In our experience, tracking was extremely robust and worms never exceeded the boundary of the camera frame under typical conditions. However, there were two cases in which tracking sometimes failed – when worms reached the boundary of the dish and when condensation on the plate lid reduced contrast or overall image brightness. When worms reached the dish boundary, there were often dark regions in the image that the worm might enter, at which point the tracking code would no longer be able to identify the worm’s position. Similarly, condensation in the optical path tended to decrease overall brightness and contrast, which in some cases prevented the code from identifying the worm as a dark component on a light background.

Behavior detection

While gross locomotor behavior could be quantified online, most other metrics were not, due to computational requirements. We developed an offline analysis pipeline in R (RRID:SCR_001905) to 1) calculate additional locomotion-related metrics and also quantify 2) body posture 3) pumping 4) defecation and 5) egg-laying.

Locomotion

We quantified multiple metrics of locomotion on 1- and 10 s timescales, as these capture different aspects of behavior. We measured speed as the magnitude of the displacement of the worm’s center of mass and velocity as displacement projected onto the worm’s body axis. We also measured the angular direction of the worm and calculated the angular velocity as change in angular direction over time. Finally, we tracked the distance between the worm’s center of mass and the bacterial lawn (equal to 0 if the worm was on the lawn), as well as the distance from the worm’s nose to the lawn.

Body posture

Body posture has been the subject of extensive study in C. elegans (Stephens et al., 2008; Yemini et al., 2013). We used a well-established pipeline to quantify body posture. This pipeline follows the same protocol as the online tracking analysis (above), including thresholding, dilation and erosion, and selecting the connected component representing the worm. That component is then thinned by iteratively applying a 3 × 3 look-up-table based thinning filter. This process yields pixels that are along the worm’s centerline. We treat these pixels as a graph, in which bright pixels become nodes and we create edges between all pairs of adjacent (8-connected) pixels. If the graph contains cycles, we mark the frame as ‘self-intersecting’ and do not analyze it further. ‘Self-intersecting’ frames are most commonly due to the animal exhibiting an omega bend, or a related body posture. If the graph has branchpoints, we iteratively prune the shortest branches until the graph no longer has branchpoints and is thus a single line. We refer to this as the centerline. We smooth the centerline coordinates (31-pixel running mean) to reduce discretization artifacts, and resample the centerline so that it contains 1001 evenly-spaced points. We calculate angles between all consecutive points, and fit this vector of angles to a 2nd-degree b-spline basis consisting of 14 components. This yields a 14-dimensional vector that accurately and succinctly represents the worm’s posture. We record the mean and interpret it as the worm’s overall orientation. We mean-center the 14-point vector, which we then interpret as representing deviations from the worm’s overall orientation. Because this representation allows straightforward and accurate reconstruction of the worm’s centerline, we also use this centerline to calculate curvature along the centerline as the inverse of the local radius of curvature.

Assignment of head/tail

The initial body posture quantification described above arbitrarily designated one end of the worm as the head in each frame. Thus, between any consecutive two frames, the apparent orientation may have flipped 180 degrees due to different assignment of which end was the head. Such a 180-degree flip cannot occur due to the worm’s locomotion, as worms cannot reorient themselves by 180 degrees in 50 ms (our frame period). Our first step towards assigning head and tail was to simply ensure frame-to-frame consistency by detecting these 180-degree flips between consecutive frames, and reassigning head and tail of the second frame. To do so, we iterated through frames and if the mean angle difference between frames i and i+1 exceeds π/2 radians, we reassigned which end was the head in frame i+1. Reassigning the head also results in reversing the centerline angle vector and subtracting π from all the body angles.

This was insufficient to ensure consistency across entire datasets, as some frames did not have body angles assigned due to self-intersection of the centerline (described above). Therefore, this first approach could only ensure consistency within each block of contiguous non-self-intersecting frames. We then iterated through contiguous blocks of non-self-intersecting frames and ensured that each block had a similar average centerline intensity (brightness) profile as the previous block. Specifically, we checked whether the average centerline intensity vector of block j+one or its reverse was better correlated to that of block j. If the reverse was a better match, then the head was reassigned for all frames in block j+1.

At this point, the orientation of the worm was consistent across the entire experiment, but the head and tail could still be incorrect. We manually checked whether the head was correctly labeled in one frame; if it was not, then the head/tail assignment was flipped for every frame in the dataset and body angles were also correspondingly reversed. Notably, at no point in this process did we rely on locomotion to determine which end was the head or tail.

Pumping

Our general strategy to quantify pumping was to detect the position of the grinder as well as the posterior end of the posterior bulb and then count negative peaks in the distance between them. This approach is similar to Lee et al., 2017, but performed on a freely-moving worm instead of a worm immobilized in a microfluidic chip.

Because there were occasional errors in estimating the worm’s centerline (typically due to the presence of eggs touching the body, especially the tip of the nose/tail), we first eliminated from the analysis all frames in which the worm’s length suddenly increased. We identified these frames as those in which the worm length exceeded the 90th percentile of the surrounding 10 min by at least 30 μm.

Within the remaining frames, we identified the grinder and the posterior end of the posterior bulb as dark positions in the intensity (brightness) profile along the worm’s length. This profile was obtained by averaging the intensity of 8 perpendicularly-oriented pixels for each point on the centerline. We then used spline interpolation to upsample this profile to a roughly 0.2 μm resolution, and looked for the presence of two local minima in the profile. In particular, we sought two local minima amongst the four darkest local minima in the first quarter of the worm’s length that were between 8 and 17 μm apart. If these were found, we calculated the distance between them, otherwise we marked the frame as missing data. We refer to this signal as the grinder distance.

For contiguous stretches for which the grinder distance was defined, we bandpass filtered this signal (2nd-order Butterworth filter, passband 0.2–0.8 normalized frequency) and counted peaks that deviated more than 0.6 μm below 0 (the average grinder position). Pumping rates were only defined during time periods in which the grinder distance was not missing.

Defecation

We used the stereotyped body contraction, known as the defecation motor program (Thomas, 1990), to identify defecation events. We first identified proportional fluctuations in the worm’s body length by subtracting a moving median filtered (width 50 s) estimate of the worm’s length, then dividing by the value of the median filter. This yielded a signal with roughly zero mean, in which deviations represented the proportion by which the length changed. We then applied a matched filter with a kernel consisting of two Gaussians (width 0.9 s) separated by 3.5 s. This is a rough approximation of the body length profile during a typical defecation event. Peaks in the filtered signal were taken to be defecation events.

Egg-laying

Our general strategy for detecting egg-laying was to look for sudden increases in the worm’s width around the vulval region.

We calculated the worm’s body width by measuring the distance from the worm’s centerline to the dorsal or ventral edge of the worm, perpendicular to the centerline, at 1001 evenly spaced points along the centerline. To compress these oversampled vectors, we then fit these to a b-spline basis consisting of 30 components, yielding two 30-point ‘half-width’ (centerline to edge) vectors.

We developed a heuristic in which candidate egg-laying events are detected by meeting the following criteria:

  1. the worm’s area does not decrease

  2. the worm’s length does not change by more than 5%

  3. the worm’s width in any of segments 15–20 (roughly the midpoint to 66% along the worm’s length) on either side increases abruptly within 100 ms by at least six pixels.

  4. a filter calculated using the worm’s width crosses a threshold. In particular, this filter was designed to maximize the signal from an egg suddenly appearing around the vulva, while minimizing the signal from a worm moving alongside an existing stationary egg.

The latter filter was constructed using the average width of 5 segments anterior to the vulval region, five segments around the vulval region, and five segments posterior to the vulval region. A differencing filter of length 250 ms was applied to the width time series from each 5-segment region to detect arrival of eggs, and then the three regions were summed with weights 1, 2, and 1 respectively.

Because C. elegans only lays eggs on its ventral side, our analysis then identified the putative ventral side as the side of the worm with more candidate egg laying events. This criterion proved highly reliable in that it correctly identified the ventral side for every worm we analyzed (verified during manual annotation, below). Candidate egg laying events on the dorsal side were ignored.

These criteria yielded generally high sensitivity but poor specificity, often identifying up to >200 frames containing candidate egg laying events (out of >400,000 frames for a six-hour dataset). We then manually verified these candidate frames, typically identifying 20–70 real egg-laying events. For each event we also manually identified the number of eggs laid, as multiple eggs are occasionally laid simultaneously.

Lawn boundary

Before each experiment, we manually annotated the position of the bacterial lawn by manually directing the microscope to travel around the perimeter of the lawn and record the path coordinates. This enabled post-hoc determination of when the worm was on the bacterial lawn and if not, how far the worm was from it.

Posture analysis and HMMs

Overview

As is described in the main text, we used time-varying changes in C. elegans posture to learn behavioral states displayed by adult animals feeding on OP50. This pipeline consisted of several data processing steps, described here.

Data pre-processing

The input data for these analyses consisted of 14-element data vectors at each time-point that describe the worm’s posture as a series of relative body angles, from nose to tail (see ‘Behavior Detection’ section above). We used the location of egg expulsion along the body to determine the ventral side of the body, and inverted the body angles of animals travelling on their left sides, so that all animals were aligned along the same dorsal-ventral axis.

Posture compendium

To express the worm’s posture in a simple, compressed manner, we constructed a compendium of reference postures that encompass the broad range of postures that C. elegans animals display while feeding. This approach has been previously employed by other groups (Schwarz et al., 2015). Then, for each posture observed at each moment in time, we determined the closest match in the compendium. To construct a compendium, we sampled 100,000 frames from 24 N2 animals and performed hierarchical clustering. We then cut the dendrogram at different depths (1-200) to build compendiums with different numbers of reference postures. Each time, we averaged together the body angles in each cluster to obtain the prototypical posture for that cluster. We could describe the degree to which the compendium faithfully captured the worm’s posture by measuring how much of the variance of the body angle vector was discarded when transforming the actual posture vector to its most similar reference posture. Then, to determine the optimal size of the posture compendium, we examined the variance explained for compendiums with a wide range of sizes (1-200). This curve (Figure 2—figure supplement 2A) clearly plateaus beyond a compendium size of ~70, indicating that adding additional postures to the compendium beyond this point fails to capture a great deal more variance. We identified the size at which at least 75% of the postural variance was explained while adding another posture explained less than 1% of additional variance. This size was 100 postures, and the 100-posture compendium explained approximately 76% of the variance (Figure 2—figure supplement 2A).

Transitions between reference postures

To begin identifying stereotyped postural changes, we examined the probability of each reference posture transitioning to the other reference postures. In this analysis, we ignored self-transitions. This transition matrix was constructed using six animals. We then clustered the rows of this transition matrix using k-means clustering to identify sets of postures with similar transition profiles. We observed a clear, symmetric, block-like structure to the clustered transition matrix, indicating that there are sets of postures that animals tend to transition back and forth between. We performed k-means clustering 500 times for a given number of clusters, while varying the number of clusters from 2 to 10. To determine the optimal number of clusters, we measured the degree to which the block-like structure emerged for a given clustering by calculating the ratio of the average intra-group transition probabilities to the average inter-group transition probabilities. Based on this measurement, the optimal number of clusters was found to be eight, and we selected the clustering with the highest value for further analysis. We refer to these eight clusters of reference postures as ‘posture groups’.

Pre-processing for HMMs

To capture slow time-scale changes in body posture, we attempted to describe the typical postures emitted by C. elegans animals over three-second intervals (60 frames). We chose this time frame because we found that over three-second intervals animals typically generated postures from a single posture group, suggesting that this time frame was a good match to the posture group transition rate. Nevertheless, because animals sometimes generated postures from two or three groups within a given 3 s bin, we segmented these three-second intervals by clustering. To perform clustering, we described the posture groups emitted over each three-second interval as an eight-element vector where each entry is the fraction of data points belonging to each posture group. We then clustered these vectors by k-means clustering and used silhouette criterion to determine the optimal number of clusters. The optimal number was found to be eight; there was a clear mapping where each cluster consisted of data vectors primarily belonging to a single posture group. This allowed us to describe each three-second interval with a single value 1–8, based on which cluster it mapped to. We will refer to these cluster values as ‘coarsened posture groups’ in the section below.

Training and evaluating HMMs

We trained HMMs on the sequences of coarsened posture groups from six animals. The transition and emission matrices were randomly initialized for each model training. To determine the optimal number of hidden states, we trained models across of a range of hidden states (2-12) and used the Bayesian information criterion (BIC) to compare model likelihoods to one another. The curve of median BIC values demonstrated an optimal value at nine hidden states. We trained 200 nine-state models, each from random initial conditions; half were trained on the same group of 6 animals, while the other half were trained on a separate, non-overlapping group of 6 animals. We then evaluated the similarity of these 200 models by measuring the average Euclidean distance between the rows of the emission matrices, that is how similar the emissions were in each state. We found that the models with the highest likelihoods were essentially identical, despite being trained from different sets of animals and different initial conditions (Figure 2—figure supplement 2E–F). This observation suggests that model training reliably converges to the same solution. We arbitrarily selected one of these extremely similar models for further use. To determine the most likely state path for each animal, we used the Viterbi algorithm.

Eigenworm analyses

In several figure panels, we used the previously developed ‘eigenworm’ approach (Stephens et al., 2008), where the animal’s body posture (a 14-element vector of body angles, from head to tail) is expressed as a smaller number of principal components (PCs), or eigenworms. To perform this analysis, we constructed a matrix consisting of each 14-element posture vector observed across all wild-type animals at all timepoints. As is described above, the posture vectors were mean-subtracted so that they were rotationally invariant. We then performed principal component analysis (PCA) on this matrix and, similar to previous studies, found that the top four PCs together explained the majority (87%) of the variance of the body angles. The relative ordering of the eigenworms (1–4, in order of which explains the most variance) was different in our analysis compared to previous studies. We attribute this to the fact that animals in our analysis were on food and, thus, emitting their postures in a different manner from those off of food, as was the case in previous studies (Stephens et al., 2008). In all figures, we number the eigenworms according to the variance explained in our dataset.

Comparing the posture-HMM to continuous models of postural change during dwelling

To examine whether the posture-HMM provides a better description of dwelling behavior than simpler models where animals continuously change their posture during dwelling (vs. switching between discrete states), we generated posture sequences from three different models and asked which provided a closer match to actual animal data. The posture sequences for the three models were generated in the following manner: We first used the hmmgenerate function in MATLAB (RRID:SCR_001622) to generate a sequence of HMM states and emissions whose length matches the entirety of our wild-type dataset (30 animals; 6 hr each). The model parameters used here were the 9-state model parameters described in Figure 2. To allow for a direct comparison between the three alternative models, we lumped all eight dwelling sub-modes together and then segmented out each of the dwelling states in this sequence. Then, for each dwelling state, we generated three different synthetic posture sequences corresponding to the three different models:

  1. Posture-HMM: We used the emissions from the hmmgenerate output to determine the sequence of posture groups generated by the 9-state HMM (giving rise to a plausible sequence of posture groups specified by the parameters of the 9-state HMM). To generate sequences of postures (with values ranging 1–100; see Figure 2B–C) from these vectors of posture groups, we segmented the vector into consecutive stretches of the same posture group and for each stretch we initialized in a random posture within the group. Then ‘animals’ transitioned between postures within the same group, according to the pairwise transition rates that were measured from real animals (Figure 2C). The time spent in each posture was constrained to match actual animals: for each of the 100 postures, we obtained a distribution of posture durations from actual animals and then randomly sampled from the corresponding distribution when generating the in silico posture sequences. This process was re-iterated all the way through each dwelling state.

  2. Continuous model with transition rates determined by empirical pairwise transition rates: For each dwelling state, we initialized the sequence of postures in a random posture. The ‘animals’ then transitioned between postures according to the pairwise transition rates that were measured from real animals (Figure 2C). Just like the other models, the time spent in each posture was constrained to match actual animals: for each of the 100 postures, we obtained a distribution of posture durations from actual animals (same distributions were used for all three models) and then randomly sampled from the corresponding distribution when generating the in silico posture sequences. Note that this model is essentially identical to the posture-HMM model, except it lacks the discrete posture group component.

  3. Continuous model with transition rates determined by posture similarity: For each dwelling state, we initialized the sequence of postures in a random posture. The ‘animals’ then transitioned between postures using a rule where the probability of transitioning from each posture to the others was based on how similar the postures were (as measured by the Euclidean distance between the two posture vectors). As in the other models, the time spent in each posture was constrained to match actual animals: for each of the 100 postures, we obtained a distribution of posture durations from actual animals (the same distributions were used for all three models) and then randomly sampled from the corresponding distribution when generating the in silico posture sequences. Note that this model is identical to Model #2, except the rule for pairwise transitions between postures is based on posture similarity, rather than empirically measured transition probabilities.

To assess how well the sequence of postures from each model matched actual posture sequences recorded from real animals during dwelling, we used the following metric: We measured the average minimum duration of time between observed postures for each pair of postures. For example, we found that when animals were in posture #59, it took an average of 21 s until they next emitted posture #61, but it took an average of 2.7 min until they next emitted posture #31. This metric takes into account the higher order patterns in which animals actually emit their postures, but does not assume any particular underlying structure. We obtained this measurement for each pair of postures in our real recorded data, as well as the synthetic posture sequences from the three models (all analyses were restricted to dwelling states only). The ‘error’ of each model was taken to be the square of the difference between this metric for a given model and the real animal data (summed across all pairs of postures; Figure 2—figure supplement 5B). We note that we also performed a BIC analysis of the 9-state HMM, as compared to HMMs with fewer states (Figure 2—figure supplement 2D), to ensure that increased model performance could not be trivially explained by the more complex models having a higher number of parameters.

In vivo calcium imaging

In vivo calcium imaging of the four dopaminergic cell types was conducted on one-day-old wild-type animals. Animals were positioned on thin, flat slices of NGM agar with a PDMS outer barrier so that animals could not crawl off the agar. OP50 E. coli was seeded uniformly on the agar, except for off-food videos. Animals were permitted to equilibrate on the agar slides for 10 min prior to the beginning of each recording. Animals were then recorded with a 4x/0.2NA Nikon objective and an Andor Zyla 4.2 Plus sCMOS camera. Blue light output to animals was 9–20% output from an X-Cite 120LED system for 10 ms of each exposure. Brightfield images (to collect postural and behavioral information) and fluorescence images were collected in an alternating fashion, made possible by alternating which light source was active during each camera exposure. The total frame rate was 20fps, so that each channel (GCaMP and brightfield) had an effective frame rate of 10fps. GCaMP data and behavioral data were thus collected with a 50 ms lag, though for the purposes of our analyses we dis-regarded this small time lag. GCaMP fluorescence was tracked using a previously-described ImageJ (RRID:SCR_003070) tracking macro (Flavell et al., 2013) and behavioral data were extracted using the software that was developed for the tracking microscope analysis (described above).

Statistics

The details of all statistical tests carried out in this study can be found in Supplementary file 1.

Acknowledgements

We thank Cori Bargmann and members of the Flavell lab for helpful comments on the manuscript, Joshua Powers and Karen Gao for assistance with data annotation, and Andrew Bahle for help with microscope construction. We thank the Bargmann lab, Horvitz lab, and the Caenorhabditis Genetics Center (supported by P40 OD010440) for strains. Y-C.H. acknowledges support from the Picower Fellows program. S.W.F. acknowledges funding from the JPB Foundation, PIIF, PNDRF, the NARSAD Young Investigator Award Program, NIH (R01NS104892) and NSF (IOS 1845663 and DUE 1734870).

Funding Statement

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

Contributor Information

Steven W Flavell, Email: flavell@mit.edu.

Manuel Zimmer, Research Institute of Molecular Pathology, Vienna Biocenter and University of Vienna, Austria.

Ronald L Calabrese, Emory University, United States.

Funding Information

This paper was supported by the following grants:

  • National Science Foundation IOS 1845663 to Steven Flavell.

  • National Science Foundation DUE 1845663 to Steven Flavell.

  • National Institutes of Health NS104892 to Steven Flavell.

  • JPB Foundation PIIF to Steven Flavell.

  • JPB Foundation PNDRF to Steven Flavell.

  • Brain and Behavior Research Foundation NARSAD Young Investigator to Steven Flavell.

  • JPB Foundation Picower Fellows Award to Yung-Chi Huang.

Additional information

Competing interests

No competing interests declared.

Author contributions

Conceptualization, Data curation, Software, Formal analysis, Validation, Investigation, Visualization, Methodology, Writing - review and editing.

Conceptualization, Data curation, Software, Formal analysis, Validation, Investigation, Visualization, Methodology, Writing - review and editing.

Conceptualization, Data curation, Software, Formal analysis, Supervision, Validation, Investigation, Visualization, Methodology, Writing - review and editing.

Conceptualization, Data curation, Formal analysis, Validation, Investigation, Writing - review and editing.

Conceptualization, Data curation, Software, Formal analysis, Validation, Investigation, Writing - review and editing.

Conceptualization, Data curation, Software, Formal analysis, Supervision, Funding acquisition, Validation, Investigation, Visualization, Methodology, Writing - original draft, Project administration, Writing - review and editing.

Additional files

Supplementary file 1. Details about statistical tests.

This excel sheet includes a detailed description of each statistical test carried out in this study.

elife-57093-supp1.xlsx (46.5KB, xlsx)
Transparent reporting form

Data availability

Data have been uploaded to Dryad (https://doi.org/10.5061/dryad.t4b8gthzf) and are publicly available.

The following dataset was generated:

Cermak N, Yu SK, Clark R, Huang Y-C, Baskoylu S, Flavell SW. 2020. Behavioral and GCaMP data. Dryad Digital Repository.

References

  1. Alkema MJ, Hunter-Ensor M, Ringstad N, Horvitz HR. Tyramine functions independently of octopamine in the Caenorhabditis elegans nervous system. Neuron. 2005;46:247–260. doi: 10.1016/j.neuron.2005.02.024. [DOI] [PubMed] [Google Scholar]
  2. Anderson DJ, Adolphs R. A framework for studying emotions across species. Cell. 2014;157:187–200. doi: 10.1016/j.cell.2014.03.003. [DOI] [PMC free article] [PubMed] [Google Scholar]
  3. Artiushin G, Sehgal A. The Drosophila circuitry of sleep-wake regulation. Current Opinion in Neurobiology. 2017;44:243–250. doi: 10.1016/j.conb.2017.03.004. [DOI] [PMC free article] [PubMed] [Google Scholar]
  4. Aston-Jones G, Cohen JD. An integrative theory of locus coeruleus-norepinephrine function: adaptive gain and optimal performance. Annual Review of Neuroscience. 2005;28:403–450. doi: 10.1146/annurev.neuro.28.061604.135709. [DOI] [PubMed] [Google Scholar]
  5. Avery L, You Y-J. C. elegans feeding. WormBook Online Rev. C Elegans Biol. 2012:1–23. doi: 10.1895/wormbook.1.150.1. [DOI] [PMC free article] [PubMed] [Google Scholar]
  6. Ben Arous J, Laffont S, Chatenay D. Molecular and sensory basis of a food related two-state behavior in C. elegans. PLOS ONE. 2009;4:e7584. doi: 10.1371/journal.pone.0007584. [DOI] [PMC free article] [PubMed] [Google Scholar]
  7. Bendesky A, Pitts J, Rockman MV, Chen WC, Tan MW, Kruglyak L, Bargmann CI. Long-range regulatory polymorphisms affecting a GABA receptor constitute a quantitative trait locus (QTL) for social behavior in Caenorhabditis elegans. PLOS Genetics. 2012;8:e1003157. doi: 10.1371/journal.pgen.1003157. [DOI] [PMC free article] [PubMed] [Google Scholar]
  8. Berman GJ, Choi DM, Bialek W, Shaevitz JW. Mapping the stereotyped behaviour of freely moving fruit flies. Journal of the Royal Society Interface. 2014;11:20140672. doi: 10.1098/rsif.2014.0672. [DOI] [PMC free article] [PubMed] [Google Scholar]
  9. Brenner S. The genetics ofCaenorhabditis elegans. Genetics. 1974;77:71–94. doi: 10.1093/genetics/77.1.71. [DOI] [PMC free article] [PubMed] [Google Scholar]
  10. Carter ME, Yizhar O, Chikahisa S, Nguyen H, Adamantidis A, Nishino S, Deisseroth K, de Lecea L. Tuning arousal with optogenetic modulation of locus coeruleus neurons. Nature Neuroscience. 2010;13:1526–1533. doi: 10.1038/nn.2682. [DOI] [PMC free article] [PubMed] [Google Scholar]
  11. Cermak N. wormImageAnalysisR. 29Bitbucket. 2020 https://bitbucket.org/natecermak/wormimageanalysisr/src/master/
  12. Chase DL, Pepper JS, Koelle MR. Mechanism of extrasynaptic dopamine signaling in Caenorhabditis elegans. Nature Neuroscience. 2004;7:1096–1103. doi: 10.1038/nn1316. [DOI] [PubMed] [Google Scholar]
  13. Chase DL, Koelle MR. Biogenic amine neurotransmitters in C. elegans. WormBook : The Online Review of C. Elegans Biology. 2007;20:1–15. doi: 10.1895/wormbook.1.132.1. [DOI] [PMC free article] [PubMed] [Google Scholar]
  14. Chen Y, Essner RA, Kosar S, Miller OH, Lin YC, Mesgarzadeh S, Knight ZA. Sustained NPY signaling enables AgRP neurons to drive feeding. eLife. 2019;8:e46348. doi: 10.7554/eLife.46348. [DOI] [PMC free article] [PubMed] [Google Scholar]
  15. Choi S, Chatzigeorgiou M, Taylor KP, Schafer WR, Kaplan JM. Analysis of NPR-1 reveals a circuit mechanism for behavioral quiescence in C. elegans. Neuron. 2013;78:869–880. doi: 10.1016/j.neuron.2013.04.002. [DOI] [PMC free article] [PubMed] [Google Scholar]
  16. Collins KM, Bode A, Fernandez RW, Tanis JE, Brewer JC, Creamer MS, Koelle MR. Activity of the C. elegans egg-laying behavior circuit is controlled by competing activation and feedback inhibition. eLife. 2016;5:e21126. doi: 10.7554/eLife.21126. [DOI] [PMC free article] [PubMed] [Google Scholar]
  17. de Bono M, Maricq AV. Neuronal substrates of complex behaviors in C. elegans. Annual Review of Neuroscience. 2005;28:451–501. doi: 10.1146/annurev.neuro.27.070203.144259. [DOI] [PubMed] [Google Scholar]
  18. Donnelly JL, Clark CM, Leifer AM, Pirri JK, Haburcak M, Francis MM, Samuel AD, Alkema MJ. Monoaminergic orchestration of motor programs in a complex C. elegans behavior. PLOS Biology. 2013;11:e1001529. doi: 10.1371/journal.pbio.1001529. [DOI] [PMC free article] [PubMed] [Google Scholar]
  19. Emtage L, Aziz-Zaman S, Padovan-Merhar O, Horvitz HR, Fang-Yen C, Ringstad N. IRK-1 potassium channels mediate peptidergic inhibition of Caenorhabditis elegans serotonin neurons via a G(o) signaling pathway. Journal of Neuroscience. 2012;32:16285–16295. doi: 10.1523/JNEUROSCI.2667-12.2012. [DOI] [PMC free article] [PubMed] [Google Scholar]
  20. Faumont S, Lockery SR. The awake behaving worm: simultaneous imaging of neuronal activity and behavior in intact animals at millimeter scale. Journal of Neurophysiology. 2006;95:1976–1981. doi: 10.1152/jn.01050.2005. [DOI] [PubMed] [Google Scholar]
  21. Flames N, Hobert O. Gene regulatory logic of dopamine neuron differentiation. Nature. 2009;458:885–889. doi: 10.1038/nature07929. [DOI] [PMC free article] [PubMed] [Google Scholar]
  22. Flavell SW, Pokala N, Macosko EZ, Albrecht DR, Larsch J, Bargmann CI. Serotonin and the neuropeptide PDF initiate and extend opposing behavioral states in C. elegans. Cell. 2013;154:1023–1035. doi: 10.1016/j.cell.2013.08.001. [DOI] [PMC free article] [PubMed] [Google Scholar]
  23. Fujiwara M, Sengupta P, McIntire SL. Regulation of body size and behavioral state of C. elegans by sensory perception and the EGL-4 cGMP-dependent protein kinase. Neuron. 2002;36:1091–1102. doi: 10.1016/S0896-6273(02)01093-0. [DOI] [PubMed] [Google Scholar]
  24. Füzesi T, Daviu N, Wamsteeker Cusulin JI, Bonin RP, Bains JS. Hypothalamic CRH neurons orchestrate complex behaviours after stress. Nature Communications. 2016;7:11937. doi: 10.1038/ncomms11937. [DOI] [PMC free article] [PubMed] [Google Scholar]
  25. Gallagher T, Bjorness T, Greene R, You YJ, Avery L. The geometry of locomotive behavioral states in C. elegans. PLOS ONE. 2013;8:e59865. doi: 10.1371/journal.pone.0059865. [DOI] [PMC free article] [PubMed] [Google Scholar]
  26. Goodman MB, Sengupta P. How Caenorhabditis elegans senses mechanical stress, temperature, and other physical stimuli. Genetics. 2019;212:25–51. doi: 10.1534/genetics.118.300241. [DOI] [PMC free article] [PubMed] [Google Scholar]
  27. Gordus A, Pokala N, Levy S, Flavell SW, Bargmann CI. Feedback from network states generates variability in a probabilistic olfactory circuit. Cell. 2015;161:215–227. doi: 10.1016/j.cell.2015.02.018. [DOI] [PMC free article] [PubMed] [Google Scholar]
  28. Govorunova EG, Sineshchekov OA, Janz R, Liu X, Spudich JL. NEUROSCIENCE natural light-gated anion channels: a family of microbial rhodopsins for advanced optogenetics. Science. 2015;349:647–650. doi: 10.1126/science.aaa7484. [DOI] [PMC free article] [PubMed] [Google Scholar]
  29. Gray JM, Hill JJ, Bargmann CI. A circuit for navigation in Caenorhabditis elegans. PNAS. 2005;102:3184–3191. doi: 10.1073/pnas.0409009101. [DOI] [PMC free article] [PubMed] [Google Scholar]
  30. Hardaker LA, Singer E, Kerr R, Zhou G, Schafer WR. Serotonin modulates locomotory behavior and coordinates egg-laying and movement in Caenorhabditis elegans. Journal of Neurobiology. 2001;49:303–313. doi: 10.1002/neu.10014. [DOI] [PubMed] [Google Scholar]
  31. Hill AJ, Mansfield R, Lopez JMNG, Raizen DM, Van Buskirk C. Cellular stress induces a protective Sleep-like state in C. elegans. Current Biology. 2014;24:2399–2405. doi: 10.1016/j.cub.2014.08.040. [DOI] [PMC free article] [PubMed] [Google Scholar]
  32. Hills T, Brockie PJ, Maricq AV. Dopamine and glutamate control area-restricted search behavior in Caenorhabditis elegans. Journal of Neuroscience. 2004;24:1217–1225. doi: 10.1523/JNEUROSCI.1569-03.2004. [DOI] [PMC free article] [PubMed] [Google Scholar]
  33. Hobson RJ, Hapiak VM, Xiao H, Buehrer KL, Komuniecki PR, Komuniecki RW. SER-7, a Caenorhabditis elegans 5-HT7-like receptor, is essential for the 5-HT stimulation of pharyngeal pumping and egg laying. Genetics. 2006;172:159–169. doi: 10.1534/genetics.105.044495. [DOI] [PMC free article] [PubMed] [Google Scholar]
  34. Horvitz HR, Chalfie M, Trent C, Sulston JE, Evans PD. Serotonin and octopamine in the nematode Caenorhabditis elegans. Science. 1982;216:1012–1014. doi: 10.1126/science.6805073. [DOI] [PubMed] [Google Scholar]
  35. Hu Z, Pym EC, Babu K, Vashlishan Murray AB, Kaplan JM. A neuropeptide-mediated stretch response links muscle contraction to changes in neurotransmitter release. Neuron. 2011;71:92–102. doi: 10.1016/j.neuron.2011.04.021. [DOI] [PMC free article] [PubMed] [Google Scholar]
  36. Iannacone MJ, Beets I, Lopes LE, Churgin MA, Fang-Yen C, Nelson MD, Schoofs L, Raizen DM. The RFamide receptor DMSR-1 regulates stress-induced sleep in C. elegans. eLife. 2017;6:e19837. doi: 10.7554/eLife.19837. [DOI] [PMC free article] [PubMed] [Google Scholar]
  37. Jayanthi LD, Apparsundaram S, Malone MD, Ward E, Miller DM, Eppler M, Blakely RD. TheCaenorhabditis elegansgene T23G5.5 encodes an antidepressant- and cocaine-sensitive dopamine transporter. Molecular Pharmacology. 1998;54:601–609. [PubMed] [Google Scholar]
  38. Kang L, Gao J, Schafer WR, Xie Z, Xu XZ. C. elegans TRP family protein TRP-4 is a pore-forming subunit of a native mechanotransduction channel. Neuron. 2010;67:381–391. doi: 10.1016/j.neuron.2010.06.032. [DOI] [PMC free article] [PubMed] [Google Scholar]
  39. Kato S, Kaplan HS, Schrödel T, Skora S, Lindsay TH, Yemini E, Lockery S, Zimmer M. Global brain dynamics embed the motor command sequence of Caenorhabditis elegans. Cell. 2015;163:656–669. doi: 10.1016/j.cell.2015.09.034. [DOI] [PubMed] [Google Scholar]
  40. Kim YJ, Zitnan D, Galizia CG, Cho KH, Adams ME. A command chemical triggers an innate behavior by sequential activation of multiple peptidergic ensembles. Current Biology. 2006;16:1395–1407. doi: 10.1016/j.cub.2006.06.027. [DOI] [PubMed] [Google Scholar]
  41. Klapoetke NC, Murata Y, Kim SS, Pulver SR, Birdsey-Benson A, Cho YK, Morimoto TK, Chuong AS, Carpenter EJ, Tian Z, Wang J, Xie Y, Yan Z, Zhang Y, Chow BY, Surek B, Melkonian M, Jayaraman V, Constantine-Paton M, Wong GK, Boyden ES. Independent optical excitation of distinct neural populations. Nature Methods. 2014;11:338–346. doi: 10.1038/nmeth.2836. [DOI] [PMC free article] [PubMed] [Google Scholar]
  42. Kormos V, Gaszner B. Role of neuropeptides in anxiety, stress, and depression: from animals to humans. Neuropeptides. 2013;47:401–419. doi: 10.1016/j.npep.2013.10.014. [DOI] [PubMed] [Google Scholar]
  43. Krashes MJ, Shah BP, Koda S, Lowell BB. Rapid versus delayed stimulation of feeding by the endogenously released AgRP neuron mediators GABA, NPY, and AgRP. Cell Metabolism. 2013;18:588–595. doi: 10.1016/j.cmet.2013.09.009. [DOI] [PMC free article] [PubMed] [Google Scholar]
  44. Lee KS, Iwanir S, Kopito RB, Scholz M, Calarco JA, Biron D, Levine E. Serotonin-dependent kinetics of feeding bursts underlie a graded response to food availability in C. elegans. Nature Communications. 2017;8:14221. doi: 10.1038/ncomms14221. [DOI] [PMC free article] [PubMed] [Google Scholar]
  45. Leifer AM, Fang-Yen C, Gershow M, Alkema MJ, Samuel AD. Optogenetic manipulation of neural activity in freely moving Caenorhabditis elegans. Nature Methods. 2011;8:147–152. doi: 10.1038/nmeth.1554. [DOI] [PMC free article] [PubMed] [Google Scholar]
  46. Li W, Feng Z, Sternberg PW, Xu XZ. A C. elegans stretch receptor neuron revealed by a mechanosensitive TRP channel homologue. Nature. 2006;440:684–687. doi: 10.1038/nature04538. [DOI] [PMC free article] [PubMed] [Google Scholar]
  47. Li W, Kang L, Piggott BJ, Feng Z, Xu XZS. The neural circuits and sensory channels mediating harsh touch sensation in Caenorhabditis elegans. Nature Communications. 2011;2:315. doi: 10.1038/ncomms1308. [DOI] [PMC free article] [PubMed] [Google Scholar]
  48. Li C, Kim K. Neuropeptides. WormBook. 2008:1–36. doi: 10.1895/wormbook.1.142.1. [DOI] [PMC free article] [PubMed] [Google Scholar]
  49. Liu H, Yang W, Wu T, Duan F, Soucy E, Jin X, Zhang Y. Cholinergic sensorimotor integration regulates olfactory steering. Neuron. 2018;97:390–405. doi: 10.1016/j.neuron.2017.12.003. [DOI] [PMC free article] [PubMed] [Google Scholar]
  50. Liu D, Dan Y. A motor theory of Sleep-Wake control: arousal-action circuit. Annual Review of Neuroscience. 2019;42:27–46. doi: 10.1146/annurev-neuro-080317-061813. [DOI] [PubMed] [Google Scholar]
  51. Lockery SR, Hulme SE, Roberts WM, Robinson KJ, Laromaine A, Lindsay TH, Whitesides GM, Weeks JC. A microfluidic device for whole-animal drug screening using electrophysiological measures in the nematode C. elegans. Lab on a Chip. 2012;12:2211–2220. doi: 10.1039/c2lc00001f. [DOI] [PMC free article] [PubMed] [Google Scholar]
  52. López-Cruz A, Sordillo A, Pokala N, Liu Q, McGrath PT, Bargmann CI. Parallel multimodal circuits control an innate foraging behavior. Neuron. 2019;102:407–419. doi: 10.1016/j.neuron.2019.01.053. [DOI] [PMC free article] [PubMed] [Google Scholar]
  53. Marques JC, Lackner S, Félix R, Orger MB. Structure of the zebrafish locomotor repertoire revealed with unsupervised behavioral clustering. Current Biology. 2018;28:181–195. doi: 10.1016/j.cub.2017.12.002. [DOI] [PubMed] [Google Scholar]
  54. McCloskey RJ, Fouad AD, Churgin MA, Fang-Yen C. Food responsiveness regulates episodic behavioral states in Caenorhabditis elegans. Journal of Neurophysiology. 2017;117:1911–1934. doi: 10.1152/jn.00555.2016. [DOI] [PMC free article] [PubMed] [Google Scholar]
  55. Nagy S, Huang YC, Alkema MJ, Biron D. Caenorhabditis elegans exhibit a coupling between the defecation motor program and directed locomotion. Scientific Reports. 2015;5:17174. doi: 10.1038/srep17174. [DOI] [PMC free article] [PubMed] [Google Scholar]
  56. Nath RD, Chow ES, Wang H, Schwarz EM, Sternberg PW. C. elegans Stress-Induced sleep emerges from the collective action of multiple neuropeptides. Current Biology. 2016;26:2446–2455. doi: 10.1016/j.cub.2016.07.048. [DOI] [PMC free article] [PubMed] [Google Scholar]
  57. Nelson MD, Lee KH, Churgin MA, Hill AJ, Van Buskirk C, Fang-Yen C, Raizen DM. FMRFamide-like FLP-13 neuropeptides promote quiescence following heat stress in Caenorhabditis elegans. Current Biology. 2014;24:2406–2410. doi: 10.1016/j.cub.2014.08.037. [DOI] [PMC free article] [PubMed] [Google Scholar]
  58. Nguyen JP, Shipley FB, Linder AN, Plummer GS, Liu M, Setru SU, Shaevitz JW, Leifer AM. Whole-brain calcium imaging with cellular resolution in freely behaving Caenorhabditis elegans. PNAS. 2016;113:E1074–E1081. doi: 10.1073/pnas.1507110112. [DOI] [PMC free article] [PubMed] [Google Scholar]
  59. Nichols ALA, Eichler T, Latham R, Zimmer M. A global brain state underlies C. elegans sleep behavior. Science. 2017;356:eaam6851. doi: 10.1126/science.aam6851. [DOI] [PubMed] [Google Scholar]
  60. Pirri JK, McPherson AD, Donnelly JL, Francis MM, Alkema MJ. A tyramine-gated chloride channel coordinates distinct motor programs of a Caenorhabditis elegans escape response. Neuron. 2009;62:526–538. doi: 10.1016/j.neuron.2009.04.013. [DOI] [PMC free article] [PubMed] [Google Scholar]
  61. Raizen DM, Zimmerman JE, Maycock MH, Ta UD, You YJ, Sundaram MV, Pack AI. Lethargus is a Caenorhabditis elegans sleep-like state. Nature. 2008;451:569–572. doi: 10.1038/nature06535. [DOI] [PubMed] [Google Scholar]
  62. Rhoades JL, Nelson JC, Nwabudike I, Yu SK, McLachlan IG, Madan GK, Abebe E, Powers JR, Colón-Ramos DA, Flavell SW. ASICs mediate food responses in an enteric serotonergic neuron that controls foraging behaviors. Cell. 2019;176:85–97. doi: 10.1016/j.cell.2018.11.023. [DOI] [PMC free article] [PubMed] [Google Scholar]
  63. Saper CB, Fuller PM, Pedersen NP, Lu J, Scammell TE. Sleep state switching. Neuron. 2010;68:1023–1042. doi: 10.1016/j.neuron.2010.11.032. [DOI] [PMC free article] [PubMed] [Google Scholar]
  64. Sawin ER, Ranganathan R, Horvitz HR. C. elegans locomotory rate is modulated by the environment through a dopaminergic pathway and by experience through a serotonergic pathway. Neuron. 2000;26:619–631. doi: 10.1016/S0896-6273(00)81199-X. [DOI] [PubMed] [Google Scholar]
  65. Schafer WR. Egg-laying. WormBook. 2005:1–7. doi: 10.1895/wormbook.1.38.1. [DOI] [PMC free article] [PubMed] [Google Scholar]
  66. Scheller RH, Jackson JF, McAllister LB, Schwartz JH, Kandel ER, Axel R. A family of genes that codes for ELH, a neuropeptide eliciting a stereotyped pattern of behavior in Aplysia. Cell. 1982;28:707–719. doi: 10.1016/0092-8674(82)90050-2. [DOI] [PubMed] [Google Scholar]
  67. Schwarz RF, Branicky R, Grundy LJ, Schafer WR, Brown AE. Changes in postural syntax characterize sensory modulation and natural variation of C. elegans Locomotion. PLOS Computational Biology. 2015;11:e1004322. doi: 10.1371/journal.pcbi.1004322. [DOI] [PMC free article] [PubMed] [Google Scholar]
  68. Stephens GJ, Johnson-Kerner B, Bialek W, Ryu WS. Dimensionality and dynamics in the behavior of C. elegans. PLOS Computational Biology. 2008;4:e1000028. doi: 10.1371/journal.pcbi.1000028. [DOI] [PMC free article] [PubMed] [Google Scholar]
  69. Stern S, Kirst C, Bargmann CI. Neuromodulatory control of Long-Term behavioral patterns and individuality across development. Cell. 2017;171:1649–1662. doi: 10.1016/j.cell.2017.10.041. [DOI] [PubMed] [Google Scholar]
  70. Taghert PH, Nitabach MN. Peptide neuromodulation in invertebrate model systems. Neuron. 2012;76:82–97. doi: 10.1016/j.neuron.2012.08.035. [DOI] [PMC free article] [PubMed] [Google Scholar]
  71. Tanimoto Y, Zheng YG, Fei X, Fujie Y, Hashimoto K, Kimura KD. In actio optophysiological analyses reveal functional diversification of dopaminergic neurons in the nematode C. elegans. Scientific Reports. 2016;6:26297. doi: 10.1038/srep26297. [DOI] [PMC free article] [PubMed] [Google Scholar]
  72. Tanis JE, Bellemer A, Moresco JJ, Forbush B, Koelle MR. The potassium chloride cotransporter KCC-2 coordinates development of inhibitory neurotransmission and synapse structure in Caenorhabditis elegans. Journal of Neuroscience. 2009;29:9943–9954. doi: 10.1523/JNEUROSCI.1989-09.2009. [DOI] [PMC free article] [PubMed] [Google Scholar]
  73. Thomas JH. Genetic analysis of defecation inCaenorhabditis elegans. Genetics. 1990;124:855–872. doi: 10.1093/genetics/124.4.855. [DOI] [PMC free article] [PubMed] [Google Scholar]
  74. Van Buskirk C, Sternberg PW. Epidermal growth factor signaling induces behavioral quiescence in Caenorhabditis elegans. Nature Neuroscience. 2007;10:1300–1307. doi: 10.1038/nn1981. [DOI] [PubMed] [Google Scholar]
  75. Venkatachalam V, Ji N, Wang X, Clark C, Mitchell JK, Klein M, Tabone CJ, Florman J, Ji H, Greenwood J, Chisholm AD, Srinivasan J, Alkema M, Zhen M, Samuel AD. Pan-neuronal imaging in roaming Caenorhabditis elegans. PNAS. 2016;113:E1082–E1088. doi: 10.1073/pnas.1507109113. [DOI] [PMC free article] [PubMed] [Google Scholar]
  76. Wakabayashi T, Kitagawa I, Shingai R. Neurons regulating the duration of forward locomotion in Caenorhabditis elegans. Neuroscience Research. 2004;50:103–111. doi: 10.1016/j.neures.2004.06.005. [DOI] [PubMed] [Google Scholar]
  77. Wen Q, Po MD, Hulme E, Chen S, Liu X, Kwok SW, Gershow M, Leifer AM, Butler V, Fang-Yen C, Kawano T, Schafer WR, Whitesides G, Wyart M, Chklovskii DB, Zhen M, Samuel AD. Proprioceptive coupling within motor neurons drives C. elegans forward locomotion. Neuron. 2012;76:750–761. doi: 10.1016/j.neuron.2012.08.039. [DOI] [PMC free article] [PubMed] [Google Scholar]
  78. White JG, Southgate E, Thomson JN, Brenner S. The structure of the nervous system of the nematodeCaenorhabditis elegans. Philosophical Transactions of the Royal Society of London. Series B, Biological Sciences. 1986;314:1–340. doi: 10.1098/rstb.1986.0056. [DOI] [PubMed] [Google Scholar]
  79. Wiltschko AB, Johnson MJ, Iurilli G, Peterson RE, Katon JM, Pashkovski SL, Abraira VE, Adams RP, Datta SR. Mapping Sub-Second structure in mouse behavior. Neuron. 2015;88:1121–1135. doi: 10.1016/j.neuron.2015.11.031. [DOI] [PMC free article] [PubMed] [Google Scholar]
  80. Yemini E, Jucikas T, Grundy LJ, Brown AE, Schafer WR. A database of Caenorhabditis elegans behavioral phenotypes. Nature Methods. 2013;10:877–879. doi: 10.1038/nmeth.2560. [DOI] [PMC free article] [PubMed] [Google Scholar]
  81. Yemini E, Hobert O. NeuroPAL: a neuronal polychromatic atlas of landmarks for Whole-Brain imaging in C. elegans. bioRxiv. 2020 doi: 10.1101/676312. [DOI]
  82. Yeon J, Kim J, Kim DY, Kim H, Kim J, Du EJ, Kang K, Lim HH, Moon D, Kim K. A sensory-motor neuron type mediates proprioceptive coordination of steering in C. elegans via two TRPC channels. PLOS Biology. 2018;16:e2004929. doi: 10.1371/journal.pbio.2004929. [DOI] [PMC free article] [PubMed] [Google Scholar]
  83. Zelikowsky M, Hui M, Karigo T, Choe A, Yang B, Blanco MR, Beadle K, Gradinaru V, Deverman BE, Anderson DJ. The Neuropeptide Tac2 Controls a Distributed Brain State Induced by Chronic Social Isolation Stress. Cell. 2018;173:1265–1279. doi: 10.1016/j.cell.2018.03.037. [DOI] [PMC free article] [PubMed] [Google Scholar]

Decision letter

Editor: Manuel Zimmer1

In the interests of transparency, eLife publishes the most substantive revision requests and the accompanying author responses.

Acceptance summary:

This paper presents a new imaging setup and analysis pipeline to comprehensively record different C. elegans behaviours like egg-laying and locomotion in unprecedented quantitative details and over long time-scales. Using this approach, Cermak and colleagues present evidence indicating that behavioural diversity during locomotion is generated from a finite number of discrete behavioural states, thereby addressing a fundamental problem in ethology. Moreover, the authors discovered that egg laying rates are particularly coupled to the roaming state via dopaminergic circuits, which enables an optimal dispersal of eggs in the environment.

Decision letter after peer review:

Thank you for submitting your article "Whole-organism behavioral profiling reveals a role for dopamine in state-dependent motor program coupling in C. elegans" for consideration by eLife. Your article has been reviewed by two peer reviewers, one of whom is a member of our Board of Reviewing Editors, and the evaluation has been overseen by Ronald Calabrese as the Senior Editor. The reviewers have opted to remain anonymous.

The reviewers have discussed the reviews with one another and the Reviewing Editor has drafted this decision to help you prepare a revised submission.

As the editors have judged that your manuscript is of interest, but as described below that additional experiments are required before it is published, we would like to draw your attention to changes in our revision policy that we have made in response to COVID-19 (https://elifesciences.org/articles/57162). First, because many researchers have temporarily lost access to the labs, we will give authors as much time as they need to submit revised manuscripts. We are also offering, if you choose, to post the manuscript to bioRxiv (if it is not already there) along with this decision letter and a formal designation that the manuscript is 'in revision at eLife'. Please let us know if you would like to pursue this option. (If your work is more suitable for medRxiv, you will need to post the preprint yourself, as the mechanisms for us to do so are still in development.)

Summary:

Cermak et al. describe in this manuscript a new imaging setup that allows for both very detailed and comprehensive behavioral analysis while simultaneously performing calcium imaging or optogenetics in C. elegans. The setup potentially could be adapted for other small model organisms. The approach allows to record simultaneously the worm's major behaviors, i.e. locomotion, like egg laying, defecation and feeding, across multiple timescales (from ms to hs). Using an unsupervised learning approach adapted from a previous study they classify C. elegans locomotion behavior into the known roaming and dwelling states but in addition claim that dwelling can be subdivided into eight different sub-states. A major new finding is that egg laying behavior occurs more frequently during the roaming state, and subsequent genetics experiments indicate that dopamine is involved in this coupling. To further investigate the dopamine circuits, they optogenetically activate or suppress dopamine neurons and measure the effects on egg laying during roaming vs. other states. Indeed, suppression of dopaminergic neurons reduces egg laying mostly during the roaming state. Activation of the same dopaminergic neurons, however, could not increase the egg-laying rate, which the authors attribute to a ceiling effect. Next, they perform calcium imaging of the dopaminergic neuron PDE and find that its activity is highly correlated with the phase of the worm's undulatory gate. Egg laying occurs mostly after the PDE activity peak, and this coupling of PDE and egg laying is abolished in dopamine mutants. Lastly, they identify that GABA production by VD/DD neurons as an inhibitory signal that reduces egg laying during dwelling and off food roaming.

Essential revisions:

1) I am very enthusiastic about the behavioral profiling approach, which to my knowledge is unprecedented in its ability to quantitatively assess qualitatively different behaviors across different times-scales. This has not been achieved in worms before, neither in other models like rodents or flies. Here, comprehensive analysis of behavior relied so far largely on indirect readouts via image processing pipelines, but cannot directly measure the kinematics of behaviors, like gates etc. See for comparison (Berman, 2014) or (Wiltschko, 2015). Unfortunately, I am less excited about how superficially and uncritical the authors describe the major results from this approach.

1.1.) Building-up on an approach developed by Schwarz, 2015, the authors cluster a posture-transitions matrix, and based on its modular structure fit an HMM, finally proposing 9 behavioral states that underlie these blocks of postural sequences. While I am convinced that this procedure was designed carefully and formally segregates blocks of postural sequences that cluster in a statistically significant manner (Please represent the data in Figure 1—figure supplement 1G, J, and N, in the form of a confusion matrix, and calculate the accuracy), based on the lack of any further validation I am less convinced that these indeed represent distinct behaviors in an ethologically meaningful way. Based on the analysis in Figure 2E and upon inspecting Video 1, the 8 dwelling states seem the same behavior to me. Although they might occupy slightly different ranges on a continuous spectrum of behavioral parameters, like speed, I don't see qualitative different behaviors. We would like to see behavioral classifications evaluated more quantitatively. During dwelling, worms are very slow and by chance can pause in different postures while continuously engaging in foraging movements, called. "head sweeping"; why, for example should "shallow bends; ventral head sweeps" be a qualitative distinct behavior than "shallow bends; dorsal head sweeps" or "shallow bends; head sweeping"? Here, the worms might end pausing more frequently in some overrepresented postures but otherwise by chance, while continuing sweeping their heads. This is a trivial explanation that can lead to significant clustering, but speaking against the claim of distinct behavioral states. The manuscript text is very brief and superficial in describing the various dwelling states and no subsequent evaluation of them is provided. Gallagher, 2013, provided evidence for a continuous spectrum of dwelling-like states, which was compelling. Please provide quantifications indicating that the discretization into 8 dwelling states is a better representation of behavior versus the alternative continuous model.

1.2.) I am puzzled why this sophisticated approach fails in detecting well characterized behavioral states, like forward, reversals and omega turns, with known robust transition dynamics. Also, quiescence is not detected, which was recently shown to occur in adults on food. I wonder where these limitations come from. This should at least be intensively discussed in the manuscript.

2) Figure 1F: the eigenworm approach is not described in the Materials and methods, which should be done in a revised manuscript. Also unclear is what the "most commonly observed postures" are and how were they determined. I assume these are the eigenworms as described by Stephens, but then they should be called like this and labelled. If this is the case, then these eigenworms could not be calculated from the entire dataset as described in the text, but from the 4 bins; otherwise they would not differ. This needs to be clarified and a Materials and methods section has to be added. The 2D histograms should not be called eigenworms but 2D histograms of the projection amplitudes a1-a4 like in Stephens. The authors should make more effort in interpreting these histograms, otherwise a non-expert in the eigenworm approach is completely left alone here.

3) I could not understand the most important aspect of this paper: the relationships among behavioral status, dopamine signaling, and egg-laying. A simple interpretation of Figures 4 and 5 is that, during roaming, speed and body bending rates are high, PDE is more activated, and egg-laying is increased. Conversely, during dwelling, speed and body bending rates are low, PDE is less activated, and egg-laying is not increased. If this is the case, DA is not related to behavioral states; instead, it is a link between physical body movement and egg-laying. This possibility is consistent with a simple interpretation of Figure 3 that cat-2 cannot increase egg-laying during roaming because the DA level is always low in cat-2. Body movements may somehow increase egg-laying during roaming, which is independent of DA signaling. Is phase locking of PDE activity and egg laying specific to roaming states? Please repeat all analyses in entire Figure 5 separating the data into roaming vs. dwelling. It is possible that PDE is simply a food gated proprioceptor monitoring speed (or bends) on food. This interpretation speaks against egg laying frequency explicitly coupled to a behavioral roaming state but simply coupled to speed. This should be tested and better discussed.

4) PDE specific rescue of cat-2 would support the specific involvement of PDE; in case this is too difficult with available promoters or intersectional expression strategies, at least PDE cell ablation should be performed to show that PDE Is specifically required for the coupling of egg-laying to roaming.

5) The opposite effect of unc-25 mutation on egg laying during roaming vs. dwelling is interesting but confusing; as well as the off-food effect. I wonder whether GABA is really specifically involved in the coupling of egg-laying to roaming, and whether this fits really into the whole story. Further evidence should be provided that dopaminergic and GABAergic circuits indeed signal to each other. As the authors discuss, dop-2/3 might act in the GABA neurons, specifically VD/DD. The authors should show cell specific rescue of roaming-egg laying coupling via dop-2/3 in GABA neurons, this would also address at least partially address the problem that the authors did not test multiple alleles of dop-2/3.

6) The ethological relevance of egg-laying coupling to roaming is too briefly discussed. Animals spend most of their time on food dwelling and egg laying is not exclusive to roaming; thus, in total a good proportion of eggs laid is during dwelling. These numbers should be quantified here. Moreover, what is the effect of cat-2 or dop-2/3 mutation on the overall dispersal of eggs; the authors should be able to extract the dispersal of eggs from their data and quantify this across the various mutants analyzed here. I think such an analysis could significantly elevate the impact of this study from an ethological viewpoint.

eLife. 2020 Jun 8;9:e57093. doi: 10.7554/eLife.57093.sa2

Author response


Essential revisions:

1) I am very enthusiastic about the behavioral profiling approach, which to my knowledge is unprecedented in its ability to quantitatively assess qualitatively different behaviors across different times-scales. This has not been achieved in worms before, neither in other models like rodents or flies. Here, comprehensive analysis of behavior relied so far largely on indirect readouts via image processing pipelines, but cannot directly measure the kinematics of behaviors, like gates etc. See for comparison (Berman, 2014) or (Wiltschko, 2015). Unfortunately, I am less excited about how superficially and uncritical the authors describe the major results from this approach.

1.1.) Building-up on an approach developed by Schwarz, 2015, the authors cluster a posture-transitions matrix, and based on its modular structure fit an HMM, finally proposing 9 behavioral states that underlie these blocks of postural sequences. While I am convinced that this procedure was designed carefully and formally segregates blocks of postural sequences that cluster in a statistically significant manner (Please represent the data in Figure 1—figure supplement 1G, J, and N, in the form of a confusion matrix, and calculate the accuracy), based on the lack of any further validation I am less convinced that these indeed represent distinct behaviors in an ethologically meaningful way. Based on the analysis in Figure 2E and upon inspecting Video 1, the 8 dwelling states seem the same behavior to me. Although they might occupy slightly different ranges on a continuous spectrum of behavioral parameters, like speed, I don't see qualitative different behaviors. We would like to see behavioral classifications evaluated more quantitatively. During dwelling, worms are very slow and by chance can pause in different postures while continuously engaging in foraging movements, called. "head sweeping"; why, for example should "shallow bends; ventral head sweeps" be a qualitative distinct behavior than "shallow bends; dorsal head sweeps" or "shallow bends; head sweeping"? Here, the worms might end pausing more frequently in some overrepresented postures but otherwise by chance, while continuing sweeping their heads. This is a trivial explanation that can lead to significant clustering, but speaking against the claim of distinct behavioral states. The manuscript text is very brief and superficial in describing the various dwelling states and no subsequent evaluation of them is provided. Gallagher, 2013, provided evidence for a continuous spectrum of dwelling-like states, which was compelling. Please provide quantifications indicating that the discretization into 8 dwelling states is a better representation of behavior versus the alternative continuous model.

We performed new analyses to examine whether discretization into 8 dwelling sub-modes provides a better representation of behavior versus more continuous models. We also tested whether this discretization into different sub-modes was supported by independent analyses of the data.

First, we compared how well the HMM described in our study recapitulates data from actual animals, compared to alternative continuous models (Figure 2—figure supplement 5). Here, we compared how well posture sequences generated by three different models resembled data from actual animals. The three models were:

1) The HMM with 8 dwelling sub-modes described in our study

2) A model where animals transition between the 100 compendium postures in a continuous fashion during dwelling, with transition rates between postures determined by those measured in actual animals (i.e. the transition matrix in Figure 2C)

3) A model where animals transition between the 100 compendium postures in a continuous fashion during dwelling, with transition rates between postures determined by posture similarity

We generated posture sequences from all three models while keeping other parameters identical across the models (time spent in a given posture, length of posture sequences generated, durations of dwelling states, etc; see Materials and methods for details). As a metric of how well the posture sequences generated by each model resembled those from actual animals, we computed the average duration of time between observing each pair of postures, resulting in a 100x100 matrix (e.g. animals in posture #59 took 21sec on average to next emit posture #61, but took 2.7min on average to next emit posture #31). This metric captures the higher order patterns in which animals actually emit their postures, but does not assume any particular underlying structure. We compared values from our synthetic posture sequences to those from actual animals and found that the HMM with 8 dwelling sub-modes provided a significantly greater match to actual animal data (Figure 2—figure supplement 5A-B). This was mostly because the synthetic posture sequences from the continuous models had shorter durations of time between postures than was actually observed in the real data. These data suggest that there is long timescale stereotypy in how animals emit their postures during dwelling and that this stereotypy is better recapitulated by the HMM compared to alternative continuous models. In addition this analysis, we also provide a more discernible image of the transition probabilities between the 8 dwelling sub-modes so that this underlying structure can be more easily examined by readers (Figure 2—figure supplement 4C). (finally, we note that our BIC analysis comparing the 9-state HMM to models with fewer states also corroborates this interpretation; Figure 2—figure supplement 2D)

We also examined whether the discretization of dwelling into different sub-modes was supported by analyses of the other behavioral parameters (i.e. not posture, which was used to train the model). Here, we asked whether the inferred moments of state transitions between the dwelling sub-modes were accompanied by any sudden, reliable changes in other behavioral parameters, as might be expected if they were indeed reliable changepoints in behavior (Figure 2—figure supplement 7). Thus, we examined other behavioral parameters at moments of commonly occurring state transitions (not all types of state transitions actually happen, since the transition probabilities from some states to others are essentially zero). Strikingly, we observed that sudden and transient changes in velocity, pumping, and defecation reliably occurred at most of these state transitions (Figure 2—figure supplement 7). The typical behavioral changes that accompany state transitions were different for different types of state transitions (e.g. Dwell4 to Dwell2). These data suggest that the discrete transitions between dwelling sub-modes are reliable changepoints in behavior. We speculate that some of these behavioral changes (DMP event that involves peptide release from the gut; change in food ingestion) could be causal factors in driving state transitions, though further studies will be necessary to fully understand these relationships.

We also added confusion matrices to Figure 1—figure supplement 2G, J, as requested. We could not report data in this form for 2O, since pumping validation was not conducted on a per-pump basis (instead on a per-20s video basis), so we added statistical analysis to this figure panel.

1.2.) I am puzzled why this sophisticated approach fails in detecting well characterized behavioral states, like forward, reversals and omega turns, with known robust transition dynamics. Also, quiescence is not detected, which was recently shown to occur in adults on food. I wonder where these limitations come from. This should at least be intensively discussed in the manuscript.

Based on this suggestion, we examined our data for instances of quiescence, which we defined as a cessation of locomotion, pumping, and defecation for at least 20sec (a permissive estimate, based on Gallagher et al., 2013; Gonzales et al., 2019; and others). We only found five such events in ~180 hours of wild-type data. We included one such example in the revised manuscript (Figure 2—figure supplement 3B) to indicate the potential use of this tracking system for studying quiescence/sleep. We also explain that quiescence is not robustly observed under our recording conditions, which reveals why it was not uncovered as a reliable state in any of our analyses (subsection “Posture-HMM identifies the roaming state and distinct sub-modes of dwelling”, first paragraph).

With regards to forward vs. reverse movement, dwelling animals constantly transition between these directions, often very rapidly. Indeed, individual posture groups (Figure 2C) contain a mixture of postures typical of forward and reverse movement (new Figure 2—figure supplement 1). Therefore, the HMM defined long time-scale states that each typically include multiple F->R and R->F transitions. We describe the relationship of these timescales in better detail in the revised manuscript, as suggested (subsection “Unsupervised classification of C. elegans behavioral states based on postural changes”).

Finally, our analysis of posture did not reliably quantify omega bends, as we were unable to algorithmically resolve the head vs. tail when the animal contacted itself. Thus, time points when animals adopted these postures were excluded from our analyses (since we could not be confident that the precise posture was called correctly). This point (which was previously described only in the Materials and methods section) is now mentioned in the Results section as well.

2) Figure 1F: the eigenworm approach is not described in the Materials and methods, which should be done in a revised manuscript. Also unclear is what the "most commonly observed postures" are and how were they determined. I assume these are the eigenworms as described by Stephens, but then they should be called like this and labelled. If this is the case, then these eigenworms could not be calculated from the entire dataset as described in the text, but from the 4 bins; otherwise they would not differ. This needs to be clarified and a Materials and methods section has to be added. The 2D histograms should not be called eigenworms but 2D histograms of the projection amplitudes a1-a4 like in Stephens. The authors should make more effort in interpreting these histograms, otherwise a non-expert in the eigenworm approach is completely left alone here.

We have made the requested changes. The eigenworm analysis is described in the Materials and methods; the “commonly observed postures” are precisely described in the figure legends (Figure 1 legend); the axes of the 2D histograms have been relabeled as a1-a4 like in Stephens; and the Results section has a more detailed interpretation of these histograms (subsection “The distinct motor programs in C. elegans are coordinated with one another”).

3) I could not understand the most important aspect of this paper: the relationships among behavioral status, dopamine signaling, and egg-laying. A simple interpretation of Figures 4 and 5 is that, during roaming, speed and body bending rates are high, PDE is more activated, and egg-laying is increased. Conversely, during dwelling, speed and body bending rates are low, PDE is less activated, and egg-laying is not increased. If this is the case, DA is not related to behavioral states; instead, it is a link between physical body movement and egg-laying. This possibility is consistent with a simple interpretation of Figure 3 that cat-2 cannot increase egg-laying during roaming because the DA level is always low in cat-2. Body movements may somehow increase egg-laying during roaming, which is independent of DA signaling. Is phase locking of PDE activity and egg laying specific to roaming states? Please repeat all analyses in entire Figure 5 separating the data into roaming vs. dwelling. It is possible that PDE is simply a food gated proprioceptor monitoring speed (or bends) on food. This interpretation speaks against egg laying frequency explicitly coupled to a behavioral roaming state but simply coupled to speed. This should be tested and better discussed.

We performed new analyses to disentangle the relationships between speed, behavioral state, PDE activity, and egg-laying. Specifically, we aimed to separate out how behavioral state (roam vs. dwell) and animal movement (velocity) each impact egg-laying frequency and PDE activity. First, we plotted animal velocity vs. egg-laying frequency, separating out data during roaming and dwelling (new Figure 2F). If behavioral state were irrelevant, then these curves (roaming and dwelling) would be overlaid, at least for the range of velocities that can be observed in both states. If velocity were irrelevant, then the egg-laying frequency during roaming would be greater than that during dwelling, with no influence of velocity on egg-laying frequencies within each state. What we observed is clear evidence that speed and state are both critical: egg-laying rates are generally higher at higher animal speeds, but the rates during roaming are universally higher than those during dwelling, even when matched for velocity (Figure 2F). Plots of PDE activity show similar relationships (Figure 6—figure supplement 1B). These analyses are most consistent with the interpretation that PDE and egg-laying events are tied to animal speed on food, but are particularly robustly activated by the animal’s gait during roaming. We discuss this interpretation in the revised manuscript (subsections “Dopamine signaling promotes egg-laying during roaming states” and “Calcium dynamics in dopaminergic PDE neurons are phase-locked to egg-laying during roaming states”).

We also plotted the other data in Figure 5, separating out roaming versus dwelling, as requested (Figure 6—figure supplement 1B-C). However, we wish to note that the polar plots in Figure 6D-G were only plotted for roaming and cannot be constructed for dwelling. This is because obtaining the phase of the propagating sinusoidal wave (essential to generate these plots) is trivial during roaming, but impossible during dwelling, since dwelling animals frequently display non-sinusoidal body shapes (kinked postures, etc). To get at this same issue, though, we plotted the average postures of animals prior to egg-laying events during roaming vs. dwelling as average trajectories through PCA space (i.e. in plots with axes representing the projection amplitudes of the eigenworms). These plots that show that roaming animals proceed through a reliable posture trajectory just before egg-laying, which includes the phase of the sinusoidal wave at which PDE is maximally active (Figure 6—figure supplement 1G). However, dwelling animals’ postures are notably different prior to egg-laying events, even though the postures converge to be essentially the same at the precise moment of egg-laying. These data show that the sequence of postures that precede egg-laying are notably different during roaming vs. dwelling. This suggests that the animal’s gait during roaming phase-locks PDE activity to egg-laying events and that the animal’s gait during dwelling results in a different coupling of body posture to egg-laying. These analyses are included in the revised figures, and we expanded the text to fully unpack these new observations (subsection “Calcium dynamics in dopaminergic PDE neurons are phase-locked to egg-laying during roaming states”).

4) PDE specific rescue of cat-2 would support the specific involvement of PDE; in case this is too difficult with available promoters or intersectional expression strategies, at least PDE cell ablation should be performed to show that PDE Is specifically required for the coupling of egg-laying to roaming.

While we agree that this would be an interesting experiment to perform, we already have several lines of evidence in the paper showing that PDE and three other dopaminergic neurons are functionally required for state-dependent egg-laying (opto activation, opto silencing, and mutant analysis of dopamine-deficient animals). We also performed in vivo calcium imaging of all four neurons and only PDE has an activity profile that is correlated with state-dependent egg-laying. Moreover, only PDE has a neurite that comes into proximity of the egg-laying circuit (the other three neurons are confined to the head). While we cannot rule out a role for the other three neuron classes, these existing data already suggest a specialized function for PDE. We have added a discussion of this point in the revised manuscript (Discussion, fourth paragraph). (In addition, we wish to note that we contacted the eLife editorial team to inform them that our research lab remains closed due to Covid-19, and they suggested that we proceed with resubmission, given the circumstances)

5) The opposite effect of unc-25 mutation on egg laying during roaming vs. dwelling is interesting but confusing; as well as the off-food effect. I wonder whether GABA is really specifically involved in the coupling of egg-laying to roaming, and whether this fits really into the whole story. Further evidence should be provided that dopaminergic and GABAergic circuits indeed signal to each other. As the authors discuss, dop-2/3 might act in the GABA neurons, specifically VD/DD. The authors should show cell specific rescue of roaming-egg laying coupling via dop-2/3 in GABA neurons, this would also address at least partially address the problem that the authors did not test multiple alleles of dop-2/3.

Our existing data in the paper provide evidence of an interaction between dopamine and GABA: the effect of dopaminergic neuron activation on egg-laying is abolished in GABA-deficient mutants and in unc-30 mutants lacking GABA specifically in VD/DD neurons. It is possible that this reflects a direct effect of dopamine on VD/DD neurons. Alternatively, there may be intermediate neurons between the dopaminergic neurons and VD/DD neurons, or some other type of interaction. We agree this this is an interesting topic, but teasing this out would likely require a substantial set of new experiments. We have added a discussion about this point to the revised manuscript (Discussion, fifth paragraph). (In addition, we wish to note that we contacted the eLife editorial team to inform them that our research lab remains closed due to Covid-19, and they suggested we proceed with resubmission, given the circumstances)

6) The ethological relevance of egg-laying coupling to roaming is too briefly discussed. Animals spend most of their time on food dwelling and egg laying is not exclusive to roaming; thus, in total a good proportion of eggs laid is during dwelling. These numbers should be quantified here. Moreover, what is the effect of cat-2 or dop-2/3 mutation on the overall dispersal of eggs; the authors should be able to extract the dispersal of eggs from their data and quantify this across the various mutants analyzed here. I think such an analysis could significantly elevate the impact of this study from an ethological viewpoint.

We performed new analyses to examine the spatial distribution in which eggs are laid, aiming to understand how egg-laying during roaming vs. dwelling impacts the overall distribution and how dopamine contributes to these effects. We analyzed the spatial distribution of eggs in two ways. First, to understand the degree to which eggs are dispersed relative to one another, we measured the average distances between eggs (e.g. average distance between a given egg and its k nearest neighbors). As expected, this revealed that eggs laid during roaming are more widely dispersed from other eggs than those laid during dwelling (Figure 4A). Next, to examine how effectively each animals disperses its eggs overall, we quantified the degree to which each recorded animal dispersed its eggs over the entire area that it explored (by virtually superimposing a grid on the plate and quantifying the # of squares with eggs, normalized to area explored). This revealed that eggs were more widely dispersed across the explored area during roaming as compared to dwelling (Figure 4B-C). Notably, this assay also showed that cat-2 and dop-2;dop-3 mutants displayed a significant deficit wherein they did not disperse their eggs as widely as wild-type animals (Figure 4B-C). These data suggest that the coupling of egg-laying to roaming increases the degree to which animals disperse their eggs while exploring a food source. This could have important implications for the overall survival of an animal’s progeny, which we discuss in the revised manuscript (subsection “The coupling between egg-laying and roaming states enhances the dispersal of eggs across a food source”; and Discussion, third paragraph).

We also provide plots showing the percent of eggs laid during roaming vs. dwelling for WT animals and dopamine pathways mutants, as requested (Figure 4—figure supplement 1). ~60% of eggs are laid during roaming in WT, but this is significantly reduced in cat-2 and dop-2;dop-3 mutants.

Associated Data

    This section collects any data citations, data availability statements, or supplementary materials included in this article.

    Data Citations

    1. Cermak N, Yu SK, Clark R, Huang Y-C, Baskoylu S, Flavell SW. 2020. Behavioral and GCaMP data. Dryad Digital Repository. [DOI] [PMC free article] [PubMed]

    Supplementary Materials

    Supplementary file 1. Details about statistical tests.

    This excel sheet includes a detailed description of each statistical test carried out in this study.

    elife-57093-supp1.xlsx (46.5KB, xlsx)
    Transparent reporting form

    Data Availability Statement

    Data have been uploaded to Dryad (https://doi.org/10.5061/dryad.t4b8gthzf) and are publicly available.

    The following dataset was generated:

    Cermak N, Yu SK, Clark R, Huang Y-C, Baskoylu S, Flavell SW. 2020. Behavioral and GCaMP data. Dryad Digital Repository.


    Articles from eLife are provided here courtesy of eLife Sciences Publications, Ltd

    RESOURCES