Temperature influences the physiology and behavior of all organisms. For ectotherms, which lack central temperature regulation, temperature adaptation requires sheltering from or moving to a heat source. As temperature constrains the rate of metabolic reactions, it can directly affect ectotherm physiology and thus behavioral performance. This direct effect is particularly relevant for insects, as their small bodies readily equilibrate with ambient temperature. In fact, models of enzyme kinetics applied to insect behavior predict performance at different temperatures suggesting that thermal physiology governs behavior. However, insects also possess thermosensory neurons critical for locating preferred temperatures, showing cognitive control. This suggests that temperature-related behavior can emerge directly from a physiological effect, indirectly as a consequence of thermosensory processing, or through a combination of both. To separate the roles of thermal physiology and cognitive control, we developed an arena that allows fast temperature changes in time and space, and in which animals' movements are automatically quantified. We exposed wild-type Drosophila melanogaster and thermosensory receptor mutants to a dynamic temperature environment and tracked their movements. The locomotor speed of wild-type flies closely matched models of enzyme kinetics, but the behavior of thermosensory mutants did not. Mutations in thermosensory receptor gene dTrpA1 (Transient Receptor Potential A1) expressed in the brain resulted in a complete lack of response to temperature changes, while mutations in peripheral thermosensory receptor gene Gr28b(D) resulted in a diminished response. We conclude that flies react to temperature through cognitive control, informed by interactions between various thermosensory neurons, the behavioral output of which resembles models of enzyme kinetics.

Organisms are constantly exposed to environmental challenges over which they have no direct influence. One such challenge is temperature, a pervasive component that changes in time and space and directly influences biochemical processes (Abram et al., 2017), which in turn affects physiology (Kingsolver, 2009; Roberts et al., 2003; Soriano et al., 2002) and behavior (Crill et al., 1996; Ellison and Skinner, 1992; Gibert et al., 2001; Grigg et al., 2004; Klepsatel et al., 2013; Latimer et al., 2015). Endothermic animals adapt to temperature through metabolic mechanisms that regulate their central temperature (Clarke and Rothery, 2008; Grigg et al., 2004). Ectothermic animals, in contrast, lack central temperature regulation and instead depend on behavioral strategies to find environments where the temperature meets their needs (Klein et al., 2014; Purves et al., 2003).

The capacity of ectotherms to tolerate temperature changes is influenced by their body size. The mass of large ectotherms reduces the rate at which their core heats in comparison to their surface area (Stevenson, 1985). This allows them to move freely through a wide temperature gradient without suffering physiological consequences. For small ectotherms, a large surface area to volume ratio means that their body temperature readily equilibrates with that of the environment (Garrity et al., 2010; Hong et al., 2008; Stevenson, 1985). As temperature directly affects the rate of biochemical reactions in enzymatic systems, the immediacy with which small ectotherms adopt the temperature around them could imply that their behavioral response closely tracks that of the physiological effect of temperature (Dillon et al., 2012). In fact, models of insect performance at different temperatures reflect the predicted response of enzymatic kinetics (Gilchrist, 1995; Huey and Kingsolver, 1989; Klepsatel et al., 2013; Logan et al., 1976). However, small ectotherms such as the fruit fly Drosophila melanogaster possess central and peripheral thermosensory neurons relevant for their selection of preferred temperatures on fixed gradients (Barbagallo and Garrity, 2015; Frank et al., 2015; Gallio et al., 2011; Hamada et al., 2008; Liu et al., 2015; Ni et al., 2013). The fruit fly's thermosensory neurons express Transient Receptor Potential A1 (dTrpA1), which influences temperature preference processes, temperature-dependent daily activity patterns and sleep regulation, as well as thermal nociception in both larvae and adults (Hamada et al., 2008; Lamaze et al., 2017; Luo et al., 2016; Neely et al., 2011; Roessingh and Stanewsky, 2017; Yoshii et al., 2009; Zhong et al., 2012). dTrpA1 is expressed in the anterior cells (AC) of the adult fly central nervous system (Hamada et al., 2008), where it regulates the response to slow and shallow temperature changes (Ni et al., 2013). As these central neurons receive inputs from peripheral thermosensory neurons and project to multiple brain regions, they have also been suggested to be a site of regulation of temperature preference (Barbagallo and Garrity, 2015; Gallio et al., 2011; Tang et al., 2013). Flies also have other, peripheral thermosensory neurons located in the second and third antennal segments. The second antennal segment produces a response to warming that projects to the AC (Tang et al., 2013). The third antennal segment harbors cold-sensing neurons in the sacculus as well as hot- and cold-sensing neurons in the base of the arista (Gallio et al., 2011). Cold-sensing neurons express the Trp-related channel genes brivido1, brivido2 and brivido3, while hot-sensing neurons express the gustatory receptor gene Gr28b(D) (Fowler and Montell, 2013; Gallio et al., 2011; Ni et al., 2013). Gr28b(D) has been linked to the response to fast and small temperature changes that do not require dTrpA1 (Ni et al., 2013). The peripheral system also harbors secondary thermal projection neurons that respond to fast and large increases in temperature, independent of Gr28b(D) (Frank et al., 2015; Liu et al., 2015). Drosophila thus possesses multiple systems to respond to temperature, and both physiology and cognitive control may play a role in the resulting behavioral response (Abram et al., 2017).

Here, we set out to differentiate the contribution of the physiological effect of temperature from that of the sensory processing of thermal information in influencing the behavioral response of Drosophila to temperature changes. To do this, we developed a temperature-controlled arena that allows continuous tracking of the flies' movements in a spatially and temporally controlled thermal environment. Unlike approaches used in previous studies, this method does not require long exposure to fixed temperatures (Klepsatel et al., 2013; Latimer et al., 2014) or human intervention during the experiment (Crill et al., 1996; Gibert et al., 2001). We quantified the locomotion of flies based on their speed, as previous studies have done in the context of testing the effect of age, geography, development and natural genetic variation on the behavioral performance of the flies at different temperatures (Crill et al., 1996; Gibert et al., 2001; Klepsatel et al., 2013; Latimer et al., 2014). To clearly differentiate the contribution of the physiological effect and thermosensory processing, we compared the speed of wild-type flies with that of Gr28b(D) and dTrpA1 mutants over a large range of temperatures. The difference between the response of wild-type and mutant flies reveals how much the speed at different temperatures depends on a direct physiological effect, which would affect the flies independent of the mutations, and how much it depends on the thermosensors. Our results demonstrate that the speed of the flies is comparable to enzyme kinetics-based models, but that flies do not increase speed in the absence of thermosensory processing, especially in dTrpA1 mutants. This suggests that fruit flies, though directly affected physiologically by the increase of temperature, require thermosensory processing to produce a behavioral response to temperature. In addition, we show that both peripheral and central thermosensors are necessary for a normal response to changing external temperatures.

Drosophila rearing and stocks

Drosophila melanogaster flies were raised on a 12 h:12 h light:dark cycle at 25°C on fly food medium containing agar (10 g l−1), glucose (167 mmol l−1), sucrose (44 mmol l−1), yeast (35 g l−1), cornmeal (15 g l−1), wheat germ (10 g l−1), soya (10 g l−1), molasses (30 g l−1), propionic acid and Tegosept (for food medium preparation, see Gorter et al., 2016). All flies were collected using CO2 anesthesia on the day of eclosion and aged in same-sex food vials of 20 flies each. Tests were done using 5–7 day old males with the exception of the wild-type test, for which we also used virgin females.

Canton-S was used as the wild-type strain. Thermosensory mutants included dTrpA1GAL4 (Kim et al., 2010), w;dTrpA1903w*/TM6b (dTrpA1903w*) (Zhong et al., 2012) and w1118;Mi{ET1}Gr28bMB03888 [Gr28b(D)] (Ni et al., 2013). UAS-dTrpA1 RNAi and dTrpA1SH-GAL4 (Hamada et al., 2008) were used to create a dTrpA1 knockdown in AC neurons. The Gr28b(D) line was obtained from the Bloomington Stock Center. The dTrpA1GAL4, w;dTrpA1903w*/TM6b, UAS-dTrpA1 RNAi and dTrpA1SH-GAL4 lines were a gift from Ralf Stanewsky (University of Münster, Institute of Neuro- and Behavioral Biology). Strain w1118 was used as control strain for dTrpA1GAL4 and Gr28b(D) mutants. The UAS-dTrpA1 RNAi and dTrpA1SH-GAL4 lines were crossed to y,w to generate controls for the knockdown. Third antennal segment removal was done using iridectomy scissors (Fine Science Tools No. 15000-03) on 0–1 day old flies under CO2 anesthesia. These flies recovered for 4–5 days and were also tested on days 5–7.

Temperature-controlled arena

Flies were tested in an automated temperature-controlled arena (Fig. 1; for a detailed description, see Appendix, ‘Temperature-controlled arena’), the floor of which consisted of three adjacent copper tiles of 2.5×2.5 cm mounted on a 32 cm (L)×16 cm (W)×13 cm (H) box containing the heating and cooling elements of the thermal mechanism. Each tile presented a temperature variation of ±0.2–0.5°C around any given temperature between 15 and 50°C as measured by individual thermosensors connected to each tile. The heating rate varied according to the range of the temperature change: an increase of 2°C took ∼100 ms and an increase of 18°C (from 22°C to 40°C) required ∼4 s; cooling took ∼1 s for 2°C and ∼6 s for 18°C (from 40°C to 22°C). Each tile could thus be independently and rapidly heated or cooled. The tiles were covered with white conducting tape (Tesa® 4104 white tape, 25×66 mm) and constantly illuminated with white light (Cold White 300×5050 SMD LED Flexible Light Strip providing 45 lx) to create a uniform and contrasting background surface that was replaced between experiments. There were no thermal gradients between the tiles that could influence the flies, as confirmed by thermal imaging (FLIR® T400sc, FLIR Systems Inc., Wilsonville, OR, USA; Fig. S1).

To confine flies to the arena, a 9.6×4.5 cm aluminium frame of 3 mm height and 1 cm width was placed around the copper tiles and covered by a 3 mm-thick annealed glass plate of 9.3×4.2 cm, coated with siliconizing agent (Sigmacote®, Sigma-Aldrich, Darmstadt, Germany). The aluminium frame was constantly heated to 50°C using insulated resistors beneath the bottom surface of the frame.

Temperature protocols, data processing and statistical analysis

Individual flies were transferred to the temperature-controlled arena using a mouth aspirator. For the experiments involving temperature changes, flies were allowed to walk freely for 7 min at a constant temperature of 22°C to eliminate the natural exploratory phase in which flies walk faster and allow them to settle (Fig. S2). For experiments with a constant temperature, flies were introduced directly to the test temperature. Flies were video recorded with a high-definition webcam (Logitech® c920, Logitech Europe S.A., Lausanne, Switzerland) and then tracked using software developed for this project in Python (Python Software Foundation v2.7.6, http://www.python.org) based on the Lucas–Kanade differential method for optical flow (see Appendix, ‘Tracking Software’) and available on request. Fly centroid data were imported into Matlab (Matlab and Statistics Toolbox release 2014a, The Mathworks Inc., Natick, MA, USA) and processed using custom-written scripts. The time on each tile, speed and path length were binned per minute. We considered a fly as being on a tile when it was across the border between tiles for at least 1 s and for a distance greater than the length of one fly (0.25 cm). Matlab output data were imported into GraphPad Prism (v6 for Mac OS Sierra, GraphPad Software Inc., www.graphpad.com) for statistical analysis of the effect of sex or genotype over the speed of flies at different temperatures using a two-way repeated-measurements (RM) analysis of variance (ANOVA) with Tukey's or Sidak's post hoc test for multiple comparisons.

A custom-written script in RStudio (R Studio Team 2016, v1.0.143) was used to model the speed of flies when exposed to increasing temperatures. As customary for modeling of performance at different temperatures (Angilletta, 2006; Gilchrist, 1995, 1996; Huey, 1979; Huey and Kingsolver, 1989; Klepsatel et al., 2013; Latimer et al., 2014, 2015), we fitted multiple functions and polynomials to our data: Gaussian, modified Gaussian, quadratic, and eqns 6 and 10 from Logan et al. (1976). These last two equations are based on the rate of enzyme-catalyzed biochemical reactions and were designed to describe behavioral performance in arthropods at different temperatures. Eqn 6 of  Logan et al. (1976) (Fig. 2) is represented by:
formula
(1)
where locomotion (S) is described as a function of temperature (T) that depends on ψ, a measurable process at the base temperature (such as speed in our study) dependent on temperature; ρ is interpreted as the composite of the Q10 value of enzyme-catalyzed biochemical reactions; and τ is defined as:
formula
(2)
where TM is the maximum lethal temperature; T denotes an experimental temperature; and ΔT is the width of the high-temperature boundary section.
Eqn 10 of  Logan et al. (1976) (Fig. 2) derives from their eqn 6, and is sigmoidal in the first phase of the curve (ascent), which is considered a more accurate description of the phenomena than the straight line represented by eqn 6. Eqn 10 of  Logan et al. (1976) is given as:
formula
(3)
where T represents an experimental temperature; α, k and ρ are free parameters; and τ is as described above.

Data were fitted to these models using the non-linear mixed effects function of RStudio (v1.0.143) and compared using the Akaike information criterion (AIC; as recommended by Angilletta, 2006). We confirmed these results by comparing our models under the Bayesian information criterion (BIC), which agreed with the AIC conclusion. We also calculated the residual sum of squares (r2) and found an acceptable estimate for eqn 10 of  Logan et al. (1976), even though model preference differed. This difference can be explained by the lack of capacity of the residual sum of squares to deal with model complexity, a problem fixed through the AIC (Symonds and Moussalli, 2011).

Drosophila melanogaster increases speed at increasing temperature following a model based on enzyme-catalyzed temperature performance

In an automated temperature-controlled arena (Fig. 1), we exposed individual wild-type adult D. melanogaster to gradually increasing temperatures from 16°C to 46°C (2°C increase every minute) to experimentally determine their performance at different temperatures (Fig. 3A). Fly speed followed a skewed curve with a long tail in the cold part of the gradient, a gradual increase until a maximum temperature of 34°C, and then a rapid decay (Fig. 3B). This temperature–performance curve was observed in males and females, with no significant difference between the sexes (Fig. 3B). We therefore chose to only test males in further experiments. Model fitting showed that eqn 10 from Logan et al. (1976) best described the flies' performance when compared with other models commonly used to describe the thermal response of ectotherms (Fig. 3C; Angilletta, 2006). Logan et al.’s (1976) model is based on enzyme kinetics to predict temperature-related biological processes (AIC; Table S1). As the fly's speed increases with temperature with the same dynamic as enzymatic reactions, these data suggest that the influence of temperature on the fly's physiology may be directly regulating its speed.

Thermosensory mutants do not follow the predictions of enzyme-catalyzed temperature–performance curves

We next determined the temperature–performance curves of thermosensory mutants in order to quantify the necessity of the thermosensory system for temperature response. Loss-of-function mutation in the Gr28b(D) gene, encoding a peripheral thermosensor, did not eliminate the locomotor response to temperature (Fig. 4B). Gr28b(D) mutants moved faster as temperature increased, but at a lesser rate than controls (Fig. 4B). The response of Gr28b(D) mutants is best described by eqn 6 from  Logan et al. (1976) (Fig. S3A and Table S2), which is also considered to be a good representation of the performance at different temperatures based on enzyme kinetics. This suggests that Gr28b(D) mutants behave similar to wild-type flies but present a dampened response to temperatures higher than 26°C.

The difference in speed between the Gr28b(D) mutant flies and wild-type flies at increasing temperatures may be because the mutant flies are not be capable of walking faster as a result of a pleiotropic effect of Gr28b(D) on the locomotor system. We tested this possibility by surgically ablating the third antennal segment, which removed peripheral temperature sensors, including Gr28b(D). We tested wild-type flies with partial (one antenna removed) or total (both antennas removed) third antennal segment ablation (Fig. 4C). Flies lacking the third antennal segment moved slower at warm temperatures than the controls, as Gr28b(D) mutants do. Moreover, flies in which the third antennal segment was removed from only one antenna move slower than controls but faster than flies lacking both third antennal segments, suggesting a complementary response between antennas. Together with our Gr28b(D) mutant results, these data demonstrate that Gr28b(D) must be functional for flies to reach maximum speed when exposed to increasing temperatures outside of their comfortable temperature range. As ablation of the aristae reproduces the Gr28b(D) null mutation, the mutant phenotype of Gr28b(D) is probably directly causally connected to the peripheral thermosensory system and not due to a pleiotropic function of this gene.

Flies with a loss-of-function allele of the central thermal receptor dTrpA1 (dTrpA1GAL4) did not change their speed as temperature increased (Fig. 4D). Model fitting showed that none of the models used to described thermal reaction norms accurately described the response of these flies, leading us to conclude that thermal reaction is missing in these mutants (Fig. S3B and Table S2). To confirm the necessity of dTrpA1 for temperature performance, we tested a second dTrpA1 allele, dTrpA1903w*, in a homozygous state as well as in transheterozygous combination with the dTrpA1GAL4 allele (Fig. 4E). Homozygous dTrpA1903w* flies demonstrated a modest increase in speed at higher temperatures, suggesting that this allele is a hypomorph. Transheterozygous dTrpA1903w*/dTrpA1GAL4 flies failed to increase speed at all temperatures, demonstrating lack of complementation between the two alleles, confirming that they are alleles of the same gene. These results confirm our initial observation that dTrpA1 is necessary for the locomotor response to temperature increase and suggest that dTrpA1903w* is a strong hypomorph of dTrpA1, while dTrpA1GAL4 is probably a null allele of dTrpA1.

As dTrpA1 might have a pleiotropic effect on locomotion, we tested its necessity for temperature performance specifically in AC neurons, the central sensor neurons for temperature preference (Hamada et al., 2008) and integrators of thermal information from the periphery (Tang et al., 2013). To do this, we created a dTrp1A knockdown in AC neurons by driving the expression of UAS-dTrpA1 RNAi using the dTrpA1SH-GAL4 driver, which is expressed in AC neurons (Hamada et al., 2008). We observed a dramatically reduced response to increasing temperatures when compared with controls (Fig. 4F). This result further confirms the necessity of dTrpA1 for locomotor performance and further indicates that this function is mediated by AC neurons.

Taken together, these results lead us to conclude that intact central thermal sensing is necessary for flies to increase speed according to temperature changes, and demonstrate that the direct effect of temperature on the fly's biochemical reactions is not sufficient to explain changes in speed in response to temperature changes.

Gr28b(D) and dTrpA1 are necessary for a normal response to changing temperatures as well as constant temperatures

Gr28b(D) has been proposed to detect the process of temperature change or to be dedicated to perceiving temperature contrast (Gallio et al., 2011; Ni et al., 2013), both of which are relevant when reacting to an increasing temperature gradient. Similarly, dTrpA1 has been reported to detect the rate of temperature change in Drosophila larvae (Luo et al., 2016), which could explain its necessity in our experiments for the response to increasing temperature (Fig. 4). Thus, it is possible that when flies are exposed to a constant temperature, neither of these receptors is fundamental for the response and flies can just react based on the direct physiological effect of temperature. We tested this possibility by exposing flies to a constant temperature for 10 min within our temperature-controlled arena and quantifying their speed. Control flies increased their speed of movement when exposed to higher temperatures (Fig. 5B) in a comparable fashion to what was observed in the increasing thermal gradient (Fig. 3B). As with previous results, Gr28b(D) and dTrpA1GAL4 mutants did not follow a normal locomotor response to temperature: Gr28b(D) mutants increased locomotion at higher temperatures but were significantly slower at 32 and 36°C when compared with wild-type flies (Fig. 5B); dTrpA1GAL4 mutants maintained the same speed independently of the temperature they were exposed to (Fig. 5C). These results suggest that Gr28b(D) and dTrpA1 are relevant for a normal response under conditions of constant as well as changing temperature.

dTrpA1 but not Gr28b(D) is necessary for the response to large temperature changes

In the previous sections, we have shown that Gr28b(D) and dTrpA1 are necessary for the locomotor response to both constant and small increases in temperature. This suggests that these receptors are sufficient to regulate the locomotor response to temperature changes. However, it has been suggested that flies possess different sensors adapted to different intensities of temperature change (Liu et al., 2015). Indeed, Gr28b(D) mutant neurons respond to small changes of temperature (∼1°C per second) while larger and faster changes activate an excitatory pathway dependent on cold-sensing cells and not Gr28b(D) (Liu et al., 2015). To test the necessity of Gr28b(D) and dTrpA1 for sensing larger temperature changes, we exposed flies to a temperature gradient between 16 and 36°C, increasing by 2°C every minute, while also providing a location heated to 22°C (Fig. 6A). This location was switched between left and right for each successive iteration. As flies always moved to this 22°C location irrespective of the arena temperature, they were exposed to a sudden temperature change ranging from 2 to 14°C (Fig. 6A). Control flies moved to the 22°C tile at each iteration, increasing their speed as temperature increased (Fig. 6B). Gr28b(D) mutants behaved in a similar manner to controls (Fig. 6B). dTrpA1GAL4 mutants, however, did not increase their speed and did not seek the 22°C location (Fig. 6C). Our results suggest that flies respond to fast and large warming changes through a mechanism that requires dTrpA1 but is independent of Gr28b(D), as previously suggested (Liu et al., 2015).

We quantified the contribution of the physiological effect and the thermosensory perception of temperature on the locomotor speed of D. melanogaster. We used a new temperature-controlled arena that allows dynamic temperature changes in time and space. As flies are small ectothermic animals, we expected a significant effect of warmer temperatures on metabolic reactions, resulting in faster movement speed even in the absence of functional thermosensory neurons. However, we found that the dTrpA1 thermosensors are necessary for D. melanogaster to exhibit the locomotor reaction to temperature change (Figs 4 and 6). We interpret this result as showing that thermosensation is the main component of the locomotor response to temperature. This does not imply that the direct physiological effects of temperature on fly behavior can be neglected. What our results suggest is that the effect of temperature on biochemical reactions and on behavior are uncoupled. The fact that the best model representing the locomotor performance of D. melanogaster at different temperatures is based on enzyme kinetics probably means that the behavioral response to temperature mediated by the nervous system has been shaped by the rate of biochemical reactions (Fig. 3C; Table S1). One can imagine a scenario in which early unicellular organisms responded to temperature in an enzyme-based system. As multicellular organisms evolved, they required spatially separated enzyme systems to work together. These organisms, like modern ectotherms, needed to select environments in which they could be efficient and flexible, avoiding pushing their enzymatic systems over their maximum thermal tolerance by selecting environments below this range (Martin and Huey, 2008). Success in this process requires a central thermal processor that integrates the information from a peripheral thermosensory system that detects distinct thermal qualities of the current environment. In the case of D. melanogaster’s change in locomotion at different temperatures, the peripheral system seems to use different mechanisms according to the intensity of the thermal change: a Gr28b(D)-dependent mechanism that detects gradual and small temperature changes (Fig. 4A); and a Gr28b(D)-independent mechanism (Fig. 6B; also shown in larvae in Liu et al., 2015) that detects abrupt temperature variations. This is comparable to the findings on daily entrainment to temperature cycles, in which different thermal receptors in chordotonal organs detect a wide range (Sehadova et al., 2009; Wolfgang et al., 2013) or a small range of temperature changes (Chen et al., 2015).

Our results also suggest that dTrpA1 is required for normal locomotor changes in response to any type of temperature change. This makes AC neurons, in which dTrpA1 is necessary for the locomotor response to temperature changes (Fig. 4F), an enticing candidate for a role as central thermal processor. However, the studies on daily entrainment have not systematically concluded that either dTrpA1 or AC neurons are fundamental for temperature entrainment (Das et al., 2015; Lee and Montell, 2013; Roessingh et al., 2015). So far, dTrpA1 expression has been observed only in subsets of clock neurons (Das et al., 2016; Lee and Montell, 2013; Yoshii et al., 2015), and AC neurons have been related to temperature preference but not to temperature entrainment (Tang et al., 2017). This suggests that the central system of Drosophila thermal behavior has a high level of complexity beyond AC neurons that allows an efficient and detailed detection of thermal stimuli and their integration with other internal states to coordinate the most efficient behavioral response.

In conclusion, this study adds to the body of work demonstrating that flies possess rich thermosensory mechanisms to respond to temperature and proves that they are not passive respondents, as could have been predicted by their lack of internal temperature regulation. Instead, Drosophila possess multiple thermosensors, located in both their central and peripheral nervous system, and the signal from these is integrated to respond to different types of thermal challenge. One output of this system we have measured here is an increase in locomotor speed with higher temperatures. It is likely that greater speed functions to escape damaging temperatures, thus allowing Drosophila to actively regulate temperature via positional avoidance or preference. Future studies could take advantage of this methodology, in combination with genetic and environmental manipulation, to illuminate the mechanisms that regulate the dynamic response to temperature observed in ectotherms.

APPENDIX

Temperature-controlled arena

Current systems use Peltier elements to control the temperature of the relevant parts of research equipment because temperature can be controlled easily in a range suitable for most types of tests. However, because of the construction of Peltier elements based on a semiconductor material sandwiched between two conductors, they are prone to thermal stress that quickly destroys them when temperature is changed at a fast rate. Our temperature-controlled arena solves this problem by using a copper block and copper tiles system in which the temperature changes occur, leaving the Peltier elements to act only as constant heaters and diminishing their thermal stress.

The heart of the system is a copper block that acts as a well-controlled thermal mass, on which three tiles are glued to a heater element directly in contact with the tile and a thermal semi-insulator that sits between the heater element (printed circuit board of ∼0.3 mm thickness with three fine meandering tracks that have a resistance of 5 Ω each, one for each tile) and the copper block. The copper block is kept at a constant temperature, lower than the minimum desired temperature of the tiles, using Peltier elements clamped to a heat sink by thermally isolated bolts and spring washers. The heat sink is cooled with ambient air that is forced through it by a fan. The fan is isolated from the heat sink to avoid disturbance of the test specimen due to vibration. Each copper tile, the copper block and the heat sink are equipped with thermal sensors that are used to control and monitor the complete system.

The temperature-controlled arena facilitates maintaining a constant temperature by heating each floor to the desired temperature through a controlled low-voltage power supply with feedback from the temperature sensor, which is coordinated by a programmable circuit (Arduino UNO Atmel Atmega328). For increases in temperature, our arena permits heating individual tiles or multiple tiles together. To do this, a high-voltage supply with a bank of boost capacitors of adequate capacity yields a high-power boost for a short duration of the order of 100 ms. It is possible to fix the voltage of the power boost and then use the time length of the boost to determine the value of the temperature increase. Other schemes, like a variable boost voltage, can lead to similar results. When the desired temperature is reached, the lower voltage supply takes over control and maintains the new constant temperature with a variability of less than 0.5°C. Cooling down is controlled by the heat flux through the semi-insulating substrate into the copper block. With the heat insulation properties of the semi-insulating substrate, the heat loss in the system can be balanced to the cool-down time. When the heat transfer to the copper block is higher, the heat loss and energy consumption of the system are higher, but the benefit is a faster cool down. To lower the energy consumption of a test cycle, a sophisticated control strategy for the copper block temperature is employed. In this case, the temperature of the copper block is kept at the temperature of the coolest tile, and only at a well-chosen time before one (or more) of the floors needs to go to a lower temperature is the block cooled down to ensure a fast cooling of the other tiles. The pre-cool time has to be experimentally determined and is dependent on the initial conditions, predominantly the temperature levels of all the floors.

Each experimental procedure is controlled using a Matlab (vR2014a MathWorks Inc.) script that coordinates the instructions of the programmable circuit to manage the heating and cooling of each cooper tile individually, and also to control the turning on and off of the red LED lights. While an experiment is running, a thermal sensor under each of the tiles continually measures the tile's temperature. The programmable circuit processes this information and the temperature is constantly adjusted to maintain the desired level. We measured a constant variation of ±0.2–0.5°C around the goal temperature. The programmable circuit is also responsible for the time it takes to change the temperature in each individual tile. In our experimental design, this time range between 100 ms for an increase of 2°C and 4 s for an increase of 18°C (from 22 to 40°C).

Tracking software

We developed tracking software, as part of the temperature–performance paradigm, in which the user need only specify the location of the video files, the number of subjects to be tracked and the boundaries of the area of interest. Within the algorithm, the area of interest is represented as a series of (x,y) coordinates, which means that any arena shape can be selected, allowing the tracker to be applicable to multiple experimental set-ups. The individual subjects are detected through key points using the Minimum Eigenvalue Method (Shi and Tomasi, 1994) or the advanced features from the Accelerated Segmentation Test (Rosten et al., 2010). These methods detect stable key points that are then tracked using optical flow based on the Kanade–Lucas–Tomasi (Lucas and Kanade, 1981; Shi and Tomasi, 1994; Tomasi and Kanade, 1991) algorithm.

The stable key points initially detected are clustered to represent the actual subjects of interest based on the k-Means algorithm. k-Means uses Euclidian distances to accumulate clusters according to the initial number of subjects input by the user. We gave our tracker a choice between traditional k-Means, in which the clusters are determined in every time frame based on Euclidian distances, and k-Means++, in which the first detection creates a center in each cluster (seed), which is used in the second detection as the start point of a cluster. k-Means++ is in appearance more precise, but the seeds can drift away from the subjects, so we decided to give the option of traditional k-Means if the density of seeds is x times lower than that for k-Means++ in the first time frame. If k-Means is selected, the algorithm will use the Minimum Mean Square Error to calculate the values of all combinations for each cluster in the following time frame and select that with the smallest value.

Two possible errors to address are the shifting between close-by clusters and the loss of subjects during tracking if they step outside of the area of interest. To correct for the shifting of clusters between flies that have stepped close to each other, our tracker uses an extended version of K-Nearest Neighbor. In this version, our algorithm calculates the Least Square Error for each cluster during each time frame and constantly selects the lowest error. In the case of the missing data, the most common cause in our experiments was that a fly stepped briefly outside of the area of interest by walking on top of the heated aluminium ring surrounding the arena. This caused a jump between two detection points far from each other that simulated a speed of movement faster than possible for the fly. We corrected this anomaly by calculating the distance a cluster was displaced between each time frame and the next and forcing interpolated points between the beginning and end of an anomaly.

We thank Ralph Stanewsky and the Bloomington Drosophila Stock Center for fly stocks; Mark M. Span for help setting up the temperature-controlled arena; Pieter Gerrit Bosma for developing the fruit fly tracking software; Ido Pen for advice on statistics; and Ralph Stanewsky and Sanne Roessingh for feedback on the manuscript.

Author contributions

Conceptualization: A.S.-P., J.-C.B.; Methodology: A.S.-P., R.R., H.v.R.; Software: H.v.R.; Formal analysis: A.S.-P.; Investigation: A.S.-P., J.-C.B.; Resources: H.v.R., J.-C.B.; Data curation: A.S.-P.; Writing - original draft: A.S.-P., J.-C.B.; Writing - review & editing: A.S.-P., O.C.M.S., H.v.R., J.-C.B.; Visualization: A.S.-P., J.-C.B.; Supervision: O.C.M.S., H.v.R., J.-C.B.; Project administration: A.S.-P., O.C.M.S., H.v.R., J.-C.B.; Funding acquisition: A.S.-P., H.v.R., J.-C.B.

Funding

This work was supported in part by a scholarship from the Behavioural and Cognitive Neuroscience Program of the Rijksuniversiteit Groningen and a graduate scholarship from the Consejo Nacional de Ciencia y Tecnología (CONACyT) from Mexico granted to A.S.-P. and a grant from the John Templeton Foundation for the study of time, awarded to H.v.R. and J.-C.B.

Data availability

The datasets from the tracking process generated and analyzed for the current study are available from the DataverNL repository: http://hdl.handle.net/10411/6CYOM9

Abram
,
P. K.
,
Boivin
,
G.
,
Moiroux
,
J.
and
Brodeur
,
J.
(
2017
).
Behavioural effects of temperature on ectothermic animals: unifying thermal physiology and behavioural plasticity
.
Biol. Rev.
92
,
1859
-
1876
.
Angilletta
,
M. J.
(
2006
).
Estimating and comparing thermal performance curves
.
J. Therm. Biol.
31
,
541
-
545
.
Barbagallo
,
B.
and
Garrity
,
P. A.
(
2015
).
Temperature sensation in Drosophila
.
Curr. Opin. Neurobiol.
34
,
8
-
13
.
Chen
,
C.
,
Buhl
,
E.
,
Xu
,
M.
,
Croset
,
V.
,
Rees
,
J. S.
,
Lilley
,
K. S.
,
Benton
,
R.
,
Hodge
,
J. J. L.
and
Stanewsky
,
R.
(
2015
).
Drosophila ionotropic receptor 25a mediates circadian clock resetting by temperature
.
Nature
527
,
516
-
520
.
Clarke
,
A.
and
Rothery
,
P.
(
2008
).
Scaling of body temperature in mammals and birds
.
Funct. Ecol.
22
,
58
-
67
.
Crill
,
W. D.
,
Huey
,
R. B.
and
Gilchrist
,
G. W.
(
1996
).
Within- and between-generation effects of temperature on the morphology and physiology of Drosophila melanogaster
.
Evolution
50
,
1205
-
1218
.
Das
,
A.
,
Holmes
,
T. C.
and
Sheeba
,
V.
(
2015
).
dTRPA1 modulates afternoon peak of activity of fruit flies Drosophila melanogaster
.
PLoS ONE
10
,
1
-
21
.
Das
,
A.
,
Holmes
,
T. C.
and
Sheeba
,
V.
(
2016
).
dTRPA1 in non-circadian neurons modulates temperature-dependent rhytmic activity in Drosophila melanogaster
.
J. Biol. Rhythms
31
,
272
-
288
.
Dillon
,
M. E.
,
Liu
,
R.
,
Wang
,
G.
and
Huey
,
R. B.
(
2012
).
Disentangling thermal preference and the thermal dependence of movement in ectotherms
.
J. Therm. Biol.
37
,
631
-
639
.
Ellison
,
G. T. H.
and
Skinner
,
J. D.
(
1992
).
The influence of ambient temperature on spontaneous daily torpor in pouched mice (Saccostomus campestris: Rodentia--Cricetidae) from Southern Africa
.
J. Therm. Biol.
17
,
25
-
31
.
Fowler
,
M. A.
and
Montell
,
C.
(
2013
).
Drosophila TRP channels and animal behavior
.
Life Sci.
92
,
394
-
403
.
Frank
,
D. D.
,
Jouandet
,
G. C.
,
Kearney
,
P. J.
,
Macpherson
,
L. J.
and
Gallio
,
M.
(
2015
).
Temperature representation in the Drosophila brain
.
Nature
519
,
358
-
361
.
Gallio
,
M.
,
Ofstad
,
T. A.
,
Macpherson
,
L. J.
,
Wang
,
J. W.
and
Zuker
,
C. S.
(
2011
).
The coding of temperature in the Drosophila brain
.
Cell
144
,
614
-
624
.
Garrity
,
P. A.
,
Goodman
,
M. B.
,
Samuel
,
A. D.
and
Sengupta
,
P.
(
2010
).
Running hot and cold: behavioral strategies, neural circuits, and the molecular machinery for thermotaxis in C. elegans and Drosophila
.
Genes Dev.
24
,
2365
-
2382
.
Gibert
,
P.
,
Huey
,
R.
and
Gilchrist
,
G.
(
2001
).
Locomotor performance of Drosophila melanogaster: Interactions among developmental and adult temperautures, age, and geography
.
Evolution
55
,
205
-
209
.
Gilchrist
,
G. W.
(
1995
).
Specialists and generalists in changing environments. I. fitness landscapes of thermal sensitivity
.
Am. Nat.
146
,
252
-
270
.
Gilchrist
,
G. W.
(
1996
).
A quantitative genetic analysis of thermal sensitivty in the locomotor performance curve of Aphidius ervi
.
Evolution
50
,
1560
-
1572
.
Gorter
,
J. A.
,
Jagadeesh
,
S.
,
Gahr
,
C.
,
Boonekamp
,
J. J.
,
Levine
,
J. D.
and
Billeter
,
J.-C.
(
2016
).
The nutritional and hedonic value of food modulate sexual receptivity in Drosophila melanogaster females
.
Sci. Rep.
6
,
19441
.
Grigg
,
G. C.
,
Beard
,
L. A.
and
Augee
,
M. L.
(
2004
).
The evolution of endothermy and its diversity in mammals and birds
.
Physiol. Biochem. Zool.
77
,
982
-
997
.
Hamada
,
F. N.
,
Rosenzweig
,
M.
,
Kang
,
K.
,
Pulver
,
S. R.
,
Ghezzi
,
A.
,
Jegla
,
T. J.
and
Garrity
,
P. A.
(
2008
).
An internal thermal sensor controlling temperature preference in Drosophila
.
Nature
454
,
217
-
220
.
Hong
,
S.-T.
,
Bang
,
S.
,
Hyun
,
S.
,
Kang
,
J.
,
Jeong
,
K.
,
Paik
,
D.
,
Chung
,
J.
and
Kim
,
J.
(
2008
).
cAMP signalling in mushroom bodies modulates temperature preference behaviour in Drosophila
.
Nature
454
,
771
-
776
.
Huey
,
R. B.
(
1979
).
Integrating thermal physiology and ecology of ectotherms: a discussion of approaches
.
Am. Zool.
19
,
357
-
366
.
Huey
,
R. B.
and
Kingsolver
,
J. G.
(
1989
).
Evolution of thermal sensitivity of ectotherm performance
.
TREE
4
,
131
-
135
.
Kim
,
S. H.
,
Lee
,
Y.
,
Akitake
,
B.
,
Woodward
,
O. M.
,
Guggino
,
W. B.
and
Montell
,
C.
(
2010
).
Drosophila TRPA1 channel mediates chemical avoidance in gustatory receptor neurons
.
Proc. Natl. Acad. Sci. USA
107
,
8440
-
8445
.
Kingsolver
,
J. G.
(
2009
).
The well-temperatured biologist
.
Am. Nat.
174
,
755
-
768
.
Klein
,
M.
,
Afonso
,
B.
,
Vonner
,
A. J.
,
Hernandez-Nunez
,
L.
,
Berck
,
M.
,
Tabone
,
C. J.
,
Kane
,
E. A.
,
Pieribone
,
V. A.
,
Nitabach
,
M. N.
,
Cardona
,
A.
, et al. 
(
2014
).
Sensory determinants of behavioral dynamics in Drosophila thermotaxis
.
Proc. Natl. Acad. Sci. USA
112
,
E220
-
E229
.
Klepsatel
,
P.
,
Gálikova
,
M.
,
De Maio
,
N.
,
Huber
,
C. D.
,
Christian
,
S.
and
Flatt
,
T.
(
2013
).
Variation in thermal performance and reaction norms among populations of Drosophila melanogaster
.
Evolution
67
,
3573
-
3587
.
Lamaze
,
A.
,
Öztürk-çolak
,
A.
,
Fischer
,
R.
,
Peschel
,
N.
,
Koh
,
K.
and
Jepson
,
J. E. C.
(
2017
).
Regulation of sleep plasticity by a thermo-sensitive circuit in Drosophila
.
Sci. Rep.
7
,
40304
.
Latimer
,
C. A. L.
,
Mcguigan
,
K.
,
Wilson
,
R. S.
,
Blows
,
M. W.
and
Chenoweth
,
S. F.
(
2014
).
The contribution of spontaneous mutations to thermal sensitivity curve variation in Drosophila serrata
.
Evolution
68
,
1824
-
1837
.
Latimer
,
C. A. L.
,
Foley
,
B. R.
and
Chenoweth
,
S. F.
(
2015
).
Connecting thermal performance curve variation to the genotype : a multivariate QTL approach
.
J. Evol. Biol.
28
,
155
-
168
.
Lee
,
Y.
and
Montell
,
C.
(
2013
).
Drosophila TRPA1 functions in temperature control of circadian rhythm in pacemaker neurons
.
J. Neurosci.
33
,
6716
-
6725
.
Liu
,
W. W.
,
Mazor
,
O.
and
Wilson
,
R. I.
(
2015
).
Thermosensory processing in the Drosophila brain
.
Nature
519
,
353
-
357
.
Logan
,
J. A.
,
Wollkind
,
D. J.
,
Hoyt
,
S. C.
and
Tanigoshi
,
L. K.
(
1976
).
An analytic model for description of temperature dependent rate phenomena in arthropods
.
Environ. Entomol.
5
,
1133
-
1140
.
Lucas
,
B. D.
and
Kanade
,
T.
(
1981
).
Proceedings of the 7th International Joint Conference on Artificial Intelligence-Volume 2
.
An Iterative Image Registration Technique with an Application to Stereo Vision
, pp.
674
-
679
.
Luo
,
J.
,
Shen
,
W. L.
and
Montell
,
C.
(
2016
).
TRPA1 mediates sensation of the rate of temperature change in Drosophila larvae
.
Nat. Neurosci.
20
,
34
-
41
.
Martin
,
T. L.
and
Huey
,
R. B.
(
2008
).
Why “ suboptimal “ is optimal: Jensen's inequality and ectotherm thermal preferences
.
Am. Nat.
171
,
102
-
118
.
Meek
,
R.
(
2016
).
Reptiles, thermoregulation, and the environment
.
Testudo
4
,
56
-
78
.
Neely
,
G. G.
,
Keene
,
A. C.
,
Duchek
,
P.
,
Chang
,
E. C.
,
Wang
,
Q.-P.
,
Aksoy
,
Y. A.
,
Rosenzweig
,
M.
,
Costigan
,
M.
,
Woolf
,
C. J.
,
Garrity
,
P. A.
, et al. 
(
2011
).
TrpA1 regulates thermal nociception in Drosophila
.
PLoS ONE
6
,
e24343
.
Ni
,
L.
,
Bronk
,
P.
,
Chang
,
E. C.
,
Lowell
,
A. M.
,
Flam
,
J. O.
,
Panzano
,
V. C.
,
Theobald
,
D. L.
,
Griffith
,
L. C.
and
Garrity
,
P. A.
(
2013
).
A gustatory receptor paralogue controls rapid warmth avoidance in Drosophila
.
Nature
500
,
580
-
584
.
Purves
,
W. K.
,
Sadava
,
D.
,
Orians
,
G. H.
and
Heller
,
H. C.
(
2003
).
Endotherms and Ectotherms
. In
Life: The Science of Biology
(ed.
D.
Sadava
,
D. M.
Hillis
,
H. C.
Heller
and
M. R.
Berenbaum
), p.
788
.
Sunderland, MA
:
Sinauer Associates Inc
.
Roberts
,
S. P.
,
Marden
,
J. H.
and
Feder
,
M. E.
(
2003
).
Dropping like flies : Environmentally induced impairment and protection of locomotor performance in adult Drosophila melanogaster
.
Physiol. Biochem. Zool.
76
,
615
-
621
.
Roessingh
,
S.
and
Stanewsky
,
R.
(
2017
).
The Drosophila TRPA1 channel and neuronal circuits controlling rhythmic behaviours and sleep in response to environmental temperature
.
Int. J. Mol. Sci.
10
,
2028
.
Roessingh
,
S.
,
Wolfgang
,
W.
and
Stanewsky
,
R.
(
2015
).
Loss of Drosophila melanogaster TRPA1 function affects “ siesta “ behavior but not synchronization to temperature cycles
.
J. Biol. Rhythms
30
,
492
-
505
.
Rosten
,
E.
,
Porter
,
R.
and
Drummond
,
T.
(
2010
).
Faster and better: a machine learning approach to corner detection
.
Pattern Anal. Mach. Intell. IEEE Trans.
32
,
105
-
119
.
Sehadova
,
H.
,
Glaser
,
F. T.
,
Gentile
,
C.
,
Simoni
,
A.
,
Giesecke
,
A.
,
Albert
,
J. T.
and
Stanewsky
,
R.
(
2009
).
Temperature entrainment of Drosophila's circadian clock involves the gene nocte and signaling from peripheral sensory tissues to the brain
.
Neuron
64
,
251
-
266
.
Shi
,
J.
and
Tomasi
,
C.
(
1994
).
Good Features to Track
.
IEEE Conference on Computer Vision and Pattern Recognition
, pp.
593
-
600
.
Soriano
,
P. J.
,
Ruiz
,
A.
and
Arends
,
A.
(
2002
).
Physiological responses to ambient temperature manipulation by three species of bats from andean cloud forests
.
J. Mammal.
83
,
445
-
457
.
Stevenson
,
R. D.
(
1985
).
Body size and limits to the daily range of body temperature in terrestrial ectotherms
.
Am. Nat.
125
,
102
-
117
.
Symonds
,
M. R. E.
and
Moussalli
,
A.
(
2011
).
A brief guide to model selection, multimodel inference and model averaging in behavioural ecology using Akaike's information criterion
.
Behav. Ecol. Sociobiol.
65
,
13
-
21
.
Tang
,
X.
,
Platt
,
M. D.
,
Lagnese
,
C. M.
,
Leslie
,
J. R.
and
Hamada
,
F. N.
(
2013
).
Temperature integration at the AC thermosensory neurons in Drosophila
.
J. Neurosci.
33
,
894
-
901
.
Tang
,
X.
,
Roessingh
,
S.
,
Hayley
,
S. E.
,
Chu
,
M. L.
,
Tanaka
,
N. K.
,
Wolfgang
,
W.
,
Song
,
S.
,
Stanewsky
,
R.
and
Hamada
,
F. N.
(
2017
).
The role of PDF neurons in setting the preferred temperature before dawn in Drosophila
.
Elife
6
,
e23206
.
Tomasi
,
C.
and
Kanade
,
T.
(
1991
).
Detection and tracking of point features
.
Int. J. Comput. Vis.
1
-
20
.
Wolfgang
,
W.
,
Simoni
,
A.
,
Gentile
,
C.
and
Stanewsky
,
R.
(
2013
).
The Pyrexia transient receptor potential channel mediates circadian clock synchronization to low temperature cycles in Drosophila melanogaster
.
Proc. R. Soc. B
280
,
20130959
.
Yoshii
,
T.
,
Vanin
,
S.
,
Costa
,
R.
and
Helfrich-Förster
,
C.
(
2009
).
Synergic entrainment of Drosophila's circadian clock by light and temperature
.
J. Biol. Rhythms
24
,
452
-
464
.
Yoshii
,
T.
,
Hermann-Luibl
,
C.
,
Kistenpfennig
,
C.
,
Schmid
,
B.
,
Tomioka
,
K.
and
Helfrich-Förster
,
C.
(
2015
).
Cryptochrome-dependent and -independent circadian entrainment circuits in Drosophila
.
J. Neurosci.
35
,
6131
-
6141
.
Zhong
,
L.
,
Bellemer
,
A.
,
Yan
,
H.
,
Honjo
,
K.
,
Robertson
,
J.
,
Hwang
,
R. Y.
,
Pitt
,
G. S.
and
Tracey
,
W. D.
(
2012
).
Thermosensory and non-thermosensory isoforms of Drosophila melanogaster TRPA1 reveal heat sensor domains of a thermoTRP channel
.
Cell Rep.
1
,
43
-
55
.

Competing interests

The authors declare no competing or financial interests.

Supplementary information