A value-based behavioural choice underlies phototaxis in Drosophila

Like a moth into the flame ­ phototaxis is commonly thought of as the iconic example of hard­wired input­output relationships in insect brains. Perhaps therefore, the century­old discovery of flexibility in ​Drosophila ​phototaxis has received little attention. Here we report that across several different behavioural tests, light/dark preference is dependent on the flies’ ability to fly. If we temporarily compromise flying ability, phototaxis reverses concomitantly. Neuronal activity in circuits expressing dopamine and octopamine, respectively, plays a differential role in this case of behavioral flexibility. We conclude that flies constantly monitor their ability to fly, and that flying ability exerts a fundamental effect on action selection in ​Drosophila​ . This work suggests that even behaviours which appear simple and hard­wired comprise a value­driven decision­making stage, negotiating external stimuli with the animal’s internal state, before an action is selected. Introduction In their struggle for survival, animals need not just the capability to trigger behaviours at the appropriate time, but these behaviours need to be flexible in response to or anticipation of changes in environmental and internal conditions. What may be an appropriate response to a given stimulus when the animal is hungry may be maladaptive when the animal is seeking a mating partner, and ​vice versa​. The value of extrinsic and intrinsic factors must be analysed in order to shape the behaviour to be adaptive in a particular situation. Across animal phyla, biogenic amines have been shown to be part of a complex network involved in such value­driven processes. In invertebrates, Dopamine (DA) and Octopamine (OA) are two important modulators of behaviour. OA, the invertebrate counterpart of the adrenergic vertebrate system, has been implicated in state­dependent changes in visual­processing ​ , experience­dependent modulation of aggression ​ , social decision­making ​ , and reward ​ . DA is also known for its countless roles in physiological and behavioural processes across animal phyla such as reward ​ , motivation ​ and value­based or goal­directed decision­making ​ . Complementing such flexible behaviors are simple, innate responses such as escape responses, taxis/kinesis behaviors, or fixed action patterns. They are commonly thought to be less flexible and more automatic, but with the advantage of either being especially efficient, fast, or with only a low cognitive demand. However, recent research has shown that many of these behaviors are either more complex than initially imagined ​ or liable to exploitation ​ . Due to observations like these, the general concept of behaviors as responses to external stimuli . CC-BY 4.0 International license peer-reviewed) is the author/funder. It is made available under a The copyright holder for this preprint (which was not . http://dx.doi.org/10.1101/023846 doi: bioRxiv preprint first posted online Aug. 3, 2015;


Introduction
In their struggle for survival, animals need not just the capability to trigger behaviours at the appropriate time, but these behaviours need to be flexible in response to or anticipation of changes in environmental and internal conditions. What may be an appropriate response to a given stimulus when the animal is hungry may be maladaptive when the animal is seeking a mating partner, and vice versa . The value of extrinsic and intrinsic factors must be analysed in order to shape the behaviour to be adaptive in a particular situation. Across animal phyla, biogenic amines have been shown to be part of a complex network involved in such valuedriven processes. In invertebrates, Dopamine (DA) and Octopamine (OA) are two important modulators of behaviour. OA, the invertebrate counterpart of the adrenergic vertebrate system, has been implicated in statedependent changes in visualprocessing 1,2 , experiencedependent modulation of aggression 3 , social decisionmaking 4 , and reward 5 . DA is also known for its countless roles in physiological and behavioural processes across animal phyla such as reward [5][6][7] , motivation 8,9 and valuebased or goaldirected decisionmaking 8,[10][11][12][13][14] .
Complementing such flexible behaviors are simple, innate responses such as escape responses, taxis/kinesis behaviors, or fixed action patterns. They are commonly thought to be less flexible and more automatic, but with the advantage of either being especially efficient, fast, or with only a low cognitive demand. However, recent research has shown that many of these behaviors are either more complex than initially imagined [15][16][17][18] or liable to exploitation 19 . Due to observations like these, the general concept of behaviors as responses to external stimuli . CC-BY 4.0 International license peer-reviewed) is the author/funder. It is made available under a The copyright holder for this preprint (which was not . http://dx.doi.org/10.1101/023846 doi: bioRxiv preprint first posted online Aug. 3, 2015; ('sensorimotor hypothesis') has come under ever more critical scrutiny in the last decade.
Studying what can arguably be perceived as the most iconoclastic of stereotypic insect responses, the approach of a bright light (phototaxis), we provide evidence that the simple inputoutput relationships long assumed to underlie most if not all behaviors, may not even exist.
Drosophila melanogaster phototactic behaviour has been studied for at least one hundred years. As most flying insects, flies move towards a light source after being startled, showing positive phototaxis. Interestingly, experiments described by McEwen in 1918 and Benzer in 1967 demonstrated that wing defects affect phototaxis in walking flies. These early works showed that flies with clipped wings did not display the phototactic response to light, whereas cutting the wings from mutants with deformed wings did not decrease their already low response to light 20,21 . The fact that manipulating an unrelated organ, such as wings, affects positive phototaxis contradicts the assumed hardwired organisation of this behaviour, suggesting that it may not be a simple matter of stimulus and rigid, innate response, but that it contains at least a certain element of flexibility.
In this work, we systematically address the factors involved in this behavioral flexibility and begin to explore the neurobiological mechanisms behind it. Data from experiments with mechanical and genetic manipulations of flying ability suggest that flies are constantly monitoring their flying capability and adjust their phototactic preference accordingly. Consistent with the hypothesis that phototaxis is an inherently value driven decisionmaking process, we found that the neuromodulators DA and OA are implicated in this adjustment of phototactic preference with distinctive roles in different conditions. Our results demonstrate that even such a straightforward 'response' as insect phototaxis is not a reflexlike reaction to a stimulus, but rather a more complex decisionmaking process involving the concurrent valuation of internal state (or goal) and external stimuli. the published observations, the three lines showed a significant reduction in BCP performance index (PI) when the wings were cut (Fig. 1a). This reduction was apparent despite large variations between the three lines in the PI levels from intact flies, showing that the reduction in phototaxis due to wingclipping is independent from wild type genetic background and associated differences in baseline levels of performance.
Original experiments from McEwen, and then Benzer, showed that mutant flies with deformed wings displayed a lower positive phototaxis than wild types 20,21 and a diminished wingclipping effect 21 . We wondered whether this simultaneous low phototaxis and absence of wingclipping effect was due to a specific effect of these mutations or a general consequence of both manipulations altering the flies' ability to fly. In order to answer this question we tested three lines with flight impairments, the flightless PKC Δ mutant, the wings of which are indistinguishable from wild type wings (Fig S1), the CyO balancer line with curly wings, and a transgenic line in which the wings were deformed due to an overexpression of a constitutively active form of the baboon receptor in wing imaginal discs ( A9>babo QD , 22 ). Again replicating previous experiments, CyO flies showed a reduced PI that remained unchanged in wingclipped animals (Fig. 1a).
Similarly, A9>babo QD showed less attraction to light and no significant wingclipping effect (Fig.   1b), while all genetic controls behaved similar to wild type flies. Remarkably, PKC Δ mutants exhibited the same behavioural characteristics as CyO flies (Fig. 1a). Hence, we conclude that the reduction in phototaxis is not dependent on the origin of wing damage or the damage itself, but probably to wing utility.

The behavioural change is immediate
If flies were constantly monitoring their flying ability, wingclipping should have an almost instantaneous effect on the behaviour. Thus, to find out when the behavioural switch takes place, we assessed wingclipped WTB flies at different time points after the injury was made.
Flies from different groups were tested either 3 weeks, 24h, 3h, 30min, 5min or immediately after the surgery. To diminish the effects of anaesthesia on phototactic behaviour 23 , we only used CO 2 anaesthesia for recovery times longer than 30min, and cold anaesthesia for 0 and 5min recoveries. We found that the PI reduction could be observed in all tested groups (Fig. 1c).
Moreover, the difference between intact and clipped flies increased with longer recovery phases, probably due to the vanishing of the anaesthesia effect, only to decrease again in aged flies, perhaps due to a combination of a deteriorated locomotor activity and a decreased response to light in old flies 24,25 . Even if flies were placed in BCP right after surgery and let to recover from anaesthesia only during the acclimation phase (0min group), it was possible to see . CC-BY 4.0 International license peer-reviewed) is the author/funder. It is made available under a The copyright holder for this preprint (which was not . http://dx.doi.org/10.1101/023846 doi: bioRxiv preprint first posted online Aug. 3, 2015; a significant decrease in the phototactic response. These results are consistent with the hypothesis that flies continually monitor their ability to fly.

Wingless flies become negatively phototactic
One hypothetical evolutionary explanation for the reduced phototaxis is that flies unable to fly may gain an advantage from hiding from predators, rather than to seek, in vain, to escape by flight. One prediction of this hypothesis is that the flightless flies should exhibit negative . CC-BY 4.0 International license peer-reviewed) is the author/funder. It is made available under a The copyright holder for this preprint (which was not . http://dx.doi.org/10.1101/023846 doi: bioRxiv preprint first posted online Aug. 3, 2015; phototactic behaviour, when given the choice between a bright and a dark location. To test this hypothesis, we used a TMaze to study choice behavior in flightless and flying flies. In the Tmaze, flies were allowed to choose between a bright or a dark tube, respectively. As in BCP, we selected different recovery times (0min, 5min or 24h). As predicted, intact flies showed a positive phototactic Choice Index (CI), while wingclipped flies switched to negative phototaxis immediately after their wings were cut (Fig. 1d). We conclude that the wingclipping effect on phototaxis is not just a decrease in the response towards light as proposed by McEwen (1918), but instead comprises a more radical change in the behaviour: flightless flies actively avoid brightness, having reversed their light/dark preference.

Only injuries affecting flight ability promote a behavioural switch
To further confirm that the switch in light/dark preference was in fact affected by the lack of flying ability, we tested the effects of a series of injuries ( Supplementary Fig. 1 During our pilot experiments, we observed that flies with different degrees of injuries on their wings behaved differently. Therefore, we hypothesized that winginjuries with a smaller impact on flight would lead to less pronounced behavioural changes. Thus, we next compared the phototactic behaviour of flies, whose wings were completely removed, with those with only the end of the wings cut ( Supplementary Fig. 1). It is worth to mention that McEwen also attempted to test if the decrease in positive phototaxis was directly proportional to the amount of wing removed, but the lower number of replicates, the use of ether as an anaesthetic, and a different setup, prompted us to obtain our own data (the same is true for antenna experiments -see below).
Remarkably, in both cases, injured flies showed a statistically significant reduction in PI and CI, but both indexes were higher in flies with only the end of the wing cut (Fig. 2e,f). In fact, the behaviour from both types of injured flies was significantly different in the TMaze paradigm ( Fig   2f). Therefore, we conclude that behavioural change depends on the degree of the injury, and how much it affects flying ability.
. CC-BY 4.0 International license peer-reviewed) is the author/funder. It is made available under a The copyright holder for this preprint (which was not . http://dx.doi.org/10.1101/023846 doi: bioRxiv preprint first posted online Aug. 3, 2015; So far, all injuries tested affected the wings. Hence, to test if the behavioural switch is dependent on flight ability and not on injury in general, we administered injuries that did not affect the wings, in two organs related to flight (halteres and antennae) and one unrelated to flight (the abdomen). In one group of flies the halteres were removed, in another the distal segments of the antennae (funiculus and arista), while a small needle was used to carefully puncture the abdomen of the flies belonging to a third group ( Supplementary Fig. 2). Consistent with our hypothesis, only injuries affecting flying ability led to a switch in phototactic behaviour ( Fig. 2gj), while a wound in the abdomen did not produce any detectable phototactic modification (Fig. 2k,l).   The phototactic switch is fully reversible and traces flying ability.
If flies were constantly monitoring their flying ability and changing their phototactic behaviour accordingly, one would expect that transient impairments in flying ability would cause transient changes in phototactic preference. To examine the reversibility of the behavioural switch, we designed two complementary experiments. In the first, we tested WTB flies in BCP and TMaze before and after gluing, as well as after ungluing their wings. Wing gluing perfectly reproduced the wingclipping effect, evidenced by a clear reduction of the PI and CI (Fig. 3a,b), showing again that the phototactic switch is independent from the cause of the flightlessness.
Remarkably, positive phototaxis was completely restored after cleaning the wings of the tested flies ( Fig. 3a,b).
In our complementary approach we manipulated flying ability by reversibly altering Indirect Flight Muscle (IFM) contraction, expressing the temperaturesensitive TrpA1 channel under the promoter of the IFMspecific gene actin 88F ( act88F ), using the act88F GAL4 26 driver. At room temperature, experimental flies tested in a TMaze were indistinguishable from their genetic controls. However, at 37°C, when TrpA1 caused a sustained IFM contraction disrupting wing movements, the same flies showed a marked negative phototaxis that fully recovered when they were tested back at room temperature on the following day (Fig. 3c). It is worth to mention that genetic controls also showed a CI decrease at 37°C, but it was less pronounced and significantly different from the experimental group. In sum, these results show that flies adjust their phototactic behaviour in accordance with their flying ability. Moreover, these changes are immediate and fully reversible.

Black stripe fixation in Buridan's Paradigm is influenced by flight ability
Our phototaxis experiments may be interpreted as a specific instantiation of a measurement of the flies' more general preference for bright vs. dark objects or places. To test this interpretation, we compared intact and wingless flies from three lines ( WTB , CyO , PKC Δ ) in a modified version of Buridan's paradigm 27,28 , where a roof prevents flies from escaping. In this experiment, flies . CC-BY 4.0 International license peer-reviewed) is the author/funder. It is made available under a The copyright holder for this preprint (which was not . http://dx.doi.org/10.1101/023846 doi: bioRxiv preprint first posted online Aug. 3, 2015; walk on a watersurrounded circular platform with two opposing vertical black stripes on the walls of a round panorama illuminated in bright white light from behind. Interestingly, paralleling the BCP and TMaze experiments, WTB flies with clipped wings showed a stronger fixation of the black stripes than flies with intact wings (Fig. 4a). Moreover, wingclipping of flightless CyO mutants did not show an effect in this paradigm (Fig. 4a). Similarly, wing clipping effect was also absent in PKC Δ mutants. However, the behavior of intact and clipped PKC Δ flies, was indistinguishable from a random walk, perhaps due to the many roles of PKC . Nevertheless, these results imply that phototaxis assays may be specific instances where flies can exhibit their light/dark preference, rather than a case where flies respond to packets of light reaching their retinae with an innate approach.

Wingclipping effect is not related to memory and learning processes
An alternative hypothesis to a constant monitoring of flying ability, may be a nearinstantaneous learning mechanism by which the animals attempt flight and immediately learn about the futility of their attempt. To test this hypothesis, we screened a selection of mutant/transgenic fly lines with a variety of known learning and memory impairments using BCP. We selected lines known to affect classical olfactory conditioning/operant worldlearning, operant selflearning, or any other Mushroom Bodydependent learning processes. In order to avoid differences related to specific locomotor characteristics from the different lines, the wingclipping effect was assessed as the proportion of behavioural change and a Change Index was computed (see Materials and Methods). Remarkably, all lines tested showed a clear behavioural change after wingclipping, evidenced by a decrease in their PI of around 50%, irrespective of the baseline value (Fig. 4b).
While we cannot rule out that an unknown learning mechanism exists which is unaccounted for in our screen, we conclude that at least none of the known learning mechanisms suffices to explain the behavioral switch after wingclipping. These results corroborate the findings above, that the switch is instantaneous and does not require thorough training or learning from repeated attempts to fly.

The behavioural switch is not central complexdependent
The central complex is a higherorder neuropil related to locomotion 29,30 , visual information processing 31 , orientation 32 , visual pattern 33,34 and spatial working memory 35 . As many of these functions may be important for either phototaxis or its flexibility, we tested two structural mutants of this neuropil, Central Body Defect ( cbd 762 ) and Ellipsoid Body Open ( ebo 678 ). However, wingclipped cbd 762 as well as ebo 678 flies both showed a clear significant change in their . CC-BY 4.0 International license peer-reviewed) is the author/funder. It is made available under a The copyright holder for this preprint (which was not . http://dx.doi.org/10.1101/023846 doi: bioRxiv preprint first posted online Aug. 3, 2015; phototactic preference measured either in BCP or TMaze (Fig. 4c,d). It is worth to mention that, although ebo 678 wingless flies still showed a positive phototaxis, their PI was dramatically decreased in comparison with intact ebo 678 flies. Hence, if the central complex plays a role in this process, it is likely not a crucial one.

DA and OA differently modulate intact and wingless fly behaviour
Biogenic amines have long been known for their role in mediating the processing and assignment of value 4,[9][10][11][12]14,[36][37][38][39][40][41][42][43] . If indeed it is the preference of light vs. dark that is switched when a fly's flying ability is altered, it is straightforward to hypothesize that the two biogenic amines involved in valuation in Drosophila , octopamine (OA) and dopamine (DA), are involved also in this instance of valuebased decisionmaking as well. Moreover, flies depleted of DA show reduced phototaxis in BCP 42 further motivating the manipulation of this amine pathway.
Finally, flies without OA show a pronounced impairment in flight performance and maintenance 44 , making OA an interesting candidate for phototaxis as well.
To evaluate the involvement of DA and OA for phototaxis, we acutely disrupted synaptic output from two separate groups of neurons by expressing the temperaturesensitive form of dynamin ( Shibire; shi TS , 45 ) either under control of the th GAL4 driver (driving in dopaminergic neurons) or under control of the tdc2 GAL4 driver (driving in octopaminergic, as well as tyraminergic, neurons). We tested the resulting transgenic flies with and without wings in BCP and TMaze.
Although BCP and TMaze results tended to agree, we only obtained clear results in our TMaze experiments. We found a genotypeindependent and longlasting effect of temperature switch on the flies' PI in the BCP. Hence, we show results from TMaze here and the BCP results in the supplementary information. In the TMaze at permissive room temperature, when dynamin is in its wild type conformation, in all tested groups, flies with intact wings showed positive phototaxis, while wingclipped flies showed negative phototaxis (Fig. 5a,b). In contrast, when the same experiment was performed at the restrictive 32°C (i.e, blocking synaptic activity), we found opposite effects in flies with dopaminergic, and octopaminergic/tyraminergic neurons blocked, respectively. While disrupting synaptic output from dopaminergic neurons appeared to have little if any effect on clipped animals, flies with intact wings became negatively phototactic (Fig. 5a). Conversely, blocking synaptic output from octopaminergic neurons only affects wingless flies, which now preferred the bright arm of the maze (Fig. 5b). Replicating the reversibility described above, after a 24h recovery phase, flies tested at room temperature showed wild type behavior, meaning positive phototaxis for intact flies and negative phototaxis for wingclipped flies (Fig. 5a,b). The conventional interpretation of these results is that synaptic   We also transiently activated OA/TA and DA neurons, respectively, using the temperature sensitive TrpA1 channel 46 , while testing the flies for their light/dark preference. Again, at room temperature, when the channel is closed, flies with and without wings behaved similar to wild type animals (Fig. 5c,d). However, when tested in the same experiment at 32°C, where the TrpA1 channel is open and depolarizes the neurons in which it is expressed, the flies showed a change in their behaviour. Flies with clipped wings and activated DA neurons now preferred the bright arm of the maze, with no effect on intact flies (Fig. 5d). Conversely, activating OA/TA neurons only had an effect on flies with intact wings, which now chose the dark arm of the maze, while no effect could be observed in wingclipped flies (Fig. 5c). Again, when tested back at room temperature 24h later, wild type behaviour was restored. The conventional interpretation of these results is that active OA/TA neurons are sufficient for negative phototaxis, while the activation of DA neurons is sufficient for positive phototaxis.
In summary, we conclude from our data that flies constantly monitor their flying ability and changes in it have a broad impact on the flies' valuation of external stimuli, specifically brightness and darkness. This valuation process appears to be mediated by a concerted action of octopaminergic/tyraminergic and dopaminergic circuits.

Discussion
McEwen's discovery captured our attention because of its implications for the supposed rigidity of simple behaviors in simple animals. We designed our experiments with the intent to test various hypotheses potentially explaining the reduction in phototaxis observed by McEwen. A straightforward explanation for a lower response to light are unspecific motor deficits in the flightless flies. However, flightless flies actively move towards darkness in the TMaze experiments (Fig. 1d). We also excluded that the effect may only be a peculiar deficit in a particular strain of Drosophila , as the wingclipping effect was present in all control lines tested in the different experiments. Another hypothesis was that injury may trigger negative phototaxis as a general escape response to bodily harm. This explanation appears unlikely, as flies with injured abdomen show intact phototaxis (Fig. 2). In this respect, it is worth to mention that removing the halteres seemed to have a greater effect than damaging the antennae. This difference may be explained by their respective roles during flight. Halteres are comparable to biological gyroscopes and are important for rapid flying manoeuvres [47][48][49] , while antennae contain mechanoreceptors, whose information, combined with visual information, is important . CC-BY 4.0 International license peer-reviewed) is the author/funder. It is made available under a The copyright holder for this preprint (which was not . http://dx.doi.org/10.1101/023846 doi: bioRxiv preprint first posted online Aug. 3, 2015; for visuallyguided steering and achieving a stable flight speed 50,51 . Moreover, even without injury, flightless flies show negative phototaxis, irrespective of the method used to render them flightless (Figs. 1a, b, 3, 5). We can also exclude that the trauma of manipulating the flies triggered a persistent shockresponse, as the effect is reversible (Fig. 3). It also seems unlikely that damage to or removal of the sensory organs in the wings directly triggers negative phototaxis, as flies still change their light/dark preference even in our experiments where the wings remained intact (Fig. 3). We also tentatively conclude that the process does not require any of the known learning processes (Fig. 4b) and is (near) instantaneous (Fig. 1c, d). The observation that none of our hypotheses withstood our experimental tests together with the double dissociation of two neuromodulators known for their involvement in valuation on phototaxis, prompted our current hypothesis that a valuebased decisionmaking process underlies phototaxis in Drosophila (more information in supplementary discussion). This conclusion extends and corroborates recent evidence raising doubts as to the general validity of the sensorimotor hypothesis 38,52,53 . WTB is a Wildtype Berlin strain from our stock in Regensburg.

Strains and fly rearing.
CS RE is a CS strain bred in our lab in Regensburg.    The copyright holder for this preprint (which was not . http://dx.doi.org/10.1101/023846 doi: bioRxiv preprint first posted online Aug. 3, 2015; A9GAL4 and UASbaboo QD were provided by Florian Bayersdorfer (University of Regensburg, Germany).

Wing clipping
Unless described otherwise, 24h before the experiment 25 d old flies were briefly anesthetized under CO 2 , and the distal two thirds from both wings were clipped from half of the individuals. At least 30 flies with clipped wings and 30 flies with intact wings were placed in the same vial until the experiment was performed, in which they were tested together.

Wing gluing
Flies were cold anesthetized using a custom made cold air station and their wings were glued together in their natural relaxed posture using a 3M sucrose solution. To unglue the wings flies were cold anesthetized and their abdomen gently submerged in water to dissolve the sucrose.
After each process flies were left to recover overnight. Flies were discarded from the analysis if their wings were damaged because of the treatments or unglued by chance.

Antennal damage, Halteres removal, and Abdominal Injury
Flies (25d old) were anesthetized with CO2 and one of the different treatments (see supplementary Fig. 2) was applied to half of them. At least sixty flies (half of them with injury) were placed in vials for 24h recovery and tested together. Flies with abdominal injury were not mixed with intact flies to avoid mistakes during the evaluation of the experiment due to the inconspicuous nature of the injury.
Halteres removal was performed by removing each haltere with forceps, while the antennal damage was produced by clipping the third segment of the antenna (funiculus). The abdominal injury was performed with a sharpened needle, and was always made ventrally in one side of the fourth abdominal segment.

Countercurrent Apparatus
Phototactic preference was evaluated using Benzer's Countercurrent Apparatus 20 . The test group was placed in the initial tube and was left to acclimate for 10 min. Thereafter, flies were startled by tapping the apparatus, making all of them end up at the bottom of the tube. The apparatus was placed horizontally and the initial tube faced the first test tube for 15 seconds, allowing the flies to move towards the light if the test tube was facing it, or away from it if the initial tube was facing the light. Flies that moved to the test tube were transferred to the next tube, and the same test was repeated 4 more times. The Preference Index was calculated using the formula: . CC-BY 4.0 International license peer-reviewed) is the author/funder. It is made available under a The copyright holder for this preprint (which was not . http://dx.doi.org/10.1101/023846 doi: bioRxiv preprint first posted online Aug. 3, 2015; where was the number of flies in the tube n (being 0 the initial tube and 5 the last test tube), and was the total number of flies. If the test tubes were on the bright side a higher index meant a more positive phototaxis. In each experiment a PI was calculated for the wingless flies and other for the intact flies. The tubes were cleaned thoroughly after each test.
The change index in figure 4b was calculated as the proportion of change in the PI between flies with and without wings: 1 (PI clipped /PI intact ).

TMaze
Light/Darkness choice was measured in a custom build PVC opaque TMaze with only one transparent choice tube (acrylic). Flies were placed in an initial dark tube and were left to dark adapt for 10 min. Then, they were transferred to the elevator chamber by gently tapping the apparatus, where they remained for 30s. Next, the elevator was placed between the dark and the bright tube, and flies were allowed to choose for 30s.

Buridan
Locomotion towards dark objects was evaluated using Buridan's paradigm as explained in 28 .
Briefly, 36d old flies were selected and half of them had their wings clipped under CO 2 anaesthesia. They were left to recover overnight within individual containers, with access to water and sugar (local store) before being transferred to the experimental setup. The setup consists of a round platform (117 mm in diameter) surrounded by a waterfilled moat placed at the bottom of a uniformly illuminated white cylinder (313 mm in height) with 2 stripes of black cardboard (30mm wide, 313 mm high and 1 mm thick) placed 148.5 cm from the platform center one in front of the other. Flies were prevented from escaping by a transparent lid over the platform. The experiment duration was set to 900 seconds. Data were analysed using BuriTrack and CeTrAn 28 , both available at http://buridan.sourceforge.net .

Genetic manipulation of flying ability and neuronal activity
For the experiments involving TrpA1 and the act88fGAL4 driver, experimental flies and their respective controls were raised at 18°C. Three to five days old flies were tested at room temperature (RT) and recovered for 56h at 18°C. Then, they were transferred to 37°C climate room where they were placed in an acclimation vial for 15min. Next they were transferred to the . CC-BY 4.0 International license peer-reviewed) is the author/funder. It is made available under a The copyright holder for this preprint (which was not . http://dx.doi.org/10.1101/023846 doi: bioRxiv preprint first posted online Aug. 3, 2015; first tube from a Tmaze placed in the 37°C climate room, and the experiment proceeded as explained above. The choice step was reduced to 15s to compensate the increased activity that flies showed in pilot experiments. After counting the flies, they were transferred to fresh vials and placed at 18°C for 24h. After this recovery phase they were tested again at RT.
In the case of manipulation of dopaminergic or octopaminergic neural activity with Shi TS or TrpA1 the same protocol was applied but instead of 37°C, 32°C were used and the choice step was 30s long.

Statistical Analysis
Statistical analyses were performed with InfoStat, version 2013 (Grupo InfoStat, Facultad de Ciencias Agropecuarias, Universidad Nacional de Córdoba, Córdoba, Argentina) and R ( http://www.rproject.org/ ). Number of replicates in each experiments were adjusted to provide a statistical power of at least 80% using pilot experiments. As dictated by the experimental design and data composition, a paired Ttest, a Randomized Block Design ANOVA or an ANOVA were performed. Normality was tested using Shapiro-Wilks test, and the homogeneity of variance was assessed with Levene's test. A value of p<0.05 was considered statistically significant.
After ANOVA, a Tukey leastsignificant difference or an orthogonal contrasts test was performed. If an interaction between factors was significant in twoway ANOVAs, simple effects were performed, and p values were informed. In figure 5c and d, homogeneity of variance was violated and a KruskalWallis test was employed for multiple comparisons. The alpha value was corrected using Bonferroni's correction.

Supplementary Discussion
Today, it is widely acknowledged that the human brain is constantly active with external stimuli exerting only a modulatory effect (see, e.g., 1 ). Also in invertebrates, the appeal of simple inputoutput concepts is now rapidly waning, despite already studying seemingly simple behaviors. Mechanosensory input, otherwise reliably triggering escape responses in leeches, ceases to be followed by a response when the feeding animal releases serotonin, blocking sensory transmission from the mechanosensory neurons 2 . Optomotor responses in flies, among the most reliably reproducible behaviors in animals, can vary in amplitude up to 40 fold, depending on state of the animal being either quiescent, walking or flying; the mechanisms of this modulation can be traced all the way from the sensory pathway to motor neurons and involve OA [3][4][5][6][7][8] . With such a multitude of aminecontrolled complex negotiation processes even in relatively simple behaviors in relatively simple nervous systems, can one find even simpler behaviors to search for stimulusresponse relationships? Moreover, in these previous preparations, the response was found to be only modulated in magnitude but not in its valence.
Perhaps biogenic amines only modulate the strength of the stimulusresponse coupling in these animals, leaving the concept essentially intact?
Arguably, moving towards the light might be ranked among the least complex of behaviors, as plants manage phototropism without a nervous system and the larvae of the marine polychaete worm Platynereis show positive phototaxis with neither brain nor even inter or motor neurons 9 .
In insects, a positive phototactic response quickly becomes maladaptive in the case of the candle or street light at night or when the animal is trapped at a tilted window, intuitively suggesting a hardwired connection between light and approach. On the other hand, McEwen's and Benzer's observations about the impact of wing condition on Drosophila phototaxis, provided evidence that even this simple innate behaviour may be more than just a hardwired response. Our experiments showed that manipulating the ability to fly reversibly alters the flies' preference of light vs. dark not only in magnitude, but also in valence, and imply that the . CC-BY 4.0 International license peer-reviewed) is the author/funder. It is made available under a The copyright holder for this preprint (which was not . http://dx.doi.org/10.1101/023846 doi: bioRxiv preprint first posted online Aug. 3, 2015; biogenic amines DA and OA/TA are necessary and sufficient for the modulation of this preference. From these results, it is tempting to generalize that the internal state of an organism always modulates action selection, primarily via the action of biogenic amines, irrespective of the apparent complexity or simplicity of the task. Nevertheless, it is still prudent to attempt to discuss our results with respect to the traditional stimulusresponse perspective. In its conceptually simplest form, the phototactic sensorimotor pathway may be switched between light triggering attraction (positive phototaxis) or aversion reflexive and an active concept of brain function (e.g., 1 ), onto an active concept. Interestingly, a recent report from a model organism whose connectome is dominated by feedforward connections, the nematode worm C. elegans , found that olfactory stimuli only modulate ongoing ON/OFF fluctuations in a circuit controlling reversal behavior even in this animal with its mere 302 neurons 11 .
. CC-BY 4.0 International license peer-reviewed) is the author/funder. It is made available under a The copyright holder for this preprint (which was not . http://dx.doi.org/10.1101/023846 doi: bioRxiv preprint first posted online Aug. 3, 2015; Therefore, it is both conservative and consequential to discuss our results in terms of insect phototaxis being part of a spectrum of actions, selected after a central decisionmaking stage.
Moreover, both OA and DA action is associated with decisionmaking mechanisms 12-14 as well as statedependent changes 7,14-17 . There is also an extensive literature on the role of biogenic amines in valuebased decisionmaking 2,12,13,15,[18][19][20][21][22][23][24][25][26][27] . Our results that output from OA/TA and DA neurons, respectively, appears to be sufficient and necessary for phototaxis provide independent evidence that phototaxis involves a decisionmaking step, above and beyond the experiments where flying ability was manipulated by various means. Curiously, the function of these circuits appears to lie in their tonic, rather than their phasic firing properties: constant activation of these neurons throughout the testphase caused the behavioral shift, irrespective of where the animal was looking. However, while it has been shown that neurons fire action potentials when trpA1 is activated, without recording from these neurons during the behavior, it cannot be excluded that the depolarization only serves to cancel out strong tonic inhibition. Therefore, we are currently designing single animal experiments where such recordings can be performed. It is tempting to predict that the tonic activity in the respective OA/TA and DA subpopulations will show spontaneous fluctuations which predict phototactic choice in individual flies.
Interestingly, DA and OA/TA seem to be necessary and sufficient eac 28 h for a different aspect of the behaviour. Our results indicate that, while OA/TA is necessary and sufficient for shifting the light/dark preference away from light, DA is necessary and sufficient for shifting it towards light, compared to the respective opposite state. This finding complements emerging evidence currently revising the initial hypothesis that DA mediated aversive value while OA mediated attractive value. Instead, both seem to be involved in mediating certain aspects of value albeit in different modalities or domains. According to this most recent literature, OA mediates the attractive value of sweet taste 29,30 , while DA mediates the attractive value of sugar reinforcement 31,32 and the aversive value of electric shock 33 . In binary choice situations like the . CC-BY 4.0 International license peer-reviewed) is the author/funder. It is made available under a The copyright holder for this preprint (which was not . http://dx.doi.org/10.1101/023846 doi: bioRxiv preprint first posted online Aug. 3, 2015; TMaze, it is impossible to know which is the driving force, attraction, aversion or both. Hence, we do not yet know the precise role DA and OA play in mediating the attractive and aversive values of bright or dark situations. After wing injury, the capability of flies to escape from a potential risk is drastically reduced. A new strategy is needed in order to survive. It is tempting to interpret that the observed change in light preference is reflecting the necessity of the fly to hide until the danger goes away or the flying ability returns (e.g., Fig. 3). This flexibility could be explained in terms of changes in outcome expectations 34 . For diurnal flying insects, light probably represents the possibility of finding food, a mate, and freedom, without entirely ruling out the danger of being caught by a predator. When flying ability is compromised, the value of the different consequences of moving towards light changes and the dangers become more prominent due to the difficulties to escape, hence the flies choose to hide. In this view, the alteration in flying ability promotes a shift in the outcome expectation, which finally drives the selection of an alternative, more adaptive action. The observation that each fly, when it is freshly eclosed from the pupal case and the wings are not yet expanded, goes through a phase of reduced phototaxis until its wings render it capable of flying 35 , supports such an adaptive interpretation of this behavioral flexibility.
In addition to developmental reversals of phototaxis 35 , parasitism is also wellknown to alter phototactic behavior of arthropods (e.g., [36][37][38][39]. The amino acid precursor of both DA and OA, Tyrosine, was found to be associated with nematomorph parasite infection in crickets 37 .
Conspicuously, parasite infection appears to reverse the normally negative phototaxis in these crickets. While OA was not tested, DA did not show any difference in infected, vs. noninfected animals. It is thus conceivable that manipulation of host OA signalling by the parasite is one mechanism by which the parasite is altering host phototaxis behavior. Similarly, in crustaceans, administering another biogenic amine, Serotonin, was found to reverse phototaxis 37 .
. CC-BY 4.0 International license peer-reviewed) is the author/funder. It is made available under a The copyright holder for this preprint (which was not . http://dx.doi.org/10.1101/023846 doi: bioRxiv preprint first posted online Aug. 3, 2015; Regardless of the theoretical context within which the behavioural flexibility may be discussed, our findings demonstrate that even innate preferences, such as phototaxis, are not completely hardwired, and depend on the animal's state and other factors. This gives the animal the possibility to decide, for example, when it is better to move towards the light or hide in the shadows. Moreover, the fact that flies adapt their phototactic choice behaviour in accordance with their flying ability shows that flies have the cognitive tools required to evaluate the capability to perform an action and to let that evaluation impact other actions an observation reminiscent of metacognition.