Summary
Sleep in adult C. elegans occurs spontaneously, making timing of individual sleep/wake state transitions unpredictable. This protocol presents a closed-loop system to automatically detect sleep state transitions, trigger stimulation, and record evoked neural responses. This allows users to assess functional consequences of behavioral states in an unbiased manner and identify state-dependent neuromodulation. This closed-loop system is flexible and can be configured to detect any visible events, such as behavior patterns or optical reporters, and measure corresponding evoked neural responses.
For complete details on the use and execution of this protocol, please refer to Lawler et al. (2021).
Subject areas: Microscopy, Model Organisms, Neuroscience, Behavior
Graphical abstract
Highlights
-
•
Protocol to assess neural activity changes between sleep and wake states in C. elegans
-
•
Closed-loop system automatically detects sleep state and triggers neural stimulation
-
•
Microfluidic arenas enable recording of freely moving behavior and neural responses
-
•
Image analysis software extracts sleep-dependent neural changes
Publisher’s note: Undertaking any experimental protocol requires adherence to local institutional guidelines for laboratory safety and ethics.
Sleep in adult C. elegans occurs spontaneously, making timing of individual sleep/wake state transitions unpredictable. This protocol presents a closed-loop system to automatically detect sleep state transitions, trigger stimulation, and record evoked neural responses. This allows users to assess functional consequences of behavioral states in an unbiased manner and identify state-dependent neuromodulation. This closed-loop system is flexible and can be configured to detect any visible events, such as behavior patterns or optical reporters, and measure corresponding evoked neural responses.
Before you begin
Construct the neural imaging system
Timing: Several days to weeks prior to experimentation, depending on equipment availability
A custom imaging and stimulation system controls illumination timing, image acquisition, sleep state identification, and stimulus delivery (Figure 1). Although a variety of equipment can accomplish these tasks, here we describe the construction of an inexpensive system using open-source hardware and software. An Arduino Nano microcontroller controls fluidic valves through a ValveLink 8.2 (AutoMate Scientific) valve controller and controls illumination sources for brightfield and fluorescent imaging via digital signals. The Arduino controller interacts with the camera to synchronize stimulation and image recording, as directed by open-source Micro-Manager software (Edelstein et al., 2014).
-
1.Build an Arduino controller with all necessary connections to the brightfield and fluorescent illumination sources, the camera, and to the valve controller (Figures 2A and 2B).
-
a.Connect Arduino Nano and screw terminal breakout (Figure 2C). Solder headers onto Nano if necessary.
-
b.Connect BNC screw terminals (or equivalent connectors) for the following signals, connecting the negative terminal to ground (GND) and positive to the indicated pin number (Figure 2D).
-
i.CAM_IN (pin 2): Digital input signal from microscope camera indicating image frame exposure.
-
ii.FL_OUT (pin 7): Digital output signal to fluorescent LED excitation.
-
iii.BF_OUT (pin 8): Digital output signal to brightfield LED illumination.Optional: LED_OUT (pin 5): Analog output signal to optogenetic stimulation LED.
-
i.
-
c.Connect DB9 screw terminals for the ValveLink valve controller (Figure 2D).
-
i.GND to DB9_pin1.
-
ii.A0 to DB9_pin5 (valve 1) for stimulus switching.
-
iii.A1 to DB9_pin9 (valve 2) for optional outflow control.
-
iv.Optionally connect other valve control wires as needed, such as A2 to DB9_pin4 (valve 3). Up to eight valves can be supported to deliver multiple stimuli.
-
i.
-
d.Recommended: secure all cables and components.
-
i.Attach Nano to ValveLink using velcro hook-and-loop fastener (Figures 2E–2G), and any others such as a LED controller.
-
ii.Route all cables and secure them to ensure stable connections, e.g., using tape, zip tie, or Velcro.
-
i.
-
a.
-
2.
Connect valve cable (RCA or as needed by controller) to a 3-way actuated fluidic valve for stimulus selection at valve 1.
-
3.
Connect valve cable (RCA or as needed by controller) to a pinch valve for outflow shutoff at valve 2.
Alternatives: Other equipment can be used for each of the imaging system components, as long as any substitutes maintain the ability to control illumination timing, fluidic valves, and image acquisition. For example, the Valvelink controller can be replaced with an inexpensive multichannel relay module or MOSFET trigger switch module to actuate fluidic valves. In the configuration described, all inputs and outputs are TTL-compatible voltage signals (0–5 V). Substitution of different cameras and controllers may require modification of the open-source code, for example to invert the polarity of a control signal.
Install and configure software
Timing: 1–2 h for software download and installation
Several scripts are necessary to install prior to experimentation, available at https://github.com/albrechtLab/ClosedLoopStimulation.
-
4.
Download the “NanoController.ino” program and upload it to the Arduino Nano using Arduino IDE software (https://www.arduino.cc/en/software).
-
5.
Download and install the open-source microscopy software “Micro-Manager” (https://micro-manager.org).
-
6.Configure Micro-Manager to communicate with the camera and the Arduino Nano controller.
-
a.Ensure all devices are turned on, open Micro-Manager, and create a new hardware configuration. Open Tools -> Hardware Configuration Wizard… then select “Create new configuration.”
-
b.Add the camera and any other microscope controllers, such as stages and shutters.
-
c.Add the Arduino Nano controller using “FreeSerialPort” to add a Free-form communication Serial Port. Title the device “ArduinoValveControl” and select the appropriate serial port for the Arduino device (e.g., COM3 for Windows PC). Port information is accessible within the Arduino IDE (Tools -> Port) or Windows Device Manager.
-
d.Save the configuration file with a recognizable name and load it at the beginning of each experiment.
-
a.
-
7.
Download the “SleepDetection.ijm” ImageJ Macro file. This macro analyzes bright field images and determines when a sleep state change has occurred. Copy this and other files to a folder and note the file path or location.
-
8.
Download the “User Defined Closed Loop Settings.txt” text file. This text file contains experiment configuration parameters and should be adjusted as needed for each experiment.
-
9.
Download the “ClosedLoopSleepStim.bsh” Micro-Manager script and add the script to the “Script Panel” within the Micro-Manager “Tools” drop-down menu. This script reads an experiment settings file and controls the Arduino and image acquisition.
-
10.
Configure the “ClosedLoopSleepStim.bsh” script. Edit the header lines with full file locations of the “SleepDetection.ijm” macro and the “User Defined Closed Loop Settings.txt” text file.
Note: This protocol was tested with MicroManager version 1.4.17. Use this version to ensure consistency of operation.
Prepare microfluidic equipment
Timing: 2–6 h for fabrication of new components; ∼30 min to clean and prepare reused components
Experiments are conducted using microfluidic chambers that facilitate precise chemical stimulation and keep animals within the microscope field of view. For complete details regarding the design, fabrication, cleaning, and preparation of microfluidic devices for behavioral and neural imaging of C. elegans please refer to Lagoy and Albrecht (2015). For video protocols regarding the setup and use of microfluidic devices, please see Reilly et al. (2017). The reusable microfluidic device, reservoirs, and tubing should be fabricated in advance and cleaned prior to experimentation.
-
11.Prepare all components for the microfluidic system:
-
a.Neural imaging microfluidic device made from cured poly(dimethyl siloxane) (PDMS) with dermal punched inlet and outlet channel holes (Figure 3A, a). See Lagoy and Albrecht, 2015 for fabrication information, and Larsch et al. (2013) for device design.
-
b.Drilled glass top slide (Figures 3A and 3B). Cut glass slides to size (e.g., 25 × 40 mm) with a diamond scribe and grind holes (∼2 mm diameter) using a rotary tool and diamond-coated bit.
-
c.Hydrophobic (fluorinated) glass bottom slide (Figures 3A and 3C). Silanize glass with TFOCS by vapor deposition in a fume hood vacuum chamber (see Lagoy and Albrecht, 2015). Sealing hydrophobic PDMS microfluidic devices with hydrophobic glass reduces the risk of leakage.
- d.
-
e.Three solution reservoirs using 60 mL syringes for fluid storage, 3 mL syringes for fluid priming, 3-way Luer valves for flow control, and tubing attached (Figure 3D). Two reservoirs (for saline buffer and copper chloride stimulus solution) have tubing attached for direct flow into the microfluidic device. One reservoir (for control solution) will connect to a 3-way electrically-actuated fluidic valve (Figure 3E) for switching between flows during the automated neural imaging trials. Label each reservoir clearly for intended use.
-
f.Worm loading syringe (Figure 3F) consisting of a 1-mL syringe connected to ∼50 cm tubing and a metal end tube.
-
g.Outflow tubing connected through an optional outlet pinch valve to a 10 mL or 30 mL syringe reservoir and 3 mL side syringe for priming via two 3-way Luer valves (Figures 3G and 3H). The pinch valve allows automatic flow stoppage at the end of an experiment.
-
a.
Note: Inlet tubing can be flexible Tygon or rigid Teflon. Consult Lagoy and Albrecht, 2015 for details. Teflon tubing is more inert and preferred for hydrophobic stimuli.
Note: Components can be reused after thorough cleaning. Flush with diH2O, 70% ethanol, then diH2O, and dry using an air stream. Microfluidic devices should be soaked in 70% ethanol for 1 h to overnight and can be reused dozens of times. Devices used with hydrophobic stimuli at high concentrations may require stronger cleaning, dedicated components, or more frequent replacement.
Prepare nematodes
Timing: 10–20 min, timed 16–24 h prior to experiment
Maintain C. elegans under standard conditions on Nematode Growth Medium (NGM) plates and fed OP50 Escherichia coli bacteria (Stiernagle, 2006). For neural imaging of the ASH aversive sensory neuron, use a C. elegans strain expressing GCaMP in the ASH neuron such as: CX10979, kyEx2865 [Psra-6::GCaMP3; Pofm-1p::GFP] (Larsch et al., 2013). Each experiment uses a single young adult C. elegans. Pick several array-positive L4 stage hermaphrodite animals 16–24 h prior to the experiment and isolate them to a fresh seeded plate. Adjust timing as needed for the desired stage of testing.
Note: The closed-loop system is applicable to studying any neuron(s). Substitute an appropriate strain expressing GCaMP in the desired neurons. For other color indicators, such as red-emitting RCaMP, use an appropriate fluorescent excitation source and microscope filter set, and a brightfield illuminator that matches the emission filter color.
Note: When using animals larger or smaller than wild-type young adult hermaphrodites, such as males, older adults, younger larval stage animals, or some genetic mutants, use microfluidic devices scaled proportionally to body size for smooth locomotion and to prevent escape from the arena.
Key resources table
REAGENT OR RESOURCE | SOURCE | IDENTIFIER |
---|---|---|
Bacterial and virus strains | ||
E. coli (OP50) | Caenorhabditis Genetics Center (CGC) | OP50 |
Experimental models: Organisms/strains | ||
Young adult C. elegans hermaphrodites expressing GCaMP in desired neurons | Caenorhabditis Genetics Center (CGC) or corresponding authors of published work | N/A |
C. elegans ASH::GCaMP3 strain | Larsch et al. (2013) | CX10979 |
Chemicals, peptides, and recombinant proteins | ||
HEPES | Sigma-Aldrich | Cat# H3375 |
Magnesium chloride, MgCl2 | Sigma-Aldrich | Cat# M2393 |
Calcium chloride, CaCl2 | Sigma-Aldrich | Cat# C3881 |
Sodium chloride, NaCl | Sigma-Aldrich | Cat# S7653 |
Potassium chloride, KCl | Sigma-Aldrich | Cat# P3911 |
Copper chloride, CuCl2 | Sigma-Aldrich | Cat# 751944 |
D-glucose | Sigma-Aldrich | Cat# G7021 |
Nematode Growth Medium (NGM) agar | Stiernagle (2006) | N/A |
Poly(dimethyl siloxane) (PDMS) | Ellsworth Adhesives | Sylgard 184 |
(tridecafluoro-1,1,2,2-tetrahydrooctyl)trichlorosilane (TFOCS) | Gelest | CAS# 78560-45-9 |
Fluorescein, Sodium salt | Sigma-Aldrich | Cat# F6377 |
Software and algorithms | ||
Custom control code: ClosedLoopStimulation | Lawler et al. (2021) and this work |
https://albrechtlab.github.io https://github.com/albrechtLab/ClosedLoopStimulation 10.5281/zenodo.6629830 |
Custom analysis code: Neurotracker | Larsch et al. (2013) |
https://github.com/albrechtLab/Neurotracker 10.5281/zenodo.6632736 |
Micro-manager | Micro-manager | https://micro-manager.org/ |
MATLAB | MathWorks | https://www.mathworks.com/products/matlab.html |
Arduino IDE | Arduino | https://www.arduino.cc/en/software |
ImageJ | Schneider et al. (2012) | https://imagej.nih.gov/ij/ |
Other | ||
ValveLink 8.2 digital/manual valve controller | AutoMate Scientific | Cat #01-18 |
Arduino nano | Arduino | Cat #A000005 |
Wires and connectors | Various | See Figure 2B |
3-way miniature inert PTFE isolation valve | Parker | Cat #001-0017-900 |
Pinch valve, normally open | NResearch | Cat #161P021 |
SOLA light engine (fluorescence) | Lumencor | Cat #SM6-LCR-SA |
Axio Observer.A1 inverted microscope set up for epifluorescence (GFP filter cubes, 5× objective or similar) | Zeiss | Cat #491237-0012-000 |
Illuminator microLED (brightfield) | Zeiss | Cat #423053-9072 |
Orca Flash 4.0 Digital sCMOS camera | Hamamatsu | Cat #C11440-22CU |
Optogenetic stimulation LED and controller (optional) | Mightex | Cat #PLS-0625-030-S and #SLA-1200-2 |
Petri dishes (60 mm) | Tritech | Cat #T3305 |
Glass slide, 1 mm thick | VWR | Cat #75799-268 |
Glass scribe | Ted Pella | Cat #54468 |
Diamond drill bit | Dremel | Cat #7134 |
Microfluidic device | Larsch et al. (2013); Lagoy and Albrecht (2015) | N/A |
Microfluidic tubing, 0.02″ ID | Cole-Parmer | Cat #EW-06419-01 |
Luer 3-way stopcock | Cole-Parmer | Cat #EW-30600-07 |
Luer 23 ga. blunt needle | VWR | Cat #89134-100 |
Tube 19 ga., 0.5″ | New England Small Tube | Cat #NE-1027-12 |
Microfluidic device clamp | Warner Instruments (or machine shop) | P-2 |
Materials and equipment
Reagent | Final concentration | Amount |
---|---|---|
NaCl | 80 mM | 4.68 g |
KCl | 5 mM | 0.373 g |
D-glucose | 20 mM | 3.60 g |
HEPES | 10 mM | 2.38 g |
MgCl2 | 5 mM | 1.02 g |
CaCl2 | 1 mM | 0.111 g |
ddH2O | n/a | to 1 L |
pH to 7.2 | n/a | n/a |
Total | n/a | 1 L |
Store at room temperature (15°C–25°C) for up to 1 year.
Reagent | Final concentration | Amount |
---|---|---|
Saline buffer | n/a | 60 mL |
Fluorescein | 1 μg/mL | n/a |
Total | n/a | 60 mL |
Prepare fresh on day of experiment and keep at room temperature (15°C–25°C).
Reagent | Final concentration | Amount |
---|---|---|
Saline buffer | n/a | 60 mL |
1 M CuCl2 | 1 mM | 60 μL |
Total | n/a | 60 mL |
Prepare fresh on day of experiment and keep at room temperature (15°C–25°C).
Reagent | Final concentration | Amount |
---|---|---|
NaCl | 50 mM | 3 g |
Agar | 50 mM | 17 g |
Peptone | 10 mM | 2.5 g |
5 mg/mL cholesterol in ethanol | ∼13 mM | 1 mL |
1 M KPO4 buffer pH 6.0 | 25 mM | 25 mL |
1 M MgSO4 | 1 mM | 1 mL |
1 M CaCl2 | 1 mM | 1 mL |
ddH2O | n/a | 975 mL |
Total | n/a | ∼1 L |
Mix dry ingredients and water and autoclave on liquid cycle. When cooled to 55°C, add the four liquid additives, mix, and pour into Petri dish plates under sterile conditions. Store plates at room temperature (15°C–25°C) for several weeks or at 4°C for several months.
Step-by-step method details
Prepare microfluidic system for experiment
Timing: ∼1 h
This step prepares the microfluidic equipment and solutions for experimentation. For complete details regarding the design, fabrication, cleaning, and preparation of microfluidic devices for behavioral and neural imaging of C. elegans please refer to Lagoy and Albrecht (2015). For video protocols of microfluidic device setup and operation, see Reilly et al. (2017). This example uses Copper chloride solution to stimulate the ASH aversive neurons.
-
1.
Clean microfluidic device and top and bottom glass pieces by rinsing sequentially with water and 70% ethanol, wiping with a lint-free wipe, then drying in an air stream. Remove any dust with transparent tape, then align and secure with binder clips or a microscope slide holder (Figures 3B and 3C).
-
2.
Place device in a vacuum desiccator for 30 min.
-
3.
Prepare 200 mL of Saline buffer and use it to prepare 60 mL of Control buffer (1 μg/mL fluorescein) and 60 mL of Copper chloride stimulus solution (1 mM CuCl2).
-
4.
Attach 3 reservoirs to the reservoir rack stand above the microscope (Figure 4A).
-
5.
Fill each of the 3 reservoirs with their designated solutions (60 mL of Saline buffer, Control buffer, or Copper chloride solution) and purge all bubbles from the connected tubing using the priming syringe (see Reilly et al., 2017 and troubleshooting Note 1). Actuate the valve to fill all tubes connected to the 3-way fluidic valve.
-
6.
Fill the waste reservoir with ≥10 mL Saline buffer and use the priming syringe to fill both the outflow waste tube and the outflow outlet tube with buffer (see Figures 3G and 3H).
-
7.
After 30 min in the vacuum desiccator, remove the device and mount it on the microscope.
-
8.Fill microfluidic device with fluid.
-
a.Insert the outflow tubing into the waste outlet of the microfluidic device.
-
b.Ensure the outflow valve is open and gently push buffer through the device using the priming syringe.
-
c.When liquid droplets form at all 4 of the inlets, close the outflow valve (Figures 4B and 4C).
-
a.
-
9.
Insert tubing or a blocking pin into the worm loading inlet.
-
10.Gently insert each reservoir’s tubing into the appropriate inlet (Figures 1 and 4C).
-
a.Connect the control reservoir 3-way valve (Figure 3E) “normally-closed” outlet to the “control1” inlet and its “normally-open” outlet to the “control2” inlet.
-
b.Insert tubing approximately 3 mm into the PDMS inlet hole (to ∼2/3 depth).
-
c.Use “drop-to-drop” connections, in which a droplet hangs from the tubing end and is connected to a liquid droplet above the microfluidic port (see Lagoy and Albrecht, 2015).
-
d.Remove any excess liquid from the glass by vacuum aspiration or paper towel.
-
a.
-
11.
Open the outflow valve to establish flow. View live images in the microscope and verify that no bubbles are present in the device channels (see troubleshooting Note 1).
-
12.Balance inlet flows.
-
a.Focus on the intersection of inlet channels (Figures 4C and 4D) and observe flow patterns while alternately activating and deactivating the 3-way stimulus valve.
-
b.Adjust reservoir heights up or down so that flow from Saline buffer and Copper chloride solution are equal and flow from Control buffer enables complete switching between Saline buffer and Copper chloride solution into the downstream imaging area (see Figure 4D and troubleshooting Note 2).
-
a.
CRITICAL: Avoid introducing bubbles into the device during device preparation (see also troubleshooting Note 1). Ensure that the outflow valve is open only when all device inlet and outlet ports are connected to tubing or blocking pins. Close the outflow valve whenever any tubing adjustments are made.
Load animal into microfluidic device
Timing: ∼15 min
This step describes loading an individual animal into the microfluidic device without disturbing the fluidic set up or introducing bubbles.
-
13.
Gently transfer one young adult C. elegans to a small (35 or 60 mm) unseeded Nematode Growth Medium (NGM) agar plate.
-
14.
Flood the NGM plate about halfway to the rim with Saline buffer.
-
15.
Fill the worm loading syringe with ∼1 mL Saline buffer and purge any bubbles.
-
16.Draw an animal into the worm loading syringe.
-
a.With a drop-to-drop connection, submerge the tip of the worm loading syringe under the saline solution.
-
b.Keeping the tip of the syringe submerged, gently draw the swimming animal into the tubing section of the worm loading syringe. Do not draw the animal into the syringe barrel.
-
a.
-
17.
Close the outlet valve to cease flow through the microfluidic device.
-
18.Connect the worm loading tubing to the microfluidic device.
-
a.Remove the blocking pin from the worm loading inlet and allow a small droplet to form by briefly opening the buffer reservoir valve.
-
b.Insert the worm loading tubing with a drop-to-drop connection.
-
c.Remove excess liquid from the glass by aspiration or paper towel.
-
a.
-
19.Establish fluid flow in the microfluidic arena.
-
a.Open the outlet valve to resume flow. Typical flowrate is about 1 μL/s or ∼4 mL/h, and is proportional to the difference in fluid height between inlet and outlet reservoirs.
-
b.Adjust flowrate by raising or lowering reservoirs. Behavior is generally insensitive to flowrate (Albrecht and Bargmann, 2011).
-
a.
-
20.Insert worm into the microfluidic arena.
-
a.Verify that saline buffer is present in the imaging arena (deactivate stimulus valve if not).
-
b.Apply gentle pressure to the worm loading syringe plunger until the animal enters the arena.
-
a.
-
21.
Monitor the animal for 1–2 min to ensure behavior is normal and the animal is healthy (see troubleshooting Note 3).
Set testing parameters and run experiment
Timing: 5–10 min setup, 12 h duration
This step describes the final steps of setting experimental parameters to determine sleep/wake state prior to running the closed-loop script.
-
22.
Capture a single image frame of the arena under brightfield illumination with the animal visible.
-
23.
Using the “ImageJ” toolbar in “Micro-Manager,” import the image frame at 25% scale.
-
24.
Using the rectangle tool, draw a box spanning the outermost points of the arena where the animal will roam. This selection box will be the area of interest used for analyzing animal movement. Record the dimensions (x, y, w, h) of the rectangle, visible in the ImageJ toolbar window (Figure 5).
-
25.
Open “SleepDetection.ijm” and edit the variables x, y, w, and h near the top to define the selected area of interest, then save the file.
-
26.
Locate the “User Defined Closed Loop Settings.txt” file on the computer and set parameters as desired (Figure 6). Detailed information on each parameter is available within the file and in the “ClosedLoopSleepStim.bsh” script.
-
27.
Run the “ClosedLoopSleepStim.bsh” within Micro-Manager to initiate the experiment.
Note: Occasionally animals try to escape the microfluidic arena through the worm entry port (see troubleshooting Note 3). Most often this occurs at the beginning of the experiment, so it is advised to monitor progress during the first few minutes after loading the animals. Use the worm loading syringe to gently push the animal back into the field of view if the animal attempts to escape the arena, or load a new animal if necessary. Once the animal is well established in the arena, the experiment can run unattended.
Expected outcomes
Adult C. elegans sleep behavior varies greatly even across a population of genetically identical wild-type animals under no stimulation (Figure 7A). On average, about 10%–30% of unstimulated wild-type adult C. elegans animals should be in a sleep state at any moment, and median sleep bout duration is about 1.5–2 min (Lawler et al., 2021). With a moderate stimulus (such as 1 mM CuCl2), a typical 12 h experiment should yield ∼12–24 sleep/wake transitions or approximately one transition every 30–60 min (Figure 7B). If sleep/wake event yield is too low with a stronger stimulus, sleep events can be induced via deoxygenation (such as using sodium sulfite, see Lawler et al., 2021). Many factors can influence sleep dynamics, including environmental conditions (see troubleshooting Note 4).
The closed-loop script organizes behavioral videos and neural stimulation sets into a designated save location. All behavioral videos are contained in “TimeLapse” folders separated between stimulations. All stimulus captures are labeled in “Stimulus” folders with the detected behavioral state indicated. Sleep state predictions were found to be 93.4% accurate compared to human observation (Lawler et al., 2021). It is recommended to verify correct identification of behavioral transitions prior to sleep state analysis. For example, view behavioral videos and verify that sleep bout videos show minimal motion and sleep-specific posture (Lawler et al., 2021) and awake videos do not include sleep periods (see troubleshooting Note 5).
Quantification and statistical analysis
To quantify neural fluorescence, NeuroTracker (Larsch et al., 2013) ImageJ software tracks the position of the neuron over time and integrates fluorescence intensity of the soma within a small integration box (available with usage instructions at https://github.com/albrechtLab/Neurotracker). Use active behavior tracking settings as animals frequently move during the stimulation period. Choose an integration box size that just encloses the neuron soma, typically 4 × 4 pixels or 6 × 6 pixels.
NeuroTracker outputs a text file containing neural tracking data over time for each animal, including centroid position, integrated fluorescence intensity, and background level. A MATLAB script “NeuroTrackerSummary.m” can be used to read, organize, and visualize neural fluorescence data across individuals (Figure 7C) or averaged across groups such as sleep and wake states (Figure 7D). Neural fluorescence (F) is calculated by subtracting the background (median intensity of an annulus surrounding the neuron) from average fluorescence intensity in the integration box. To compare across animals with different GCaMP expression, intensity measurements are normalized to a baseline consisting of the first 4 s of each trial before stimulation (F0). The normalized activity over baseline, ΔF/F0 = (F – F0)/F0, can be averaged across individuals and population groups. For statistical comparisons, it is recommended to reduce data per trial to metrics such as peak calcium activity, area-under-curve (AUC), baseline F0, rise time, and decay time. These values can then be compared statistically across sleep states, perturbations, or other experimental groups.
Limitations
Unlike lethargus states between well-timed larval stages, adult sleep events are not time synchronized and occur randomly. Since chemical stimulation is applied uniformly across the entire arena in the neural imaging device, the methods described above are limited to one animal at a time. Additionally, sleep state is determined by a whole-field image subtraction, necessitating one animal per image field. Due to this reduced throughput, it is advised to first determine the overall sleep response to new genetic or chemical perturbations using a high-throughput microfluidic population behavior assay (Lawler et al., 2021), then analyze neural responses as described here using identical conditions. Alternatively, timed stimulus pulses can be delivered and resulting neural responses can be grouped post hoc based on each animal’s sleep state. However, while this method allows for analysis of many animals at once, it does not control for timing between state transitions and stimulation tests.
To monitor free-roaming behavior without camera tracking, a low-magnification (5×) objective is used such that the entire 3 mm × 3 mm microfluidic arena is contained within the field of view. Calcium imaging at this magnification is sufficient for tracking single neural activity, or a few neurons spaced at least 10–20 μm apart. This resolution is not sufficient for whole-brain imaging. Additionally, some neural imaging C. elegans strains may not show sufficient expression to be clearly visible at this magnification or may have low baseline activity. For example, newer GCaMP variants (6+) increase dynamic range by decreasing baseline fluorescence, making tracking of inactive neurons more difficult without additional markers, such as a stable red fluorescent protein expressed in the same neuron.
The sleep detection script relies on detection of movement across frames, and therefore may not be suitable for detecting sleep events in mutants that have overall movement deficiencies. Adjusting movement sensitivity parameters may be sufficient for accurate state detection (see troubleshooting Note 5). Alternatively, the image processing script can be altered to assess any type of optical reporter that does not rely on movement. For example, states and trigger events could be defined by fluorescent reporters expressed in neurons, muscles, or other cells. In this way, the closed-loop sleep detection and stimulation system could be broadly adapted to automatically assess neural responses following any detectable biological phenomenon, such as a locomotory behavior, neural response, mating event, or a change in level or localization of a signaling molecule.
Troubleshooting
Problem 1
Air bubbles enter or form in the microfluidic chamber (steps 5 and 11).
Potential solution
A common problem with microfluidic devices is the presence of air bubbles within the liquid channels, which affect fluid flow, animal behavior, and microscope imaging. Bubbles can either be present at the beginning of an experiment or form during the experiment. To avoid initial bubbles, the microfluidic devices should be degassed in a vacuum chamber before filling such that any bubbles present upon fluid inflow are absorbed into the gas-permeable PDMS material. Extended vacuum duration, and quickly loading fluid upon release from vacuum, will accelerate this process. Next, it is important to avoid flow of air bubbles from the tubing and Luer fittings. Thoroughly purge air from reservoirs and inlet tubing, using vigorous flicks of the Luer fittings to dislodge any bubbles, and make careful drop-to-drop connections at the inlets as described in Lagoy and Albrecht (2015) and Reilly et al. (2017). Finally, to avoid bubble growth during a long experiment, ensure that the chamber is kept at a net positive pressure relative to atmosphere by keeping the inlet and outlet reservoir liquid levels above the device. While it is possible to remove bubbles by pressurizing the chamber, it is usually faster to open, clean, reassemble, and refill the microfluidic device.
Problem 2
Fluids do not switch properly during stimulation (step 12).
Potential solution
Proper fluid switching ensures that the stimulus is delivered reliably to the animal regardless of its position within the arena. During the setup procedure, it is recommended to include a temporary stimulus solution containing fluorescein or other visible dye, and ensure that upon valve actuation the entire arena fills with stimulus solution (see Figure 4D). Imbalanced flow is indicated by a buffer stream at the top or bottom of the arena during valve actuation, or a stimulus stream without valve actuation. To balance flows, ensure that the tubing lengths and diameters are identical, and that reservoirs are positioned such that fluid heights are level. Slight adjustments in flow balance can be made by raising or lowering reservoirs. Note that any fluorescent dye in the stimulus or buffer solutions should be removed after flow balancing, as it can affect tracking of neural activity. One convenient method is to draw a small amount of dye (∼20–50 μL of 0.1 μg/mL fluorescein) into the tubing of either the stimulus or buffer reservoirs using the priming syringe. Flow balance can then be monitored and adjusted until the dye fluid has passed. Fluorescein added to the control fluid should never pass through the arena. Ensure that the control fluid only exits via the bypass channels around the arena, with equal stream width in the upper and lower channels as the valve is actuated.
Problem 3
Animal escaped the microfluidic arena (step 21).
Potential solution
Animals may try to escape the arena in search of food or other attractants. Physical barriers upstream and downstream keep the animal actively roaming in the field of view. Animals that escape through these barriers may be physically smaller than a young adult stage wild-type C. elegans. For example, mutants may grow more slowly and require more time to reach the desired size. Additionally, animals may escape if the device is not sealed properly or is damaged. Carefully check the device for damage, especially at the barriers using a stereomicroscope, and ensure all surfaces of the microfluidic device and glass pieces are fully cleaned of debris prior to assembly. Minimize syringe force when loading the animal, as overpressure may disrupt the seal between the device and the glass slide.
An animal may also escape the microfluidic arena through the worm loading port located upstream in the device, especially if fluid flow is slow or stopped. Ensure that sufficient downstream flow is present to keep animals within the micropost array of the arena. A typical flowrate of 1 μL/s is sufficient, corresponding to about 50 cm height between inlet and outlet reservoir levels. Monitor the beginning of each experiment, and if an animal enters or nears the worm loading port, gently apply pressure to the worm loading syringe to push the animal back into the micropost array.
Problem 4
The animal does not sleep (expected outcomes section).
Potential solution
Sleep in adult C. elegans is sensitive to many environmental factors and varies substantially across individuals. A lack of sleep may result from unintended stimulation to the animal. Stimulation from light (especially blue and ultraviolet light), chemical stimuli, and mechanical perturbations can limit sleep. Ensure that the animal is not exposed to any unnecessary blue/UV light, that buffers are freshly prepared, that animals are loaded into arenas filled with buffer (not stimulus), that flow through the microfluidic device is gentle, and that animals exhibit natural crawling movement. If animals do not sleep after the first sleep transition stimulation, the stimulus concentration may be too high. Additionally, rough handling of the animal prior to loading can also lead to a diminished sleep response.
Problem 5
The script does not correctly identify sleep states (expected outcomes section).
Potential solution
Sleep detection follows an image processing algorithm that may require adjustment based on image quality and lighting to correctly identify the animal. To determine adjustments, observe the result of each step in the segmentation process “SleepDetection.ijm” using the ImageJ software. For example, segmentation of the animal from the microfluidic environment requires thresholding, by default using Otsu’s method to isolate the foreground (animal) from the background of the image. Depending on lighting conditions, other automatic or manual thresholding methods may be more effective. After thresholding, the script identifies a valid animal assuming a consistent pixel resolution to size the animal. The script by default expects an image resolution of ∼350 pixels/mm when at full scale (∼90 pixels/mm at 25% scale), and this parameter should be adjusted for other image resolutions or animal sizes.
Resource availability
Lead contact
Further information and requests for resources and reagents should be directed to Dirk R. Albrecht (dalbrecht@wpi.edu).
Materials availability
C. elegans strains are available from the Caenorhabditis Genomics Center, or from the corresponding author of published works. Microfluidic design files are available upon request to the lead contact.
Acknowledgments
We thank R. Lagoy, K. Burnett, H. White, L. Innarelli, E. Larsen, and A. Marley for experimental support and feedback. Some strains were provided by the CGC, which is funded by National Institutes of Health (NIH) Office of Research Infrastructure Programs (P40 OD010440). D.R.A. was supported by National Science Foundation (NSF) Chemical, Bioengineering, Environmental and Transport Systems Grant 1605679 and Division of Emerging Frontiers Grant 1724026, the NIH Grant R01DC016058, and a Career Award at the Scientific Interface (CASI) from the Burroughs Wellcome Fund. D.E.L. was supported by the NSF Integrated Graduate Research Traineeship Award DGE 1144804.
Author contributions
D.E.L. and D.R.A. designed the research. D.E.L. performed the research. D.E.L. and D.R.A. analyzed the data. D.E.L. and D.R.A. wrote the paper.
Declaration of interests
The authors declare no competing interests.
Data and code availability
Custom control scripts and analysis software are available at Github (https://github.com/albrechtLab/ClosedLoopStimulation and https://github.com/albrechtLab/Neurotracker).
References
- Albrecht D.R., Bargmann C.I. High-content behavioral analysis of Caenorhabditis elegans in precise spatiotemporal chemical environments. Nat. Methods. 2011;8:599–605. doi: 10.1038/nmeth.1630. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Edelstein A.D., Tsuchida M.A., Amodaj N., Pinkard H., Vale R.D., Stuurman N. Advanced methods of microscope control using μManager software. J. Biol. Methods. 2014;1:e10. doi: 10.14440/jbm.2014.36. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Lagoy R.C., Albrecht D.R. Microfluidic devices for behavioral analysis, microscopy, and neuronal imaging in Caenorhabditis elegans. Methods Mol. Biol. 2015;1327:159–179. doi: 10.1007/978-1-4939-2842-2_12. [DOI] [PubMed] [Google Scholar]
- Larsch J., Ventimiglia D., Bargmann C.I., Albrecht D.R. High-throughput imaging of neuronal activity in Caenorhabditis elegans. Proc. Natl. Acad. Sci. USA. 2013;110:E4266–E4273. doi: 10.1073/pnas.1318325110. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Lawler D.E., Chew Y.L., Hawk J.D., Aljobeh A., Schafer W.R., Albrecht D.R. Sleep analysis in adult C. elegans reveals state-dependent alteration of neural and behavioral responses. J. Neurosci. 2021;41:1892–1907. doi: 10.1523/jneurosci.1701-20.2020. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Reilly D.K., Lawler D.E., Albrecht D.R., Srinivasan J. Using an adapted microfluidic olfactory chip for the imaging of neuronal activity in response to pheromones in male C. Elegans head neurons. J. Vis. Exp. 2017:56026. doi: 10.3791/56026. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Schneider C.A., Rasband W.S., Eliceiri K.W. NIH Image to ImageJ: 25 years of image analysis. Nat. Methods. 2012;9:671–675. doi: 10.1038/nmeth.2089. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Stiernagle T. In: WormBook. Fay D., Ambros V., editors. The C. elegans Research Community; 2006. Maintenance of C. elegans. [Google Scholar]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Data Availability Statement
Custom control scripts and analysis software are available at Github (https://github.com/albrechtLab/ClosedLoopStimulation and https://github.com/albrechtLab/Neurotracker).