Sleep Analysis in Adult C. elegans Reveals State-Dependent Alteration of Neural and Behavioral Responses

Sleep, a state of quiescence associated with growth and restorative processes, is conserved across species. Invertebrates including the nematode Caenorhabditis elegans exhibit sleep-like states during development, satiety, and stress. Here, we describe behavior and neural activity during sleep and awake states in adult C. elegans hermaphrodites using new microfluidic methods. We observed effects of fluid flow, oxygen, feeding, odors, and genetic perturbations on long-term sleep behavior over 12 h. We developed a closed-loop sleep detection system to automatically deliver chemical stimuli to assess sleep-dependent changes to evoked neural responses in individual animals. Sleep increased the arousal threshold to aversive stimulation, yet the associated sensory neuron and first-layer interneuron responses were unchanged. This localizes adult sleep-dependent neuromodulation within interneurons presynaptic to the premotor interneurons, rather than afferent sensory circuits. However, sleep prolonged responses in appetitive chemosensory neurons, suggesting that sleep modulates responsiveness specifically across sensory systems rather than broadly damping global circuit activity. SIGNIFICANCE STATEMENT Much is known about molecular mechanisms that facilitate sleep control. However, it is unclear how these pathways modulate neural circuit-level sensory processing or how misregulation of neural activity contributes to sleep disorders. The nematode Caenorhabditis elegans provides the ability to study neural circuitry with single-neuron resolution, and recent studies examined sleep states between developmental stages and when stressed. Here, we examine an additional form of spontaneous sleep in adult C. elegans at the behavioral and neural activity levels. Using a closed-loop system, we show that delayed behavioral responses to aversive chemical stimulation during sleep arise from sleep-dependent sensorimotor modulation localized presynaptic to the premotor circuit, rather than early sensory circuits.


Introduction
Sleep is a physiological state during which voluntary muscle activity ceases, sensory processing is modulated (Velluti, 1997), and anabolic, growth, and restorative processes occur in the brain and other tissues (Adam and Oswald, 1977). Sleep is observed across species, from mammals to invertebrates (Campbell and Tobler, 1984), where it controls energy usage and metabolism (Schmidt, 2014), macromolecular biosynthesis (Mackiewicz et al., 2007), and neural plasticity and memory consolidation (Frank and Benington, 2006). Owing to these critical functions, sleep deficiencies are associated with impaired cognitive function, productivity (Rajaratnam et al., 2013), and immune response (Luyster et al., 2012) and increased prevalence of cardiovascular disease (Newman et al., 2000), diabetes (Gottlieb et al., 2005), and obesity (Hasler et al., 2004). The initiation and cessation of sleep is mediated in most species by circadian rhythms which are controlled by environmental factors (Reppert and Weaver, 2002) and timing
C. elegans sleep has been observed using a variety of experimental platforms, including agar  or agarose pads (Turek et al., 2015;Churgin et al., 2017) and microfluidic chambers that house individual animals (Singh et al., 2011;Nagy et al., 2014b;Huang et al., 2017;Gonzales et al., 2019) throughout multiple development stages. Neural activity measurements typically require immobilization by agarose pads (Spies and Bringmann, 2018) or microfluidic traps (Cho and Sternberg, 2014), which limit their use to developmentally-timed or induced sleep studies. However, adult sleep events occur spontaneously and are identified by analysis of locomotion and quiescent behaviors. Thus, to assess the functional circuit changes that occur during adult sleep, new methods for monitoring sleep state and stimulated neural responses in freely-moving animals are needed.
Here, we demonstrate two systems to quantify the behavioral and neural characteristics of sleep in young adult C. elegans. We first show that sleeping behavior exhibited by young adult C. elegans follows characteristic dynamics over 12 h in microfluidic devices and is altered by fluid flow, oxygen, bacterial food, food signals, and genetic perturbations affecting sensory input. Next, using a closed-loop chemical stimulation system, we observed an increased arousal threshold during adult sleep states, as has been observed previously in developmentallytimed sleep , and simultaneously monitored neural activity via fluorescence microscopy during these behavioral responses. A sleep-dependent delay in response to aversive stimulation corresponded to diminished and delayed responses in premotor interneurons. However, responses in associated sensory neurons and first-layer interneurons were not modulated by sleep, localizing sleep-state neural circuit modulation within interneurons of the aversive sensorimotor subcircuit. These results suggest that sleep specifically alters the linkage between sensory stimuli and premotor neurons without changing upstream sensory or interneuron information. In contrast, responses in the appetitive sensory neurons were prolonged during sleep, indicating that sleep can affect sensory modalities differently. Together, these results illustrate that sleep modulates neural activity differently across stimuli and validate an experimental system to further dissect the molecular processes that produce this specificity.

Materials and Methods
Strains and C. elegans culture All C. elegans strains were maintained under standard conditions on NGM plates and fed OP50 Escherichia coli bacteria seeded onto each plate. Wild-type animals were Bristol strain (N2). The following mutant strains were used: CB1611, mec-4 (e1611); FK103, tax-4 (ks28); CX32, odr-10 (ky32); IB16, ceh-17 (np1). Neural imaging strains expressing GCaMP in specific neurons were: (AWA; Larsch et al., 2013)   . To make the RIS imaging line, a 2643 bp region immediately upstream of the ATG of the flp-11 gene was amplified, similar to previously reported methods (Turek et al., 2016). This promoter was shown to express consistently in RIS and occasionally in other neurons (Turek et al., 2016). To synchronize for age, we picked L4 larval stage animals 1 d before experimentation such that all animals tested were at the young adult stage.
Animals were transferred to unseeded NGM plates immediately before experimentation. The plates were then flooded with the control buffer used for their respective experiment: S. basal buffer (100 mM NaCl, and 50 mM KPO 4 ; pH 6.0) for unfed behavioral experiments and diacetyl stimulus experiments, S. medium buffer (1-l S. basal, 10 ml 1 M potassium citrate pH 6.0, 10 ml trace metals solution, 3 ml 1 M CaCl 2 , and 3 ml 1 M MgSO 4 ) for feeding experiments, or a saline buffer (80 mM NaCl, 5 mM KCl, 20 mM D-glucose, 10 mM HEPES, 5 mM MgCl 2 , and 1 mM CaCl 2 ; pH 7.2) for copper chloride stimulus experiments. Animals were then collected into loading tubing using a 1-ml syringe before injection into the microfluidic arena (Lagoy and Albrecht, 2015).
Microfluidic device fabrication "Population behavior" and "neural imaging" microfluidic devices were fabricated as previously described (Lagoy and Albrecht, 2015). Briefly, transparency photomasks were printed at 25 000 dpi from designs sketched using DraftSight CAD software. SU-8 mold masters were prepared on silicon wafers using standard photolithography techniques, and microfluidic devices were fabricated by pouring degassed PDMS (Sylgard 184, Dow Corning) onto the mold and heat curing. Individual devices were then cut out and punched to provide inlet and outlet flow. A hydrophobic glass substrate was created by vapor deposition of tridecafluoro-1,1,2,2-tetrahydrooctyl trichlorosilane (TFOCS; Gelest) and then sealed reversibly to the microfluidic channels. An upper glass slide, with holes drilled over inlet and outlet ports with a diamond-coated drill bit, was sealed above the device, which was then was placed into a metal clamp.

Stimulus preparation
All odor dilutions were freshly prepared on the day of experimentation. NA22 E. coli stock solutions were prepared using previously described methods (Keil et al., 2017). Briefly, NA22 E. coli was cultured, concentrated into pellet form, and suspended in S. medium buffer. A stock solution was diluted to an OD600 of 7.0, and 50 mg/ml of kanamycin was added to prevent bacteria from growing. Chemical solutions were prepared at a 1:20 dilution of stock solution and filtered through a 5-mm filter. Diacetyl (1.1 mM) was prepared from a 10 À3 dilution (11 mM) stock solution immediately before experimentation. Serotonin was prepared by dissolving serotonin creatine sulfate monohydrate powder (Sigma  Figure 1. Young adult sleep in wild-type C. elegans in "population behavior" microfluidic devices. A, Schematic of the "population behavior" microfluidic device, including multiple inlets to switch fluids, four worm entry ports to introduce separate worm populations, and a flow outlet. B, Image frame of a device containing ;100 animals, ;25 in each of four separated 16 Â 15 mm arenas. C, Awake animals roam freely between 200-mm diameter microposts. An awake animal exhibits active contact (filled arrows) around posts along the entire body length. D, Distribution of behavior probability and average speed in the 60 s before and after sleep bouts of at least 1 min. Data are from 4359 sleep bouts from 697 wild-type animals over 12 h that had adjacent wake states at least 1 min (32% of total). Error bar shading in average speed plots indicate 95% confidence interval, and "forward only" speed excludes pauses and reverse behaviors. Example of 10 individual events is shown. Accuracy of automated sleep bout prediction is assessed in Table 2. E, A sleeping animal in the microfluidic device exhibits a straight head posture and the relaxed, bent body passively contacts only one to two posts (filled arrow) because of fluid flow, leaving others untouched (open arrows). F, Montage (10-s interval) of an animal transitioning between forward motion (red), pausing/creeping motion (pink) and sleep with characteristic head relaxation (blue). Black triangles represent a fixed position for each image located at the final position of the mouth, and microposts were background subtracted for clarity. solution would be devoid of oxygen for entire 12-h testing period. The control solution of sodium sulfate was created by allowing for reoxygenation of the sodium sulfite solution for .5 d. For neural imaging experiments, 1 mM copper chloride solution was prepared the day of the experiment using copper chloride powder.

Microfluidic device setup
Microfluidic devices were cleaned, assembled, and degassed in a vacuum desiccator for 30-60 min before experimentation. Degassing devices accelerates the absorption of air bubbles within the device. For behavioral experiments, devices were filled with 5% (w/v) Pluronic F127 through the outlet port to prevent bacterial and molecular absorption by passivation of the microfluidic surfaces and to minimize bubble entrapment via its surfactant properties. Neural imaging devices were filled with control buffer alone. Reservoirs of loading solutions were prepared as previously described (Lagoy and Albrecht, 2015), purging the reservoir system of bubbles and connecting the tubing into the inlets of the device. Once flow was properly established, animals were gently loaded into their respective arenas and allowed to roam for 15-20 min before experimentation. For neural imaging experiments, a control valve was used to switch between stimulus and control buffer conditions within 0.5 s (Extended Data Fig. 7-1).

Population behavior imaging and identification of sleep events
Videos of population behavior were captured using a 6.6 MP PixelLink FireWire Camera at 1 fps for 12 h with an image resolution of ;30 pixels/mm. Videos were processed after experimentation as previously described using MATLAB to extract behavioral data (Albrecht and Bargmann, 2011), and then further analyzed to identify sleep events. A minimum sleep entry window of 20 s and exit window of 5 s were used to quantify state transitions. To verify accuracy in parameters for sleep detection, user observed behavioral state was compared with script-calculated state on randomly chosen 60 s traces of an individual animals ( Table 2). All behavior data were collected using "population behavior" devices with four 16 Â 15 mm arenas capable of housing ;25 animals per arena for simultaneous study.
Neural calcium imaging, sleep detection, and data analysis in closed-loop system Closed-loop neural imaging videos were acquired at 5Â magnification (NA = 0.25) with a Hamamatsu Orca-Flash 4.0 sCMOS camera using MicroManager/ImageJ software. The system has a green (l = 520-550 nm) LED mounted overhead to provide pulsed brightfield illumination for tracking animal behavior and a Lumencor SOLA-LE solid-state lamp pulsed to excite GCaMP during fluorescence calcium imaging. To achieve autonomous experimentation for a closed-loop system, custom Arduino, MicroManager, and ImageJ scripts work together to control illumination timing, image acquisition, stimulus delivery, and sleep/ wake state identification. An Arduino Uno microcontroller was programmed to control fluidic valves through a ValveLink 8.2 (AutoMate Scientific) controller and to control illumination sources for brightfield and fluorescent imaging. A MicroManager script allows the user to configure all camera and illumination settings before experimentation as well as all testing conditions for sleep assessment. Once the experiment is underway, the script initiates brightfield image capture at the desired framerate, and analyzes movement compared with the prior image in real time to determine the animal's behavioral state. If the current state and timing match the desired and preprogrammed conditions for neural imaging, the script initiates a fluorescence image stack recording and communicates with the Arduino via serial commands to control epifluorescence illumination and chemical stimulation with the desired timing.
Tracking of behavior of a single animal in the closed-loop neural imaging system was done using brightfield illumination with images captured at 0.1 fps. The current sleep/awake state of the animal was determined by an ImageJ script which calculates a movement index for each frame, represented as the fraction of body pixels moved since the previous frame, ranging from 0 to 1. A sleep state was defined as movement below the empirically-optimized threshold (0.125) for three consecutive frames (i.e., for 20-30 s). Optimization of detection parameters was done by maximizing accuracy from user observed behavioral states to script calculated states (Table 3). 1 min of consistent sleep or wake state frames were used to increase confidence in the animals' current state before neural imaging.
Calcium imaging was performed on freely-moving animals as previously described  using lines expressing GCaMP in selected neurons. Neural activity was recorded in RIS neurons at 2 fps with no stimulation from the closed-loop system; however, motion was detected postprocessing to identify sleep bouts. Calcium imaging in ASH, AIB, AVA neurons was performed at 10 fps, using closed-loop stimulation to record responses to 10-s chemical stimulation from 5 to 15 s within a 30-s trial. Calcium imaging in AWA neuron was performed similarly, but was initiated every 5 min without closed-loop monitoring; sleep/ wake state at stimulus onset was determined postcapture. Videos were analyzed for neural fluorescence and locomotion using NeuroTracker software Movie 1. Sleep tracking in "population behavior device." Video shows three portions of a 12-h video tracking sleep behavior in wild-type animals: early (1.5 h), middle (5.5 h), and late (11 h in ImageJ, which tracks the position of the neuron over time and integrates fluorescent intensity of the soma using a 4 Â 4 pixel box for ASH, AIB, and AVA neurons, and an 8 Â 8 pixel box for the AWA neuron . Fluorescence (F) was normalized by dividing by the initial baseline fluorescence in the first 4 s of each trial before stimulation (F 0 ). As AIB fluorescence may not be at baseline at the beginning of each trial, baseline AIB intensity was determined for each animal across all trials, and individual AIB traces were excluded when animals engaged in reversal behavior immediately before stimulation. Traces and peak data from ASH, AIB, and AVA fluorescence are represented as 1-s moving average. Traces and peak data from AWA fluorescence is represented as a 0.3-s binned average through the 30-s trials. The timing of arousal response was defined by the first frame of reversal movement for aversive stimuli, and by the first frame of head movement in sleeping animals stimulated with diacetyl. The onset of neural response was defined as the first frame three standard deviations above the prestimulation noise level.

Experimental design and statistical analyses
Sample sizes for each experiment are listed in the figure legends. All animals tested were adult hermaphrodites. Statistics were performed using one-way ANOVA with Bonferroni's correction for multiple comparisons or an unpaired two-tailed t test when specified for two sample comparison, using the Statistics and Machine Learning Toolbox in MATLAB. Data are represented as mean 6 SEM unless otherwise stated. In behavioral experiments, animals were excluded when valid behavioral tracks comprised ,8% of recording time, indicating an animal was not viable or not present during the test. In neural recordings, the top and bottom 1% of instantaneous fluorescent intensity was removed to reduce noise in peak fluorescence calculations. Complete statistical data for all figures reported in Table 1.

Software accessibility
Software for control systems and data analysis are available on request.

Results
High-throughput analysis of adult sleep Sleep behavior, defined by periods of behavioral quiescence, was observed in young adult C. elegans over 12 h in microfluidic behavior arenas (Albrecht and Bargmann, 2011). Each microfluidic device contained four 16 Â 15 mm arenas housing four Hourly sleep fraction for all animals from A and grouped into four quartiles by their total 12-h sleep fraction (quartile 1 = most sleep). C, Median sleep fraction, sleep bout duration, and awake bout duration from data in A, separated by total sleep quartiles. Error bars indicate 95% confidence interval. D, Changes to sleep behavior over 12 h represented by sleep and awake bout duration. Solid lines represent median durations. Shaded regions represent 25-75% quartile durations and dashed lines represent 10% and 90% decile durations of each respective state. E, Average sleep entry and exit transition rate for each hour of experimentation from data in A. Separating these curves by total sleep quartile demonstrates consistent sleep exit rates (F) but large variation in sleep entry rates (G) across wild-type animals.
independent populations of ;25 animals that share the same dynamic, switchable fluidic environment with continuous flow (Fig. 1A,B). A hexagonal array of 70-mm-tall microposts enables free sinusoidal crawling behavior as animals gain traction from contact with several microposts along the body (Fig.  1C). Wild-type animals roam microfluidic arenas with predominantly forward locomotion, separated by momentary pauses, spontaneous short reversals (,1 s), and long reversals coupled with reorienting omega turns (Gray et al., 2005;Albrecht and Bargmann, 2011). Awake animals may pause briefly to feed if bacterial food is present (Flavell et al., 2013) or when encountering obstacles such as other animals or arena barriers. Other times, animals enter a prolonged quiescence state that lasts between ;20 s and several minutes (Movie 1). These bouts begin with animals gradually slowing their mean forward locomotion speed over 10-20 s (Fig. 1D), often pausing briefly a few times during slow, creeping motion. Animals then gradually adopt a relaxed body posture (Schwarz et al., 2012) over ;1 min and cease further movement (Fig. 1E,F). Sleeping animals are apparent visually in microfluidic arenas by their straight head and passive contact with only one to two microposts ( Fig. 1E), whereas awake animals actively bend around several posts (Fig. 1C). After one or more minutes, animals quickly wake and resume forward (or occasionally reverse) locomotion, accelerating to a typical 0.15 mm/s forward velocity within 5 s. Since pauses reflect both the extended quiescent states of sleep bouts and the momentary pauses of awake animals, true sleep states were automatically identified by tracking centroid movement filtered by the characteristic duration, history, and body shape of sleep. Using temporal parameters based on sleep entry and exit dynamics (onset after 20-s continuous pausing and ending at 5-s non-pausing), automatic classification of sleep bouts showed 95.2% agreement with human observation, with slight underestimation of sleep states (1.9% false discovery rate; 7.9% false omission rate; n = 500 randomly selected bouts; Table 2). These detected sleep bouts excluded the brief pauses that precede a sleep bout, and included momentary "twitch" movements during sleep which can be caused by contact from other animals, flow disturbance, or presumed involuntary movements, and do not signal exit of a sleep state.
We analyzed 535 wild-type (N2) animals for 12 h in continuous slow (0.5 mm/s) flow of S. basal buffer ( Fig. 2A). Hourly sleep fraction, defined by the fraction of time the animal spends in a sleep state during each hour, decreased on average across the population from 22 6 0.8% SEM in the first hour to 8 6 0.5% in hour 3, then increased steadily to 38 6 1% in hour 12 (Fig. 2B). A wide range of sleep behavior was observed among individual wild-type animals, with 95% exhibiting a 12-h total sleep fraction ranging from 4% to 43%. To assess variability in sleep dynamics, we divided animals into quartiles by total sleep fraction. Sleep dynamics were similar in all quartiles, with sleep fraction increasing over time after 3 h (Fig. 2B), but median sleep fraction over 12 h varied greatly across quartiles from 3% to 24%. Median sleep duration remained between 1.3 and 1.9 min for each quartile (Fig.  2C), whereas median awake duration varied more greatly, with the top quartile of sleeping animals remaining awake for a median of 7 min, about one-quarter of the most active animals (27 min awake). The increase in sleep fraction from hours 3-12 resulted from longer sleep bouts and shorter awake periods (Fig.  2D). These changes were associated with both an increased rate of sleep entry (more sleep pressure) and a decreased rate of sleep exit (more sleepiness; Fig. 2E). The rate of sleep exit remained consistent across total sleep quartiles (Fig. 2F), while the rate of sleep entry varied greatly (Fig. 2G). Together, these results indicate that individual sleep bouts were similar across wild-type animals, whereas variability in sleep fraction across the population predominantly arose because of variation in frequency of sleep bouts, or equivalently, to variation in the rate of sleep entry and in the duration of awake bouts.
Environmental and sensory effects on sleep dynamics Sleep entry and exit are sensitive to environmental conditions and sensory input. To test the role of sensory input on sleep, we first assessed the effect of fluid flow in the microfluidic environment, comparing sleep amounts with a slow flow rate (0.5 mm/ s), no flow, and periodic pulsing of flow conditions (Fig. 3A,B). Without flow, sleep fraction was similar to moderate flow conditions for the first 3 h, but rose dramatically from 12% to 42% around 4 h and remained high (;70%) for the duration of the 12 h experiment (Fig. 3A). To test whether resumption of flow would return sleep fraction to baseline rates, we pulsed flow every 2 h, alternating between 0.5 mm/s flow or no flow. Again, sleep fraction remained low for the first 3 h regardless of flow condition, then increased during each flow stoppage after ;30 min and decreased sharply when flow resumed (Fig. 3B). Sleep fraction when flow resumed fell below measurements in continuous flow, suggesting evidence of a homeostatic sleep mechanism, in which periods of elevated sleep are followed by reduced sleep, and vice versa. We tested this further by subjecting animals to a no flow condition for 6 h, during which they slept more (126.8 6 9.5%, p = 0.03, t test) than control animals in continuous flow after 2 h of acclimation (Fig. 3C). Upon resumption of flow, these animals then slept significantly less (À14.3 6 5.8%, p = 8.13 Â 10 À5 , t test) than control animals over the following 6 h. Conversely, reducing sleep with 1.1 mM diacetyl (À7.4 6 1.8%, p = 0.031, t test) resulted in a compensatory increase (111.5 6 4.7%, p = 1.84 Â 10 À5 , t test) in sleep fraction compared with controls that persisted for several hours (Fig.  3D). Together, these results demonstrate a bidirectional homeostatic sleep response.
Under static conditions, animals can deplete the microfluidic environment of oxygen (Suda et al., 2005;Huang and Lin, 2018), and hypoxia has been shown to induce sleep behavior (Kim and Jin, 2015) especially in starved animals (Skora et al., 2018). We therefore assessed the role of oxygen in adult sleep in microfluidic devices. With continuous flow of 0.5 mm/s, a hypoxic buffer (,1% O 2 , 30 mM sodium sulfite; Jiang et al., 2011) significantly increased total sleep fraction over 12 h (48 6 1.1%, p = 1.74 Â 10 À43 , ANOVA) compared with the same solution reoxygenated to .20% O 2 (16 6 1.3%; Fig. 4A-C). During hypoxia, 13% of sleep bouts were .10 min long compared with only 3.5% of bouts in the reoxygenated buffer, and 1% of hypoxic sleep bouts lasted over 30 min (Fig. 4B). Notably, hypoxia increased sleep fraction only after 4 h in the device (Fig. 4C), in line with past results suggesting that starvation and hypoxia work together to promote sleep behavior (Skora et al., 2018). The rapid rise in sleep behavior after 4 h mimicked a similar rise in static no-flow conditions (Fig. 3A), suggesting that gentle flow replenishes oxygen to suppress sleep behavior.
Because feeding state impacts arousal (Chao et al., 2004;Ezcurra et al., 2016) and starvation may regulate the impact of hypoxia on sleep (Skora et al., 2018), we next assessed the role of feeding and satiety on adult sleep dynamics within microfluidic chambers (Fig. 4D-F). The presence of bacterial food (NA22 E. coli) suppressed total 12 h average sleep fraction (3.8 6 0.6%, p = 2.83 Â 10 À123 , ANOVA) compared with S. basal control (33 6 0.5%; Fig. 4E). Serotonin, which mimics the feeding response (Horvitz et al., 1982), similarly reduced total sleep fraction (8 6 1.1%, p = 4.21 Â 10 À103 , ANOVA) compared with control buffer conditions when presented at a moderate concentration of 10 mM. Whereas bacterial food suppressed sleep continuously for 12 h, serotonin suppressed sleep for the first ;9 h. Similarly, a moderate behaviorally attractive food odor (Chuang and Collins, 1968; 1.1 mM diacetyl) suppressed total sleep fraction compared with control buffer (28 6 0.9%, p = 3.13 Â 10 À8 , ANOVA), although to a lesser extent than food or serotonin. Diacetyl suppressed sleep fraction only up to hour 9, consistent with adaptation to the odor over hours (Matsuura et al., 2009;Larsch et al., 2015;Fig. 4F). Animals also slept more when starved longer on a plate without food before entry into the microfluidic environment (Fig. 4G,H). These results suggest that adult sleep behavior in microfluidic devices is driven in part by feeding state and the perception of hunger.
To observe how sensory information influences sleep, we tested wild-type animals and three sensory mutants (Fig. 5A-C) loaded into separate arenas of each "population behavior" device ( Fig.  1A). Since the odorant diacetyl reduced sleep (Fig. 4F), we tested odr-10 mutants, which lack the diacetyl receptor normally present in the AWA sensory neurons and should not perceive this odor. In the presence of 1.1 mM diacetyl, odr-10 mutants exhibited a higher total sleep fraction (40 6 1.0%, p = 2.93 Â 10 À11 , ANOVA) compared with wild-type (28 6 1.2%; Fig. 5B), and similar to wild-type animals in control buffer conditions lacking the odor (Extended Data Fig. 5-1). In diacetyl, odr-10 mutants showed a significant increase in hourly sleep fraction compared with wild-type only up to 8 h (Fig. 5C), after which habituation to the odor may reduce its influence. Sensory deficient tax-4 mutants lack a cyclic GMP-gated ion channel necessary for signal transduction in many sensory neurons (Komatsu et al., 1996) and are defective in multiple sensory behaviors, failing to respond to temperature or to water-soluble or volatile chemical cues.   Table 3.
However, tax-4 is not present in AWA neurons; hence, diacetylmediated sleep suppression should be preserved in this mutant. Indeed, while tax-4 showed a moderate decrease in total sleep fraction (20.7 6 1.0%, p = 2.66 Â 10 À5 , ANOVA) compared with wildtype over 12 h in 1.1 mM diacetyl, no significant differences in hourly sleep fraction were observed except during the first hour (Fig. 5C). Strong suppression of early quiescence bouts in hour 1 in tax-4 animals (4% vs 21%) suggests that sensory information other than from AWA neurons contributes to elevated quiescence in the first hour. Animals transferred into microfluidic devices experience a novel mechanical environment, including gentle touch of the microposts and continuous fluid flow. While gentle touch deficient mec-4 mutants showed a slightly lower total sleep fraction than wild-type (24 6 1.0% vs 28 6 1.2%, p = 0.005, ANOVA), mec-4 mutants had no significant difference in first hour sleep fraction compared with wild-type (18% vs 21%), suggesting that any sensory information leading to elevated initial quiescence did not come from the mec-4-expressing touch receptor neurons ALM, AVM, or PLM. Together, these data demonstrate the role of sensory information in sleep regulation, and the testing of multiple mutants at once in multi-arena microfluidic devices to investigate regulators of sleep dynamics. Stress-induced sleep is altered in ceh-17 mutants, in which the ALA neurons fail to develop normally (Pujol et al., 2000). These animals are resistant to lin-3/EGF-induced sleep (Buskirk and Sternberg, 2010) and exhibit lower levels of quiescence after exposure to stressors such as heat shock, hyperosmosis, alcohol, cold, and toxins (Hill et al., 2014). However, spontaneous adult sleep in ceh-17 mutants was significantly higher over 12 h (43 6 0.9%, p = 1.47 Â 10 À23 , ANOVA) compared with wild-type (26.5 6 0.9%) animals in unrestrained microfluidic arenas (Fig. 5D-F), suggesting that it differs from ALA-dependent stress-induced sleep.
Automatic sleep tracking, chemical stimulation, and neural imaging To understand how neural activity changes during sleep cycles, we designed a smaller "neural imaging" microfluidic device containing a single 3 Â 3 mm arena with the same micropost array as the "population behavior" device ( Fig. 6A), but sized to fit the entire field of view at 5Â magnification on an epifluorescence microscope (Fig. 6B). Wild-type C. elegans sleep dynamics in the small "neural imaging" device were equivalent to the larger "population behavior" devices, dropping from 18% to 6% over the first 3 h, then steadily rising to 50% by 12 h, despite a faster flow velocity in the neural imaging microfluidic device (15 vs 0.5 mm/ s; Fig. 6C). Sleep behavior was tracked using brightfield illumination every 10 s, using a frame subtraction algorithm similar to previous methods (Nagy et al., 2014b; Fig. 6D,E), and correctly identified sleep bouts with 93.4% agreement with human observers (Table 3).  The "neural imaging" device provides fast temporal control of chemical stimuli, capable of reproducible fluid switching in ,0.5 s (Extended Data Fig. 7-1) without disturbing natural behaviors. We assessed arousal threshold by testing sensory responsiveness of sleeping and awake wild-type animals to aversive 10-s pulses of 1 mM copper chloride solution, recording the time elapsed between chemical onset and the initial reversal movement response. Sleep or wake states were determined by average pixel movement 5 s before stimulation (Fig. 7A), which was significantly higher in awake versus sleeping states (58.1 6 15.3 vs 3.2 6 0.7 mm/s, p = 3.2 Â 10 À4 , t test; Fig. 7B). Reversal responses in a sleep state were about eight times slower (6.0 s 6 1.2 s, p = 0.0014, t test) than in an awake state (0.76 s 6 0.14 s). This delay is consistent with an increased threshold for sensory responsiveness in sleeping young adult animals (Fig. 7C), as has been shown during lethargus to mechanical and chemical stimuli in developmentally-timed sleep .
RIS interneuron activity correlates with the onset of developmentally-timed sleep (   sleep-wake cycles in the microfluidic device, we recorded activity in the RIS interneuron expressing GCaMP3 (Fig. 7D) in freely moving animals while simultaneously assessing movement behavior. As expected, RIS activity increased at the onset of adult sleep (Fig. 7E).
Closed-loop stimulation and neural imaging of a reversal circuit An increased threshold for sensory responsiveness during sleep suggests sleep-dependent modulation to neural activity in C. elegans, either in sensory responses to stimulation, or in downstream interneurons or motor neurons. For example, during lethargus states in developmentally-timed sleep, aversive chemical pulses (1 mM copper chloride) elicited weaker ASH sensory neuron activity (Cho and Sternberg, 2014). However, it is unclear whether sensory-level modulation occurs during adult sleep as well. Since adult sleep is not synchronized across animals, or within an individual, we developed a closed-loop system that monitors sleep state every 10 s and triggers a stimulation and neural recording when user-programmable conditions are met ( Fig. 8A; Movie 2). Here, we chose to stimulate 1 min after a sleep state transition, allowing a 15-min recovery period between stimulation trials (Fig. 8B). Brief pulses of blue light excitation were used for fluorescent imaging to measure calcium activity during each 30-s trial (Fig. 8C), as strong blue light can cause arousal by itself (Edwards et al., 2008), and sleep state was monitored by behaviorally-neutral green light.
We measured neural responses to 10-s pulses of 1 mM copper chloride in the ASH sensory neurons over 12 h in individual animals. A typical closed-loop experiment with 15-min recovery per stimulation recorded about one sleep and one awake response per hour over .10 h (Fig. 8D,E; Extended Data Fig. 8-1). ASH neurons responded strongly and consistently to each copper chloride pulse, regardless of sleep or awake state during stimulation (Fig. 8F,G), and showed no significant sensory adaptation (Fig. 8E).
Since ASH chemosensory responses were equivalent in sleep and awake states, the elevated arousal threshold in sleep could result from diminished activity in interneurons, motor neurons, or in the muscles themselves. ASH is directly presynaptic to AVA premotor interneurons, and also has secondary connections through AIB, AVD, and RIC interneurons (Extended Data Fig. 8-2). As AIB shares a gap junction with the sleep-inducing neuron RIS, and ablation of AIB reduces long reversals (Gray et al., 2005), we recorded AIB and AVA neural activity in sleep and awake states in response to 1 mM copper chloride. Neural responses in AIB were not significantly different between awake and sleep states (Fig. 8H,I). In contrast, animals in sleep states had diminished AVA responses, increasing average relative GCaMP fluorescence 48% when awake and 19% when asleep (p = 0.031, t test). AVA neural responses were also delayed relative to the copper pulse (Fig. 8J,K), consistent with delayed and shortened reversal behaviors (Fig. 7C). AIB activity often increased before reversal behavior in sleeping animals but coincided with reversal responses in awake animals (Extended Data Fig.  8-3). This suggests a sleep-dependent behavioral delay downstream of (or bypassing) AIB and presynaptic to AVA, that contributes to the apparent arousal threshold increase in sleeping animals.
Appetitive sensory modulation during sleep Sleep may affect sensory modalities differently. To compare with ASH aversive response circuits, we assessed sleep-dependent changes in an appetitive sensory circuit using the AWA chemosensory neurons. Whereas aversive stimulation of ASH with copper chloride provoked reversal behavior in both sleeping and awake animals, appetitive stimulation of AWA with 1.1 mM diacetyl elicited slight head movement in sleeping animals and promoted a continuation of forward locomotion behavior in awake animals (Fig. 9A). Since awake animals experienced no strong behavior change on presentation of appetitive stimuli, sleep-dependent arousal timing differences could not be made. However, simultaneous measurements of neural activity revealed sleep-dependent differences in neural response (Fig. 9B).
Animals that were sleeping before diacetyl stimulation responded with a ;2 s delay in initial movement (3.25 6 0.15 s after stimulation onset, p = 2.11 Â 10 À13 , t test) compared with the initial rise in AWA activity (1.21 6 0.05 s after stimulation onset; Fig. 9C). This sleep-dependent response delay was shorter and more consistent than with copper chloride stimulation. AWA neural activity arose equally in awake and sleeping animals at stimulus onset (Fig. 9B,D), but AWA activity remained high throughout the 10-s diacetyl pulse in sleeping animals, whereas it declined ;5 s earlier in awake animals (Fig. 9D). As a result, AWA neural responses were significantly elevated during the 15 s after stimulation in sleeping animals (0.54 6 0.04 dF/F 0 , p = 1.18 Â 10 À5 , t test) than awake animals (0.19 6 0.05 dF/F 0 ; Fig. 9E). While sleep prolonged sensory neural dynamics in AWA to 1.1 mM diacetyl, peak response levels were unchanged across sleep and awake states, as were ASH responses to 1 mM copper chloride (Fig. 9F).
Movie 2. Example of closed loop system in "neural imaging device." Video shows an animal expressing GCaMP in the ASH neuron tracked in the closed loop system. First, awake behavior is detected using brightfield illumination and the system applies a stimulus paradigm, 30 s long with a 10-s pulse of 1 mM copper chloride, recording GCaMP fluorescence. Next, a sleep bout is detected and the same stimulus pattern is initiated 1 min after sleep entry. State change detection and stimulus presentation are indicated above. Video is accelerated 37.5Â during brightfield behavior and 3Â during fluorescent trials. [View online] Discussion C. elegans sleep has been studied previously during developmentally-timed transitions (lethargus) and after induction by satiety or various stresses, but spontaneous adult sleep has been technically more difficult to assess. Adult quiescence behavior in our microfluidic arena devices displays the same general characteristics of sleep previously used to define quiescent behavior as sleep in C. elegans during developmentally-timed sleep and stressinduced sleep. Quiescent adults exhibited: (1) an increase in arousal threshold to an aversive chemical stimulus by a delay in behavioral response (Fig. 7C); (2) rapid sleep reversibility on changes in fluid flow (Fig. 3B); (3) a characteristic relaxed posture (Fig. 1E,F); and (4) a homeostatic sleep response (Fig. 3C,D). We observed some differences in unrestrained adult sleep behavior compared with recent reports on adult sleep in open and constrained environments, which we attribute to microfluidic geometry and experiment duration. For example, static fluids and hypoxia were highly somnolent in freely-behaving animals over 12 h, whereas constricted animals increased sleep during gentle microfluidic flow, with no effect of oxygen over 1 h (Gonzales et al., 2019). Spontaneous adult sleep was elevated in ceh-17 mutant animals, which are deficient in stressinduced sleep, suggesting that spontaneous adult sleep in unrestrictive microfluidic devices is unique to the sleep states previously observed.
Sleep and hunger are mutually inhibitory. In mammals, the hunger-associated peptide ghrelin suppresses sleep, whereas satietyrelated leptin and insulin promote sleep (Goldstein et al., 2018). In C. elegans, adult sleep behavior was also strongly suppressed by continuous food presentation for the entire 12-h experiment duration. In contrast, well-fed animals introduced into buffer without food gradually increased their sleep fraction over several hours, and prestarvation commensurately accelerated this timing. Presenting exogenous serotonin to mimic the feeding response, or the food odor diacetyl, suppressed sleep for 8-9 h, consistent with adaptation timing to these food-related signals.
Sleep behavior is also sensitive to environmental conditions presented in microfluidic devices. For example, fluid flow in the microfluidic environment is important for maintaining a fresh and constant environment, and cessation of flow increased sleep behavior dramatically after several hours. Static fluid conditions decrease mechanical stimulation, deplete nutrients and oxygen, and increase concentrations of byproducts and CO 2 . Oxygen depletion by animals may be a primary factor driving elevated sleep in static microfluidic conditions, as sleep dynamics were similar in static fluid and with hypoxic buffer flow. Hypoxia increased sleep behavior only after 4 h in freely-behaving animals, likely because of increasing starvation over this time. Similarly, hypoxia was shown to suppress most spontaneous neural activity across the whole brain of trapped C. elegans, but only in starved animals (Skora et al., 2018). In mammals, intermittent hypoxia can cause excessive sleepiness (Sanfilippo-Cohn et al., 2006), but can also cause disturbed and superficial sleep with frequent waking via chemoreceptor reflex pathways (Laszy and Sarkadi, 1990). Thus, there is an interplay between arousing and somnolent environmental cues, in addition to feeding state.
Further studies in C. elegans may be useful to distinguish between these contrasting hypoxic effects and to understand the role of sleep in regulating metabolic systems. Sensory neural activity directly modulates sleep. For example, sleep suppression by diacetyl was absent in odr-10 mutants that lack only the diacetyl receptor and are unable to detect this odor. Sensory information and fluid flow also contribute to the initial elevated sleep behavior seen in the first hour of testing as animals acclimate to the microfluidic environment. The general sensory mutant tax-4 suppressed first-hour sleep, whereas mechanosensory-deficient mec-4 animals did not, suggesting that gentle touch of microfluidic structures do not contribute to early sleep behavior. Instead, other tax-4-dependent sensation, such as from various thermosensory and chemosensory neurons (Komatsu et al., 1996), may be involved in detecting the novel microfluidic environment.
We compared activity of several neurons during sleep and awake states of unrestrained animals. The RIS interneuron is active at the onset of spontaneous adult sleep, as has been shown during developmentally-timed lethargus sleep (Turek et al., 2013;Maluck et al., 2020). The automated closed-loop stimulation system, which requires no user input, further allows unbiased comparison of stimulus-evoked neural responses during alternating sleep and awake bouts within the same animal. The ability to record state-dependent response differences within individuals is particularly important because of the wide variation in sleep dynamics observed across individual animals. Isogenetic animals, even when raised on the same plate from the same parent, exhibited total sleep fractions varying from zero to nearly one half over 12 h. Given the sensitivity of adult sleep to oxygen, feeding state, chemicals, and likely other sensory stimuli, it is possible that animals cultured identically experience slight variations in these inputs. Longitudinal studies capturing dozens of events per animal allow identification of intra-animal differences in sensory processing regardless of population-wide variation in sleep patterns.
An increased arousal threshold in sleeping animals suggests modulation to sensorimotor neural circuit activity in C. elegans during sleep. Responses of the AVA command interneurons, which are required for backward locomotion (Zheng et al., 1999;Gray et al., 2005;Piggott et al., 2011) were indeed diminished and delayed during adult sleep, coinciding with delayed behavioral responses. Similarly, diminished AVA activity was previously observed during lethargus (Cho and Sternberg, 2014). However, sensory responses in ASH neurons were not modulated by sleep state in adults, in contrast to the weaker ASH responses observed in larval stages during developmentallytimed sleep (Cho and Sternberg, 2014), suggesting that spontaneous adult sleep is a distinct phenomenon. The first layer AIB interneurons, which share synaptic connections with ASH, the AVA command interneurons, and the RIS sleep-induction neuron, also showed no sleep-dependent difference in response. Together, these results suggest that modulation in sensory processing that leads to reduced arousal response in sleep occurs at or upstream of AVA, such as synaptic signaling from ASH, AIB, or other interneurons (Extended Data Fig. 8-2), or neuropeptides from other sources. One possibility is that sleep increases arousal threshold predominately by diminishing the efficacy of monosynaptic shortcuts to the command interneurons (here, ASH to AVA), whereas sensory information is preserved to first layer interneurons (such as AIB) to allow for rapid arousal from more salient polymodal stimuli from multiple sensory neurons. However, animal survival should benefit from maintaining rapid arousal to potentially harmful stimuli such as sensed by ASH, yet this does not appear true. Alternatively, the dampened brain state apparent in sleep (Nichols et al., 2017) may broadly suppress activity in premotor interneurons like AVA, increasing arousal thresholds equally to all types of sensory input which result in reversal behavior.
But sleep influences sensory modalities differently. The appetitive stimulus diacetyl aroused sleeping animals after several seconds, just as the aversive stimulus, although the stimulus-tobehavior delay was shorter and more consistent (2.5-4.4 s to appetitive forward response vs 1-14 s to aversive reversal response). Further, AWA sensory responses to diacetyl were prolonged in the sleep state, unlike ASH aversive responses. While locomotory feedback is processed by sensorimotor circuits (Hendricks et al., 2012), past studies have shown no AWA response differences between crawling and paralyzed animals . This suggests that differences seen in neural response in AWA are because of sleep related mechanisms rather than feedback from locomotion alone. Together, these differences suggest that sleep-dependent circuit modulation acts differently across sensory circuits, and further study of additional sensory stimuli and neurons will be necessary to uncover its architecture and mechanisms.
These flexible microfluidic systems for studying adult sleep in C. elegans are applicable to any neuron, stimulus, environment, and genetic perturbation for thorough assessment of sleep behavior and underlying neural responses. For example, it will be informative to compare neural responses in various sleep modes, including hypoxia and starvation-induced sleep as shown here, as well as heat shock and satiety-related sleep. Microfluidic devices are easily customized to different animal sizes by adjusting arena post geometry, for example, to observe L4 animals in lethargus transition stages in developmentally-timed sleep. Other types of oxidative or metabolic stress (such as by chemical oxidants or varying food quality), or sleep disruption via mechanical stimulation or light, can be applied using the same microfluidic devices and tracking methods. Overall, this platform can be used to uncover molecular and neural circuit pathways underlying altered sensation during sleep, toward establishing connections between nematode sleep and associated regulatory mechanisms and human sleep disorders.