Investigating C. elegans Escape Responses with Biophotonics and Machine Vision

BY

JᴀRᴌᴀᴛH D. BYRNᴇ RᴏᴅGᴇRS

A ᴛHᴇSIS SᴜBᴍIᴛᴛᴇᴅ IN ᴄᴏNFᴏRᴍIᴛY ᴡIᴛH ᴛHᴇ RᴇQᴜIRᴇᴍᴇNᴛS FᴏR ᴛHᴇ ᴅᴇGRᴇᴇ ᴏF DᴏᴄᴛᴏR ᴏF PHIᴌᴏSᴏᴘHY Cᴇᴌᴌ ᴀNᴅ SYSᴛᴇᴍS BIᴏᴌᴏGY UNIᴠᴇRSIᴛY ᴏF TᴏRᴏNᴛᴏ

© CᴏᴘYRIGHᴛ BY JᴀRᴌᴀᴛH D. BYRNᴇ RᴏᴅGᴇRS 2020 Investigating C. elegans Escape Responses with Biophotonics and Machine Vision

JᴀRᴌᴀᴛH D. BYRNᴇ RᴏᴅGᴇRS DᴏᴄᴛᴏR ᴏF PHIᴌᴏSᴏᴘHY Cᴇᴌᴌ ᴀNᴅ SYSᴛᴇᴍS BIᴏᴌᴏGY UNIᴠᴇRSIᴛY ᴏF TᴏRᴏNᴛᴏ 2020 Abstract One of the fundamental goals in neuroscience is to describe how animals process information from their environment, integrate it with past experience and internal physiological states, and output an appropriate behavioral response. This goal has remained elusive, however, even in circuits as small as the adult nervous system of the nematode Caenorhabditis elegans, with just 302 neurons, and even in frequently studied and apparently simple behaviors, such as the escape response. This thesis presents work towards achieving this goal by developing tools to quantify the behavioral complexity of the C. elegans escape from rapidly increasing temperature. We developed a system that tracks the behavior of individual freely behaving worms, and simultaneously targets infrared laser stimuli to small body regions. We showed that certain aspects of the escape response last for several minutes, and vary with experience, environment and immediate behavioral state. Equipped with these tools for applying precise stimuli and quantitatively measuring behavior, we characterized the worm’s response to repeated stimulation. Escape responses habituate over time, and high-content phenotyping revealed that different behavioral metrics reflect different rates of learning, which suggests multiple loci of plasticity for this simple form of learning. The stimulation and tracking system has also proven useful for other projects: first, it helped test hypotheses derived from whole- calcium imaging, in particular confirming that the AWCOFF neuron has a role in the

ii noxious heat response. Second, a behavioral dataset of heat-induced escape responses helped collaborators describe the worm’s shape through self-occluding turns, an important behavior. We also describe methods for applying similar thermal stimuli while recording neuronal activity with genetically encoded calcium indicators and for measuring temperature with high precision. These techniques were used to identify a novel role for the PVD neurons as midbody thermosensors in C. elegans. Taken together, this thesis demonstrates the utility of combining precise control of environmental stimuli with high-dimensional phenotyping for understanding how a small nervous system controls sensory behavior.

iii Acknowledgments

I am grateful for the support of the many individuals who made the completion of this thesis possible. Thank you first to my supervisor Professor Will Ryu. I have learned a great deal from Will since we met in my freshman year Integrated Science course thirteen years ago. Will brought together a wonderful group of people in the Ryu Lab, several of whom I was fortunate to work with, and to call not only colleagues but friends. Thank you to my supervisory committee members Joel Levine and Mei Zhen, each of whom brought their unique perspectives to my committee meetings over the years. This thesis is stronger because of them. Thank you to Chris V. Gabel and Tod Thiele for enthusiastically joining my examination committee. Thank you to my collaborators from the Ryu, Stephens and Kalia Labs, especially Aylia Mohammadi, Ippei Kotera, Onno Broekmans, Greg Stephens and Krystal Menezes. I enjoyed working with Byron Wilson on the original track and zap system when he was an undergraduate. I was supported in this work by the Natural Sciences and Engineering Research Council of Canada (NSERC) through a Postgraduate Scholarship (PGS-M) and an Alexander Graham Bell Canada Graduate Scholarship (CGS-D).

This dissertation was typeset in Michael Sharpe’s fbb with LATEX, using a version of Jordan Suchow’s Dissertate template. As I reflect on my path to the end of this doctoral thesis, I am reminded of its beginning. I feel very fortunate to have met David Botstein and learned from him about the new Integrated Science curriculum at Princeton before choosing my first year undergraduate courses. In Integrated Science I learned from many inspiring

iv teachers and scientists, in particular Professors William Bialek, Leonid Kruglyak, Clarence Schutt and Eric Wieschaus, and made many close friends. Thank you to Amy Caudy, Gunnar Kleemann and my undergraduate thesis advisor Coleen Murphy for first exposing me to worms, and for providing the supportive foundation that made possible my first independent research projects. Finally, thank you to my friends and family, whose support has been unwavering and incredibly helpful and important. I am especially grateful to my parents Miriam Byrne and Kim Rodgers.

v Contents

1 INᴛRᴏᴅᴜᴄᴛIᴏN Ο 1.0.1 Quantifying behavior ...... 2 1.0.2 C. elegans escape...... 2 1.0.3 Thermosensory behaviors in C. elegans ...... 3 1.0.4 Outline ...... 4

2 TᴀRGᴇᴛᴇᴅ ᴛHᴇRᴍᴀᴌ SᴛIᴍᴜᴌᴀᴛIᴏN ᴀNᴅ HIGH-ᴄᴏNᴛᴇNᴛ ᴘHᴇNᴏᴛYᴘING Rᴇᴠᴇᴀᴌ ᴛHᴀᴛ ᴛHᴇ C. ᴇᴌᴇGᴀNS ᴇSᴄᴀᴘᴇ RᴇSᴘᴏNSᴇ INᴛᴇGRᴀᴛᴇS ᴄᴜRRᴇNᴛ BᴇHᴀᴠIᴏRᴀᴌ Sᴛᴀᴛᴇ ᴀNᴅ ᴘᴀSᴛ ᴇXᴘᴇRIᴇNᴄᴇ. Τ 2.1 Introduction ...... 6 2.2 Results ...... 7 2.2.1 System for long term tracking and targeted thermal stimulation of individual C. elegans combined with high-content behavioral phenotyping ...... 7 2.2.2 Noxious thermal stimuli at the head elicit robust escape responses and induce an arousal state that lasts for several minutes 9 2.2.3 Stimulus strength affects both the probability and magnitude of the escape response ...... 13 2.2.4 Food context changes escape and unstimulated behaviors...... 15 2.2.5 Escape strategy depends on initial behavioral state ...... 17 2.2.6 Escape reversals must be completed before additional stimuli can evoke a response ...... 19 2.2.7 Response to thermal stimuli habituates after multiple encounters 22 2.2.8 Long-term thermal experience modulates escape response...... 23 2.3 Discussion ...... 26 2.4 Materials and methods ...... 29 2.4.1 Strain cultivation ...... 29 2.4.2 Applying repeated thermal stimuli to freely behaving animals.... 29 2.4.3 Data analysis ...... 32 2.5 Acknowledgments ...... 36

vi 3 BᴇHᴀᴠIᴏRᴀᴌᴌY ᴅISᴛINᴄᴛ HᴀBIᴛᴜᴀᴛIᴏN RᴀᴛᴇS IN ᴛHᴇ C. ᴇᴌᴇGᴀNS RᴇSᴘᴏNSᴇ ᴛᴏ NᴏXIᴏᴜS Hᴇᴀᴛ. ΡΥ 3.1 Introduction ...... 37 3.2 Results ...... 39 3.2.1 The C. elegans response to noxious heat habituates after repeated encounters with a short, rapidly increasing stimulus .... 39 3.2.2 Multiple components of the escape behavior habituate at different rates ...... 39 3.2.3 Habituation dynamics of distinct response components are separable by stimulus intensity and genotype ...... 41 3.3 Discussion ...... 46 3.4 Materials and methods ...... 47 3.4.1 Strain cultivation ...... 47 3.4.2 Thermal stimulation assay ...... 47 3.4.3 Behavioral metrics ...... 47

4 TᴇᴄHNIᴄᴀᴌ ᴄᴏNSIᴅᴇRᴀᴛIᴏNS ᴀNᴅ ᴄᴏᴌᴌᴀBᴏRᴀᴛIᴠᴇ ᴀᴘᴘᴌIᴄᴀᴛIᴏNS ΢Χ 4.1 Simultaneous application of thermal stimuli and multi-channel fluorescent imaging for measuring neuronal activity and temperature ... 51 4.1.1 Introduction...... 51 4.1.2 Results ...... 52 4.1.3 Materials and methods ...... 58 4.2 Image registration-based determination of microscope stage movement for single worm tracking ...... 60 4.2.1 Approach and results ...... 60 4.3 Collaborative applications ...... 66 4.3.1 Measuring neuronal calcium signals to identify PVD as a noxious heat sensing neuron at the midbody ...... 66 4.3.2 Pan-neuronal screening in C. elegans reveals asymmetric dynamics of AWC neurons is critical for thermal avoidance behavior ...... 69 4.3.3 Resolving coiled shapes reveals new reorientation behaviors in C. elegans...... 70

5 CᴏNᴄᴌᴜSIᴏN ΥΠ

RᴇFᴇRᴇNᴄᴇS ΥΣ

vii List of figures

1.1 C. elegans sensory neurons that respond to noxious temperature ...... 4 2.1 High spatiotemporal resolution thermal stimulation of freely behaving C. elegans ...... 8 2.2 A single thermal stimulus elicits an immediate rapid escape response, and an extended period of locomotory arousal ...... 11 2.3 The probability and magnitude of the C. elegans escape response depends on the amplitude of the thermal stimulus ...... 14 2.4 Being off-food suppresses the escape response ...... 16 2.5 Sensorimotor processing and escape behaviors depend on the animal’s behavioral state prior to the stimulus ...... 18 2.6 Initiation of the escape response is suppressed while an escape reversal is still underway ...... 20 2.7 C. elegans sensory processing of thermal stimuli habituates with repeated encounters with a stimulus...... 24 2.8 Animals cultivated at lower temperatures exhibit reduced escape responses ...... 25 3.1 Escape responses decrease in probability and magnitude with repeated stimulation ...... 40 3.2 Multiple components of the escape behavior habituate at different rates.. 42 3.3 Habituation rates of behavioral features depend on stimulus intensity .... 44 3.4 Habituation rates of behavioral features are genetically separable ...... 45 4.1 Optical setup for two-channel fluorescent microscopy and infrared laser stimulation ...... 54 4.2 Spatial and temporal temperature characteristics of infrared laser stimulus 56 4.3 Image processing of a stationary bead and crawling worm ...... 61 4.4 Uncorrected position error, while tracking a crawling worm ...... 62 4.5 Distribution of tracked object positions, after correction with image-registration estimate of stage position ...... 64 4.6 PVD is a midbody thermosensor in C. elegans...... 68

viii 1 Introduction

HIᴌᴇ ᴀNIᴍᴀᴌS NᴀᴠIGᴀᴛᴇ their environment, they encounter various sensory W information, which their nervous systems must process, integrate with their memory and internal physiological state, and enact an appropriate response. This continuous coordinated response is what we consider behavior, and is the final output of an animal’s nervous system. Investigations of stereotyped escape behaviors or startle responses to various stimuli have provided extensive insight into the neuronal coordination of behavior in a number of model organisms, including flies, zebrafish, crayfish and molluscs [1–4]. However, how existing behavior affects the steps an animal takes to avoid incoming threatening stimuli, and how escape responses integrate past experience and information from other sensory systems has not been fully elucidated. The free-living nematode Caenorhabditis elegans is an attractive for this work, because the full genome and connectome are known, and the full repertoire of body postures which comprise its behavior can be described with just four eigenworms [5–7].

1 1.0.1 Quantifying behavior

Despite its relatively low-dimensional posture space, and apparently simple crawling behavior, new complexities in C. elegans locomotory behavior continue to be discovered. These discoveries were driven first by technological developments in the collection and processing of video behavioral data and, more recently, by progress in machine-vision based automatic behavioral quantification [8]. For example, since omega turns and reversals were first described as the primary C. elegans turning mechanisms [9], computer-aided analysis has made it possible to quantify at least two other reorientation behaviours: patterns of two or more turns in short succession, called pirouettes [10], and delta turns, large angle dorsal reorientations [11]. In addition to the description of new behaviors, higher throughput and more automatic analysis of behavior have made it possible to characterize locomotion phenotypes for hundreds of C. elegans mutant strains, in spontaneous and stimulus- evoked behavior paradigms [12, 13]. Combining multiple behavioral metrics into behavioral barcodes or fingerprints has made it possible to identify previously undetectable phenotypes [14], and revealed that for thermal stimuli of different intensities, behavioral responses that appear qualitatively similar in fact rely on distinct genetic regulators [15].

1.0.2 C. elegans escape

When C. elegans is confronted with certain aversive stimuli, it executes a sequence of behaviors (collectively, an ‘escape response’) to reorient its locomotion away from the location of the stimulus. The classic escape response consists of a reversal, a deep turn to reorient direction, and resumed forward motion in the new direction, at an increased velocity [16, 17]. C. elegans executes acute avoidance behaviors in response

2 to a wide range of stimuli, including touch, changes in osmolarity, pheromones and noxious heat [16, 18–21]. Although the responses to these myriad stimuli are collectively described as avoidance behaviors, and achieve the common goal of moving the worm away from the source of the noxious stimulus, it is important to note that a variety of behavioral strategies are employed, depending on the character of the noxious stimuli. In this work, we used a focused infrared (IR) laser beam, steered by a pair of galvanometer-driven scanning mirrors, to target short (100 ms) pulses of heat at the worm’s head. Noxious heat avoidance behaviors can be triggered by crossing absolute temperature thresholds as well as by the rate of temperature change [22]. Our laser heating system induces C. elegans escape with relatively small (∆T < 1.2 °C), but fast (dT/dt ≈ 1 − 5 °C) heating (see Chapter 4 and [16]).

1.0.3 Thermosensory behaviors in C. elegans

Thermosensation in C. elegans is not as well understood as mechanosensation, but several neurons that respond to noxious heat have been identified, including AFD, AWC and FLP in the head, and PHC and PVD in the midbody and tail [23, 24]. See Figure 1.1 for the anatomical positions and morphology of these neurons. The AFD neurons are also required for sensing non-noxious temperature, and the related thermotactic behaviors essential to the survival of an ectotherm like C. elegans [25]. In addition to the sensory neurons involved in thermosensation, much of the neural circuitry involved in the escape response has been identified, at the cellular and molecular level [26, 27]. However, although the neuronal connectivity is quite well characterized, an understanding of how sensory and motor signaling are coordinated to orchestrate complicated behaviors such as the escape response remains elusive [28].

3 Figure 1.1: C. elegans sensory neurons that respond to noxious temperature. The locaons of five known C. elegans thermosensory neurons: AFD, AWC and FLP in the head, PVD in the midbody and PHC in the tail. Note the highly branched dendric arbors of FLP and PVD. All five of these neurons occur in bilaterally symmetric pairs, but only the le neurons are shown here. Redrawn with data from [29–31].

1.0.4 Outline

In the work on which this thesis is based, we took a behavior-first approach to investigate the strategies employed by C. elegans to escape from thermal stimuli, and to explore what factors affect these behaviors. The foundation of this effort is a novel system for high resolution tracking of C. elegans behavior across relatively long time and distance scales, combined with a targetable thermal stimulus. To interpret the extensive tracking data produced by this system, we developed a software package to extract meaningful representations of the worm’s behavior and movement through its environment. In Chapter 2 we describe how we applied these tools to expand our understanding of the internal and external conditions that affect the escape response from noxious heat in C. elegans. In Chapter 3 we demonstrate that the escape response habituates after repeated encounters with a noxious thermal stimulus, and that, surprisingly, different behavioral components habituate at different rates. In parallel with our efforts to comprehensively measure behavior in variable thermosensory environments, which at points required new image- and data-processing techniques, we developed non-invasive optical methods for precisely quantifying the thermal stimuli being applied; these methods are described in Chapter 4. Finally, we summarize three projects in which we were able

4 to apply these tools to help characterize novel roles in noxious thermosensation for two well-studied C. elegans neurons [16, 32], and to help identify a new reorientation behavior [11].

5 2 Targeted thermal stimulation and high-content phenotyping reveal

that the C. elegans escape response integrates current behavioral state

and past experience.

2.1 Introduction

Hᴇ ᴀBIᴌIᴛY ᴛᴏ ᴀᴠᴏIᴅ harmful or potentially harmful stimuli can help an T organism escape predators and injury, and certain avoidance mechanisms are conserved across the animal kingdom. However, how the need to avoid an imminent threat is balanced with current behavior and modified by past experience is not well understood. In this work we focused on rapidly increasing temperature, a signal that triggers an escape response in a variety of animals, including C. elegans. We have developed a noxious thermal response assay using an infrared laser that can be automatically controlled and targeted in order to investigate how C. elegans responds to noxious heat over long timescales and to repeated stimuli in various behavioral and sensory contexts. High-content phenotyping of behavior in individual animals

6 revealed that the escape response of C. elegans is multidimensional, with some features that extend for several minutes, and can be modulated by (1) stimulus amplitude; (2) other sensory inputs, such as food context; (3) long and short-term thermal experience; and (4) the animal’s current behavioral state.

2.2 Results

2.2.1 System for long term tracking and targeted thermal stimulation of individual C. elegans combined with high-content behavioral phenotyping

When a worm is confronted with noxious heat, or another aversive stimulus such as mechanical touch or vibration, it often responds with a sequence of behaviors that reorients its body and direction of movement away from the stimulus [16, 33]. To investigate C. elegans escape behaviors in response to noxious heat, we developed a tracking microscope and infrared laser stimulation system, with precise and automated spatial control of an infrared laser stimulus that is small (full width at half maximum (FWHM) intensity = approximately 200 µm), targetable, and of scalable intensity and duration (Fig 2.1). Real-time machine vision software analyses the worm’s posture and location in each frame of the high resolution video stream, allowing computer-controlled targeting of the stimulus. The software identifies the pixel location of the desired position on the worm’s body at which the laser is to be aimed (in this work the worm’s head), and adjusts the scanning mirrors to appropriately steer the laser beam (Fig 2.1). The focused and steered IR stimulus is much smaller and more spatially and temporally precise than the stimuli used in previous studies of the C. elegans response to noxious heat, which have included an electronically heated metal wire [19], heating or cooling a metal microscope stage [34], a thermal barrier many times larger than the worm [35], an area heated by an

7 Figure 2.1: High spaotemporal resoluon thermal smulaon of freely behaving C. elegans. Worms crawl on an agar assay plate. The stage is manually moved by joysck to posion a worm in the camera’s field of view, then the machine vision tracking system takes over automac object tracking and laser targeng for the duraon of the experiment. Doed lines indicate flow of informaon in the system. The two red lines from ‘IR laser’ indicate two possible paths of the thermal smulaon beam, which is focused to a spot at the target posion on the worm’s body. The yellow line from ‘illuminaon’ indicates the bright field illuminaon used to visualize the worm. The red dots ploed around the head skeletonized worm indicate the laser locaons for 392 smuli. The worm’s body is approximately 1 mm long. Abbreviaons: obj. = objecve lens; b.s. = polarizing beam splier; lens = 75 mm or 100 mm laser focusing lens; galvo. scanner = pair of galvanometer- driven scanning mirrors. See Methods for further details.

8 IR laser beam that the worm entered [19], and IR laser pulses with a beam diameter much larger than the worm’s body [15]. A system that is conceptually similar to ours has been used to activate temperature gated ion channels in the head and thorax regions of the fruit fly Drosophila melanogaster, but we were able to achieve better spatial and temporal targeting [36]. From the video recording of the worm’s locomotion before and after the stimulus, we extracted its position and posture in each frame, and calculated a variety of metrics, including translational and phase velocity of the worm’s undulatory cycle [6], heading and position relative to the stimulus, and instantaneous behavioral state (forward, reverse, turn or pause). In their investigation of habituation of the escape response to photoactivation of the ASH neurons, Ardiel, E. et al. demonstrated the importance of considering not just the reversal response, but also changes in other components of ongoing behavior [37]. Similarly, we found it necessary to consider several behavioral metrics in order to describe differences in the escape response as it varied with the worm’s behavioral state, stimulus history and environment. In this work, three primary measurements are used to quantify the escape response: the fraction of the sample population occupying each behavioral state at each time point during the observation of the worm’s movement, phase velocity, and escape distance from the stimulus location. Combined, these measurements describe both the instantaneous behavior of the worm at each moment in time, and how that behavior results in changes in the worm’s position in the real world.

2.2.2 Noxious thermal stimuli at the head elicit robust escape responses and induce an arousal state that lasts for several minutes

This escape behavior has been considered highly stereotyped and short-lived, generally completed within 10 seconds [26]. However, certain stimuli cause far

9 longer lasting changes in C. elegans behavior. In order to determine whether noxious heat can induce altered behavior over timescales of many minutes, we tracked single animals for five minutes after applying a focused IR laser pulse to the head. We confirmed that in response to noxious heat, similar to mechanical stimuli, the initial escape response prior to resuming forward motion is complete within approximately 10 s to 20 s. However, the population mean velocity remains elevated above the pre- stimulus level for approximately three minutes (Fig 2.2A), far longer than previously shown. We also considered how the distribution of behavioral states is affected by an encounter with a thermal stimulus. As expected, immediately after the stimulus, there is a significant increase in the fraction of animals in a reversal state (Figs 2.2C and 2.2D). As the escape response progresses, we observed the anticipated spike in the probability of a deep turn (t ≈ 10 s in Figs 2.2C and 2.2D). These increases correspond with decreases in the proportion of animals in the forward and pause state, which are near zero immediately after the stimulus. By 20 s post stimulus, most worms have resumed forward motion. However, the population’s distribution of behavioral states does not return to the pre-stimulus distribution until approximately four minutes after the stimulus. Notably, the probability of forward motion remains elevated, while pause and turn probabilities and, to a lesser extent, reversal probability, are depressed. Combined with the initial escape trajectory, this shift in navigational strategy has the effect of biasing worms’ movement away from the location of the stimulus (Fig 2.2B).

10 Figure 2.2 (following page): A single thermal smulus elicits an immediate rapid escape response, and an extended period of locomotory arousal. The thermal smulus is delivered by an IR laser (100 ms 75 mA pulse) targeted at the animal’s head (anterior 1/5th), and focused by a 75 mm lens. Plots are aligned so that the smulus is at t = 0 s (indicated by an orange circle). (a) Mean phase velocity of the populaon of worms. Shaded region indicates the standard error of the mean. Note that the populaon’s average phase velocity takes greater than 180 s to return to pre-smulus levels (the doed blue line indicates the average pre-smulus phase velocity). (b) Mean escape distance: the radial distance between the worm’s instantaneous centroid posion and the centroid locaon at the me of the smulus. The doed black line shows data for unsmulated control animals. (c) Ethogram showing the instantaneous behavioral states of individual animals. One of four discrete states is assigned to each animal in each frame: forward, reverse, omega turn, or pause. (d) Fracon of animals in each behavioral state before and aer the smulus. The inset shows the period from 2 s before the smulus unl 15 s aer the smulus. Noce the well-described reverse-turn-forward sequence in the 15 s following the smulus, indicated by the spike in reversal probability, followed by the spike in turn probability, and finally the elevated forward probability. The doed navy and yellow lines indicate the average pre- smulus fracon of the populaon occupying the forward and pause states, respecvely. n ≥ 73 individuals.

11 Figure 2.2: (connued)

12 2.2.3 Stimulus strength affects both the probability and magnitude of the escape response

We corroborated previous results indicating that at lower stimuli amplitudes, which correspond to smaller and slower increases in temperature, the worm’s response becomes probabilistic [16]. For example, at a laser power level of 37.5 mA, some worms respond with a diminished escape reversal, others pause or slow down, and some appear to not respond at all (Fig 2.3A). At 75 mA, the probability of an escape reversal increases dramatically, and most worms respond robustly with a strong reversal, often followed by an omega turn and accelerated forward motion (Fig 2.3B). Compared to 37.5 mA, the reversal and omega turn probability is much higher in response to a 75 mA or greater stimulus (Figs 2.3A–C). At 375 mA, the response probability saturates and 100% of worms execute a reversal after the stimulus (Fig 2.3C). The C. elegans response to mechanical touch is also dose-dependent, although the response probability saturates at 80% [38, 39]. In response to noxious heat, even when the response probability is saturated and 100% of worms reverse, other characteristics of the escape response, such as velocity (Fig 2.3D), reversal duration and probability of pausing, continue to depend on the amplitude of the stimulus (compare 75 mA and 375 mA in Figs 2.3B and 2.3C). Together, these results indicate that the worm is capable of a number of behaviors in response to different levels of noxious heat, and that both the probability and the magnitude of various response characteristics depend on the strength of the stimulus. Furthermore, modulating the magnitude of certain behavioral parameters such as velocity and reversal duration helps the worm escape more dangerous stimuli more efficiently (Fig 2.3E).

13 d a

b

e c

Figure 2.3: The probability and magnitude of the C. elegans escape response depends on the amplitude of the thermal smulus. Responses to three levels of thermal smuli are shown (all 100 ms, focused by a 75 mm lens). Plots are aligned so that the smulus is at t = 0 s (indicated by an orange circle). (a–c) Fracon of animals in each of the four behavioral states, for three different laser power levels: (a) 37.5 mA (n ≥ 23), (b) 75 mA (n ≥ 65), and (c) 375 mA (n ≥ 33). 75 mA is the primary power level used in this work because it elicits robust responses from most animals, but does not fully saturate the response. (d) Populaon average phase velocity for each power level. Shaded regions indicate the standard error of the mean. (e) Mean escape distance. Shaded regions indicate the standard error of the mean.

14 2.2.4 Food context changes escape and unstimulated behaviors

It is well documented that C. elegans basal locomotory behavior depends on its environment and sensory context, in particular food, one of the primary drivers of behavior [40, 41]. However, how current food context affects noxious heat avoidance is unknown. To determine whether food context affects the C. elegans escape response, we applied localized thermal stimuli to similarly treated worms on bare plates and on plates seeded with an E. coli OP50 bacterial lawn, the standard laboratory food source for C. elegans. We confirmed previous reports [42, 43], showing that basal (pre-stimulus) velocity is higher off food (Fig 2.4C, t = −2 to 0 s), and that unstimulated worms off food spend less time reversing (Figs 2.4A and 2.4B, t = −2 to 0 s). However, we also found that other characteristics of the unstimulated behavioral state distribution are dramatically shifted. Notably, when worms are off food, the probability of being in a forward state is much larger, as is the probability of turning (Figs 2.4A and 2.4B, t = −2 to 0 s). When worms on food encounter noxious thermal stimuli, they respond more frequently and more robustly than worms off food (Figs 2.4A-C). On food, more animals execute reversals in response to noxious heat, the reversals last longer (Fig 2.4B), and the average speed of escaping worms is higher than those off food (Fig 2.4C). The combined effect of these behavioral differences is reflected in the escape distance (Fig 2.4D), particularly in the four seconds immediately following the stimulus, in which animals on food escape further away from the stimulus. Eventually, the effect of the higher baseline speed of worms off food outweighs the faster and longer escape reversals of worms on food, and by eight seconds post-stimulus, worms off food are further away from the location of the noxious stimulus (Fig 2.4D). These results indicate a strong context dependence of the escape response, suggesting that

15 c

a

b d

Figure 2.4: Being off-food suppresses the escape response. Smulus (100 ms 75 mA, focused by 75 mm lens) is at t = 0 s (indicated by an orange circle). (a–b) Fracon of animals in each behavioral state, OFF (n ≥ 46) and ON (n ≥ 24) food. Control ON food worms are washed with the same protocol as the OFF food animals. (c) Mean phase velocity. Shaded regions indicate the standard error of the mean. (d) Mean escape distance. Shaded regions indicate the standard error of the mean.

16 worms integrate rapidly changing thermosensory measurements with information about their current food substrate when deciding how to respond to noxious heat.

2.2.5 Escape strategy depends on initial behavioral state

It has been demonstrated that for some stimuli, the behavioral response depends on current body posture [6] or behavioral context [44]. To explore if this is true for thermal noxious escape, we analysed the pre-stimulus behavioral states of a large population of similarly treated worms, and compared the context-dependent escape responses of individuals that were paused at the time of stimulation with the responses of those that were moving forward. We found that a worm’s response to identical stimuli depends on its initial behavioral state when the stimulus was applied: animals that are moving forward when they encounter a stimulus almost always reverse (Fig 2.5A), whereas if an animal is paused when faced with noxious heat, it only reverses approximately 60% of the time (Fig 2.5B). Furthermore, animals moving forward prior to the stimulus exhibit much greater changes in velocity than the paused population (Fig 2.5C). These differences in velocity and reversal probability are reflected in the escape distances achieved by the forward-moving and paused animals: the population moving forward before the stimulus achieves significantly greater escape distances in as little as 1 s, and remains further away from the stimulus location for the duration of the assay (Fig 2.5D). Together, these results indicate a second type of state-dependence of the noxious heat response, in addition to the food- context-dependence described above; notably, thermosensory processing depends on initial behavioral state.

17 c a

b d

Figure 2.5: Sensorimotor processing and escape behaviors depend on the animal’s behavioral state prior to the smulus. Smulus (133 ms 95 mA, focused by 100 mm lens) is at t = 0 s (indicated by an orange circle). (a–b) Fracon of animals in each behavioral state, separated by inial condion (FORWARD n ≥ 15; PAUSE n ≥ 56). Note the much larger proporon of FORWARD inial condion animals that reverse in response to the smulus, and the extended length of those reversals. (c) The populaon mean phase velocity, separated by inial behavioral condion. Animals moving forward before the smulus are averaged in purple, animals that are paused in yellow. Shaded regions indicate the standard error of the mean. (d) Mean escape distance. Shaded regions indicate the standard error of the mean. The populaon of worms moving forward before the smulus escapes significantly further.

18 2.2.6 Escape reversals must be completed before additional stimuli can evoke a response

Having established that whether a worm is paused or moving forward prior to encountering a noxious thermal stimulus changes the probability and magnitude of its escape response, we asked whether C. elegans is able to sense and respond to additional noxious thermal stimuli while already executing an escape response, in order to broaden our understanding of this avoidance behavior’s state-dependence. To answer this question, we performed a “double zap” experiment, in which we applied a second IR laser stimulus two seconds after the first. Most worms respond to the first stimulus by rapidly reversing. However, by two seconds after the stimulus, some animals have stopped reversing and entered a pause state (‘Short Response’). This distinction between ‘Short’ and ‘Long’ escape reversals has also been recently reported in response to sorbitol and optogenetic stimulation of ASH neurons [45]. The population of worms that have completed their reversal response when the second stimulus is applied (‘Short Response’, Fig 2.6C) responds more robustly than worms still reversing (‘Long Response’, Fig 2.6B), showing a change in speed that resembles their naive response (Fig 2.6D). In the ‘Long Response’ population, the proportion of animals in each behavioral state after the second stimulus closely resembles the behavioral distribution of the single stimulus population (Figs 2.6A and 2.6B). Similarly, there is no significant difference between the escape distances of ‘Long Response’ worms stimulated twice and worms stimulated only once (Fig 2.6E). Together, these results illustrate a second type of behavioral state-dependence for noxious heat avoidance: if a worm is executing an escape reversal, responses to additional noxious stimuli are repressed. In contrast, if the initial escape reversal is complete before encountering the second stimulus, the new stimulus is not ignored

19 Figure 2.6 (following page): Iniaon of the escape response is suppressed while an escape reversal is sll underway. (a–c) Fracon of animals occupying each behavioral state in response to either a single (a) or double (b and c) thermal smulus, separated by 2 s (133 ms 95 mA, focused by 100 mm lens). Only animals that respond to the first smulus with a reversal are included. The SHORT and LONG responding animals are separated on the basis of the behavioral state occupied prior to the second smulus, at 2 s aer the first smulus. Animals that have stopped reversing and transioned into a paused state are categorized as SHORT response, while animals that are sll reversing are labelled LONG. Note the similarity in the behavioral state distribuon over me aer the second smulus between the single- (a) and double-smulated (b) LONG responders. Smuli ming is indicated with orange circles. Single smulus n ≥ 32; double smulus LONG n ≥ 74; double smulus SHORT n ≥ 14. (d) Average speed of worms in each of the three populaons in (a–c). Shaded regions indicate the standard error of the mean. Note the robust response to the second smulus from the SHORT responding populaon (d, yellow); also visible in (c). (e) Mean escape distance for each of the three populaons in (a–c). Shaded regions indicate the standard error of the mean.

20 Figure 2.6: (connued)

a d

b

c e

21 and a robust escape response can be executed.

2.2.7 Response to thermal stimuli habituates after multiple encounters

After showing that the escape response depends on an animal’s pre-exposure and stimulus-induced behavioral states, we asked how repeated encounters with noxious thermal stimuli affect C. elegans sensory processing over longer time periods. We tracked individual worms and applied stimuli to their heads every 15 s. This interstimulus interval (ISI) was chosen so that the sequence of immediate escape behaviors (reversal, turn, resumed forward motion) is completed by almost all animals before a subsequent stimulus is applied, and because it is within the range of ISIs to which C. elegans habituates its response to non-localized mechanical tap [46]. With repeated stimuli, the maximum escape reversal velocity decreases steadily (Fig 2.7B). Interestingly, this decrease in maximum reversal velocity does not closely resemble responses to lower power stimuli (Fig 2.3). That is, at lower power stimuli, while reversal speeds are lower, the more salient change is the decrease in reversal probability (Fig 2.3) and [16]. In contrast, with repeated stimuli at the same power, reversal probability remains high despite significant reductions in other aspects of the response, such as reversal velocity and duration (Figs 2.7A and 2.7B). These decreases in certain aspects of the escape response resemble the habituation to mechanical tap that has been reported [47]. However, the habituation we observed seems to be a more complicated phenomenon, with different features of the response decaying at different rates. Some characteristics, such as the velocity of the worm’s resumed forward motion after reorientation, increase after several subsequent stimuli, before later decaying (Fig 2.7B). Figure 2.7C illustrates how these changes in the escape responses to different numbers of stimuli affect how well C. elegans avoids the location of the stimulus. Surprisingly, large escape distances are achieved by 10 s post-

22 stimulus in response to both early (stimulus 1, Fig 2.7E) and late stimuli (stimuli 5, 10, and 20, Fig 2.7E), but with divergent navigational strategies: large escape distances in response to early stimuli are achieved by extended, high velocity reversals, whereas large escape distances to later stimuli are achieved by sustained high velocity forward locomotion past the stimulus location, combined with shorter reversals (Figs 2.7A–C).

2.2.8 Long-term thermal experience modulates escape response

C. elegans thermosensory behavior is regulated, in part, by their previous temperature

experience—animals migrate toward their cultivation temperature (TC) on thermal

gradients, and track isotherms near TC [22, 48]. In the noxious range (29 °C to

37 °C), pre-exposure to high temperatures above TC (1 hr at 28 °C) increases the threshold temperature required to elicit avoidance behaviors from worms on thermal gradients [49]. To determine whether past experience also modulates escape from rapidly increasing temperature, we examined the escape responses of worms reared at different temperatures. Surprisingly, when assayed at an ambient temperature of 23 °C, worms grown at 17 °C respond less frequently and less robustly than worms grown at 23 °C (Figs 2.8A and 2.8B). The average reversal velocity and omega

turn probability is lower for TC = 17 °C animals (Figs 2.8A–C), and consequently

the population of TC =23 °C animals achieves a greater distance away from the location of the noxious stimulus (Fig 2.8D). These results indicate that worms’ past temperature experience affects their behavioral response to acute noxious heat, suggesting that to execute an escape response, worms integrate rapidly changing thermosensory information with longer term memory of ambient temperatures.

23 a

b c

Figure 2.7: C. elegans sensory processing of thermal smuli habituates with repeated encounters with a smulus. IR laser smuli (100 ms 75 mA, focused by 75 mm lens) were automacally targeted to the animal’s head every 15 s (indicated by orange circles). (a) Fracon of animals occupying each of the four behavioral states aer repeated smuli. Note the decreasing proporon of animals in the turn and pause state for the first several smuli. n ≥ 14. (b) Mean phase velocity of animals that have been smulated 1 (purple), 5 (blue), 10 (teal), 20 (green) and 30 (yellow) mes. Shaded regions indicate the standard error of the mean. (c) Escape distance. Shaded regions indicate the standard error of the mean.

24 c a

b

d

Figure 2.8: Animals culvated at lower temperatures exhibit reduced escape responses. Animals were reared in incubators set to 17 °C and 23 °C. All behavioral experiments were performed at 23 °C. Smulus (100 ms 75 mA, focused by 75 mm lens) is applied at t = 0 s. (a) and (b) show fracon of animals raised at each temperature in each of the four behavioral states aer a thermal smulus. n at 17 °C ≥ 53; n at 23 °C ≥ 32. (c) Mean phase velocity aer smulus. Shaded regions indicate the standard error of the mean. (d) Mean escape distance. Shaded regions indicate the standard error of the mean.

25 2.3 Discussion

We developed a new assay for interrogating the behavioral responses of C. elegans to noxious thermal stimuli. This assay enables: observing individual animals for long periods of time; high-resolution imaging of animal posture; and precise spatiotemporal control of a focused thermal stimulus with high anatomical specificity. We combined this experimental approach with comprehensive behavioral phenotyping, leveraging both continuous measurements, such as phase velocity and position, as well as discretized behavioral states, such as turns, pauses and reversals. The ability to apply precise time-varying thermal stimuli to individual animals and comprehensively quantify their behavioral responses revealed previously unknown complexity and extensive context-dependence in this apparently simple behavior. By following individual animals for up to five minutes after they encountered a noxious thermal stimulus, we found that a single 100 ms thermal pulse is sufficient to induce elevated speeds and a shifted behavioral state distribution for many minutes, indicating a residual effect of the stimulus on that timescale. This result parallels the recent finding that aversive mechanical stimuli lead to long-term locomotory arousal [50]. In that paradigm, locomotory arousal lasts for one to two minutes and depends on FLP-20 neuropeptides from the touch receptor neurons (TRNs) and cell-specific activity of the FLP-20 receptor FRPR-3 in the RID neuron. Despite the similarity in the behavior, FLP-20 is not expressed in any known thermosensory neurons [51], which suggests that the worm’s arousal state might be regulated by independent mechanisms in different sensory modalities. Investigating the role of neuropeptide signalling in noxious heat-mediated arousal will be an interesting direction for future study. The avoidance of noxious heat by C. elegans depends on integrating contextual

26 cues about the animal’s local environment, such as food, and we demonstrated that sensitivity to noxious thermal stimuli is reduced when well-fed animals are off food. With this finding, we add noxious heat to the other aversive stimuli the responses to which depend on food availability, including CO2, octanol and nose touch [52–54]. For octanol and nose touch, this sensitivity depends on dopamine and neuropeptide signalling in the polymodal nociceptor neurons ASH [55]; however, the neuronal signalling that underlies the food-dependent tuning of noxious heat sensitivity that we report here is unknown. That the presence of food significantly alters the C. elegans noxious heat avoidance strategy demonstrates that the worm is capable of rapidly integrating multiple sensory inputs when deciding how to respond to potentially harmful stimuli. We investigated how an animal’s current behavioral state affects its sensorimotor response to noxious heat in two ways, by considering the influence of pre-stimulus behavioral state, and by applying a second stimulus to escaping worms. In both cases, we observed a strong state-dependence of C. elegans noxious heat avoidance behavior. An animal moving forward when it encounters a noxious stimulus is far more likely to respond than if it is paused, suggesting that the worm combines information about its current behavioral state with information collected by the thermosensory system. Why this behavioral strategy might have evolved is not immediately obvious. It is possible that the reason is purely sensory, since a faster moving worm will perceive a thermal stimulus as changing temperature at a higher rate than a stationary worm, and therefore determine that it is a more dangerous threat. Another possibility is that ecologically different strategies in threat response, depending on these small differences in initial behavioral state, lead to different survivability outcomes. When a worm encounters a second noxious thermal stimulus while it is still reversing away from the original stimulus, it appears to ignore the second stimulus,

27 neither interrupting the first escape response to initiate a second, nor integrating the second stimulus and extending the first. This result suggests that the escape reversal has characteristics of an all-or-none response, which must finish before another escape reversal can be initiated. Recent projects exploiting optogenetic activation of specific mechanosensory neurons in C. elegans and descending neurons in D. melanogaster also revealed that an animal’s behavior immediately prior to a stimulus can bias its behavioral response [44, 56]. The results of those optogenetic interrogations, combined with the evidence presented here that the noxious heat avoidance response is strongly behavioral state-dependent, suggest that this type of context-dependency may be generalizable across various sensory modalities and evolutionarily conserved between phyla. How the C. elegans nervous system encodes information about its current behavior, and how it integrates this information with incoming sensory stimuli, remains unclear. We anticipate that our system for precisely applying dynamic thermal stimuli and comprehensively quantifying behavior will prove useful for answering these questions. In addition to current behavioral state, we found two ways that the worm’s temperature experience modulates noxious heat avoidance: first, the escape response depends on the animal’s long term thermal history (cultivation temperature), and second, worms reduce but never eliminate avoidance behaviors after repeated encounters with noxious thermal stimuli. Previous work has revealed that sensed temperature experience can impact longevity [57], high temperature thermal tolerance [58], and noxious heat avoidance responses [49]. Our results add to the wide range of behaviors that reflect the worm’s thermal memory, and emphasize how important storing a record of thermal experience is for the worm. We have demonstrated that C. elegans implements a diverse range of behavioral strategies to escape from noxious heat. Worms are able to tune their escape responses

28 to various threat levels, combine inputs from distinct sensory pathways to incorporate food context in their decision making, and modulate their escape responses in an experience and behavioral state dependent way. Remarkably, the small nervous system of the worm simultaneously integrates memory of long-term thermal experience on the timescale of days with information about its immediate behavioral state on the timescale of seconds. With this work we have placed the noxious heat escape response in a broader context than previously considered, and in doing so have revealed surprising complexity and plasticity in a well studied behavior. The noxious thermal response assay described here will be useful for future investigations of how such a simple circuit in C. elegans can rapidly integrate current behavior with multiple sensory inputs to execute a complex escape response with several degrees of freedom.

2.4 Materials and methods

2.4.1 Strain cultivation

C. elegans Bristol N2 hermaphrodites were cultivated at 23 °C (except when otherwise indicated) on standard nematode growth medium (NGM) plates seeded with E. coli OP50 following standard cultivation methods [59].

2.4.2 Applying repeated thermal stimuli to freely behaving animals

Automatic tracking and thermal stimulation

We integrated a steerable infrared laser with a worm-tracking microscope. A 1440 nm diode laser (FOL1404QQM; Fitel, Peachtree City, GA) is steered by a pair of galvanometers (GVS002 TSH24006 X/Y; Thorlabs, Newton, NJ), reduced in intensity as necessary by ND filters and focused to spot by a 75 mm or 100 mm

29 focal length lens. The diode is driven and temperature controlled by a Thorlabs diode controller (LDC 240C) and temperature controller (TED 350). A polarizing beam splitter is used to reflect the beam to the surface of the assay plate and enables imaging from above. Assay plates are illuminated from below with red light from an adjustable output LED (DiCon Fiberoptics, Richmond, CA). Images were captured at 20 Hz by a digital camera (MANTA 125B ASG; Allied Visions, Stadtroda, Germany), magnified by a variable magnification imaging lens (55-906 MMS R-2; Edmund Optics, Barrington, NJ). Custom machine vision software written in LabVIEW (National Instruments, Austin, TX) evaluates the worm’s location in each frame and updates the position of the XY tracking stage controlled by a 2-channel stepper motor controller (BSC-102; Thorlabs) in order to keep the worm in the field of view. Simultaneously, the program processes each frame to isolate a binary image of the worm and identify the location of the head and tail to allow precise stimulation with the laser. Combined tracking and thermal stimulation is possible up to 20 Hz. The duration of tracking and number of stimuli is limited only by disk space. The accuracy of the laser stimulus position relative to the target position on the worm is limited by the worm’s displacement between the time the stimulus is applied and the time at which the frame immediately prior was recorded, which is used to calculate the target position. Our system allows full control of the duration, frequency, intensity and position of the thermal stimulus. For the experiments described in this work, two stimulus regimes were used: (1) the animals represented in Figs 2.2, 2.3, 2.4, 2.7 and 2.8 were stimulated with a 100 ms pulse focused by a 75 mm lens (37.5 mA, 75 mA or 375 mA, as indicated). (2) the animals represented in Figs 2.5 and 2.6 were stimulated with a 133 ms 95 mA pulse focused by a 100 mm lens, in order to facilitate comparison with other studies [16, 60, 61].

30 Behavioral assays

Plates were prepared for the thermal stimulus assay using a previously developed protocol [15, 16]. 16–24 hours before testing, assay plates were seeded with 100 µL E. coli OP50 (OD600 = 0.6–0.8), and stored at room temperature overnight. Unless otherwise indicated, young adult worms were assayed. Between 1–10 animals were picked to each assay plate. For single-animal experiments, the dorsal-ventral orientation was annotated by eye when each worm was picked to its assay plate. We assumed that worms did not flip themselves through the course of the experiment. The underside of the plate lid was polished with a drop of detergent to prevent collection of condensation interfering with imaging. All behavioral experiments were performed in a temperature controlled room set to 23.0 °C. Three timing protocols were used: (1) for experiments on food, worms were allowed to recover from picking for at least 30 minutes at 20 °C or 23 °C. (2) For experiments off food and relevant controls, worms were washed twice in M9 buffer, picked to an unseeded plate, and allowed to recover from picking for 10 minutes before assaying, and then experiments were completed within the next 30 minutes. This time frame was used to limit possible changes in behavior due to extended periods of time off food. (3) For the 2 second ISI double-stimulus and initial condition dataset (Figs 2.5 and 2.6), worms were washed twice in M9, gently spun down for 1 minute, then incubated in M9 for 30 minutes. The worms were then transferred to an assay plate, and allowed to recover from picking for 30 minutes. Trials were then completed within the next 30 minutes. This protocol was used to make quantitative comparison with other datasets possible [16, 60, 61].

31 2.4.3 Data analysis

All offline image processing and behavioral analysis was completed in MATLAB (R2015a, The Mathworks, Natick, MA).

Image segmentation

First, worm bodies are segmented from the background. Because imaging conditions are variable across different experiments, a set of histogram-based binary thresholding algorithms are polled to find a threshold value that best segments each image. This segmented image is used as a seed mask for the Fast Marching Method, to generate a final segmentation [62]. Holes in the worm body are filled, except for holes which fulfill selection criteria matching the centre of a looped worm.

Calculation of worm skeletons

Worm skeletons are generated in two primary steps. First, a skeleton for each frame is calculated with a robust midline-finding algorithm described previously [15, 61]. This algorithm works very well for frames with simple worm postures, but fails during self-occluding coils and deep turns. Frames with crossed worms or binary segmentation failures are flagged using skeleton length and worm shape characteristics, and are double-checked by the user. In the second step, skeletons for these frames with complex worm shapes are calculated using an eigenworm-based posture-tracking algorithm [11]. The final step of this algorithm interpolates across time through posture space, which ensures that the best solution for each crossed frame is found, and also reduces minor errors in simple, non-overlapping frames.

32 Head-tail correction

The skeleton tracking algorithm described above occasionally reverses the head and tail of the worm. To accurately and efficiently assign the head and tail, we exploited the location of each stimulus, which is known to be at the head. Moving forward and backward from each stimulus frame, the skeletons were checked and flipped as necessary, to minimize the change in head-position from frame to frame. In the case of segmentation errors which interrupt this process, the user is asked to annotate the head in a single frame after the error, and the correction process continues.

Coordinate systems

Before each recording, the XY stage is calibrated by tracking the movement of a stationary object on the plate (a speck of dust, for example), in order to determine the transformation matrix to convert pixel coordinates to real-world coordinates. The laser galvanometers are also calibrated, by asking the user to click on the position of the beam as it burns a spot on the surface of the agar plate. The beam is then steered by both mirrors and the new position is recorded, confirming the conversion between input voltage and pixel-movement.

Stage movement estimation

To measure the real-world position of the stage in each frame, including frames during which the stage is in motion, we calculated the frame-frame movement of the tracking stage using an image-registration based strategy. The translation between each pair of frames is calculated using a fast subpixel image-registration algorithm which utilizes the discrete Fourier transform [63]. A region from the edge of each frame where no worm is present is used, to avoid attempted registrations of the

33 worm’s body, which might change position frame to frame. The pairwise translations were averaged with translations between frames 2 and 3 frames apart, to reduce the effect of accumulated noise in summing across many frames. The cumulative translation between frames is converted from pixels to mm (stage units), and added to the starting position of the stage, as reported by the controller. These stage positions are used to calculate the real-world position of the worm and laser position in each frame.

Calculating translational velocity

The centroid of the binary image of the worm in each frame, converted to real-world units (mm), is used to calculate the magnitude of the worm’s translational velocity (speed). The x and y position vectors are first smoothed with a robust discretized spline smoothing algorithm [64, 65] to reduce the effect of high frequency noise on the derivative calculation. The worm’s speed is the magnitude of this derivative. The worm’s heading (sign of the translational velocity), is assigned by taking the angle between the direction of the worm’s centroid movement for each frame − − [ctrxi ctrxi−1, ctrxi ctryi−1], and the worm’s orientation, which is defined as the − − vector from the centroid to the worm’s head, [headxi ctrxi, headyi ctryi]. The translational velocity is positive (forward movement) for θ < π/2, and negative (reverse movement) for π/2 < θ < π.

Calculating phase velocity

The worm’s phase (ϕ) was described using the projections of the worm’s skeleton (modes a1 and a2) on to the first two eigenworms, which dominate the worm’s posture during forward and backward sinusoidal motion, as described previously [6]. The modes are smoothed across time and posture space during the final interpolation

34 step of skeleton calculation so are not smoothed further [11]. Phase is defined as ϕ = tan−1(a2/a1). The phase velocity (ω) is then calculated by taking the derivative of this phase vector, dϕ/dt. In some postures, when modes a1 and a2 are near zero, high frequency noise dominates the phase derivative. Therefore, we removed frames that resulted in physiologically impossible changes in phase velocity (dω/dt > 0.18 cycles·s−1). Peaks in dω/dt were identified with the MATLAB findpeaks function, using a threshold of three standard deviations from the mean of dω/dt, calculated from a population of worms. Frames within half the peak width before and after each peak were removed from the phase velocity vectors. Peaks were generally no more than a few frames, less than 0.25 s. Positive phase velocities correspond with forward motion, and negative phase velocities correspond with backward motion. It is important to note that accurate calculation of direction depends on accurate labelling of the worm’s head in each frame.

Behavioral flagging

Four behavioral states are automatically flagged based on the worm’s skeleton and phase velocity: forward, reverse, pause and deep turn. Worms cannot occupy more than a single behavioral state simultaneously. The minimum duration of a behavioral segment is 0.25 s (5 frames). Fluctuations shorter than 0.25 s are assigned the state of the surrounding behavior. Forward and reverse behavioral flags are assigned according to the sign of the worm’s instantaneous phase velocity. Deep turns are flagged when the head-tail distance is less than half the average head-tail distance. Pauses are flagged when the magnitude of the phase velocity is less than 0.02 cycles·s−1. Behavioral flags are user-verified.

35 2.5 Acknowledgments

We thank Byron Wilson for the initial hardware and software development of the laser tracking instrument.

36 3 Behaviorally distinct habituation rates in the C. elegans response to

noxious heat.

3.1 Introduction

NᴄᴏRᴘᴏRᴀᴛING SᴇNSᴏRY ᴇXᴘᴇRIᴇNᴄᴇ into future activity by learning is essential to I the survival of all organisms. One of the simplest forms of learning, habituation is the gradual decrease in an organism’s response to a stimulus [66]. Habituation has been observed in many organisms across widely varying scales of complexity, with initial descriptions of the neuronal and biochemical foundations of memory coming from studies in Aplysia (sea snail), and crayfish [67, 68]. Since then, habituation has been demonstrated in behaviors as complex as mate preference [69], and even suggested in organisms without neurons, such as slime moulds [70]. C. elegans, with its known connectome, has been used extensively as a model organism for the study of habituation, especially in response to mechanical tap [71]. More recent work in C. elegans revealed that insulin signalling in the light and pheromone sensing neurons

37 (ASJ) is required for cold habituation, and that habituation to optogenetic activation of a polymodal nociceptor neuron (ASH) is food and dopamine dependent [72, 73]. Despite the suggestion that responses to strong or noxious stimuli may not habituate [74], and the apparent risk to the organism that is involved, a number of studies have shown habituation to stimuli that signal noxious threats, such as the crab’s response to predator shadows [75], and the human response to acutely painful stimuli, such as electric shock [76]. How animals are able to habituate to noxious signals without limiting their ability to respond to actually lethal threats is not well understood. In this study, we aimed to determine whether, and in what ways, C. elegans habituates to noxious heat, by targeting infrared laser pulses to the head, while tracking the worm’s behavior. Using a multimetric phenotyping approach [15], we found that the behavioral response to noxious heat has multiple components that show variable habituation dynamics. Certain features of the response behavior are amplified before decaying, suggesting that the resulting behavior may integrate both sensitization and habituation. The rates of learning depend on the strength and frequency of the stimulus, and appear to be affected by specific genetic manipulations. Together, these results suggest that there are multiple loci of plasticity in the neuronal circuit regulating C. elegans habituation to noxious heat, and may help explain how a simple nervous system has evolved to habituate to stimuli that could be life- threatening.

38 3.2 Results

3.2.1 The C. elegans response to noxious heat habituates after repeated encounters with a short, rapidly increasing stimulus

We developed an assay that allows the repeated targeted stimulation of individual worms, with continuous tracking over long periods of time and large distances, and high temporal and spatial resolution of animal posture and position (see Fig 2.1). This device made it possible to maintain individual worm identity across encounters with large numbers of stimuli, and applying postural reconstruction and eigenworm analysis [6, 11] to the high resolution images made it possible to comprehensively describe the response behaviors. It is important to note two characteristics of our stimulus that differ from stimuli historically used to investigate habituation in C. elegans. The most commonly used stimulus, tap, stimulates the entire animal, and thus the behavioral response integrates antagonistic sensory signals from across the worm’s body. Recently, optogenetic stimulation has been applied to investigate specific neuron-mediated habituation, bypassing the neuron’s sensory function. Our stimulus has the advantage of localized targeting along the body, without bypassing the sensory transduction machinery. Our protocol induced habituation of the escape response (Fig 3.1).

3.2.2 Multiple components of the escape behavior habituate at different rates

Habituation has primarily been measured as a decrease in a binary response variable (i.e. probability of response), but can also be quantified by assessing any reduction in the magnitude of the response [77]. As described in Chapter 2, and by others, accumulating evidence indicates that the C. elegans escape response is more

39 Figure 3.1: Escape responses decrease in probability and magnitude with repeated smulaon. (a) Ethogram of behavioral states for a representave subset of individual worms across twenty 75 mA smuli at 15 s intersmulus interval (ISI) (5 min total). (b) Populaon behavioral state fracons of animals. Note the overall characteriscs of the changing escape response with increasing smuli, including shorter and less frequent reversals, decreased omega turn frequency, and increased pausing. (c) Average phase (undulatory wave) velocity. (d) Euclidean distance from the smulus locaon for indicated smuli. Shaded regions in (c) and (d) indicate standard error of the mean.

40 complicated than a simple reflex that can be described by the response probability or magnitude of a single behavioral parameter alone [16, 26]. Therefore, we investigated whether other movement characteristics of the escape response also habituate. We confirmed that the noxious heat response in C. elegans is multi-dimensional, and investigated twelve components of the behavior that are modified by increasing numbers of stimuli. Repeated stimulation results in the decay of several components of the escape response, including escape angle, reversal distance and probability of executing an omega turn, while other metrics such as probability of reversal show significantly less decrease (Fig 3.2). Surprisingly, certain aspects of the escape behavior, such as probability of omega turn and velocity of resumed forward motion, increased during the first several stimuli before they subsequently decayed (Fig 3.2).

3.2.3 Habituation dynamics of distinct response components are separable by stimulus intensity and genotype

Previous studies have shown that stimulus amplitude modulates habituation rate: very intense stimuli may result in little or no habituation of response, while less intense stimuli result in a more rapid or pronounced decrease in response [74]. We sought to confirm whether the stimulus intensity affects the rate of decrease in the response behavior we observed. When we applied repeated stimulation at 300 mA, a hotter stimulus that yields a stronger naive response than the 75 mA stimulus used elsewhere in our study, the escape response still showed evidence of habituation. Reversal duration, a commonly-used metric in studies of C. elegans tap habituation, decreases at a very similar rate in response to 75 mA and 300 mA stimuli intensities (Fig 3.3A). However, comparing habituation rates across different components of the behavior reveals more subtle differences: omega turn probability decays markedly more slowly in response to the hotter 300 mA stimuli (Fig 3.3B). The fact that a more

41 Figure 3.2: Mulple components of the escape behavior habituate at different rates. The change in twelve behavioral measurements of the escape response with increasing smuli. 100 ms 75 mA laser pulses were applied every 15 s. See Methods for a descripon of each measurement. Shaded regions indicate standard error of the sample stasc (mean or proporon).

42 intense stimulus resulted in slower decay of parts of the escape response suggests that we observed habituation consistent with historic definitions [74]. It also illustrates the importance of a high-content phenotyping approach: only looking at reversal duration or response probability after repeated exposure to the higher amplitude stimulus would not have elucidated the difference in phenotype. That omega turn rates remain higher in response to repeated 300 mA stimulation provides evidence that noxious heat-induced deep turning is controlled independently from reversal duration. Although we had observed that independent behavioral components exhibited different learning kinetics, it remained uncertain whether these separate aspects of behavior relied on isolated molecular pathways. Finding a genetic manipulation that has distinct effects on different behavioral components would help confirm whether the variable habituation rates we observed are regulated by multiple plasticity loci. To this end, we tested two mutant strains: (1) gcy-23; gcy-8; gcy-18 mutants which lack three guanyl cyclases required for avoiding high temperatures and for thermosensory calcium signalling in the AFD neurons; and (2) ocr-2; osm-9; ocr-1 mutants which lack three TRPV channel related genes required for sensing noxious heat in the FLP and PHC neurons [22]. Despite previous reports indicating noxious heat avoidance deficits in these mutants, in our assay, both strains responded robustly to the thermal stimulus (Fig 3.4, stimulus 1). After repeated stimulation, certain behavioral metrics decayed at different rates relative to wildtype (Fig 3.4). It appears that reversal duration decreases at similar rates in all three strains. In contrast, omega turn proportion in ocr-2; osm-9; ocr-1 mutants seems to decay more slowly than in wildtype, which provides additional evidence that the habituation of noxious-heat induced omega turns is controlled separately from other behavioral metrics such as reversal duration (Fig 3.4, in particular stimuli 3–10).

43 Figure 3.3: Habituaon rates of behavioral features depend on smulus intensity. Worms were smulated at the head with either 75 mA or 300 mA 100 ms laser pulses, with a 10 s intersmulus interval. (a) Proporon of animals that execute an omega turn in each intersmulus interval. Shaded regions indicate standard error of the proporon. (b) Reversal duraon (s). Shaded regions indicate standard error of the mean.

44 Figure 3.4: Habituaon rates of behavioral features are genecally separable. Worms were smulated at the head with a 100 ms 75 mA pulse, with a 10 s intersmulus interval. Genotype is indicated by line colour. (a) Proporon of animals that execute an omega turn in each intersmulus interval. Shaded regions indicate standard error of the proporon. (b) Reversal duraon (s). Shaded regions indicate standard error of the mean.

45 3.3 Discussion

These results demonstrate that the C. elegans behavioral response to noxious heat habituates in a multi-component way. Our observation that there are variable habituation kinetics for different aspects of the escape behavior adds to previous evidence that the escape response in C. elegans is more complicated than a simple binary reflex, and suggests that it comprises multiple behavioral components that can habituate independently. Although some of the behavioral measurements we investigated are correlated (for example, reversal distance with reversal speed and reversal duration), there is significant variation in the learning kinetics of separate behavioral components. Furthermore, habituation rates of certain aspects of the escape response are affected differently by changes in stimulus intensity and in certain mutant strains lacking proteins important for thermosensation. These variable habituation rates suggest that multiple mechanisms or independent plasticity loci, each with different habituation kinetics, are required for the multi-component habituation we observe. This result is paralleled by recent work in zebrafish that showed the dark-flash escape response is composed of several behavioral components capable of habituation at different rates [77], suggesting that modular control of habituation may be evolutionarily conserved. Multi-component habituation might help animals maintain behavioral flexibility in response to variable environmental conditions or internal states, enabling the specific tuning of response behaviors.

46 3.4 Materials and methods

3.4.1 Strain cultivation

C. elegans Bristol N2 hermaphrodites were cultivated at 23 °C (except when otherwise indicated) on standard nematode growth medium (NGM) plates seeded with E. coli OP50 following standard cultivation methods [59]. The two mutant strains, FG125 ocr-2(ak47) osm-9(ky10) IV; ocr-1(ak46) V and IK597 gcy-23(nj37) gcy-8(oy44) gcy-18(nj38) IV were obtained from the Caenorhabditis Genetics Center (CGC).

3.4.2 Thermal stimulation assay

Worms were tracked and stimulated as described in Chapter 2.

3.4.3 Behavioral metrics

A number of behavioral metrics were calculated, of which twelve representatives were plotted in the figures contained here.

1. a3 is the peak value of the third eigenmode observed in each interstimulus interval.

2. number of deep bends is a count of high curvature body posture events, surrounded by periods of straight postures (forward or reverse motion).

3. deep bend reorientation is the change in the overall orientation of the worm between the first straight posture before and after a deep bend.

4. P(rev.) is the probability that there is at least one reversal during an interstimulus interval.

47 5. P(Ω turn) is the probability that there is at least one omega turn during an interstimulus interval.

6. pause prop. is the proportion of the interstimulus interval spent in the pause state. For experiments with ISIs longer than 10 s, only the first 10 s are used to calculate this proportion.

7. forw. vel. is the mean velocity of the worm while it is moving forward.

8. escape dist. is the euclidean distance between the worm’s centroid at the end of the ISI and the location of the stimulus.

9. total reorient. is the angle between the worm’s orientation before the stimulus, and the orientation of its resumed forward motion.

10. reversal dur. is the duration of the first reversal after a stimulus.

11. reversal vel. is the mean velocity of the worm while it is reversing.

12. ∆ vel. is the magnitude of the difference between the worm’s velocity immediately before and after the stimulus.

48 4 Technical considerations and collaborative applications

NᴛᴇRRᴏGᴀᴛING C. elegans behavioral responses to noxious heat required us to I develop new techniques and tools for tracking animals, applying focused thermal stimuli, recording and quantifying behavior, and measuring small local changes in temperature. In this chapter, we will expand on two of the techniques that underpin our quantitative investigation of thermosensory behavior, and describe three collaborative projects which have been facilitated by these tools. In studies of behavioral or neuronal response to temperature signals, the ability to precisely measure the changes in temperature experienced by the experimental animal is essential. However, the absolute temperature dynamics experienced by the worm as it crawls through the short infrared laser pulse is difficult to measure. To address this problem, we used temperature sensitive fluorescent dyes to measure how local temperature changes during and after a focused laser pulse, as well as in steady state environments. In order to process the large quantity of data generated by the track and zap

49 system, and to facilitate the high content phenotyping described in Chapters 2 and 3, we developed and continued to refine a software package that verifies worm tracking and stimulation data and extracts comprehensive behavioral information. This work builds on previous machine vision tools and C. elegans phenotyping efforts by many people, both within the Ryu Lab and in a number of outside groups. The system and its application to quantifying the escape behavior is described in Chapters 2 and 3; see Fig 2.1 for an overview schematic. In this chapter we highlight in more detail an improved method of estimating stage movement we developed that significantly reduced error in our measurements of worm position, and subsequently improved calculations of translational velocity, allowing us to better analyze the large volume of single worm tracking data our experiments generated. The techniques we developed have proven valuable in a number of applications, in both experimental neuroscience and computational . The final section of this chapter highlights how it was possible to take advantage of the unique capabilities of the thermal stimulation systems developed here to contribute results in support of larger collaborative projects. First, we used the same stimulation and fluorescent imaging system developed for temperature measurement to record calcium signals from worms expressing a calcium indicator in the PVD neurons, thus confirming that the PVDs sense temperature at the midbody. Second, we verified behavioral phenotypes for hypotheses generated from whole-brain neuronal imaging, confirming a new role for the AWCOFF neuron in sensing noxious heat. Third, exploiting a large dataset we generated with the track and zap system recording the movement of worms executing laser-induced omega turns, collaborators were able to fully describe the worm’s posture through self-occluding coils and loops, providing evidence for a new type of deep turn behavior called a ‘delta turn.’

50 4.1 Simultaneous application of thermal stimuli and multi-channel

fluorescent imaging for measuring neuronal activity and temperature

4.1.1 Introduction

Temperature is a ubiquitous factor in an animal’s sensory landscape, and is of particular importance to ectotherms such as C. elegans, that must translocate in order to maintain appropriate internal temperatures. In their natural environments, animals must navigate complex and time-varying thermosensory landscapes, and are well adapted to do so. In addition to responding to specific global temperatures, C. elegans is remarkably sensitive to small changes in local temperature, and responds with different behaviors depending on the location of temperature changes along its body and the rate of temperature change [16, 22]. Similar sensitivity to small changes in local temperature has been observed in flies [78]. Therefore, to investigate how nervous systems process temperature signals with complicated or fast dynamics, we need reliable methods to measure small and rapid changes in temperature in experimental settings permitting behavioral and neurophysiological measurements. Because the worm is moving and the laser pulse is short, the local temperature changes experienced by the worm are dynamic in space and time. This requires a measurement tool with high spatial, temperature and temporal resolution. This is a difficult problem because of the open air environment in which experiments were conducted and the short duration, focused size and low temperature increase of the pulse. Temperature estimates in simpler thermosensory environments can be achieved by modelling, or with existing tools such as thermocouples and infrared cameras, but most require significant compromise on one or more of spatial, temporal or temperature resolution.

51 Conventional sensors are also not suitable for measuring temperature in the closed slide system in which our lab measures whole-brain neuronal activity from worms stimulated with similar pulses of heat from an IR laser. For example, in addition to its spatial resolution limitations, the IR camera can’t measure temperature through a glass slide or coverslip, and thermocouples are physically large relative to the sample. These difficulties are not unique to our experimental system—the rapid proliferation of complicated ‘lab-on-a-chip’ microfluidic devices means there are now many experiments that are simply too small to be susceptible to study using conventional sensors. To address these issues, we took advantage of ratiometric fluorescence thermometry [79], specifically two combinations of reagents: (1) the temperature sensitive dye rhodamine B with the temperature insensitive reference rhodamine 110, and (2) the pH sensitive dye BCECF with the temperature sensitive buffer TRIS. Using these methods, we were able to confirm previous estimates of the temperature change experienced by a worm that is stimulated on our system [16].

4.1.2 Results

Imaging system for two-channel fluorescent thermometry

For quantitative fluorescent microscopy, it is highly desirable to use ratiometric imaging to reduce the impact of external factors that might affect fluorescent signals, in particular changes in sample composition over time. In this application, the signal we were trying to measure is change in temperature. Therefore, we needed one imaging channel that changes its fluorescence with temperature, and one which shows no temperature dependence [80]. We explored two solutions that satisfy this requirement: the rhodamine B and rhodamine 110 pair, and emission from BCECF

52 dissolved in TRIS buffer, when excited at two separate excitation wavelengths. Rhodamine B has a reported temperature sensitivity of 2.3–3.4%/K [81, 82], and has been used to measure temperature both by itself and as a part of a ratiometric pair in several types of samples [83, 84]. The rhodamine B and rhodamine 110 dye pair has been used to non-intrusively measure IR laser-induced temperature, although not in a context where time resolution was a priority [79]. The second dye system exploits a pH sensitive dye, in a buffer solution with temperature sensitive pH. BCECF (2, 7-biscarboxy-ethyl-56-carboxyfluorescein) is a well-documented pH sensor [85]. TRIS buffer (Trishydroxymethyl aminomethane hydrochloride) has a reported pH sensitivity to temperature of approximately 2.68%/K [86]. The TRIS and BCECF pair has been used to make non-ratiometric temperature measurements of steady state temperatures [87], as well as of the change in temperature during short IR laser pulses [88]. An inverted microscope was set up for two-channel imaging and combined with an infrared laser similar to the one used in the behavioral experiments described in Chapters 2 and 3 (Fig 4.1). A temperature controlled stage was used to allow calibration of the dyes to known temperatures, and to make sure that baseline temperatures were consistent between experiments. Because the IR laser pulse is reliably reproducible, averaging across many identical laser pulses made it possible to significantly decrease the noise of the measurement. Individual pulses were aligned to either the onset of the laser or the peak of the temperature time series. Figure 4.2A shows the spatial temperature profile of the 375 mA pulse through time, measured using BCECF. To obtain an estimate of the peak temperature experienced by the worm as it crawls through the laser pulse, we averaged across a 18.7 µm radius circular region of interest (ROI) around the centre of the beam. As Figure 4.2A indicates, the spatial temperature profile

53 Figure 4.1: Opcal setup for two-channel fluorescent microscopy and infrared laser smulaon. A collimated infrared laser beam is focused to a spot at the surface of an agar disk similar to the surface on which worms crawl during behavioral experiments, which has been treated with the appropriate temperature sensive dye soluon. The focus of the laser is adjusted using a micrometer adjustment screw. The temperature of the sample stage is maintained by a thermoelectric cooler (T.E.C.). The yellow, blue and purple lines trace the excitaon light path from the illuminaon source through the appropriate excitaon filters to the sample through the microscope objecve (obj.). The green and orange lines trace the light path of the two emission channels from the sample to dual EMCCD cameras for recording.

54 is relatively flat in this region, so averaging over the ROI decreases noise without significantly underestimating the peak temperature. Figure 4.2B shows the temporal temperature profile of four laser powers, averaged at the centre of the beam. These time series demonstrate that the local temperature increases very rapidly through the duration of the 100 ms laser pulse, and decays back to ambient temperature over approximately 2.5 s. Figure 4.2C indicates that the relationship between laser power and peak temperature is approximately linear, as expected.

55 Figure 4.2 (following page): Spaal and temporal temperature characteriscs of infrared laser smulus. (a) The temperature of the surface of an agarose disk was measured using the pH sensive dye BCECF in the temperature-sensive buffer TRIS. The disk was made with 10 mM TRIS (pH 7.1) and treated with 5 μL 200 mM BCECF dye in 10 mM TRIS (pH 7.1). The spaal temperature profile of the 375 mA pulse as it decays from its peak (t = 0 s) is shown. Numerous individual pulses (>20) from 6 samples were combined, and then radial profiles from the center of the pulse were averaged. Shaded regions indicate the standard error of the mean. (b) The local temperature at the focus of the beam increases rapidly with laser onset, and decays back to baseline over the course of approximately 2.5 s. Four laser current levels are shown, including the three used in this work. Shaded regions indicate the standard error of the mean. (c) Peak pulse temperature increases linearly with laser current. Error bars show the standard error of the mean; for 37.5 mA and 75 mA the values are smaller than the data markers.

56 Figure 4.2: (connued)

57 4.1.3 Materials and methods

For the results included in this chapter, the local changes in temperature induced by the IR laser stimulus were measured using the pH sensitive dye BCECF in combination with TRIS buffer, the pH of which is sensitive to temperature. Details specific to the rhodamine dye method are included at the end of this section.

Sample preparation and imaging

All experiments were conducted in a temperature controlled room set to 23 °C. The infrared laser stimulus used in the behavioral experiments was replicated on top of an inverted microscope set up for dual-excitation imaging (Eclipse Ti; Nikon). The power of the laser was matched to the behavioral set-up using a power meter and IR- sensitive sensor (PM100D and S122C; Thorlabs), and an identical collimator and lens was used to focus the laser to the surface of the sample. As in the behavioral assay, the IR laser was focused to the sample’s surface from above, and the top surface was exposed to air. We used an agarose sample (1.7% in 10 mM TRIS buffer, pH 7.1) roughly 1 mm thick, made by stacking a 200 µm thick, surface layer with 5 µL 200 µM BCECF acid (85138-49-4; Biotium) in 10 mM TRIS (pH 7.1) and a bottom layer with no dye. The sample was mounted on a coverslip, surrounded by a custom aluminum stage with an integrated thermoelectric cooler (MCTE1-19913L-S; Farnell), the temperature of which was stabilized with a recirculating chiller (T255P-3CR; Coherent) and controlled by a benchtop controller (5R6-900; Oven Industries). The sample was sealed above with a piece of plastic cut from a petri dish lid, so that the laser passes through the same materials as in the behavioral experiments. The surface of the sample was imaged from below using a high numerical

58 aperture objective with sufficient working distance to image through the 1 mm sample (S Fluor 10x NA 0.5 WD 1.2; Nikon). The sample was excited by a high- power LED and driver (M470L2 and LEDD1B; Thorlabs), through either a 440 nm or 490 nm excitation filter. Emission at 535 nm was captured by an EMCCD (DU-897E-CSO-BV; Andor). Image capture was controlled by custom MATLAB software [32].

Calibration of temperature–fluorescence ratio relationship

For each sample, the relationship between the change in the BCECF intensity ratio (490 nm / 440 nm excitation) and the change in temperature was calibrated by monitoring fluorescence from each channel at known temperatures (23 °C– 26 °C). To help control for possible changes in dye distribution and concentration due to diffusion between the agarose disks or evaporation, each sample was calibrated before and after laser stimulation. Sample temperature at various set temperatures was measured separately using a thermocouple positioned at the surface of the agarose disk (5TC-TT-T-40-36; Omega).

IR stimulus and processing

Laser pulses at different power levels were applied to the sample every 6 s. For each sample and power level, a number of pulses (20–50) were aligned in time and averaged. We acquired one frame from the temperature insensitive channel at the beginning and end of each laser pulse experiment, and captured the temperature sensitive channel at maximum frame rate (approximately 20 frames per second). The temperature insensitive signal was interpolated between the start and end points as previously described [89]. For each set of aligned pulses, the difference in the ratio of BCECF intensities

59 (490 nm / 440 nm excitation) between each frame of the pulse time series and an average of 3 pre-stimulus frames was calculated. The ∆ ratio /∆ temperature relationships obtained from calibrating each sample were averaged and used to calculate the change in temperature above baseline for the full field of view at each time point. To estimate the maximum temperature, a 30 pixel radius (18.7 µm) circular ROI was averaged around the center of the beam. Image sequences were processed with custom programs written in MATLAB.

Rhodamine details

The same overall approach was used to measure temperature changes with rhodamine B and rhodamine 110, with the following differences: (1) the agar disk sample was cut out from a behavioral assay plate, and treated with 20 µL of 0.1 mM rhodamine B (83695; Sigma) and rhodamine 110 (R6626; Sigma) in 20 mM HEPES buffer; (2) the sample was excited with a 505 nm LED (M505L1; Thorlabs) and emission from each channel was concurrently captured by dual EMCCDs (DU-897E- CSO-BV; Andor) at 40.5 frames per second, using 2× binning.

4.2 Image registration-based determination of microscope stage movement for

single worm tracking

4.2.1 Approach and results

Initial estimates of a tracked worm’s real world position are calculated from stage positions reported by the stage controller, and by applying a calibration matrix, which incorporates any required scaling or rotations of the microscope. However, due in part to the design of the tracking system, which executes the laser stimulation

60 Figure 4.3: Image processing of bead and worm. (a) Raw image of worm and a bead, on a tracking plate without food. Plates with food were also used. (b) Isolated thresholded worm. (c) Isolated thresholded polystyrene microbead for readout of stage movement.

and stage repositioning in independent loops, the image data and stage data are not perfectly aligned in time. As a result, in some frames, especially when the stage is moving rapidly, the asynchronicity between the stage and image data results in inaccurate estimates of the worm’s position. In order to determine the baseline error level in the measurement of position, we tracked worms crawling on plates on which we had also distributed ≈ 100 µm polystyrene beads (Fig 4.3A). Because the beads are stationary on the plate, any bead movement from the reference point of the camera is due to the moving stage, giving us a precise readout of stage movement between every frame. The precise size and circularity of the beads made it straightforward to calculate the positions of both worm and beads in each frame (Figs 4.3B and 4.3C). It was important to track worms in a range of conditions that were representative of the experiments performed on the system. For this reason, we tracked worms and beads on plates with and without food, and stimulated at both high and low powers, which elicit different crawling speeds. After applying the stage data transformations to the pixel positions of a stationary bead, any calculated movement represents error in the tracked position: because the bead is stationary, its change in position should be zero. Tracking stationary beads reveals that position error is highly correlated with stage movement: error

61 Figure 4.4: Uncorrected posion error, while tracking a crawling worm. (a & b) Representave traces, showing the velocity of the X-axis (a) and Y-axis (b) stage stepper motors, calculated as the difference in their posions as reported by the stage controller. (c & d) The error in the posion of a staonary bead, for the X (c) and Y (d) axes. The purple lines indicate the error in the posion of a staonary bead when calculated using the posion of the stage as reported by the stage controller, while the system is tracking a moving worm. The green line indicates the error in the posion of the same bead, calculated using the change in pixel locaon of the bead between frames. Since the bead is staonary, the green line represents error introduced by image segmentaon. is largest when the stage is moving fastest (Fig 4.4). Because the stage repositions the assay plate as the worm crawls out of the centre of the field of view, periods of stage movement occur during, or immediately after, periods of worm movement. As a result, the tracking error was highest in behaviorally relevant periods of high activity. It is important to note that the absolute error (in µm) in a specific frame is not very large; for example, in Fig 4.4 the absolute error is approximately 100 µm. However, the rate of change in the error is high, which means that calculating the instantaneous velocity of the worm accurately becomes problematic.

62 To address this issue, we developed an image-registration based method of determining the position of the stage that does not rely on the positions reported from the stage controller, and therefore does not suffer from the movement- correlated error illustrated in Fig 4.4. Calculating the translation between pairs of frames provides a measure of the tracking stage’s movement. Using this estimate of the stage movement significantly increases the accuracy of our position measurements, reducing the average error from a range of approximately 300 µm, to 30 µm (Fig 4.5). This improvement resulted in significantly decreased error in the measurements of worms’ velocity.

63 Figure 4.5 (following page): Distribuon of tracked object posions, aer correcon with image-registraon esmate of stage posion. (a) Scaer plot of normalized real- world posions (μm) of a staonary bead, calculated using the posion of the stage as reported by the stage controller (orange) or using the image-registraon calculated stage movement (purple). Since the bead is staonary, its normalized posion should always be (0,0), therefore any difference in posion from the origin is error. n = 5000 bead posions, randomly sampled from the full dataset of 158 009 bead posions, extracted from experiments covering a range of worm speeds and smulus intensies. (b) The posions of the same beads as (a), only calculated using the image-registraon calculated stage movement. Note that the scale of (a) is approximately 10x larger than in (b), ±140 μm versus ±14 μm. (c) Histogram showing the probability distribuon of posion errors for the full bead dataset, a subsample of which is shown in (a) and (b). Posion error = euclidean distance from (0,0) in μm. Note that the y-axis is cropped above the tallest bin of the ‘uncorrected’ histogram—the inset shows the full height of the first 4 bins (different x-scale). The maximum uncorrected posion error = 220.6 μm. The maximum corrected posion error = 14.9 μm. (d) The cumulave probability of the posion errors.

64 Figure 4.5: (connued)

65 4.3 Collaborative applications

Several opportunities emerged to apply the experimental systems and analysis approaches developed throughout this thesis to exciting questions in C. elegans behavioral neuroscience. In this section, we will describe three collaborative efforts in which the experimental techniques described here, combined with the expertise of other researchers, made it possible to yield new insights, specifically: (1) identifying a new role for the PVD neurons as highly spatially sensitive thermosensory cells in the worm’s midbody; (2) verifying that the AWCOFF neuron is required for noxious heat avoidance behavior; and (3) describing a new type of deep reorientation behavior.

4.3.1 Measuring neuronal calcium signals to identify PVD as a noxious heat sensing neuron at the midbody

C. elegans responds to localized stimuli depending on the location of the stimulus along its body. For example, touch at the head usually results in a reversal, and touch at the tail usually results in accelerated forward motion [17]. By mapping the behavioral receptive field of C. elegans in response to localized noxious thermal stimulation, previous work in the Ryu Lab identified a novel midbody escape response [16]. In the midbody region, the probability that a worm responds with forward motion, a reversal or a pause depends on the precise location of the stimulus. A targeted mutant behavioral screen identified the PVD neurons as candidate thermosensory cells for this midbody behavioral response. The PVD neurons are multidentritic nociceptors required for sensing harsh touch and cold temperatures [34], and notably, possess a dendritic arbor that extends the full length of the worm’s body (Fig 4.6A) [90]. To test the hypothesis that the PVD neurons sense noxious heat, we measured

66 PVD calcium activity during thermal stimulation with the imaging system described above for two-channel fluorescent imaging with simultaneous application of focused IR laser pulses (Fig 4.1). To measure cell-specific neuronal activity, we generated a transgenic C. elegans strain expressing the genetically encoded ratiometric calcium sensor Cameleon in the PVD neurons, with the help of Hang Li. This strain was used for cell identification during laser ablation, and for the first round of calcium imaging (stronger signals from G-GECO1.2 [91] were used for publication in [16]). We observed calcium signals in the PVD neurons in response to thermal stimulation of the posterior-middle of the worm (Fig 4.6), which is strong evidence that the PVD neurons sense noxious heat in the C. elegans midbody. To determine whether the PVD neurons are required for the behavioral avoidance response, we constructed a laser ablation system for targeted killing of PVD neurons, similar to previously described methods [92]. Killing both left and right PVD neurons resulted in a significantly reduced thermal avoidance response at the midbody and tail, but not the head, indicating that the PVDs are required for posterior noxious heat sensing. The thermal stimuli used in both the behavioral and neuronal activity experiments were measured using the ratiometric dual-rhodamines method described above. Overall, this result illustrates the utility of a precise thermal stimulus that can be applied in behavioral, temperature measurement and calcium imaging assays. This integrated approach combining a targeted stimulus, quantitative descriptions of behavior, laser killing of neurons, and measuring neuronal activity made it possible to discover that PVD is a midbody thermosensory neuron. This work was published as: Aylia Mohammadi, Jarlath Byrne Rodgers, Ippei Kotera, and William S. Ryu. Behavioral response of Caenorhabditis elegans to localized thermal stimuli. BMC Neuroscience, 14:66–66, 2013. doi: 10.1186/1471-2202-14-66.

67 Figure 4.6: PVD is a midbody thermosensor in C. elegans. (a) A confocal Z-projecon of a worm expressing the calcium-indicang Cameleon in PVD (cyan and yellow fluorescent proteins (CFP and YFP)). odr-1::GFP was used as a coinjecon marker, therefore several chemosensory neurons in the head (boom le) are expressing GFP. The cell body is indicated with a red arrow, and the highly branched dendric arbor can be seen throughout the worm. (b) The change in the rao of fluorescent intensies between YFP and CFP, during thermal smulaon. The opcal system shown in Fig 4.1 was used to apply focused IR laser pulses. Signals were measured from the cell body. The worm was smulated with a focused IR laser targeted just posterior to the PVD cell body, which corresponds with the midbody behavioral response described in [16]. The black arrow indicates the ming of the thermal smulus. Shaded region indicates standard error of the mean.

68 4.3.2 Pan-neuronal screening in C. elegans reveals asymmetric dynamics of AWC neurons is critical for thermal avoidance behavior

Recent advances in genetically expressed calcium indicators have made whole- brain imaging of intact animals possible, which should narrow the gap in our understanding of the neuronal control of sensory behavior [93]. With its small nervous system and transparent body, and the extensive range of tools available for manipulating its genetics, C. elegans is an excellent subject for experiments which attempt to record neuronal signals from many or most neurons. Ippei Kotera developed a transgenic worm expressing the G-GECO1.1 calcium indicator and DsRed2 reference fluorescent protein in all neurons. To retain individual cell resolution despite the close proximity of many head neurons, expression was localized with a nuclear localization promoter. This strain was combined with an imaging system that allowed for whole-worm heating and cooling, as well as localized thermal stimulation with an IR laser, similar to the one used for behavioral measurements in Chapters 2 and 3, and similar in arrangement to the fluorescent thermometry setup described above. With these tools, a pan-neuronal calcium imaging screen was developed to investigate the neuronal substrates of thermosensation in C. elegans [32]. The system quickly demonstrated the promise of whole-brain imaging: as hypothesized, Kotera was able to quickly recapitulate the activity of most previously described neurons associated with thermosensation, including AFD, FLP and AIY [22, 25, 32]. However, in addition to known thermosensory neurons, recording neuronal activity from worms while applying slow ramps or rapid increases in temperature identified activity in a number of neurons with ambiguous or completely undescribed roles in thermosensation, including RIS, RMDV and SMDV, and AWC. The unique asymmetric activity identified in the AWCOFF neurons was the focus

69 of the rest of the study, and provided the opportunity to combine this whole-brain functional imaging approach with the track and zap behavioral phenotyping system. Applying focused thermal stimuli to the heads of mutant worms with either two AWCOFF or AWCON neurons showed that AWCOFF is required for normal noxious heat avoidance behavior. This work was published as: Ippei Kotera, Nhat Anh Tran, Donald Fu, Jimmy H. J. Kim, Jarlath Byrne Rodgers, and William S. Ryu. Pan-neuronal screening in Caenorhabditis elegans reveals asymmetric dynamics of AWC neurons is critical for thermal avoidance behavior. eLife, 5:e19021, 2016. doi: 10.7554/eLife.19021.

4.3.3 Resolving coiled shapes reveals new reorientation behaviors in C. elegans

One of the reasons C. elegans is so useful for behavioral neuroscience is the diversity of behaviors it demonstrates, ranging from navigating gradients and avoiding noxious levels or changes in temperature, chemical concentrations, osmolarity, to searching for food in low-information landscapes. Despite these complex navigational strategies, the range of postures available to the worm is relatively small, and can be described by the amplitudes of just four ‘eigenworms’, which reduces the entire behavioral space of the worm to just four or five dimensions [6]. However, it has remained difficult to quantify C. elegans shape, and therefore behavior, in a small number of rare but important postures: specifically when the worm touches or crosses its body, or coils [9]. These events correspond with reorientations that are important for foraging and escape behaviors, and coiling is a relevant mutant phenotype. However, because they have remained unresolved, frames containing images of these events are often discarded from databases of C. elegans behavior [13], or omega turns are annotated according to experimenter definitions. It has recently been suggested that across both experts and automatic methods, there is wide divergence in the definition of omega

70 turn events which has problematic implications for the interpretation and comparison of results [94]. To fill this gap in the characterization of C. elegans behavior, Broekmans et al. developed a ‘reverse’ tracking algorithm that is able to find solutions for the worm’s posture during self-occluding coils and omega turns [11]. These events are relatively rare in unstimulated behavior, so this effort required a high-resolution dataset of worms escaping from noxious heat, during which they almost always execute omega turns. We were able to generate this dataset using the thermal stimulation and tracking system described in this thesis, which was uniquely suited to the task. Surprisingly, Broekmans et al. found that the classic omega turn actually has two subtypes, one of which, the newly coined ‘delta turn,’ appears to occur primarily during foraging behavior, and helps to reduce directional bias introduced by omega turns. This collaboration demonstrates how combining data from the track and zap system with new techniques in computational behavioral analysis can solve difficult problems and discover previously undescribed behaviors that have been in plain sight. This work was published as: Onno D. Broekmans, Jarlath Byrne Rodgers, William S. Ryu, and Greg J. Stephens. Resolving coiled shapes reveals new reorientation behaviors in C. elegans. eLife, 5:e17227, 2016. doi: 10.7554/eLife.17227.

71 5 Conclusion

N ᴛHIS ᴡᴏRᴋ we aimed to expand our understanding of the experience- and I behavioral state-dependence of the C. elegans response to noxious heat, by high- content quantitative phenotyping of C. elegans escape behavior in a number of behavioral and sensory contexts. This approach required long-term tracking of individual animals at high resolution, and automatic targeting of a small infrared laser stimulus with variable amplitude. We fully quantified the resulting behavior by applying recent technological developments in posture decomposition and ethologically relevant behavioral metrics. Surprisingly, we found that the escape response is far more complicated than a simple stimulus-dependent reflex. Instead, C. elegans can modify its escape response depending on its long and short-term temperature experience, and its current behavioral state, demonstrating a high degree of plasticity in the response to similar stimuli despite a relatively simple neuronal circuit. We proceeded to investigate whether C. elegans habituates to noxious heat, and if

72 so, how different aspects of the behavioral response depend on repeated stimulation. Surprisingly, several features of the escape behavior decay at different rates, and some increase before decreasing. These results suggest multiple mechanisms in control of this simple learning behavior, possibly mediated by several neuronal loci. To obtain these findings we were required to develop both new software for processing and interpreting behavioral tracking data, and techniques for the precise measurement of thermal stimuli and temperature-induced neuronal signals. We have already been able to apply these tools to collaborative projects, helping to describe neurons required for noxious thermal avoidance, and, by generating a large high-resolution dataset of stimulus-evoked deep turns, aiding in the discovery of a previously undescribed reorientation behavior. Our results raise interesting questions for future investigation. For example, the escape response explored here has been previously described as a reflex and a fixed action pattern, and yet we found that at least in some ways the escape behavior is inconsistent with these definitions. It will be interesting to apply the quantitative phenotyping tools we developed to other behaviors that appear simple, and to explore how genetic and pharmacological perturbations affect subtle aspects of behavior. Tracking the complete movement of freely behaving individual animals, and accounting for their sensory and behavioral histories and contexts, makes it possible to take a more comprehensive view of animal behavior. For example, considering the effect of initial behavioral state was a first step toward understanding possible sources of behavioral variation between individuals. This integrative approach to mapping and comparing behavior between both individuals and populations promises to be useful for probing how genes, nervous systems and the environment interact to result in diverse animal behaviors. Furthermore, as techniques for whole-brain functional imaging in freely behaving animals continue to improve, it is exciting to anticipate

73 combining measurements of neuronal activity with the tools described in this thesis for applying and measuring precise thermal stimuli and multimetric phenotyping of behavior. Mapping a complex sensorimotor behavior in C. elegans from stimulus to response may be a reality in the near future.

74 References

[1] Gwyneth Card and Michael Dickinson. Performance trade-offs in the flight initiation of Drosophila. Journal of Experimental Biology, 211(3):341–353, 2008. doi: 10.1242/jeb.012682.

[2] Ruth M. Colwill and Robbert Creton. Imaging escape and avoidance behavior in zebrafish larvae. Reviews in the Neurosciences, 22(1):63–73, 2011. doi: 10.1515/RNS.2011.008.

[3] Donald H. Edwards, William J. Heitler, and Franklin B. Krasne. Fifty years of a command neuron: the neurobiology of escape behavior in the crayfish. Trends in Neurosciences, 22(4):153–161, 1999. doi: 10.1016/S0166-2236(98) 01340-X.

[4] Paul S. Katz. Neuromodulation intrinsic to the central pattern generator for escape swimming in Tritonia. Annals of the New York Academy of Sciences, 860: 181–188, 1998. doi: 10.1111/j.1749-6632.1998.tb09048.x.

[5] Cornelia I. Bargmann. Neurobiology of the Caenorhabditis elegans genome. Science, 282(5396):2028–2033, 1998. doi: 10.1126/science.282.5396.2028.

[6] Greg J. Stephens, Bethany Johnson-Kerner, William Bialek, and William S. Ryu. Dimensionality and dynamics in the behavior of C. elegans. PLoS Computational Biology, 4(4):e1000028, 2008. doi: 10.1371/journal.pcbi.1000028.

[7] John Graham White, Eileen Southgate, J. Nichol Thomson, and . The structure of the nervous system of the nematode Caenorhabditis elegans. Philosophical Transactions of the Royal Society of London. Series B, Biological Sciences, 314(1165):1–340, 1986. doi: 10.1098/rstb.1986.0056.

[8] Troy A. McDiarmid, Alex J. Yu, and Catharine H. Rankin. Beyond the response-High throughput behavioral analyses to link genome to phenome in Caenorhabditis elegans. Genes, Brain and Behavior, 17(3):e12437, 2018. doi: 10.1111/gbb.12437.

[9] Neil A. Croll. Components and patterns in the behaviour of the nematode Caenorhabditis elegans. Journal of Zoology, 176(2):159–176, 1975. doi: 10.1111/j.1469-7998.1975.tb03191.x.

[10] Jonathan T. Pierce-Shimomura, Thomas M. Morse, and Shawn R. Lockery. The fundamental role of pirouettes in Caenorhabditis elegans chemotaxis. The Journal of Neuroscience, 19(21):9557–9569, 1999. doi: 10.1523/JNEUROSCI. 19-21-09557.1999.

75 [11] Onno D. Broekmans, Jarlath Byrne Rodgers, William S. Ryu, and Greg J. Stephens. Resolving coiled shapes reveals new reorientation behaviors in C. elegans. eLife, 5:e17227, 2016. doi: 10.7554/eLife.17227.

[12] Nicholas A. Swierczek, Andrew C. Giles, Catharine H. Rankin, and Rex A. Kerr. High-throughput behavioral analysis in C. elegans. Nature Methods, 8(7): 592–598, 2011. doi: 10.1038/nmeth.1625.

[13] Eviatar Yemini, Tadas Jucikas, Laura J. Grundy, André E. X. Brown, and William R. Schafer. A database of Caenorhabditis elegans behavioral phenotypes. Nature Methods, 10(9):877–879, 2013. doi: 10.1038/nmeth.2560.

[14] André E. X. Brown, Eviatar I. Yemini, Laura J. Grundy, Tadas Jucikas, and William R. Schafer. A dictionary of behavioral motifs reveals clusters of genes affecting Caenorhabditis elegans locomotion. Proceedings of the National Academy of Sciences, 110(2):791–796, 2013. doi: 10.1073/pnas.1211447110.

[15] Rajarshi Ghosh, Aylia Mohammadi, Leonid Kruglyak, and William S. Ryu. Multiparameter behavioral profiling reveals distinct thermal response regimes in Caenorhabditis elegans. BMC Biology, 10(1):85–85, 2012. doi: 10.1186/ 1741-7007-10-85.

[16] Aylia Mohammadi, Jarlath Byrne Rodgers, Ippei Kotera, and William S. Ryu. Behavioral response of Caenorhabditis elegans to localized thermal stimuli. BMC Neuroscience, 14:66–66, 2013. doi: 10.1186/1471-2202-14-66.

[17] Robert O’Hagan and Martin Chalfie. Mechanosensation in Caenorhabditis elegans. In The Neurobiology of C. elegans, volume 69 of International Review of Neurobiology, pages 169–203. Academic Press, 2005. doi: 10.1016/ S0074-7742(05)69006-X.

[18] Jennifer K. Pirri, Adam D. McPherson, Jamie L. Donnelly, Michael M. Francis, and Mark J. Alkema. A tyramine-gated chloride channel coordinates distinct motor programs of a Caenorhabditis elegans escape response. Neuron, 62(4):526– 538, 2009. doi: 10.1016/j.neuron.2009.04.013.

[19] Nicole Wittenburg and Ralf Baumeister. Thermal avoidance in Caenorhabditis elegans: An approach to the study of nociception. Proceedings of the National Academy of Sciences, 96(18):10477–10482, 1999. doi: 10.1073/pnas.96.18.10477.

[20] Jingyi Yu, Wenxing Yang, He Liu, Yingsong Hao, and Yun Zhang. An Aversive Response to Osmotic Upshift in Caenorhabditis elegans. eNeuro, 4(2), 2017. doi: 10.1523/ENEURO.0282-16.2017.

76 [21] Ying Zhou, Mario Loeza-Cabrera, Zheng Liu, Boanerges Aleman-Meza, Julie K. Nguyen, Sang-Kyu Jung, Yuna Choi, Qingyao Shou, Rebecca A. Butcher, and Weiwei Zhong. Potential Nematode Alarm Pheromone Induces Acute Avoidance in Caenorhabditis elegans. Genetics, 206(3):1469–1478, 2017. doi: 10.1534/genetics.116.197293. [22] Miriam B. Goodman and Piali Sengupta. How Caenorhabditis elegans Senses Mechanical Stress, Temperature, and Other Physical Stimuli. Genetics, 212(1): 25–51, 2019. doi: 10.1534/genetics.118.300241. [23] Ichiro Aoki and Ikue Mori. Molecular biology of thermosensory transduction in C. elegans. Current Opinion in Neurobiology, 34:117–124, 2015. doi: 10.1016/j.conb.2015.03.011. [24] Shu Liu, Ekkehard Schulze, and Ralf Baumeister. Temperature- and Touch- Sensitive Neurons Couple CNG and TRPV Channel Activities to Control Heat Avoidance in Caenorhabditis elegans. PLoS ONE, 7(3):e32360, 2012. doi: 10.1371/journal.pone.0032360. [25] Damon A. Clark, David Biron, Piali Sengupta, and Aravinthan D. T. Samuel. The AFD Sensory Neurons Encode Multiple Functions Underlying Thermotactic Behavior in Caenorhabditis elegans. Journal of Neuroscience, 26(28): 7444–7451, 2006. doi: 10.1523/JNEUROSCI.1137-06.2006. [26] Jamie L. Donnelly, Christopher M. Clark, Andrew M. Leifer, Jennifer K. Pirri, Marian Haburcak, Michael M. Francis, Aravinthan D. T. Samuel, and Mark J. Alkema. Monoaminergic Orchestration of Motor Programs in a Complex C. elegans Behavior. PLoS Biology, 11(4):e1001529, 2013. doi: 10.1371/journal.pbio.1001529. [27] Jennifer K. Pirri and Mark J. Alkema. The neuroethology of C. elegans escape. Current Opinion in Neurobiology, 22(2):187–193, 2012. doi: 10.1016/j.conb.2011. 12.007. [28] Mei Zhen and Aravinthan D. T. Samuel. C. elegans locomotion: small circuits, complex functions. Current Opinion in Neurobiology, 33:117–126, 2015. doi: 10.1016/j.conb.2015.03.009. [29] David H. Hall and Zeynep F. Altun. C. elegans Atlas. Cold Spring Harbor Laboratory Press, Cold Spring Harbor, New York, 2008.

[30] OpenWorm Browser, 2019. URL http://browser.openworm.org/. [31] David H. Hall and Millet Treinin. How does morphology relate to function in sensory arbors? Trends in Neurosciences, 34(9):443–451, 2011. doi: 10.1016/j.tins. 2011.07.004.

77 [32] Ippei Kotera, Nhat Anh Tran, Donald Fu, Jimmy H. J. Kim, Jarlath Byrne Rodgers, and William S. Ryu. Pan-neuronal screening in Caenorhabditis elegans reveals asymmetric dynamics of AWC neurons is critical for thermal avoidance behavior. eLife, 5:e19021, 2016. doi: 10.7554/eLife.19021.

[33] Sean M. Maguire, Christopher M. Clark, John Nunnari, Jennifer K. Pirri, and Mark J. Alkema. The C. elegans Touch Response Facilitates Escape from Predacious Fungi. Current Biology, 21(15):1326–1330, 2011. doi: 10.1016/j.cub.2011.06.063.

[34] Marios Chatzigeorgiou, Sungjae Yoo, Joseph D. Watson, Wei-Hsiang Lee, W. Clay Spencer, Katie S. Kindt, Sun Wook Hwang, David M. Miller III, Millet Treinin, Monica Driscoll, and William R. Schafer. Specific roles for DEG/ENaC and TRP channels in touch and thermosensation in C. elegans nociceptors. Nature Neuroscience, 13(7):861–868, 2010. doi: 10.1038/nn.2581.

[35] Dominique A. Glauser, Will C. Chen, Rebecca Agin, Bronwyn L. MacInnis, Andrew B. Hellman, Paul A. Garrity, Man-Wah Tan, and Miriam B. Goodman. Heat Avoidance Is Regulated by Transient Receptor Potential (TRP) Channels and a Neuropeptide Signaling Pathway in Caenorhabditis elegans. Genetics, 188(1):91–103, 2011. doi: 10.1534/genetics.111.127100.

[36] Daniel E. Bath, John R. Stowers, Dorothea Hörmann, Andreas Poehlmann, Barry J. Dickson, and Andrew D. Straw. FlyMAD: rapid thermogenetic control of neuronal activity in freely walking Drosophila. Nature Methods, 11 (7):756–762, 2014. doi: 10.1038/nmeth.2973.

[37] Evan L. Ardiel, Alex J. Yu, Andrew C. Giles, and Catharine H. Rankin. Habituation as an adaptive shift in response strategy mediated by neuropeptides. npj Science of Learning, 2(1):9, 2017. doi: 10.1038/ s41539-017-0011-8.

[38] Patrick D. McClanahan, Joyce H. Xu, and Christopher Fang-Yen. Comparing Caenorhabditis elegans gentle and harsh touch response behavior using a multiplexed hydraulic microfluidic device. Integrative Biology, 9(10):800–809, 2017. doi: 10.1039/c7ib00120g.

[39] Bryan C. Petzold, Sung-Jin Park, Eileen A. Mazzochette, Miriam B. Goodman, and Beth L. Pruitt. MEMS-based force-clamp analysis of the role of body stiffness in C. elegans touch sensation. Integrative Biology, 5(6):853–864, 2013. doi: 10.1039/c3ib20293c.

[40] Alejandro López-Cruz, Aylesse Sordillo, Navin Pokala, Qiang Liu, Patrick T. McGrath, and Cornelia I. Bargmann. Parallel Multimodal Circuits Control

78 an Innate Foraging Behavior. Neuron, 102(2):407–419.e8, 2019. doi: 10.1016/j.neuron.2019.01.053.

[41] Young-Jai You and Leon Avery. Appetite Control: worm’s-eye-view. Animal Cells and Systems, 16(5):351–356, 2012. doi: 10.1080/19768354.2012.716791.

[42] Jesse M. Gray, Joseph J. Hill, and Cornelia I. Bargmann. A circuit for navigation in Caenorhabditis elegans. Proceedings of the National Academy of Sciences, 102(9):3184–3191, 2005. doi: 10.1073/pnas.0409009101.

[43] Elizabeth R. Sawin, Rajesh Ranganathan, and H. Robert Horvitz. C. elegans Locomotory Rate Is Modulated by the Environment through a Dopaminergic Pathway and by Experience through a Serotonergic Pathway. Neuron, 26(3): 619–631, 2000. doi: 10.1016/S0896-6273(00)81199-X.

[44] Mochi Liu, Anuj K. Sharma, Joshua W. Shaevitz, and Andrew M. Leifer. Temporal processing and context dependency in Caenorhabditis elegans response to mechanosensation. eLife, 7:e36419, 2018. doi: 10.7554/eLife.36419.

[45] Sayaka Hori, Shigekazu Oda, Yuji Suehiro, Yuichi Iino, and Shohei Mitani. OFF-responses of interneurons optimize avoidance behaviors depending on stimulus strength via electrical . PLoS Genetics, 14(6), 2018. doi: 10.1371/journal.pgen.1007477.

[46] Catharine H. Rankin and Brett S. Broster. Factors affecting habituation and recovery from habituation in the nematode Caenorhabditis elegans. Behavioral Neuroscience, 106(2):239–249, 1992. doi: 10.1037/0735-7044.106.2.239.

[47] Evan L. Ardiel and Catharine H. Rankin. Behavioral Plasticity in the C. elegans Mechanosensory Circuit. Journal of Neurogenetics, 22(3):239–255, 2008. doi: 10.1080/01677060802298509.

[48] Edward M. Hedgecock and Richard L. Russell. Normal and mutant thermotaxis in the nematode Caenorhabditis elegans. Proceedings of the National Academy of Sciences, 72(10):4061–4065, 1975. doi: 10.1073/pnas.72.10.4061.

[49] Lisa C. Schild, Laurie Zbinden, Harold W. Bell, Yanxun V. Yu, Piali Sengupta, Miriam B. Goodman, and Dominique A. Glauser. The Balance between Cytoplasmic and Nuclear CaM Kinase-1 Signaling Controls the Operating Range of Noxious Heat Avoidance. Neuron, 84(5):983–996, 2014. doi: 10.1016/j.neuron.2014.10.039.

[50] Yee Lian Chew, Yoshinori Tanizawa, Yongmin Cho, Buyun Zhao, Alex J. Yu, Evan L. Ardiel, Ithai Rabinowitch, Jihong Bai, Catharine H. Rankin, Hang Lu, Isabel Beets, and William R. Schafer. An Afferent Neuropeptide System

79 Transmits Mechanosensory Signals Triggering Sensitization and Arousal in C. elegans. Neuron, 99(6):1233–1246.e6, 2018. doi: 10.1016/j.neuron.2018.08.003.

[51] Kyuhyung Kim and Chris Li. Expression and regulation of an FMRFamide- related neuropeptide gene family in Caenorhabditis elegans. Journal of Comparative Neurology, 475(4):540–550, 2004. doi: 10.1002/cne.20189.

[52] Andrew Jonathan Bretscher, Karl Emanuel Busch, and Mario de Bono. A carbon dioxide avoidance behavior is integrated with responses to ambient oxygen and food in Caenorhabditis elegans. Proceedings of the National Academy of Sciences, 105(23):8044–8049, 2008. doi: 10.1073/pnas.0707607105.

[53] Michael Y. Chao, Hidetoshi Komatsu, Hana S. Fukuto, Heather M. Dionne, and Anne C. Hart. Feeding status and serotonin rapidly and reversibly modulate a Caenorhabditis elegans chemosensory circuit. Proceedings of the National Academy of Sciences, 101(43):15512–15517, 2004. doi: 10.1073/pnas. 0403369101.

[54] Philip J. Summers, Robert M. Layne, Amanda C. Ortega, Gareth P. Harris, Bruce A. Bamber, and Richard W. Komuniecki. Multiple Sensory Inputs Are Extensively Integrated to Modulate Nociception in C. elegans. The Journal of Neuroscience, 35(28):10331–10342, 2015. doi: 10.1523/JNEUROSCI.0225-15. 2015.

[55] Marina Ezcurra, Denise S. Walker, Isabel Beets, Peter Swoboda, and William R. Schafer. Neuropeptidergic Signaling and Active Feeding State Inhibit Nociception in Caenorhabditis elegans. The Journal of Neuroscience, 36(11): 3157–3169, 2016. doi: 10.1523/JNEUROSCI.1128-15.2016.

[56] Jessica Cande, Shigehiro Namiki, Jirui Qiu, Wyatt Korff, Gwyneth M. Card, Joshua W. Shaevitz, David L. Stern, and Gordon J. Berman. Optogenetic dissection of descending behavioral control in Drosophila. eLife, 7:e34275, 2018. doi: 10.7554/eLife.34275.

[57] Rui Xiao, Bi Zhang, Yongming Dong, Jianke Gong, Tao Xu, Jianfeng Liu, and X. Z. Shawn Xu. A Genetic Program Promotes C. elegans Longevity at Cold Temperatures via a Thermosensitive TRP Channel. Cell, 152(4):806–817, 2013. doi: 10.1016/j.cell.2013.01.020.

[58] Gregory W. Stegeman, Denise Medina, Asher D. Cutter, and William S. Ryu. Neuro-genetic plasticity of Caenorhabditis elegans behavioral thermal tolerance. BMC Neuroscience, 20(1):26, 2019. doi: 10.1186/s12868-019-0510-z.

[59] Sydney Brenner. The genetics of Caenorhabditis elegans. Genetics, 77(1):71–94, 1974.

80 [60] Bryan C. Daniels, William S. Ryu, and Ilya Nemenman. Automated, predictive, and interpretable inference of Caenorhabditis elegans escape dynamics. Proceedings of the National Academy of Sciences, 116(15):7226–7231, 2019. doi: 10.1073/pnas.1816531116.

[61] Kawai Leung, Aylia Mohammadi, William S. Ryu, and Ilya Nemenman. Stereotypical Escape Behavior in Caenorhabditis elegans Allows Quantification of Effective Heat Stimulus Level. PLoS Computational Biology, 12(12):e1005262, 2016. doi: 10.1371/journal.pcbi.1005262.

[62] James A. Sethian. Level Set Methods and Fast Marching Methods: Evolving Interfaces in Computational Geometry, Fluid Mechanics, Computer Vision, and Materials Science. Cambridge University Press, Cambridge, United Kingdom, 1999.

[63] Manuel Guizar-Sicairos, Samuel T. Thurman, and James R. Fienup. Efficient subpixel image registration algorithms. Optics Letters, 33(2):156–158, 2008. doi: 10.1364/OL.33.000156.

[64] Damien Garcia. Robust smoothing of gridded data in one and higher dimensions with missing values. Computational Statistics & Data Analysis, 54 (4):1167–1178, 2010. doi: 10.1016/j.csda.2009.09.020.

[65] Damien Garcia. A fast all-in-one method for automated post-processing of PIV data. Experiments in Fluids, 50(5):1247–1259, 2011. doi: 10.1007/ s00348-010-0985-y.

[66] Philip M. Groves and Richard F. Thompson. Habituation: A dual-process theory. Psychological Review, 77(5):419–450, 1970. doi: 10.1037/h0029810.

[67] Vincent Castellucci, Harold Pinsker, Irving Kupfermann, and Eric R. Kandel. Neuronal Mechanisms of Habituation and Dishabituation of the Gill-Withdrawal Reflex in Aplysia. Science, 167(3926):1745–1748, 1970. doi: 10.1126/science.167.3926.1745.

[68] Franklin B. Krasne. Excitation and Habituation of the Crayfish Escape Reflex: The Depolarizing Response in Lateral Giant Fibres of the Isolated Abdomen. Journal of Experimental Biology, 50(1):29–46, 1969.

[69] Mitchel J. Daniel, Laura Koffinas, and Kimberly A. Hughes. Habituation underpins preference for mates with novel phenotypes in the guppy. Proceedings of the Royal Society B: Biological Sciences, 286(1902):20190435, 2019. doi: 10.1098/rspb.2019.0435.

81 [70] Romain P. Boisseau, David Vogel, and Audrey Dussutour. Habituation in non- neural organisms: evidence from slime moulds. Proceedings of the Royal Society B: Biological Sciences, 283(1829):20160446, 2016. doi: 10.1098/rspb.2016.0446.

[71] Andrew C. Giles and Catharine H. Rankin. Behavioral and genetic characterization of habituation using Caenorhabditis elegans. Neurobiology of Learning and Memory, 92(2):139–146, 2009. doi: 10.1016/j.nlm.2008.08.004.

[72] Evan L. Ardiel, Andrew C. Giles, Alex J. Yu, Theodore H. Lindsay, Shawn R. Lockery, and Catharine H. Rankin. Dopamine receptor DOP-4 modulates habituation to repetitive photoactivation of a C. elegans polymodal nociceptor. Learning & Memory, 23(10):495–503, 2016. doi: 10.1101/lm.041830.116.

[73] Akane Ohta, Tomoyo Ujisawa, Satoru Sonoda, and Atsushi Kuhara. Light and pheromone-sensing neurons regulates cold habituation through insulin signalling in Caenorhabditis elegans. Nature Communications, 5:4412, 2014. doi: 10.1038/ncomms5412.

[74] Catharine H. Rankin, Thomas Abrams, Robert J. Barry, Seema Bhatnagar, David F. Clayton, John Colombo, Gianluca Coppola, Mark A. Geyer, David L. Glanzman, Stephen Marsland, Frances K. McSweeney, Donald A. Wilson, Chun-Fang Wu, and Richard F. Thompson. Habituation revisited: An updated and revised description of the behavioral characteristics of habituation. Neurobiology of Learning and Memory, 92(2):135–138, 2009. doi: 10.1016/j.nlm. 2008.09.012.

[75] Jan M. Hemmi and Tobias Merkle. High stimulus specificity characterizes anti- predator habituation under natural conditions. Proceedings of the Royal Society B: Biological Sciences, 276(1677):4381–4388, 2009. doi: 10.1098/rspb.2009.1452.

[76] Eva M. Bauch, Christina Andreou, Vanessa H. Rausch, and Nico Bunzeck. Neural Habituation to Painful Stimuli Is Modulated by Dopamine: Evidence from a Pharmacological fMRI Study. Frontiers in Human Neuroscience, 11, 2017. doi: 10.3389/fnhum.2017.00630.

[77] Owen Randlett, Martin Haesemeyer, Greg Forkin, Hannah Shoenhard, Alexander F. Schier, Florian Engert, and Michael Granato. Distributed Plasticity Drives Visual Habituation Learning in Larval Zebrafish. Current Biology, 29(8):1337–1345.e4, 2019. doi: 10.1016/j.cub.2019.02.039.

[78] Junjie Luo, Wei L. Shen, and Craig Montell. TRPA1 mediates sensing the rate of temperature change in Drosophila larvae. Nature Neuroscience, 20(1):34–41, 2017. doi: 10.1038/nn.4416.

82 [79] Susanne Ebert, Kort Travis, Bryan Lincoln, and Jochen Guck. Fluorescence ratio thermometry in a microfluidic dual-beam laser trap. Optics Express, 15 (23):15493, 2007. doi: 10.1364/OE.15.015493.

[80] Ilona Węgrzyn, Alar Ainla, Gavin David Michael Jeffries, and Aldo Jesorka. An Optofluidic Temperature Probe. Sensors, 13(4):4289–4302, 2013. doi: 10.3390/s130404289.

[81] T. López Arbeloa, Maria J. Tapia-Estévez, F. López Arbeloa, I. Urretxa Aguir- resacona, and I. López Arbeloa. Luminescence properties of rhodamines in water/ethanol mixtures. Journal of Luminescence, 48-49:400–404, 1991. doi: 10.1016/0022-2313(91)90147-N.

[82] David Ross, Michael Gaitan, and Laurie E. Locascio. Temperature Measurement in Microfluidic Systems Using a Temperature-Dependent Fluorescent Dye. Analytical Chemistry, 73(17):4117–4123, 2001. doi: 10.1021/ac010370l.

[83] Veeren M. Chauhan, Richard H. Hopper, Syed Z. Ali, Emma M. King, Florin Udrea, Chris H. Oxley, and Jonathan W. Aylott. Thermo-optical characterization of fluorescent rhodamine B based temperature-sensitive nanosensors using a CMOS MEMS micro-hotplate. Sensors and Actuators B: Chemical, 192:126–133, 2014. doi: 10.1016/j.snb.2013.10.042.

[84] Jun Sakakibara and Ronald J. Adrian. Whole field measurement of temperature in water using two-color laser induced fluorescence. Experiments in Fluids, 26 (1):7–15, 1999. doi: 10.1007/s003480050260.

[85] Junyan Han and Kevin Burgess. Fluorescent Indicators for Intracellular pH. Chemical Reviews, 110(5):2709–2728, 2010. doi: 10.1021/cr900249z.

[86] Adel A. El-Harakany, Fathy M. Abdel-Halim, and Assem O. Barakat. Dissociation constants and related thermodynamic quantities of the protonated acid form of tris-(hydroxymethyl)-aminomethane in mixtures of 2- methoxyethanol and water at different temperatures. Journal of Electroanalytical Chemistry and Interfacial Electrochemistry, 162(1):285–305, 1984. doi: 10.1016/ S0022-0728(84)80171-0.

[87] Franz M. Weinert and Dieter Braun. Optically driven fluid flow along arbitrary microscale patterns using thermoviscous expansion. Journal of Applied Physics, 104(10):104701, 2008. doi: 10.1063/1.3026526.

[88] Eli Paster and William S. Ryu. The thermal impulse response of Escherichia coli. Proceedings of the National Academy of Sciences, 105(14):5373–5377, 2008. doi: 10.1073/pnas.0709903105.

83 [89] Luc Leybaert, James Sneyd, and Michael J. Sanderson. A Simple Method for High Temporal Resolution Calcium Imaging with Dual Excitation Dyes. Biophysical Journal, 75(4):2025–2029, 1998. doi: 10.1016/S0006-3495(98) 77644-1.

[90] Adi Albeg, Cody Smith, Marios Chatzigeorgiou, Dror G. Feitelson, David H. Hall, William R. Schafer, David M. Miller, and Millet Treinin. C. elegans multi- dendritic sensory neurons: morphology and function. Molecular and Cellular Neurosciences, 46(1):308–317, 2011. doi: 10.1016/j.mcn.2010.10.001.

[91] Yongxin Zhao, Satoko Araki, Jiahui Wu, Takayuki Teramoto, Yu-Fen Chang, Masahiro Nakano, Ahmed S. Abdelfattah, Manabi Fujiwara, Takeshi Ishihara, Takeharu Nagai, and Robert E. Campbell. An Expanded Palette of Genetically Encoded Ca2+ Indicators. Science, 333(6051):1888–1891, 2011. doi: 10.1126/science.1208592.

[92] Christopher Fang-Yen, Christopher V. Gabel, Aravinthan D. T. Samuel, Cornelia I. Bargmann, and Leon Avery. Laser Microsurgery in Caenorhabditis elegans. Methods in Cell Biology, 107:177–206, 2012. doi: 10.1016/ B978-0-12-394620-1.00006-0.

[93] John A. Calarco and Aravinthan D. T. Samuel. Imaging whole nervous systems: insights into behavior from worms to fish. Nature Methods, 16(1):14– 15, 2019. doi: 10.1038/s41592-018-0276-8.

[94] Balazs Szigeti, Thomas Stone, and Barbara Webb. Inconsistencies in C. elegans behavioural annotation. bioRxiv, 2016. doi: 10.1101/066787.

84