bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

1 Localized inhibition in the Drosophila mushroom body 2 3 Hoger Amin1, Raquel Suárez-Grimalt1,3, Eleftheria Vrontou2, and Andrew C. Lin1* 4 5 1 Department of Biomedical Science, University of Sheffield, Firth Court, Western 6 Bank, Sheffield S10 2TN, United Kingdom 7 2 Centre for Neural Circuits and Behaviour, University of Oxford, Tinsley Building, 8 Mansfield Road, Oxford OX1 3SR, United Kingdom 9 3 Present address: Institute of Neurophysiology, Charité - Universitätsmedizin Berlin, 10 Charitéplatz 1, 10117 Berlin, Germany. 11 12 * for correspondence: [email protected] 13

1 bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

14 Abstract 15 16 Many show compartmentalized activity, in which activity does not spread 17 readily across the cell, allowing input and output to occur locally. However, the 18 functional implications of compartmentalized activity for the wider neural circuit are 19 often unclear. We addressed this problem in the Drosophila mushroom body, whose 20 principal neurons, Kenyon cells, receive feedback inhibition from a large, non-spiking 21 interneuron called APL. We used local stimulation and volumetric calcium imaging to 22 show that APL inhibits Kenyon cells in both their and , and that both 23 activity in APL and APL’s inhibitory effect on Kenyon cells are spatially localized, 24 allowing APL to differentially inhibit different mushroom body compartments. 25 Applying these results to the Drosophila hemibrain connectome predicts that 26 individual Kenyon cells inhibit themselves via APL more strongly than they inhibit 27 other individual Kenyon cells. These findings reveal how cellular physiology and 28 detailed network anatomy can combine to influence circuit function. 29 30 Introduction 31 32 A textbook integrates input from dendrites to generate action potentials that 33 spread throughout the neuron, making it a single functional unit. However, many 34 neurons integrate inputs and generate outputs locally so that a single neuron 35 effectively functions as multiple independent units (reviewed in (Branco and 36 Häusser, 2010)). What functional consequences flow from such compartmentalized 37 activity? In some cases, the circuit function of compartmentalized activity is clear 38 (Euler et al., 2002; Grimes et al., 2010), but answering this question is often difficult 39 due to the complexity of mammalian nervous systems or lack of detailed anatomical 40 information. 41 42 These difficulties are eased in the Drosophila olfactory system, a numerically simple 43 circuit that is now subject to intensive connectomic reconstruction (Takemura et al., 44 2017; Tobin et al., 2017; Xu et al., 2020; Zhang et al., 2019; Zheng et al., 2018), 45 offering an excellent opportunity to study local computations. We focus on the 46 mushroom body, the fly’s olfactory learning center, which has a well-characterized 47 compartmentalized architecture (Amin and Lin, 2019). The mushroom body’s

2 bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

48 principal neurons, the Kenyon cells (KCs), form parallel bundles of axons that are 49 divided into compartments by the innervation patterns of dopaminergic neurons and 50 mushroom body output neurons. During learning, dopaminergic neurons in one 51 compartment modify the local connection strength between Kenyon cells and 52 mushroom body output neurons in the same compartment, but not other 53 compartments (Cohn et al., 2015; Hige et al., 2015). 54 55 Superimposed on this compartmentalized structure is an inhibitory interneuron that 56 innervates all the mushroom body compartments: the anterior paired lateral neuron 57 (APL) (Aso et al., 2014; Tanaka et al., 2008). The APL neuron ensures sparse odor 58 coding by Kenyon cells through feedback inhibition (Lei et al., 2013; Lin et al., 2014) 59 and also plays a role in memory suppression and reversal learning (Liu and Davis, 60 2008; Ren et al., 2012; Wu et al., 2012; Zhou et al., 2019). APL’s widespread 61 innervation stands in contrast to the generally compartmentalized structure of the 62 mushroom body, yet its diverse roles in memory hint that it may have a more 63 compartmentalized function than its morphology suggests. 64 65 Indeed, there are hints that APL may have compartmentalized function. Like its 66 locust homolog, the giant GABAergic neuron (GGN), APL is non-spiking 67 (Papadopoulou et al., 2011). Unlike the larval APL (Eichler et al., 2017; Masuda- 68 Nakagawa et al., 2014), the adult APL has pre- and post-synaptic specializations 69 throughout all its processes (Wu et al., 2013), and connectomic reconstructions 70 show that APL forms reciprocal with Kenyon cells throughout the 71 mushroom body (Takemura et al., 2017; Xu et al., 2020; Zheng et al., 2018). There 72 have been reports of localized activity within APL (Inada et al., 2017; Wang et al., 73 2019), and compartmental modelling suggests that in the locust GGN, depolarization 74 should diminish with distance from the site of current input, though not to zero (Ray 75 et al., 2019). However, intracellular activity propagation is difficult to measure 76 experimentally in locusts, and the lack of action potentials in APL at the soma 77 (Papadopoulou et al., 2011) does not rule out active conductances elsewhere, given 78 that mammalian dendrites often show dendritic spikes that do not necessarily 79 propagate to the soma (Branco and Häusser, 2010). There have been no systematic 80 studies of how widely activity propagates within APL, where it exerts its inhibitory

3 bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

81 effect on Kenyon cells, or how APL’s physiology would affect the structure of 82 feedback inhibition in the mushroom body. 83 84 We addressed these questions by volumetric calcium imaging in APL. By quantifying 85 the spatial attenuation of the effects of locally stimulating APL, we found that both 86 activity in APL and APL’s inhibitory effect on Kenyon cells are spatially restricted, 87 allowing APL to differentially inhibit different compartments of the mushroom body. 88 Combining these physiological findings with recent connectomic data predicts that 89 individual Kenyon cells inhibit themselves via APL more strongly than they do other 90 Kenyon cells. Our findings establish APL as a model system for studying local 91 computations and their role in learning and memory. 92 93 Results 94 95 Spatially restricted responses to electric shock in APL 96 97 We first asked whether physiological responses to sensory stimuli are spatially 98 localized within APL. At very low odor concentrations, odor responses in APL can be 99 restricted to one lobe (Inada et al., 2017), but it remains unclear how sensory-evoked 100 activity is structured across APL at larger scales. We examined this question using 101 electric shock, a typical ‘punishment’ used for olfactory aversive conditioning. 102 103 APL responds to electric shock (Liu and Davis, 2008; Zhou et al., 2019), but it is 104 unknown if these responses are spatially restricted. To test this, we subjected flies to 105 electric shock and recorded activity volumetrically throughout the APL lobes using 106 GCaMP6f driven by 474-GAL4 (Gohl et al., 2011). We divided the MB lobes into 4 107 regions: the tip of the vertical lobe (V), stalk of the vertical lobe (S), compartments 108 γ1-3 (γ), and the rest of the horizontal lobe (H) (Fig. 1A). We based these divisions 109 on findings that (1) these regions are innervated by different dopaminergic neurons 110 that respond differentially to ‘punishment’ (e.g., electric shock) vs. ‘reward’ (reviewed 111 in (Amin and Lin, 2019)), (2) dopaminergic neurons release synaptic vesicles onto 112 APL in response to electric shocks (Zhou et al., 2019), and (3) APL expresses the 113 receptors DopEcR (Aso et al., 2019) and the inhibitory Dop2R (Zhou et 114 al., 2019).

4 bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

115 116 Electric shocks evoked a strong response in APL in the V region, with significantly 117 smaller responses in the other regions (Fig. 1B,C). This difference between regions 118 did not arise from optical artifacts or differential expression of voltage-gated calcium 119 channels. If it did, one would expect other stimuli to produce a similar pattern of Ca2+ 120 influx. However, the odor isoamyl acetate evoked a different pattern of activity, with 121 somewhat stronger responses in the S region and weaker in γ (Fig. 1B,C). These 122 different spatial profiles for electric shock v. odor suggest that spatially differential 123 responses to electric shock might arise from different synaptic inputs. This could 124 arise because different regions of APL (1) have dopamine receptors of different 125 function (DopEcR vs. Dop2R), (2) receive dopaminergic inputs of different synaptic 126 numbers, or (3) receive input from dopaminergic neurons with different responses to 127 electric shock (Cohn et al., 2015; Mao and Davis, 2009). In support of (1), bath- 128 applying dopamine inhibits APL in the vertical lobe, except in the tip where it has no 129 direct effect (Zhou et al., 2019). In support of (2), APL receives more synapses from 130 the dopaminergic neurons PPL1γ2α′1, PPL1γ1pedc and PPL1α′2α2 in the heel and 131 stalk, which are presumably inhibitory (Zhou et al., 2019), compared to dopaminergic 132 neurons PPL1α3 and PPL1α′3 in the tip (Xu et al., 2020)). Regardless of the cause, 133 the spatial heterogeneity of sensory-evoked activity within APL suggests that activity 134 can remain spatially localized in APL. 135 136 Low expression of voltage-gated Na+ and Ca2+ channels in APL 137 138 In addition to reflecting differential synaptic inputs, this spatially localized activity in 139 APL most likely also reflects intrinsic properties of APL’s membrane excitability that 140 prevent activity from spreading. To validate the hypothesis that intrinsic properties 141 could contribute, we analyzed an RNA-seq dataset revealing gene expression in 142 Kenyon cells, dopaminergic neurons, mushroom body output neurons, the dorsal 143 paired medial (DPM) neuron, and APL (Aso et al., 2019). 144 145 We looked for genes with higher or lower expression in APL than in all other 20 146 mushroom body neuron types. Gene Ontology analysis revealed that the set of 147 genes with consistently higher expression in APL is strongly enriched for genes 148 involved in protein synthesis and mitochondrial respiration, perhaps reflecting the

5 bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

149 energetic demands of maintaining such a large neuron. APL also expresses higher 150 levels of the biosynthetic enzyme and vesicular transporter of GABA than any other 151 neuron in the dataset (Fig. 2). In contrast, voltage-gated Na+ and Ca2+ channels are 152 expressed at lower levels in APL than in all other types of mushroom body neurons 153 (Fig. 2), indeed 10-1000x lower than the average of non-APL neurons. In contrast, 154 the picture with K+ channels, ligand-gated Cl- channels, and other miscellaneous 155 channels is more mixed (Fig. 2). These results are consistent with previous findings 156 that APL does not fire action potentials (Papadopoulou et al., 2011), unlike all other 157 published electrophysiological recordings from other mushroom body neurons (Hige 158 et al., 2015; Takemura et al., 2017; Turner et al., 2008). 159 160 Activity in APL is spatially restricted 161 162 Based on the spatially restricted sensory-evoked activity and the low expression of 163 voltage-gated ion channels, we hypothesized that intrinsic factors limit the spatial 164 spread of activity within APL. We first tested this by imaging APL while activating 165 Kenyon cells with the heat-activated cation channel dTRPA1. We previously showed 166 that activating all Kenyon cells with dTRPA1 activates APL (Lin et al., 2014). We now 167 extended this approach by activating only subsets of Kenyon cells. Kenyon cells are 168 divided into three main classes, αβ, α′β′, and γ, which send their axons to 169 anatomically segregated mushroom body lobes, called the α, β, α′, β′, and γ lobes. 170 When we activated only the α′β′ Kenyon cells and imaged APL in the vertical lobe 171 (made of the α and α′ lobes), remarkably, only the α′ lobe of APL responded (Fig. 172 3A-C,I). The same occurred for the α lobe when we activated only αβ/γ (Fig. 3D-F,I) 173 or only αβ Kenyon cells (Fig. 3G-I). APL neurites in the unresponsive lobe failed to 174 respond despite being only 2-3 µm away from responding neurites. This can most 175 likely be explained by the fact that APL neurites in the vertical lobe mostly run in 176 parallel along Kenyon cells and do not cross between the α and α′ lobes (Takemura 177 et al., 2017). These results suggest that activity in APL fails to propagate over long 178 distances. 179 180 To measure activity propagation within APL more systematically, we directly 181 stimulated APL, to test whether local activation of APL in the mushroom body lobes 182 (where Kenyon cell axons reside) would spread to the calyx (where Kenyon cell

6 bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

183 dendrites reside), and vice versa (Fig. 4). To do this, we expressed GCaMP6f (Chen 184 et al., 2013) and P2X2, an ATP-gated cation channel (Lima and Miesenböck, 2005), 185 in APL, using a previously described intersectional driver for specifically labeling APL 186 (NP2631-GAL4, GH146-FLP, tubP-FRT-GAL80-FRT (Lin et al., 2014)). Drosophila 187 does not natively express P2X ATP receptors (Littleton and Ganetzky, 2000). We 188 locally applied ATP to the tip of the vertical lobe or to the calyx by pressure ejection 189 from a Picospritzer, while imaging both regions. This local stimulation evoked intense 190 GCaMP6f responses at the site of ATP application, but not at the unstimulated site 191 (Fig. 4A,D), indicating that activity in APL attenuates to undetectable levels across 192 the breadth of the neuron (about 250-300 µm; see below). 193 194 To rule out the possibility that all P2X2-driven excitation is always spatially restricted, 195 we repeated the experiment but expressed P2X2 in Kenyon cells instead of APL, 196 using mb247-LexA (Pitman et al., 2011). We still expressed GCaMP6f in APL, now 197 using 474-GAL4 instead of the intersectional driver, to increase throughput (as this 198 experiment did not require highly specific expression in APL). In contrast to 199 stimulating APL, stimulating Kenyon cells in the calyx evoked a strong response in 200 APL in both the calyx and the vertical lobe (Fig. 4B,E), most likely because 201 activating Kenyon cells in their dendrites drives them to spike, which then activates 202 APL throughout the mushroom body. However, stimulating Kenyon cells at the tip of 203 the vertical lobe activated APL locally, but not in the calyx (Fig. 4B,E). Puffing ATP 204 on negative control flies with no driver for P2X2 evoked no responses in APL (Fig. 205 4C,F). Together, these findings show that activity within APL is spatially restricted. 206 207 Quantification of activity spread in APL 208 209 Locally induced activity in APL declines to essentially zero at the other end of the 210 neuron, but how quickly does the activity decay along its journey? In particular, is 211 activity in APL restricted enough for APL to signal differentially in different 212 compartments of the MB lobes? We examined this question by more systematically 213 quantifying spread of activity throughout APL. We used volumetric imaging to record 214 activity in the entire 3D extent of APL (~100 x 100 x 150 µm). We analyzed APL as a 215 3D ‘skeleton’ with three branches (vertical lobe, horizontal lobe, and peduncle/calyx). 216 We used evenly spaced points every 20 µm along this skeleton to divide the 3D

7 bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

217 volume of APL into segments (Voronoi cells), and quantified fluorescence signals in 218 APL in each segment-volume (Fig. 5A, see Methods). To compare the spatial extent 219 of activity across flies, we normalized distances in these skeletons to a ‘standard’ 220 skeleton based on the average across all flies (Fig. 5B). Most neurites in APL run in 221 parallel with this skeleton (Takemura et al., 2017; Wang et al., 2019; Xu et al., 2020), 222 making this skeleton a meaningful axis along which to measure spread of APL

223 activity. 224 225 To avoid the stochastic labeling of APL associated with the intersectional 226 NP2631/GH146 driver, we developed another APL driver, VT43924-GAL4.2-SV40 227 (henceforth simply VT43924-GAL4.2), based on the original VT43924-GAL4 (Wu et 228 al., 2013), as GAL4.2-SV40 typically gives ~2x stronger expression than the original 229 GAL4 (Pfeiffer et al., 2010). This line showed more reliable expression than the 230 original VT43924-GAL4 line and labelled fewer neurons near the MB compared to 231 474-GAL4 (Figure S1A,B), making it applicable for ATP stimulation of APL. We 232 used VT43924-GAL4.2 for labeling APL in all subsequent experiments.

233 We locally activated APL by applying ATP to three zones – the tip of the vertical 234 lobe, the calyx, and the horizontal lobe – and quantified the response at evenly 235 spaced intervals along the 3D skeleton. ATP stimulation of APL evoked a strong 236 local response that gradually decayed as it propagated away from the stimulus site 237 (Fig. 5), with little change in the temporal dynamics of the response with distance 238 (Fig. 5C-E). Note that our temporal resolution (~5 Hz imaging rate) was not fast 239 enough to reveal propagation of activity along APL neurites over time (which 240 presumably occurs on the timescale of milliseconds). We co-ejected a red dye 241 together with the ATP to reveal the spatial and temporal extent of stimulation as the 242 ATP was removed by diffusion and perfusion. For example, the longer response 243 from stimulation in the calyx reflects the slower disappearance of ATP (Fig. 5C-E, 244 lower panels).

245 Strikingly, activity evoked by stimulation at the tip of the vertical lobe decayed to an 246 undetectable level by the branching point between the two lobes (Fig. 5G). 247 Stimulation in the other two zones elicited wider spread, but much of the activity 248 spread actually arises from movement of ATP away from the ejection site, as 249 revealed by spread of the co-ejected red dye (dashed lines, Fig. 5). These results

8 bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

250 confirm the spatially restricted activity shown in Fig. 4 and extend those results by 251 systematically quantifying the extent of activity spread throughout APL.

252 APL inhibits Kenyon cells mostly locally

253 Given that activity within APL is localized, we next asked whether APL’s inhibitory 254 effect on Kenyon cells is also localized. APL and Kenyon cells form reciprocal 255 synapses throughout the entire extent of the mushroom body (Fig. 8) 256 (Takemura et al., 2017; Xu et al., 2020; Zheng et al., 2018), suggesting that APL 257 could theoretically inhibit Kenyon cells everywhere. However, it remains unknown if 258 APL actually can inhibit Kenyon cells everywhere and if this inhibition remains local. 259 260 To test this, we again locally stimulated APL with ATP and used volumetric imaging 261 to record activity in Kenyon cells (expressing GCaMP6f under the control of mb247- 262 LexA) instead of from APL. Although Kenyon cells are mostly silent in the absence of 263 odor, they do exhibit some spontaneous activity (Turner et al., 2008). As expected, 264 stimulating APL with ATP in the lobes reduced the baseline GCaMP6f signal in 265 Kenyon cells, and the inhibitory effect was strongest at the site of APL stimulation. 266 This can be seen in both color-coded time courses (Fig. 6A1,B1) and plots of APL’s 267 inhibitory effect vs. distance along the 3D skeleton (Fig. 7A2,B2). We saw 268 qualitatively similar results when we examined Kenyon cells’ odor-evoked activity 269 instead of spontaneous activity. Here, we measured the inhibitory effect as the 270 difference between Kenyon cell odor responses with and without local stimulation of 271 APL by ATP, normalized to the response without APL stimulation (Fig. 6A4,B4, 272 calculated from panels A2,B2 and A3,B3). Again, this normalized inhibitory effect 273 was strongest at the site of APL stimulation (Fig. 7A4,B4). These results provide the 274 first physiological evidence that local activity in APL can locally inhibit Kenyon cells. 275 276 Strikingly, local inhibition was frequently stronger proximally in Kenyon cell axons 277 than distally. Specifically, when stimulating APL in the horizontal lobe, odor-evoked 278 Ca2+ influx in Kenyon cells was strongly inhibited at the junction of the vertical and 279 horizontal lobes, but less so in the tip of the vertical lobe (Fig. 7A2, A4; difference 280 between node 200 µm vs. 260 µm, p < 0.01, paired t-test; see Table S2). An 281 analogous difference between 200 vs. 260 µm also occurs in APL activity with the

9 bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

282 same stimulation (Fig. 7A1). That inhibition of Kenyon cell axons can differ over 283 such a short distance suggests that APL can differentially inhibit mushroom body 284 compartments (see Discussion). 285 286 Surprisingly, puffing ATP on the calyx excited Kenyon cells in the calyx but inhibited 287 them in the lobes (Fig. 6C, 7C). This apparently puzzling result can be explained by 288 observing that in negative control flies with UAS-P2X2 and no GAL4, calyx ATP also 289 excited Kenyon cells, but did not inhibit them (Fig. 6D, S2). These results are best 290 explained by leaky expression of P2X2 from the UAS-P2X2 transgene, either in 291 Kenyon cells or projection neurons. The leaky P2X2 expression allows ATP to excite 292 Kenyon cells in their dendrites, driving them to spike (hence ATP drives Ca2+ influx 293 throughout Kenyon cell dendrites and axons). However, in APL>P2X2 flies, inhibition 294 from APL is strong enough to suppress Kenyon cell spikes despite the local 295 excitation from leaky P2X2, thereby blocking both spontaneous and odor-evoked 296 activity in Kenyon cell axons. Note that some of the local Ca2+ influx in the calyx may 297 reflect Ca2+ entering directly through P2X2 channels, despite inhibition from APL 298 shunting away the resulting depolarization. These results show that sufficiently 299 strong local inhibition in Kenyon cell dendrites can silence Kenyon cells. 300 301 The inhibitory effect was sometimes less localized than APL activity itself. For 302 example, when ATP was ejected at the tip of the vertical lobe, APL activity 303 decreased to zero by 100 µm from the ejection site and there was no activity in the 304 horizontal lobe (Fig. 4D,G, 7B1), whereas the inhibitory effect on Kenyon cells 305 persisted into the peduncle and the horizontal lobe (Fig. 7B2), even into the calyx 306 (>200 µm away) in the case of the inhibitory effect on Kenyon cell odor-evoked 307 responses (Fig. 7B4). However, this more extended inhibitory effect on the calyx 308 was significantly smaller than the local inhibitory effect on the vertical lobe. These 309 results suggest that APL can, to a modest extent, inhibit areas of Kenyon cells 310 beyond areas where APL itself is active. 311 312 Local GABA application mimics the inhibitory effect of local APL stimulation 313 314 How could APL inhibit Kenyon cells in areas where it itself is not active? One 315 explanation could be that because we are measuring GCaMP6f signals and not

10 bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

316 voltage, APL might be active and thus release GABA even where we do not see 317 increased GCaMP6f signal. This possibility seems unlikely as it is unclear how 318 GABA would be released in the absence of Ca2+ influx. Still, to test this possibility, 319 we replaced APL stimulation with direct application of GABA. We reasoned that if 320 local ATP stimulation causes APL to release GABA over a wider region than APL’s 321 own GCaMP6f signal, then directly applying GABA should cause a more spatially 322 restricted inhibitory effect than applying ATP (which would evoke wider release of 323 GABA from APL). 324 325 In fact, directly applying GABA caused the same inhibitory effect on Kenyon cells as 326 locally stimulating APL with ATP: strongest at the site of stimulation but still affecting 327 Kenyon cells far from the site of stimulation, to a lesser extent (Fig. 7, columns 3 and 328 5; traces in Fig. S3). In particular, GABA applied to the tip of the vertical lobe 329 inhibited Kenyon cells throughout the horizontal lobes. In the case of odor-evoked 330 activity, this inhibition extended to the peduncle and calyx, though significantly 331 weaker than in the vertical lobe (Fig. 7B3, B5, compare to B2, B4). These results 332 argue against the possibility that APL releases GABA more widely than its area of 333 activity and suggest that APL’s inhibitory effect extends beyond the zone of its own 334 activity, though weaker than where it is active (see Discussion). 335 336 In other respects as well, puffing GABA elicited the same effects above noted for 337 locally activating APL with ATP. Locally inhibiting Kenyon cells in the calyx inhibited 338 them throughout the lobes (Fig. 7C3, C5, compare to C2, C4, now without the 339 confounding effects of leaky P2X2 expression). With local inhibition in the horizontal 340 lobe, Kenyon cells were more inhibited at the junction than at the vertical lobe tip 341 (Fig. 7A3,A5, compare to A2, A4). The close correspondence of effects of GABA 342 and ATP application indicates that the observed localization of ATP-induced Ca2+ 343 influx in APL accurately reflects the localization of GABA release. 344 345 Connectomic analysis predicts that each Kenyon cell disproportionately 346 inhibits itself 347 348 We next asked how local inhibition by APL affects lateral inhibition between Kenyon 349 cells. APL is thought to act through all-to-all feedback inhibition to sparsen and

11 bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

350 decorrelate population odor responses in Kenyon cells (Lin et al., 2014). Such a 351 function assumes that each Kenyon inhibits all Kenyon cells via APL roughly equally 352 and indeed, decorrelation should theoretically work better if all Kenyon cells inhibit 353 each other than if each Kenyon cell inhibits only itself (see Appendix; Fig. S5). 354 However, if a Kenyon cell activates APL locally and APL is not evenly activated 355 throughout, it may inhibit other Kenyon cells unevenly, i.e., some more than others. 356 Such uneven lateral inhibition would depend both on how activity spreads within APL 357 and on how APL-KC and KC-APL synapses are spatially arranged on APL neurites. 358 In particular, if activity in APL decays with distance, activating Kenyon cell 1 (KC1) 359 would inhibit another Kenyon cell (KC2) more strongly if KC1-APL synapses are 360 close to APL-KC2 synapses (as measured along APL’s neurites) than if they are far 361 apart. Thus, the degree to which KC1 inhibits KC2 can be described by the weighted 362 count of every pair of KC1-APL and APL-KC2 synapses (see Methods). The weight 363 of each pair should fall off exponentially with the distance between the two synapses, 364 given that cable theory predicts that signals decay as exp(-x/space constant) 365 (Hodgkin and Rushton, 1946) (Fig. 8F). 366 367 To test whether KC-APL synapses are spatially arranged to allow uneven lateral 368 inhibition, we analyzed the hemibrain connectome dataset released by Janelia 369 FlyEM and Google (v. 1.0.1) (Xu et al., 2020), which contains a fully segmented APL 370 and annotated KC-APL and APL-KC synapses. All 1929 traced Kenyon cells in this 371 volume form reciprocal synapses with APL (49.6±17.9 APL-KC and 52.6±13.4 KC- 372 APL synapses per KC; mean±s.d.). APL-KC synapses (but not KC-APL synapses) 373 are polyadic (a single presynaptic density on APL contacts multiple KCs). We 374 mapped all annotated APL-KC and KC-APL synapses onto APL’s neurite skeleton 375 (181,050 connected nodes, total length 79.5 mm; 95,678 and 101,430 unique 376 synapses mapped to 15,655 and 96,866 unique locations on APL’s skeleton for APL- 377 KC and KC-APL synapses, respectively) (Fig. 8A,B) and measured the distance 378 from every APL-KC to every KC-APL along APL’s neurite skeleton. 379 380 To determine what space constant to use in our analysis, we mapped our recordings 381 onto the reconstructed APL by dividing it into segments (Voronoi cells) along the 382 mushroom body 3D skeleton as in Fig. 5-7. Here we used segments spaced 10 µm 383 apart to increase spatial resolution (in Fig. 5-7 we used 20 µm spacing to reduce

12 bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

384 variability across individual flies). We took the red dye signal in each segment from 385 Fig. 5, averaged across flies, at the time of the peak signal in the segment receiving

386 the most red dye. Because these signals were weak and noisy (peak ∆F/F ~20-30%, 387 compared to 300% for GCaMP6f), we fitted exponential decay curves to approximate

388 the ATP stimulus that each segment received. We then simulated Fig. 5 by placing 389 ~10,000 randomly distributed points on the APL neurite skeleton (Fig. 8C) and 390 “stimulating” each segment of APL according to our curve fits of red dye signal (Fig. 391 8D). Given this localized stimulus, we calculated how much signal an average point 392 in each segment of APL would receive from all other points in APL, given a 393 normalized space constant of 25, 50 or 75 µm (Fig. 8E). “Normalized space 394 constant” means the space constant along a neurite of average diameter, i.e. ~0.45 395 µm (Fig. S4D); we modeled space constants as varying with the square root of the 396 neurite radius (see Methods). Note that for simplicity, we did not consider branching 397 effects in APL. Overall, 50 µm gave the best fit: 25 µm did not spread activity 398 enough, while with 75 µm, activity spread to areas where Fig. 6 found none (Fig. 399 8E). Similar results were obtained when modelling activity as decaying along a 400 straight-line mushroom body skeleton that ignores APL’s neurite morphology, albeit 401 with some differences, likely reflecting areas where APL’s neurites do not simply 402 travel parallel to the straight-line skeleton (Fig. S4C). 403 404 Using these space constants, our model predicts that Kenyon cells 405 disproportionately inhibit some Kenyon cells more than others (Fig. 8G-L). In 406 particular, each Kenyon cell inhibits itself more strongly than it inhibits other 407 individual Kenyon cells on average (Fig. 8J-L). (This can be seen in the brighter

408 pixels along the diagonal in Fig. 8G,I.) This is due partly to the fact that γ, αβp and 409 α′β′ Kenyon cells inhibit other Kenyon cells of the same subtype more than Kenyon 410 cells of other subtypes. (This can be seen as the large blocks along the diagonal in 411 Fig. 8G). However, even when comparing self-inhibition to inhibition of only other 412 Kenyon cells of the same subtype, each Kenyon cell inhibits itself more than it 413 inhibits other individual Kenyon cells on average (Fig. 8K). 414 415 These results arise from treating every KC-APL and APL-KC synapse equally. In 416 reality, Kenyon cell spiking is driven by dendritic input in the calyx, as confirmed by

13 bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

417 our finding that activity in Kenyon cells can be suppressed throughout the mushroom 418 body by locally activating APL or applying GABA in the calyx (Fig. 6,7). Therefore, 419 we repeated this analysis, taking into account only APL-KC synapses in the calyx. 420 Again, our model predicts that each Kenyon cell inhibits itself more than it inhibits 421 other individual Kenyon cells on average (Fig. 8I,L). Importantly, this imbalance 422 decreases with longer space constants and disappears entirely if the space constant 423 is infinite (at λ = 50 µm, the median imbalance is ~40%). Moreover, the imbalance 424 arises from the particular spatial relations between synapses of different Kenyon 425 cells, because the imbalance disappeared when we shuffled the identities of which 426 Kenyon cell each KC-APL or APL-KC synapse belonged to (Fig. 8J-L). Thus, our 427 physiological measurements of localized activity of APL, combined with the spatial 428 arrangements of KC-APL and APL-KC synapses, predict that Kenyon cells 429 disproportionately inhibit themselves compared to other individual Kenyon cells. 430 431 Discussion 432 433 We have shown that activity in APL is spatially restricted intracellularly for both 434 sensory-evoked and local artificial stimulation, consistent with relatively low 435 expression of voltage-gated Na+ and Ca2+ channels in APL. This local activity in APL 436 translates into localized inhibition onto Kenyon cells. Finally, combining physiological 437 and anatomical data — APL’s estimated space constant and the spatial arrangement 438 of KC-APL and APL-KC synapses – predicts that each Kenyon cell 439 disproportionately inhibits itself more than other individual Kenyon cells. 440 441 The locust equivalent of APL is called GGN (‘giant GABAergic neuron’) 442 (Papadopoulou et al., 2011). A compartmental model of GGN predicts that local 443 current injection in the α lobe should lead to depolarization throughout GGN (at least 444 500 µm across) though the depolarization should decrease with distance from the 445 injection site (Ray et al., 2019). In contrast, we found that local stimulation of APL 446 with P2X2+ATP decayed to undetectable levels within as little as 100 µm. What may 447 explain this difference? Although GGN and APL are both widefield inhibitory 448 interneurons in the mushroom body, they have striking morphological differences. 449 For example, GGN separately innervates the lobes and calyx with numerous thin, 450 branching processes; these tangled innervations are joined by relatively thick

14 bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

451 processes (almost 20 µm in diameter) (Ray et al., 2019). In contrast, APL innervates 452 the lobes continuously with numerous neurites that emerge in parallel from the calyx 453 (Mayseless et al., 2018; Xu et al., 2020). In the FIB-SEM hemibrain (Xu et al., 2020), 454 these neurites average ~0.4-0.5 µm in diameter throughout APL; ~95% of neurite 455 length is less than 1 µm in diameter and the maximum diameter is ~3 µm (Fig. S4D). 456 GGN’s morphology actually more resembles Drosophila’s larval APL, which has 457 separate innervations of the lobes and calyx joined by a single process (Eichler et 458 al., 2017; Masuda-Nakagawa et al., 2014). The larval APL has pre-synapses only in 459 the calyx, while adult APL has pre-synapses everywhere (Fig. 8A). It is tempting to 460 speculate that the locust and larval Drosophila use global activity 461 in APL/GGN to send feedback from Kenyon cell axons to Kenyon cell dendrites, 462 whereas the adult Drosophila mushroom body uses local activity in APL to locally 463 inhibit Kenyon cells everywhere. The larval APL might be small enough for activity to 464 spread passively from lobes to calyx (~100 µm) or might have different ion channel 465 composition from adult APL; the large diameter of the locust GGN’s neurites 466 between lobe and calyx might increase their space constants enough to allow activity 467 to propagate. 468 469 We measured APL’s local effects by locally puffing ATP or GABA on the mushroom 470 body. How spatially precise was this application? The co-ejected red dye indicator 471 spread tens of microns from the ejection site (decay to half-strength ~10-25 µm; see 472 Table S2). This spatial resolution is close to that of other techniques for local in vivo 473 stimulation like two-photon optogenetic stimulation (decay to half-strength 12 µm 474 horizontal, 24 µm axially: (Packer et al., 2015)). How precisely does the red dye 475 indicate the spread of the bioactive compound (ATP/GABA)? This is difficult to 476 answer with certainty, as it is unclear how much of the spread of dye/ATP/GABA 477 arises from bulk flow from ejection from the pipette (which should affect dye, ATP 478 and GABA equally) vs. diffusion (which depends on molecular weight and volume). 479 To the extent that ATP or GABA spread differently from the red dye, they are likely to 480 spread farther, as they have lower molecular weights (dye: 1461; ATP: 507; GABA: 481 103), meaning that our stimulation is less spatially restricted than the dye suggests. 482 Thus, our results likely overestimate, rather than underestimate, how far APL activity 483 and APL’s inhibitory effect spread from the site of stimulation. If the space constant 484 is indeed lower than our normalized estimate of 50 µm, then the imbalance between

15 bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

485 Kenyon cells inhibiting themselves vs. others is likely even more severe (compare λ 486 = 25 µm and 50 µm on Fig. 8J-L). In any case, in comparing the spatial spread of 487 activity in APL vs. APL’s inhibitory effect, we used the same protocol for ATP 488 stimulation, so these results are directly comparable even if the exact distance of 489 ATP spread is uncertain. 490 491 We showed that APL can locally inhibit Kenyon cells in multiple locations in the 492 mushroom body. Remarkably, inhibition of Ca2+ influx in Kenyon cell axons could be 493 stronger proximally than distally (Fig. 7A), as though action potentials traveled 494 through a zone of inhibition and recovered on the other side. This was true both 495 when stimulating APL with ATP or when directly applying GABA. GABA should act 496 on Kenyon cells by suppressing depolarization through shunting inhibition in both

497 dendrites and axons, as the GABAA receptor Rdl is expressed in both (Liu et al., 498 2007). Yet if action potentials are blocked proximally, how can they recover distally? 499 It may be that although depolarization is suppressed in a zone of local inhibition, 500 enough current remains on the other side to regenerate the action potential. 501 Alternatively, local inhibition might particularly suppress Ca2+ influx rather than

502 depolarization, perhaps by acting through GABAB receptors; Kenyon cells express

503 GABABR1 and GABABR2 (Aso et al., 2019; Crocker et al., 2016; Croset et al., 2018; 504 Davie et al., 2018), although their subcellular localization is unknown. Given that 505 synaptic vesicle release requires Ca2+ influx, such inhibition would still suppress 506 Kenyon cell synaptic output. 507 508 While APL inhibits Kenyon cells locally, the inhibitory effect spreads somewhat more 509 widely than APL’s own activity, though weakly (Fig. 7A4-5,B4-5). Local GABA 510 application produces similar results to locally activating APL with ATP (Fig. 7), 511 suggesting that GCaMP6f signals in APL accurately predict GABA release. How can 512 APL inhibit Kenyon cells where it itself is not active? Wider inhibition when inhibiting 513 Kenyon cell dendrites (Fig. 7C) can be easily explained as blocking action potentials, 514 but the wider inhibition when inhibiting the axons is more puzzling. This might arise 515 from wider network activity. For example, Kenyon cells form recurrent connections 516 with DPM and dopaminergic neurons and form synapses and gap junctions on each 517 other (Liu et al., 2016; Takemura et al., 2017). Through such connections, an odor- 518 activated Kenyon cell might excite a neighboring Kenyon cell’s ; the neighbor

16 bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

519 might passively spread activity both forward and backward or, not having fired and 520 thus not being in a refractory period, it might even be excited enough to propagate 521 an action potential back to the calyx. Alternatively, Kenyon cells indirectly excite 522 neurons in a positive feedback loop (Hu et al., 2010). In these 523 scenarios, locally puffing GABA or activating APL artificially in the vertical lobe tip 524 would block the wider network activity, thus reducing Ca2+ influx in the calyx. 525 Although the calyx was not activated when stimulating Kenyon cells in the vertical 526 lobe tip in Fig. 4B, this might be because simultaneous activation of all Kenyon cells 527 (but not odor-evoked activation of ~10% of Kenyon cells) drives strong-enough local 528 APL activation to block wider network activity. 529 530 By combining our physiological measurements of localized activity with the detailed 531 anatomy of the FIB-SEM hemibrain connectome (Xu et al., 2020), we built a model 532 that predicts that the average Kenyon cell inhibits itself more than it inhibits other 533 individual Kenyon cells. This prediction is supported by previous experimental results 534 that some Kenyon cells can inhibit some Kenyon cells more than others, and that an 535 individual Kenyon cell can inhibit itself (Inada et al., 2017). Our model goes beyond 536 these results in predicting that the average Kenyon cell actually preferentially inhibits 537 itself (Fig. 8), and by explaining how differential inhibition can arise from local activity 538 in APL and the spatial arrangement of KC-APL and APL-KC synapses. 539 540 We based our phenomenological model on the heuristic that depolarization decays 541 exponentially with distance. The model is constrained by experimental data, though 542 these are necessarily imperfect; potential sources of error include automated 543 segmentation and synapse annotation in the connectome, imperfect registration of 544 the hemibrain APL to our average 3D skeleton, and noisy red dye signals that may 545 not perfectly report ATP localization (see above). We ignored certain complicating 546 factors in our model for simplicity – some due to lack of data (e.g., active 547 conductances; differences in synaptic strength or membrane conductance across 548 APL), others as simply beyond the scope of this study (e.g., dynamic effects of 549 feedback inhibition; effects of neurite branching and differing branch lengths). 550 However, these simplifications and potential error sources would lead us to 551 underestimate, not overestimate, spatial differences in APL activity (and therefore 552 the bias toward self- rather than other-inhibition in Kenyon cells). Future detailed

17 bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

553 compartmental modeling will allow further insights into local feedback inhibition in the 554 mushroom body. 555 556 Our findings show that localized activity within APL has two broader implications for 557 mushroom body function. First, local activity in APL leads to local inhibition of 558 Kenyon cells, to the point that different compartments of the mushroom body lobes 559 can receive different inhibition. This local inhibition would allow the single APL 560 neuron to function effectively as multiple inhibitory interneurons, each locally 561 modulating the function of one mushroom body ‘compartment’, i.e., a unit of 562 dopaminergic neurons / Kenyon cells / mushroom body output neurons. Different 563 compartments are innervated by different dopaminergic neurons (e.g., reward vs. 564 punishment) and different mushroom body output neurons (e.g., avoid vs. approach) 565 (Aso et al., 2014), and they govern synaptic plasticity and hence learning by different 566 rules (e.g., different speeds of learning/forgetting) (Aso and Rubin, 2016). Thus, APL 567 could locally modulate different compartment-specific aspects of olfactory learning. If 568 such local inhibition is important for learning, the fact that spatial attenuation of APL’s 569 inhibitory effect is gradual and incomplete could explain why mushroom body 570 compartments are arranged in their particular order, with reward and punishment 571 dopaminergic neurons segregated into the horizontal and vertical lobes, respectively. 572 Under this scenario, APL would serve two distinct, spatially segregated functions: 573 enforcing Kenyon cell sparse coding in the calyx, and modulating learning in the 574 compartments of the lobes. 575 576 Second, the finding of strong self-inhibition compared to other-inhibition provides a 577 new perspective on APL’s function. Inhibition from APL sparsens and decorrelates 578 Kenyon cell odor responses to enhance learned odor discrimination (Lin et al., 2014) 579 but in general, decorrelation is better served by all-to-all lateral inhibition than by self- 580 inhibition (see Appendix, Fig. S5), raising the question of why self-inhibition is so 581 strong. Self-inhibition does help decorrelate population activity by pushing some 582 neurons’ activity below spiking threshold (Fig. S5); this could occur if APL can be 583 activated by subthreshold activity in Kenyon cells, e.g., from KC-APL synapses in 584 Kenyon cell dendrites. However, this effect of self-inhibition is better thought of, not 585 as decorrelation per se, but rather as gain control (Asahina et al., 2009; Olsen et al., 586 2010; Root et al., 2008), effectively equivalent to adjusting the threshold or gain of

18 bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

587 excitation according to the strength of stimulus. Beyond its role in sparse coding, 588 APL inhibition is also thought to function as a gating mechanism to suppress 589 olfactory learning (Liu and Davis, 2008; Zhou et al., 2019); for such a function it 590 would make sense for Kenyon cells to disproportionately inhibit themselves. Future 591 work will address how lateral inhibition interacts with other functions for APL in this 592 local feedback circuit. 593 594 Methods 595 596 Fly strains and husbandry 597 Flies were kept at 25 °C (experimental) or 18 °C (long-term stock maintenance) on a 598 12 h/12 h light/dark cycle in vials containing 80 g medium cornmeal, 18 g dried 599 yeast, 10 g soya flour, 80 g malt extract, 40 g molasses, 8 g agar, 25 ml 10% nipagin 600 in ethanol, and 4 ml propionic acid per 1 L water.

601 VT43924-Gal4.2 was created via LR Clonase reaction between pENTR-VT43924 602 and pBPGAL4.2Uw-2, in which the Gal4 sequence has been codon-optimized for 603 Drosophila and the hsp70 terminator was replaced with the SV40 terminator (Pfeiffer 604 et al., 2010). The resulting construct was inserted in attP2 by the University of 605 Cambridge Fly Facility Microinjection Service. lexAop-P2X2 was created by 606 subcloning P2X2 from pUAST-P2X2 (Lima and Miesenböck, 2005) into pLOT (Lai 607 and Lee, 2006). QUAS-GCaMP3 was created by subcloning GCaMP3 (Tian et al., 608 2009) into pQUAST (Potter et al., 2010). pLOT-P2X2 and pQUAS-GCaMP3 were 609 injected by Genetic Services, Inc. 610

Designation Reference Availability

OK107-GAL4 (Connolly et al., 1996) BDSC:854

MB247-DsRed (Riemensperger et al., 2005), FLYB:FBtp0022384

UAS-GCaMP6f (Chen et al., 2013), FLYB: BDSC:52869 (VK00005) FBst0052869

UAS-GCaMP6f (attP40) (Chen et al., 2013), FLYB: BDSC:42747 FBst0042747

19 bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

tub-FRT-GAL80-FRT (Gordon and Scott, 2009; BDSC:38880 Lin et al., 2014)

MB247-LexA (Lin et al., 2014; Pitman et al., 2011), FLYB:FBtp0070099

LexAop-P2X2 This study

LexAop-GCaMP6f (Barnstedt et al., 2016) Gift from S. Waddell

GH146-FLP (Hong et al., 2009), FBtp0053491

UAS-mCherry-CAAX (Kakihara et al., 2008; Lin et al., 2014), FLYB:FBtp0041366

NP2631-GAL4 (Tanaka et al., 2008) DGRC:104266

UAS-P2X2 (Lima and Miesenböck, BDSC:76032 2005), FLYB: FBtp0021869

UAS-P2X2(attP40) (Clowney et al., 2015) Gift from V. Ruta

VT43924-GAL4.2 This study

UAS-CD8::GFP (Lee et al., 1999), FLYB: BDSC:5130 FBst0005130

474-GAL4 (Gohl et al., 2011), BDSC:63344 FBst0063344

853-GAL4 (Gao et al., 2015; Gohl et InSITE database 0853 al., 2011)

mb247-GAL4 (Zars, 2000)

c739-GAL4 (Yang et al., 1995), BDSC:7362 FBst0007362

NP3061-GAL4 (Tanaka et al., 2008), DGRC:104360 FBti0035130

QUAS-GCaMP3 This study

GH146-QF (Potter et al., 2010) BDSC:30015 FBti0129854 611

20 bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

612 Odor delivery 613 Odors were delivered by switching mass-flow controlled carrier and stimulus streams 614 (Sensirion) via solenoid valves (The Lee Company) controlled by LabVIEW 2015 615 software (National Instruments). Air flow was 0.5 l/min at the exit of the odor tube, 616 which was positioned ~1 cm from the fly’s head. Odor pulses lasted 5 s. At the end 617 of each recording where odor pulses were given, the tubes were cleaned by passing 618 pure air through. A tube connected to a vacuum pump was positioned behind the fly 619 to deplete the air of odors remaining after the odor pulse. 620 621 Drug delivery 622 ATP or GABA at the concentrations indicated in the figure legends, together with a 623 red dye to visualize fluid ejection (SeTau-647, SETA BioMedicals), were applied 624 locally by pressure ejection from patch pipettes (resistance ~10 MΩ; capillary inner 625 diameter 0.86 mm, outer diameter 1.5 mm - Harvard Apparatus 30-0057) coupled to 626 a Picospritzer III (Parker) (puff duration 10 ms, pressure 12.5 psi unless otherwise 627 indicated), which was triggered by the same software as odor delivery. The patch 628 pipette was mounted on a micromanipulator (Patchstar, Scientifica) and positioned at 629 the tip of the vertical lobe, close to the junction point in the horizontal lobe, or in the 630 central part of the calyx. Before initiating recording, fluid was manually ejected to 631 ensure that the pipette was not blocked. For experiments where ATP or GABA were 632 applied during odor stimulus, the fluid ejection was triggered at the same time as the 633 odor pulse, although the odor arrived slightly later due to the travel time of the air 634 stream.

635 Electric shock 636 A rectangle of stacked copper plates was brought into contact with the fly’s abdomen 637 using a manually movable stage (DT12XYZ/M, Thorlabs). The design of the copper 638 plates was based on (Felsenberg et al., 2018). Shocks were provided by a DS3 639 Constant Current Isolated Stimulator (1.2 s, 32 mA, Digitimer; maximum voltage 90 640 V) and triggered by the same software as the odor delivery. Successful shock 641 delivery was confirmed by observing the fly’s physical reaction with a Genie Nano- 642 M1280 camera (Teledyne Dalsa) coupled to a 1x lens with working distance 67 mm 643 (SE-16SM1, CCS).

21 bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

644 Functional imaging 645 Flies were cold-anesthetized and mounted using wax and dental floss in a hole in a 646 piece of aluminum foil fixed to a perfusion chamber, such that the fly’s dorsal and 647 ventral sides were kept on opposite sides of the foil. The dorsal part was immersed

648 in carbogenated (95% O2, 5% CO2) external solution (103 mM NaCl, 3 mM KCl, 5

649 mM trehalose, 10 mM glucose, 26 mM NaHCO3, 1 mM NaH2PO4, 3 mM CaCl2, 4 650 mM MgCl2, 5 mM TES, pH 7.3). The cuticle overlying the brain was carefully 651 removed using forceps, followed by removal of fat tissue and trachea. During 652 experiments, the brain was continuously perfused with carbogenated external 653 solution (1.96 ml/min) using a Watson-Marlow pump (120S DM2). 654 655 Brains were initially inspected using widefield microscopy (Moveable Objective 656 Microscope, Sutter) and a xenon-arc lamp (LAMBDA LS, Sutter). Functional imaging 657 was carried out using two-photon laser-scanning microscopy (Ng et al., 2002; Wang 658 et al., 2003). Fluorescence was excited by a Ti-Sapphire laser (Mai Tai eHP DS, 659 Spectra-Physics; 80 MHz, 75-80 fs pulses) set to 910 nm, which was attenuated by a 660 Pockels cell (350-80LA, Conoptics) and steered by a galvo-resonant scanner 661 (RESSCAN-MOM, Sutter). Excitation was focussed using a 1.0 NA 20X objective 662 (XLUMPLFLN20XW, Olympus). Emitted light passed through a 750 nm short pass 663 filter (to exclude excitation light) and bandpass filters (green: 525/50; red: 605/70), 664 and was detected by GaAsP photomultiplier tubes (H10770PA-40SEL, Hamamatsu 665 Photonics) whose currents were amplified (TIA-60, Thorlabs) and transferred to the 666 imaging computer, which ran ScanImage 5 (Vidrio). Volume imaging was carried out 667 using a piezo objective stage (nPFocus400, nPoint). 668 669 Results in Fig. 3 were generated similarly but on different equipment as described in 670 (Lin et al., 2014): Movable Objective Microscope with galvo-galvo scanners, 671 Chameleon Ultra II laser (Coherent), 20x, 1.0 NA W-Plan-Apochromat objective 672 (Zeiss), HCA-4M-500K-C current amplifier (Laser Components), MPScope 2.0 673 software (Sutter). Flies were heated with a TC-10 temperature controller (NPI) and 674 HPT-2 inline perfusion heater (ALA). The temperature at the fly was measured with a 675 TS-200 temperature sensor (NPI) and a USB-1208FS DAQ device (Measurement 676 Computing) at 30 Hz; temperature traces were smoothed over 20 frames by a 677 moving-average filter to remove digitization artifacts.

22 bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

678 679 Structural imaging 680 Dissected VT43924-GAL4.2>GFP brains were fixed in 4% (wt/vol) paraformaldehyde

681 in PBT (100 mM Na2PO4, 0.3% Triton-X-100, pH 7.2), washed in PBT (2 quick 682 washes, then 3 20 min washes) and mounted in Vectashield. Confocal stacks were 683 taken on a Nikon A1 confocal microscope in the Wolfson Light Microscopy Facility. 684 685 Image analysis 686 Motion correction was carried out as in (Lin et al., 2014); flies with excessive 687 uncorrectable motion were discarded. For experiments without 3D-skeletonization 688 (see below), ΔF/F was calculated in ImageJ for manually drawn regions of interest 689 (ROIs). Background fluorescence was taken from an empty region in the deepest z-

690 slice, and subtracted from the ROI fluorescence. F0 was calculated as the average

691 fluorescence during the pre-stimulus period and ∆F/F was calculated as (F-F0)/F0.

692 ∆F/F data were smoothed by a boxcar filter of 5 frames (Fig. 3) or 1 s (Fig 1, 4, 5C- 693 E, 6, 8) for displaying time course traces or calculating the peak response, but not for 694 calculating the average response (Fig. 5F-H, 7). 695 696 3D-skeletonization 697 Where the same neuron was recorded in multiple conditions, movies were aligned by 698 maximizing cross-correlation between the time-averaged mb247-dsRed or mb247- 699 LexA>GCaMP6f signals of each recording. This aligned image was used to define 700 the 3D volume of the mushroom body neuropil by manually outlining it in each z-slice 701 (excluding Kenyon cell somata). This volume mask was converted to a skeleton 702 passing through the center of the major branches of the mushroom body (vertical 703 lobe, horizontal lobe, peduncle/calyx), by manually defining key points (e.g., tip of the 704 vertical/horizontal lobes, junction, places where the structure curves) and connecting 705 them into an undirected graph. 706 707 To compare skeletons across different flies, a ‘standard’ APL skeleton was 708 generated by taking the average length of each branch across all flies (Fig. 5). Each

709 individual skeleton was normalized to this standard skeleton by placing nodes at 710 spacing x*20 µm, where x is the ratio of the branch length of the individual skeleton

23 bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

711 over the branch length of the standard skeleton. The 3D volume of each APL neuron 712 was partitioned into Voronoi cells, each with one of the evenly spaced skeleton

713 nodes as the centroid. For each node, fluorescence signal at each time point was 714 averaged over all voxels in the corresponding Voronoi cell. The background was

715 subtracted and baseline fluorescence calculated as the average fluorescence during 716 the pre-stimulus period. ∆F/F was calculated for each node and time point as the

717 difference between the fluorescence at that time point and the baseline fluorescence, 718 divided by the baseline fluorescence. 719 720 ∆F/F at each node was calculated as both the time-average over the stimulus period

721 (for individual flies), and as the average across flies within a group, to show the time

722 course. In the latter case, time courses were linearly interpolated to a frame time of

723 0.2 s. ∆F/F vs. distance was plotted according to the normalized distance of each 724 node from the dorsal calyx on the ‘standard’ skeleton. Individual nodes were

725 excluded if the standard deviation of ∆F/F during the pre-stimulus period was greater 726 than 1.0 (green channel), or 0.7 (red channel), as such high noise indicated poor

727 signal in that segment. Normalized inhibitory effect (of ATP or GABA) was calculated 728 as (∆F/F odor with ATP/GABA - ∆F/F odor alone) divided by the peak ∆F/F for odor

729 alone. We divided by peak rather than average odor response because this was 730 more robust for recordings where the odor response was low, where normalizing to

731 the average caused extreme magnification of small changes. 732 733 Connectome analysis 734 We reasoned that the strength of lateral inhibition of one Kenyon cell (KC1) onto 735 another (KC2) could be modelled as

736 (Eq. 1)

737 where xi,k1 is the ith synapse from KC1 onto APL, and yj,k2 is the jth synapse from

738 APL onto KC2, and w is given by

24 bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

739 (Eq. 2) 740 where d is the distance between the two synapses along the APL neurite skeleton 741 and λ is the space constant. To take into account the varying widths of APL neurites, 742 we divided the Euclidean distance along each segment of the APL neurite skeleton 743 by the square root of the radius of that segment (in pixels). This approximates the 744 rule that space constants vary with the square root of the radius, so a wider segment 745 is ‘shorter’ (in electrotonic distance) than a narrower segment. The ‘electrotonic’ total 746 length of the APL skeleton was 16.8 mm compared to the actual length of 79.5 mm, 747 so we divided the space constant in real distance by ~4.73 to apply it to ‘electrotonic’ 748 distances. 749 750 To calculate the distance from every KC-APL synapse to every APL-KC synapse 751 (setting no lower threshold on confidence of synapse annotation), we calculated the 752 distance from each APL-KC synapse to its nearest neighbor APL-KC synapses, as 753 measured along the skeleton of APL neurites. We used Dijkstra’s algorithm on the 754 resulting undirected graph to calculate the distance from each APL-KC synapse to 755 every other APL-KC synapse. We then calculated the distance from each KC-APL 756 synapse to its nearest neighbor APL-KC synapses, and combined this with the 757 distances between APL-KC synapses to find the distance from every KC-APL 758 synapse to every APL-KC synapse. 759 760 To simulate the space constant, we placed ~10,000 points at random on APL’s 761 neurite skeleton. We divided the mushroom body skeleton (Fig. 6) into 10 µm

762 segments. We simulated the activity in segment si (i = 1...35) as the count of every

763 pair between points in si and points in the whole APL, weighted by the distance

764 separating the pair:

765 (Eq. 3)

766 where w(pj, pk) depends on the distance between points pj and pk (as in Eq. 2), Nsi is

767 the number of points (j∈si) lying within segment si, and n = the number of random 768 points (~10,000). We excluded points outside the mushroom body (e.g., the neurite 769 leading to the APL soma).

25 bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

770 771 Analysis of RNA-seq data 772 Raw transcripts per million (TPM) counts (Aso et al., 2019) were summed

773 arithmetically across splice variants for each gene. The log10 of each resulting value

774 was taken. To prevent negative infinities, we set the log10 of zero values to be -2 775 (i.e., TPM = 0.01), because the minimum TPM value in the dataset was 0.1. The

776 arithmetic mean of log10(TPM) was taken across biological replicates for each cell 777 type (i.e., geometric mean of raw TPM). Gene Ontology (Ashburner et al., 2000; 778 The Gene Ontology Consortium, 2019) was used to categorize by biological process 779 the 1529 genes in which APL’s TPM counts were higher than all 20 other cell types 780 in the dataset. The list of ion channels was curated from The Interactive Fly and 781 (Groschner et al., 2018); genes whose mean TPM across all non-APL MB neurons 782 was less than 1 were excluded. 783 784 Statistics and software 785 Statistical analysis and curve fitting were carried out in Prism 8 (GraphPad). 786 Parametric (t-test, ANOVA) or non-parametric tests (Wilcoxon, Mann-Whitney, 787 Friedman, Kruskal-Wallis) were used depending on whether data passed the 788 D’Agostino-Pearson (or Shapiro-Wilk, for small n) normality test. Traces of manual 789 ROIs were analysed in Igor Pro 7 (WaveMetrics). 3D-skeletonisation and analysis of 790 connectome and RNA-seq data was carried out with custom software written in 791 Matlab (MathWorks). No explicit power analysis was used to pre-determine sample 792 sizes; we used sample sizes comparable to those used in similar studies (e.g., (Zhou 793 et al., 2019)). The experimenter was not blind to experimental conditions or 794 genotypes. 795 796 Acknowledgements 797 We thank Moshe Parnas, Przemyslaw Stempor, Natalia Bulgakova, and members of 798 the Lin and Juusola labs for discussions, Yoshinori Aso for sharing the RNA-seq 799 data before publication, Saket Navlakha for help with accessing the hemibrain data, 800 Mark Kelly for preliminary analyses of data from (Takemura et al., 2017), Emmanuel 801 Perisse for the design of the electric shocker, Vanessa Ruta, the Bloomington Stock 802 Center, and the Vienna Drosophila Resource Center for fly stocks, and Lily Bolsover, 803 Chloe Donahue, Kath Whitley, Josh Marston, Rachael Thomas, and Rachid Achour

26 bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

804 for technical assistance. This work was supported by the European Research 805 Council (639489) and the Biotechnology and Biological Sciences Research Council 806 (BB/S016031/1). 807 808 Author contributions 809 H.A.: Conceptualization, Software, Formal analysis, Investigation, Visualization, 810 Methodology, Writing–original draft, Writing–review and editing 811 R.S.-G.: Investigation, Writing–review and editing 812 E.V.: Resources, Writing–review and editing 813 A.C.L.: Conceptualization, Software, Formal analysis, Supervision, Funding 814 acquisition, Investigation, Visualization, Methodology, Writing–original draft, Writing– 815 review and editing 816 817 Figure legends 818 819 Figure 1. Spatially restricted responses to electric shock in APL 820 (A) Diagrams of regions used to quantify APL activity in (B-C). 821 (B) APL responses to electric shock (left) or the odor isoamyl acetate (right) in the 822 regions defined in (A), in 474-GAL4>GCaMP6f flies. Traces show mean ± SEM 823 shading. Electric shock trace is the average of 3 shocks with 12 s between onset of 824 each shock. Horizontal black lines show timing of electric shock (1.2 s) or odor (5 s). 825 (C) Mean ∆F/F during the intervals shaded in panel (B). ## p<0.01, ### p<0.001, 826 one-sample Wilcoxon test vs null hypothesis (0) with Holm-Bonferroni correction for 827 multiple comparisons. * p<0.05, *** p<0.001, Friedman t-test with Dunn’s multiple 828 comparisons test for each group (V, H, S, and γ) against each other. n, given as # 829 neurons (# flies): electric shock, 19 (15); odor, 13 (11). 830 831 Figure 2. Low expression of voltage-gated Na+ and Ca2+ channels in APL 832 (A) Expression levels of GABAergic markers and various Na+, Ca2+, K+, Cl- and other 833 channels, in APL compared to non-APL mushroom body neurons, normalized to the 834 mean of non-APL neurons. Box plots show the distribution of expression levels in

835 non-APL MB neurons (whiskers show full range), using the average of log10(TPM) 836 across biological replicates for each type. Red dots show 5 biological replicates of

27 bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

837 APL; red line shows the mean APL expression level. Genes are grouped by type and 838 sorted by fold difference in APL expression relative to non-APL MB neurons. Data 839 from (Aso et al., 2019). TPM, transcripts per million. 840 (B) Heat map of TPM counts (log scale) for all genes shown in (A), for all 21 cell 841 types. 842 843 Figure 3. Activating subsets of Kenyon cells only activates the corresponding 844 lobe of APL 845 (A) Time-averaged images of APL in a cross-section of the lower vertical lobe 846 (dotted line in diagram) at room temperature (< 25 ºC) vs. heated (> 30 ºC). 847 Activating α′β′ Kenyon cells expressing 0853-GAL4-driven dTRPA1 activates the α′ 848 lobe, but not the α lobe, of APL. APL expresses GCaMP3 driven by GH146-QF. 849 (B) Example responses to heating (black), by the α′ (red) and α (blue) lobes in the 850 same APL recording. 851 (C) ∆F/F for the α′ (red) and α (blue) lobes plotted against temperature. Each trace

852 represents one recording forms a loop: it rises as the fly is heated and falls down a 853 different path as the fly is cooled. 854 (D-F) As for (A-C) except activating αβ and γ Kenyon cells (mb247-GAL4>dTRPA1) 855 drives activity in the α, but not the α′ lobe of APL. 856 (G,H) As for (C) and (F) except activating αβ Kenyon cells with c739-GAL4 (G) or 857 NP3061-GAL4 (H). 858 (I) Maximum ∆F/F between 30 ºC and the peak temperature, summarizing data from 859 (C,F-H). Lines indicate the same APL recording. * p < 0.05, paired t-test with Holm- 860 Bonferroni multiple comparisons correction. n (# flies), left to right: 5, 5, 5, 6. 861 862 Figure 4. Activity in the APL neuron is spatially restricted 863 (A-C) Response of APL in the vertical lobe (red) or calyx (blue) to pressure ejection 864 of 1.5 mM ATP (100 ms pulse, 12.5 psi) in the lobe or calyx, to stimulate APL (A), 865 KCs (B), or negative control flies with lexAop-P2X2 but no LexA driver (C). 866 Schematics show ROIs where responses were quantified (red/blue squares), and 867 where ATP was applied (pipette symbol). Traces show mean ± SEM shading. 868 Vertical lines on traces show time of ATP application; gray shading shows 5 s used 869 to quantify response in (D-F).

28 bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

870 (D-F) Mean ∆F/F from (A-C), when stimulating APL (D), KCs (E), or negative 871 controls (F). Error bars show SEM. 872 n, given as # neurons (# flies): (A,D): 11 (9); (B,E): 11 (7); (C,F) 8 (4). *** p<0.001, t- 873 tests with Holm Sidak multiple comparisons correction. ## p = 0.004, paired t-test: 874 the ratio of (response in unstimulated site)/(response in stimulated) site is higher for 875 calyx stimulation than lobe stimulation. 876 877 Figure 5. Quantification of activity spread in APL 878 (A) 3D visualization of an example mushroom body manually outlined using mb247- 879 dsRed as an anatomical landmark. The skeleton is shown as a red line passing 880 through the center of each branch of the mushroom body, manually defined by the 881 red dots. Evenly spaced nodes every 20 µm on the skeleton subdivide the 882 mushroom body into segments, here color-coded according to distance from the 883 dorsal calyx (scale on right). 884 (B) Schematic of the ‘standard’ 3D skeleton with distances (µm) measured from the 885 dorsal calyx. Color code as in panel A. In this and later figures, signals are quantified 886 using the two outermost segments of the calyx (C, black), vertical lobe (V, green), 887 and horizontal lobe (H, blue), as shown here. 888 (C-E) Traces show the time course of the response in each segment of APL, 889 averaged across flies, when stimulating APL with 0.75 mM ATP (10 ms puff at 12.5 890 psi) in the horizontal lobe (C), vertical lobe (D), or calyx (E). Upper panels: GCaMP6f 891 signal. Lower panels: Red dye signal. The baseline fluorescence for the red dye 892 signal comes from mb247-dsRed. Color-coded skeleton indicates which segments 893 have traces shown (dotted lines mean the data is omitted for clarity; the omitted data 894 appear in panels F-H). Gray shading shows the time period used to quantify ∆F/F in

895 (F-H). Vertical black lines indicate the timing of ATP application. 896 (F-H) Mean response in each segment (∆F/F averaged over time in the gray shaded

897 period in C-E). The color of the curves matches the vertical (green) and horizontal 898 (blue) lobular branches depicted in the schematics. The responses in each panel 899 were normalized to the highest responding segment (upper panels) or data point 900 (lower panels). Error bars show SEM. n, given as # neurons (# flies): (C, F, D, G) 10 901 (6), (E, H) 6 (4). ## p<0.01, ### p<0.001, one-sample Wilcoxon test or one-sample t- 902 test, vs null hypothesis (0) with Holm-Bonferroni correction for multiple comparisons.

29 bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

903 ** p<0.01, *** p<0.001, Friedman t-test with Dunn’s multiple comparisons test or 904 repeated measures one-way ANOVA with Holm-Sidak’s multiple comparisons test, 905 comparing the stimulated vs the unstimulated sites. See Table S2 for detailed 906 statistics. 907 908 Figure 6. Time courses of APL’s inhibitory effect on KC activity 909 Traces show the time course of the response in each segment of KCs, averaged 910 across flies, when stimulating APL with 0.75 mM ATP (10 ms puff at 12.5 psi) in the 911 horizontal lobe (A), vertical lobe (B), or calyx (C). (D) shows responses in negative 912 control flies (UAS-P2X2 alone). Columns 1-3 show responses of KCs to: (A1-D1) 913 activation of the APL neuron by ATP, (A2-D2) the odor isoamyl acetate, (A3-D3) or 914 both. (A4-D4) Normalized inhibitory effect of APL neuron activation on KC responses 915 to isoamyl acetate (i.e., (column 3 - column 2)/(maximum of column 2). The color- 916 coded skeleton indicates which segments have traces shown (dotted lines mean the 917 data is omitted for clarity; the omitted data appear in Fig. 7). Vertical and horizontal 918 bars indicate the timing of ATP and odor stimulation, respectively. Gray shading in 919 panels A1-D1 and A4-D4 indicate the intervals used for quantification in Fig. 7A2-C2 920 and A4-C4, respectively. The data in D1-D4 is quantified in Fig. S2. n, given as # 921 neurons (# flies): (A1-A4, B1-B4) 10 (9), (C1-C4) 9 (8), (D1-D4) 5 (3). 922 923 Figure 7. Quantification of the inhibitory effect of GABA or the APL neuron on 924 KC activity 925 Rows: Local application of ATP (0.75 mM) or GABA (7.5 mM) in the horizontal lobe 926 (A1-A5), vertical lobe (B1-B5) or calyx (C1-C5). 927 Columns: Column 1: APL’s response to ATP stimulation (A1-C1), repeated from Fig. 928 5 for comparison. Columns 2-3: KC responses to local activation of APL by ATP (A2- 929 C2) or to GABA application (A3-C3). Columns 4-5: Nnormalized inhibitory effect of 930 APL activation (A4-C4) or GABA application (A5-C5) on KC responses to isoamyl 931 acetate. Data shown are mean responses in each segment (averaged over time in 932 the gray shaded periods in Fig. 6). The color of the curves matches the vertical 933 (green) and horizontal (blue) lobular branches depicted in the schematics shown on 934 the left. The responses were normalized to the segment (upper panels) or data point 935 (lower panels) with the largest absolute value across matching conditions (columns 936 2+3, or columns 4+5). Genotypes: for ATP, mb247-LexA>GCaMP6f, APL>P2X2; for

30 bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

937 GABA, OK107-GAL4>GCaMP6f. The baseline fluorescence for the red dye comes 938 from bleedthrough from the green channel; only trials without odour were used for 939 red dye quantification, in these trials, the change in green bleedthrough (~10-40%) is 940 negligible compared to the increase in red signal (150-300%). n, given as # neurons 941 (# flies): (A1, B1) 10 (6), (C1) 6 (4), (A2, A4, B2, B4) 10 (9), (C2, C4) 9 (8) (A3, A5, 942 B3, B5) 13 (8), (C3, C5) 11 (6). # p<0.05 ### p<0.001, one-sample Wilcoxon test, or 943 one-sample t-test, vs null hypothesis (0) with Holm-Bonferroni correction for multiple 944 comparisons,. * p<0.05, *** p<0.001, Friedman test with Dunn’s multiple 945 comparisons test, or repeated-measures one-way ANOVA with Holm-Sidak multiple 946 comparisons test, comparing the stimulated site vs the unstimulated sites. Diagonal 947 brackets in (A1-A5), paired t-test or Wilcoxon test comparing the response at 948 segment 200 vs 260 on the vertical branch. See Table S2 for detailed statistics. 949 950 Figure 8. Localized activity and KC-APL anatomy suggest that KCs inhibit 951 themselves more than other KCs 952 (A,B) 2000 randomly selected synapses from the set of 96,866 unique KC-APL 953 synapse locations (A) and 15,655 unique APL-KC synapse locations (B). Scale bars 954 50 µm. The KC-APL synapses in the calyx are consistent with reports of presynaptic 955 release from Kenyon cells in the calyx (Christiansen et al., 2011). The relative lack of 956 KC-APL and APL-KC synapses in the posterior peduncle is consistent with the lack 957 of syt-GFP signal in both APL and Kenyon cells in this zone, thought to be the 958 Kenyon cells’ axon initial segment (Trunova et al., 2011; Wu et al., 2013). 959 (C) 2000 random points along APL’s neurite skeleton, color-coded by normalized 960 distance from the dorsal calyx along the average skeleton in Fig. 5. 961 (D) Red dye signal from Fig. 5 in 10 µm segments (dots), with fitted exponential 962 decay curves (lines), for stimulation in the horizontal lobe (D1), vertical lobe (D2), 963 and calyx (D3). The slight discontinuity in the curve fit for D1 arises because the 964 calyx-to-junction branch has slightly different fits for the calyx-to-vertical vs. calyx-to- 965 horizontal branches; where the two merge, we averaged the fits together. 966 (E) Real activity in APL from Fig. 5 (dots) compared to simulated activity for different 967 space constants (lines), given localized stimulation defined by fitted curves in (D) in 968 the horizontal lobe (E1), vertical lobe (E2), and calyx (E3). 969 (F) Schematic of metric s(k1,k2) for predicting how strongly KC1 inhibits KC2 via 970 APL given the space constant λ and the relative distances (d) between KC1-APL

31 bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

971 (xi,k1) and APL-KC2 (yj,k2) synapses along APL’s neurite skeleton. The variable 972 thickness of the APL-KC2 synapses depicts how synapses closer to the KC1-APL

973 synapse (xi,k1) are weighted more strongly. The other KC1-APL synapses are greyed 974 out to show that although they are part of the double summation, the focus in the

975 diagram is on distances between xi,k1 and APL-KC2 synapses. 976 (G) s(k1,k2) for all pairs of KCs, for space constant 50 µm. αβ, α′β′, γ subtypes as 977 annotated in the hemibrain v1.0.1. Note that s(k1,k2) is higher along the diagonal. 978 KCs were sorted by subtype as annotated in the hemibrain dataset, and reordered 979 by hierarchical clustering to place similar KCs within the same subtype next to each 980 other. 981 (H) As (G) except space constant is infinite.

982 (I) As (G) except only including APL-KC synapses (yj,k2 in panel F) that are in the 983 calyx. In (H-I), the order of KCs is preserved from (G). 984 (J-L) The violin plots show, for each KC1, the ratio of s(k1,k1) (self-inhibition; on- 985 diagonal pixels in G-I) vs. the average of s(k1,k2) (inhibiting other KCs; off-diagonal 986 pixels in G-I), given different space constants (λ), where k2 includes all other KCs 987 (J), or all other KCs within the same subtype (K). (L) As (K) except only including 988 APL-KC synapses in the calyx. The squares above the violin plots mark in red which 989 pixels are being analyzed from a heat map of s(k1,k2) as in panel G: i.e., for “self”, 990 the diagonal pixels; for “other”, the off-diagonal pixels; for “other, same subtype”, the 991 off-diagonal pixels for KCs of the same subtype. “Synapse IDs”: For “Scrambled” 992 (but not “Real”), the identities of which Kenyon cell each KC-APL or APL-KC 993 synapse belonged to were shuffled. Solid horizontal lines show the median; dotted 994 lines show 25% and 75% percentile. n = 1921 KCs (8 of 1929 KCs are annotated as 995 atypical or questionable KCs). * p < 0.0001, different from 1.0 by Wilcoxon test with 996 Holm-Bonferroni correction for multiple comparisons. 997 998 Figure S1. Expression patterns of driver lines 999 (A) Maximum intensity projection of confocal image of VT43924-GAL4.2-SV40 > 1000 UAS-CD8::GFP. 1001 (B) Individual z-slices of 474-GAL4 > UAS-CD8::GFP (unfixed brain imaged on two- 1002 photon). B1 shows APL in mushroom body lobes (dashed white outline); B2 shows 1003 APL in the anterior peduncle, tip of the vertical lobe, and tip of the β′ lobe (dashed 1004 white outlines) and the APL cell body (arrow). B1 and B2 are 18 µm apart. Note the

32 bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

1005 typical morphology of APL with neurites running largely parallel to Kenyon cells. A 1006 complete z-projection of 474-GAL4’s expression pattern is available at 1007 http://www.columbia.edu/cu/insitedatabase/adultbrain/IT.0474.jpg 1008 (Gohl et al., 2011). 1009 mb247-GAL4, c739-GAL4, NP3061-GAL4 and GH146-QF were described previously 1010 (Potter et al., 2010; Qin et al., 2012; Zhou et al., 2019). The expression pattern of 1011 853-GAL4 is available at 1012 http://www.columbia.edu/cu/insitedatabase/adultbrain/IT.0853.jpg 1013 1014 Figure S2. Additional data for Fig. 7: quantification of effect of ATP on negative 1015 control (UAS-P2X2 only) 1016 Rows: Local application of ATP (0.75 mM) in the horizontal lobe (A1-A2), vertical 1017 lobe (B1-B2) or calyx (C1-C2). 1018 Columns: KC responses to APL activation by ATP (A1-C1), or the normalized 1019 inhibitory effect of APL neuron activation on KC responses to isoamyl acetate (A2- 1020 C2). Data shown are mean responses in each segment (averaged over time in the 1021 gray shaded periods in Fig. 6). The color of the curves matches the vertical (green) 1022 and horizontal (blue) lobular branches depicted in the schematics shown on the left. 1023 The responses were normalized to the segment (upper panels) or data point (lower 1024 panels) with the largest absolute value in the corresponding experimental conditions 1025 (columns 2 and 3 in Fig. 7 for column 1; columns 4 and 5 in Fig. 7 for column 2). N: 1026 5 neurons, 3 flies. # p<0.05, one-sample t-test, vs null hypothesis (0) with Holm- 1027 Bonferroni correction for multiple comparisons. ns, p>0.05, one-way ANOVA with 1028 Holm-Sidak’s multiple comparisons test, comparing the stimulated site vs the 1029 unstimulated sites. Paired t-test comparing the response at segment 200 vs 260 on 1030 the vertical branch gives p=0.2218 (A1), p=0.9397 (A2). 1031 1032 Figure S3. Time courses of GABA’s effect on KC activity 1033 Rows: Local application of ATP (7.5 mM) in the horizontal lobe (A1-A2), vertical lobe 1034 (B1-B2) or calyx (C1-C2). 1035 Columns: Responses of KCs to GABA application (A1-C1), the odor isoamyl acetate 1036 (A2-C2), or both (A3-C3). (A4-C4) Normalized inhibitory effect of GABA application 1037 on KC responses to isoamyl acetate.

33 bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

1038 Traces show the time course of the response in each segment of KCs, averaged 1039 across flies. Color-coded skeleton indicates which segments have traces shown 1040 (dotted lines mean the data is omitted for clarity; the omitted data appear Fig. 7). 1041 Vertical and horizontal bars indicate the timing of GABA and odor stimulation, 1042 respectively. 1043 1044 Figure S4. Additional data for Fig. 8 1045 (A-C) Simulating local activation of APL with space constants 25, 50 and 75 µm. (A) 1046 and (B) repeated from Fig. 8D,E for comparison. (C) Simulated activity ignoring APL 1047 neurite morphology, treating the Voronoi cells as points on perpendicular straight 1048 lines. The same exponential decay applies as in B, except that the distance between 1049 points is the cityblock distance, i.e., the distance along the straight-line skeleton, not ! 1050 the APL’s neurite skeleton (as in B): ��������(�!) = !!! �(�!, �!) 1051 Note that 50 µm gives the best fit for horizontal lobe and calyx stimulation, while 25 1052 µm gives the best fit for vertical lobe stimulation. 1053 (D) Diameter of neurites in each Voronoi cell of APL. Line shows mean, shaded area 1054 shows 5th to 95th percentile, and thin line above shows the maximum. Mean and 1055 percentiles were calculated by weighting each link in APL’s neurite skeleton by its 1056 length. 1057 1058 Figure S5. All-to-all inhibition decorrelates population activity better than self- 1059 inhibition (figure accompanying Appendix) 1060 (A) For a toy example of two neurons and two stimuli, self-inhibition improves the 1061 stimulus separation (i.e, increases angle φ between the two stimulus vectors) by 1062 bringing activity down closer to spiking threshold, but all-to-all inhibition improves the 1063 separation more. Note that to simplify the model, we model the inhibitory interneuron 1064 as being activated by the principal neurons’ dendrites, as occurs with Kenyon cells 1065 and APL. 1066 (B) Generalization of result in (A) to wider activity range in the two neurons. Heat

1067 maps show cosine distance for different values of �! and � (increasing �! means 1068 more excitation; decreasing � means the stimuli are more different). The self- 1069 inhibition panel is the same as the no-inhibition panel, just stretched vertically (i.e., 1070 self-inhibition acts as gain control), whereas the all-to-all inhibition panel expands the

34 bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

1071 range of high cosine distances toward more similar stimulus pairs. Blank areas mean 1072 the activity is zero because excitation is below threshold, so cosine distance is 1073 undefined. 1074 (C) Generalization of (A,B) to population of 100 neurons. Stimulus 1 is sampled from 1075 a uniform distribution over (0, 1). Stimulus 2 is Stimulus 1 plus Gaussian noise 1076 (magnitude of noise governed by σ; higher σ means the two stimuli are more 1077 different). Heat maps show cosine distance for different thresholds (θ) and σ 1078 averaged over 100 trials. 1079 (D) Coding level (fraction of active neurons) for different thresholds and σ as in (C); 1080 note how decreasing coding level (increased sparseness) correlates with higher 1081 cosine distance. 1082 (E) Each curve is one column (one value of σ) from the heat maps in (C) and (D), 1083 showing how cosine distance improves with lower coding levels. Adding inhibition 1084 does not change this curve; it merely shifts the model to different points along the 1085 curve. All-to-all inhibition achieves higher cosine distance (more decorrelated 1086 activity) than self-inhibition or no inhibition. 1087 1088 Supplementary Material: 1089 Appendix: Effect of self-inhibition vs. all-to-all inhibition on decorrelation of 1090 population activity 1091 Table S1: List of full genotypes 1092 Table S2: Details of statistical analysis 1093 1094 References 1095 1096 Amin, H., and Lin, A.C. (2019). Neuronal mechanisms underlying innate and learned 1097 olfactory processing in Drosophila. Current Opinion in Insect Science 36, 9–17.

1098 Asahina, K., Louis, M., Piccinotti, S., and Vosshall, L.B. (2009). A circuit supporting 1099 concentration-invariant odor perception in Drosophila. J Biol 8, 9.

1100 Ashburner, M., Ball, C.A., Blake, J.A., Botstein, D., Butler, H., Cherry, J.M., Davis, 1101 A.P., Dolinski, K., Dwight, S.S., Eppig, J.T., et al. (2000). Gene ontology: tool for the 1102 unification of biology. The Gene Ontology Consortium. Nat. Genet. 25, 25–29.

1103 Aso, Y., and Rubin, G.M. (2016). Dopaminergic neurons write and update memories 1104 with cell-type-specific rules. Elife 5, e16135.

35 bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

1105 Aso, Y., Hattori, D., Yu, Y., Johnston, R.M., Iyer, N.A., Ngo, T.-T.B., Dionne, H., 1106 Abbott, L.F., Axel, R., Tanimoto, H., et al. (2014). The neuronal architecture of the 1107 mushroom body provides a logic for associative learning. Elife 3, e04577.

1108 Aso, Y., Ray, R.P., Long, X., Bushey, D., Cichewicz, K., Ngo, T.-T., Sharp, B., 1109 Christoforou, C., Hu, A., Lemire, A.L., et al. (2019). Nitric oxide acts as a 1110 cotransmitter in a subset of dopaminergic neurons to diversify memory dynamics. 1111 Elife 8, e49257.

1112 Barnstedt, O., Owald, D., Felsenberg, J., Brain, R., Moszynski, J.-P., Talbot, C.B., 1113 Perrat, P.N., and Waddell, S. (2016). Memory-Relevant Mushroom Body Output 1114 Synapses Are Cholinergic. Neuron 89, 1237–1247.

1115 Branco, T., and Häusser, M. (2010). The single dendritic branch as a fundamental 1116 functional unit in the nervous system. Curr Opin Neurobiol 20, 494–502.

1117 Chen, T.-W., Wardill, T.J., Sun, Y., Pulver, S.R., Renninger, S.L., Baohan, A., 1118 Schreiter, E.R., Kerr, R.A., Orger, M.B., Jayaraman, V., et al. (2013). Ultrasensitive 1119 fluorescent proteins for imaging neuronal activity. Nature 499, 295–300.

1120 Christiansen, F., Zube, C., Andlauer, T.F.M., Wichmann, C., Fouquet, W., Owald, D., 1121 Mertel, S., Leiss, F., Tavosanis, G., Farca Luna, A.J., et al. (2011). Presynapses in 1122 Kenyon Cell Dendrites in the Mushroom Body Calyx of Drosophila. J Neurosci 31, 1123 9696–9707.

1124 Clowney, E.J., Iguchi, S., Bussell, J.J., Scheer, E., and Ruta, V. (2015). Multimodal 1125 Chemosensory Circuits Controlling Male Courtship in Drosophila. Neuron 87, 1036– 1126 1049.

1127 Cohn, R., Morantte, I., and Ruta, V. (2015). Coordinated and Compartmentalized 1128 Neuromodulation Shapes Sensory Processing in Drosophila. Cell 163, 1742–1755.

1129 Connolly, J.B., Roberts, I.J., Armstrong, J.D., Kaiser, K., Forte, M., Tully, T., and 1130 O'Kane, C.J. (1996). Associative learning disrupted by impaired Gs signaling in 1131 Drosophila mushroom bodies. Science 274, 2104–2107.

1132 Crocker, A., Guan, X.-J., Murphy, C.T., and Murthy, M. (2016). Cell-Type-Specific 1133 Transcriptome Analysis in the Drosophila Mushroom Body Reveals Memory-Related 1134 Changes in Gene Expression. Cell Rep 15, 1580–1596.

1135 Croset, V., Treiber, C.D., and Waddell, S. (2018). Cellular diversity in the Drosophila 1136 midbrain revealed by single-cell transcriptomics. Elife 7, e34550.

1137 Davie, K., Janssens, J., Koldere, D., De Waegeneer, M., Pech, U., Kreft, Ł., Aibar, 1138 S., Makhzami, S., Christiaens, V., Bravo González-Blas, C., et al. (2018). A Single- 1139 Cell Transcriptome Atlas of the Aging Drosophila Brain. Cell 174, 982–998.e20.

1140 Eichler, K., Li, F., Litwin-Kumar, A., Park, Y., Andrade, I., Schneider-Mizell, C.M., 1141 Saumweber, T., Huser, A., Eschbach, C., Gerber, B., et al. (2017). The complete 1142 connectome of a learning and memory centre in an insect brain. Nature 548, 175– 1143 182.

36 bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

1144 Euler, T., Detwiler, P.B., and Denk, W. (2002). Directionally selective calcium signals 1145 in dendrites of starburst amacrine cells. Nature 418, 845–852.

1146 Felsenberg, J., Jacob, P.F., Walker, T., Barnstedt, O., Edmondson-Stait, A.J., 1147 Pleijzier, M.W., Otto, N., Schlegel, P., Sharifi, N., Perisse, E., et al. (2018). 1148 Integration of Parallel Opposing Memories Underlies Memory Extinction. Cell 175, 1149 709–722.e715.

1150 Gao, X.J., Clandinin, T.R., and Luo, L. (2015). Extremely sparse olfactory inputs are 1151 sufficient to mediate innate aversion in Drosophila. PLoS ONE 10, e0125986.

1152 Gohl, D.M., Silies, M.A., Gao, X.J., Bhalerao, S., Luongo, F.J., Lin, C.-C., Potter, 1153 C.J., and Clandinin, T.R. (2011). A versatile in vivo system for directed dissection of 1154 gene expression patterns. Nat Methods 8, 231–237.

1155 Gordon, M.D., and Scott, K. (2009). Motor control in a Drosophila taste circuit. 1156 Neuron 61, 373–384.

1157 Grimes, W.N., Zhang, J., Graydon, C.W., Kachar, B., and Diamond, J.S. (2010). 1158 Retinal parallel processors: more than 100 independent microcircuits operate within 1159 a single interneuron. Neuron 65, 873–885.

1160 Groschner, L.N., Chan Wah Hak, L., Bogacz, R., DasGupta, S., and Miesenböck, G. 1161 (2018). Dendritic Integration of Sensory Evidence in Perceptual Decision-Making. 1162 Cell 173, 894–905.e13.

1163 Hige, T., Aso, Y., Modi, M.N., Rubin, G.M., and Turner, G.C. (2015). Heterosynaptic 1164 Plasticity Underlies Aversive Olfactory Learning in Drosophila. Neuron 88, 985–998.

1165 Hodgkin, A.L., and Rushton, W.A.H. (1946). The electrical constants of a crustacean 1166 nerve fibre. Proc. R. Soc. Med. 134, 444–479.

1167 Hong, W., Zhu, H., Potter, C.J., Barsh, G., Kurusu, M., Zinn, K., and Luo, L. (2009). 1168 Leucine-rich repeat transmembrane proteins instruct discrete targeting in an 1169 olfactory map. Nat Neurosci 12, 1542–1550.

1170 Hu, A., Zhang, W., and Wang, Z. (2010). Functional feedback from mushroom 1171 bodies to antennal lobes in the Drosophila olfactory pathway. Proc. Natl. Acad. Sci. 1172 USA 107, 10262–10267.

1173 Inada, K., Tsuchimoto, Y., and Kazama, H. (2017). Origins of Cell-Type-Specific 1174 Olfactory Processing in the Drosophila Mushroom Body Circuit. Neuron 95, 357– 1175 367.e4.

1176 Kakihara, K., Shinmyozu, K., Kato, K., Wada, H., and Hayashi, S. (2008). 1177 Conversion of plasma membrane topology during epithelial tube connection requires 1178 Arf-like 3 small GTPase in Drosophila. Mechanisms of Development 125, 325–336.

1179 Lai, S.-L., and Lee, T. (2006). Genetic mosaic with dual binary transcriptional 1180 systems in Drosophila. Nat Neurosci 9, 703–709.

1181 Lee, T., Lee, A., and Luo, L. (1999). Development of the Drosophila mushroom

37 bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

1182 bodies: sequential generation of three distinct types of neurons from a neuroblast. 1183 Development 126, 4065–4076.

1184 Lei, Z., Chen, K., Li, H., Liu, H., and Guo, A. (2013). The GABA system regulates the 1185 sparse coding of odors in the mushroom bodies of Drosophila. Biochem. Biophys. 1186 Res. Commun. 436, 35–40.

1187 Lima, S.Q., and Miesenböck, G. (2005). Remote control of behavior through 1188 genetically targeted photostimulation of neurons. Cell 121, 141–152.

1189 Lin, A.C., Bygrave, A.M., de Calignon, A., Lee, T., and Miesenböck, G. (2014). 1190 Sparse, decorrelated odor coding in the mushroom body enhances learned odor 1191 discrimination. Nat Neurosci 17, 559–568.

1192 Littleton, J.T., and Ganetzky, B. (2000). Ion channels and synaptic organization: 1193 analysis of the Drosophila genome. 26, 35–43.

1194 Liu, Q., Yang, X., Tian, J., Gao, Z., Wang, M., Li, Y., and Guo, A. (2016). Gap 1195 junction networks in mushroom bodies participate in visual learning and memory in 1196 Drosophila. Elife.

1197 Liu, X., and Davis, R.L. (2008). The GABAergic anterior paired lateral neuron 1198 suppresses and is suppressed by olfactory learning. Nat Neurosci 12, 53–59.

1199 Liu, X., Krause, W.C., and Davis, R.L. (2007). GABAA receptor RDL inhibits 1200 Drosophila olfactory associative learning. Neuron 56, 1090–1102.

1201 Mao, Z., and Davis, R.L. (2009). Eight different types of dopaminergic neurons 1202 innervate the Drosophila mushroom body neuropil: anatomical and physiological 1203 heterogeneity. Front. Neural. Circuits 3, 5.

1204 Masuda-Nakagawa, L.M., Ito, K., Awasaki, T., and O'Kane, C.J. (2014). A single 1205 GABAergic neuron mediates feedback of odor-evoked signals in the mushroom body 1206 of larval Drosophila. Front. Neural. Circuits 8, 35.

1207 Mayseless, O., Berns, D.S., Yu, X.M., Riemensperger, T., Fiala, A., and Schuldiner, 1208 O. (2018). Developmental Coordination during Olfactory Circuit Remodeling in 1209 Drosophila. Neuron 99, 1204–1215.e1205.

1210 Ng, M.M., Roorda, R.D.R., Lima, S.Q., Boris V BV Zemelman, Morcillo, P.P., and 1211 Miesenböck, G. (2002). Transmission of olfactory information between three 1212 populations of neurons in the antennal lobe of the fly. Neuron 36, 463–474.

1213 Olsen, S.R., Bhandawat, V., and Wilson, R.I. (2010). Divisive normalization in 1214 olfactory population codes. Neuron 66, 287–299.

1215 Packer, A.M., Russell, L.E., Dalgleish, H.W.P., and Häusser, M. (2015). 1216 Simultaneous all-optical manipulation and recording of neural circuit activity with 1217 cellular resolution in vivo. Nat Methods 12, 140–146.

1218 Papadopoulou, M., Cassenaer, S., Nowotny, T., and Laurent, G. (2011). 1219 Normalization for sparse encoding of odors by a wide-field interneuron. Science 332,

38 bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

1220 721–725.

1221 Pfeiffer, B.D., Ngo, T.-T.B., Hibbard, K.L., Murphy, C., Jenett, A., Truman, J.W., and 1222 Rubin, G.M. (2010). Refinement of tools for targeted gene expression in Drosophila. 1223 Genetics 186, 735–755.

1224 Pitman, J.L., Huetteroth, W., Burke, C.J., Krashes, M.J., Lai, S.-L., Lee, T., and 1225 Waddell, S. (2011). A pair of inhibitory neurons are required to sustain labile memory 1226 in the Drosophila mushroom body. Current Biology 21, 855–861.

1227 Potter, C.J., Tasic, B., Russler, E.V., Liang, L., and Luo, L. (2010). The Q system: a 1228 repressible binary system for transgene expression, lineage tracing, and mosaic 1229 analysis. Cell 141, 536–548.

1230 Qin, H., Cressy, M., Li, W., Coravos, J.S., Izzi, S.A., and Dubnau, J. (2012). Gamma 1231 Neurons Mediate Dopaminergic Input during Aversive Olfactory Memory Formation 1232 in Drosophila. Current Biology 1–7.

1233 Ray, S., Aldworth, Z.N., and Stopfer, M.A. (2019). Feedback inhibition and its control 1234 in an insect olfactory circuit. bioRxiv 117, 624528.

1235 Ren, Q., Li, H., Wu, Y., Ren, J., and Guo, A. (2012). A GABAergic inhibitory neural 1236 circuit regulates visual reversal learning in Drosophila. J. Neurosci. 32, 11524– 1237 11538.

1238 Riemensperger, T., Völler, T., Stock, P., Buchner, E., and Fiala, A. (2005). 1239 Punishment prediction by dopaminergic neurons in Drosophila. Current Biology 15, 1240 1953–1960.

1241 Root, C.M., Masuyama, K., Green, D.S., Enell, L.E., Nässel, D.R., Lee, C.-H., and 1242 Wang, J.W. (2008). A Presynaptic Gain Control Mechanism Fine-Tunes Olfactory 1243 Behavior. Neuron 59, 311–321.

1244 Takemura, S.-Y., Aso, Y., Hige, T., Wong, A., Lu, Z., Xu, C.S., Rivlin, P.K., Hess, H., 1245 Zhao, T., Parag, T., et al. (2017). A connectome of a learning and memory center in 1246 the adult Drosophila brain. Elife 6, 5643.

1247 Tanaka, N.K., Tanimoto, H., and Ito, K. (2008). Neuronal assemblies of the 1248 Drosophila mushroom body. J. Comp. Neurol. 508, 711–755.

1249 The Gene Ontology Consortium (2019). The Gene Ontology Resource: 20 years and 1250 still GOing strong. Nucleic Acids Res. 47, D330–D338.

1251 Tian, L., Hires, S.A., Mao, T., Huber, D., Chiappe, M.E., Chalasani, S.H., Petreanu, 1252 L., Akerboom, J., McKinney, S.A., Schreiter, E.R., et al. (2009). Imaging neural 1253 activity in worms, flies and mice with improved GCaMP calcium indicators. Nat 1254 Methods 6, 875–881.

1255 Tobin, W.F., Wilson, R.I., and Lee, W.-C.A. (2017). Wiring variations that enable and 1256 constrain neural computation in a sensory microcircuit. Elife 6, e24838.

1257 Trunova, S., Baek, B., and Giniger, E. (2011). Cdk5 regulates the size of an axon

39 bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

1258 initial segment-like compartment in mushroom body neurons of the Drosophila 1259 central brain. J. Neurosci. 31, 10451–10462.

1260 Turner, G.C., Bazhenov, M., and Laurent, G. (2008). Olfactory representations by 1261 Drosophila mushroom body neurons. J. Neurophysiol. 99, 734–746.

1262 Wang, G., Zhou, B., Wang, S., Yang, K., Zhao, J., Yang, X., Li, Y., and Shen, L. 1263 (2019). The reconstruction and functional mapping of a recurrent microcircuit in 1264 Drosophila mushroom body. bioRxiv 126, 819227.

1265 Wang, J.W., Wong, A.M., Flores, J., Vosshall, L.B., and Axel, R. (2003). Two-photon 1266 calcium imaging reveals an odor-evoked map of activity in the fly brain. Cell 112, 1267 271–282.

1268 Wu, C.-L., Shih, M.-F.M., Lee, P.-T., and Chiang, A.-S. (2013). An octopamine- 1269 mushroom body circuit modulates the formation of anesthesia-resistant memory in 1270 Drosophila. Current Biology 23, 2346–2354.

1271 Wu, Y., Ren, Q., Li, H., and Guo, A. (2012). The GABAergic anterior paired lateral 1272 neurons facilitate olfactory reversal learning in Drosophila. Learning & Memory 19, 1273 478–486.

1274 Xu, C.S., Januszewski, M., Lu, Z., Takemura, S.-Y., Hayworth, K., Huang, G., 1275 Shinomiya, K., Maitin-Shepard, J., Ackerman, D., Berg, S., et al. (2020). A 1276 Connectome of the Adult Drosophila Central Brain. bioRxiv 2020.01.21.911859.

1277 Yang, M.Y., Armstrong, J.D., Vilinsky, I., Strausfeld, N.J., and Kaiser, K. (1995). 1278 Subdivision of the Drosophila mushroom bodies by enhancer-trap expression 1279 patterns. Neuron 15, 45–54.

1280 Zars, T. (2000). Localization of a Short-Term Memory in Drosophila. Science 288, 1281 672–675.

1282 Zhang, X., Coates, K., Dacks, A., Günay, C., Lauritzen, J.S., Li, F., Calle-Schuler, 1283 S.A., Bock, D., and Gaudry, Q. (2019). Local synaptic inputs support opposing, 1284 network-specific odor representations in a widely projecting modulatory neuron. Elife 1285 8, 787.

1286 Zheng, Z., Lauritzen, J.S., Perlman, E., Robinson, C.G., Nichols, M., Milkie, D., 1287 Torrens, O., Price, J., Fisher, C.B., Sharifi, N., et al. (2018). A Complete Electron 1288 Microscopy Volume of the Brain of Adult . Cell 174, 730– 1289 743.e22.

1290 Zhou, M., Chen, N., Tian, J., Zeng, J., Zhang, Y., Zhang, X., Guo, J., Sun, J., Li, Y., 1291 Guo, A., et al. (2019). Suppression of GABAergic neurons through D2-like receptor 1292 secures efficient conditioning in Drosophila aversive olfactory learning. Proc. Natl. 1293 Acad. Sci. USA 3, 201812342.

1294

40 bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

A Quantified ROIs V Upper vertical lobe S Vertical lobe V stalk ≈ 24 μm γ γ1-γ3 of horizontal S lobe H Rest of horizontal lobe H γ

B Electric shock Odor

20% ∆F/F 5 s

C ## ### ## ## ns ns ns 1.0 1.0 ### ## ### ## * ***** ** ns ns *** 0.5 ns ns 0.5

Mean ∆F/F 0.0 0.0

V S γ H V S γ H

Figure 1. Spatially restricted responses to electric shock in APL (A) Diagrams of regions used to quantify APL activity in (B-C). (B) APL responses to electric shock (left) or the odor isoamyl acetate (right) in the regions defined in (A), in 474-GAL4>GCaMP6f flies. Traces show mean ± SEM shad- ing. Electric shock trace is the average of 3 shocks with 12 s between onset of each shock. Horizontal black lines show timing of electric shock (1.2 s) or odor (5 s). (C) Mean ∆F/F during the intervals shaded in panel (B). ## p<0.01, ### p<0.001, one-sample Wilcoxon test vs null hypothesis (0) with Holm-Bonferroni correction for multiple comparisons. * p<0.05, *** p<0.001, Friedman t-test with Dunn’s multiple comparisons test for each group (V, H, S, and γ) against each other. n, given as # neurons (# flies): electric shock, 19 (15); odor, 13 (11). bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

A 4 non-APL MB neurons APL 2

0 log10 ratio

-2 TPM APL / mean TPM non-APL / mean APL TPM -4 Ca2+ Na+ K+ Cl- other GABA na Sh slo Hk sei SK rpml Elk kcc Rdl fwe cac ask6 ask7 eag tipE RyR para Shal Ca-β Shab Gad1 Shaw T T T Lcch3 VG AT Shawl KCNQ GluClα SERCA Ca-α1T Ca-α1D Itp-r83A olf186-F CG1688 CG42594 CG42346 NaCP60E B γ α′β′ KCs αβ γ1pedc TPM γ5 1000 γ2α′1 α3 α′2α2 β′2α 100 γ4>γ1γ2 Dopaminergic γ3 α1 10 β1β2 γ1pedc>α/β α3 1 α1 β1>α α′3 MBONs γ5β′2α DPM APL

Figure 2. Low expression of voltage-gated Na+ and Ca2+ channels in APL (A) Expression levels of GABAergic markers and various Na+, Ca2+, K+, Cl- and other channels, in APL compared to non-APL mushroom body neurons, normalized to the mean of non-APL neurons. Box plots show the distribution of expression levels in non-APL MB neurons (whiskers show full range), using the average of log10(TPM) across biological replicates for each type. Red dots show 5 biological replicates of APL; red line shows the mean APL expression level. Genes are grouped by type and sorted by fold difference in APL expres- sion relative to non-APL MB neurons. Data from (Aso et al., 2019). TPM, tran- scripts per million. (B) Heat map of TPM counts (log scale) for all genes shown in (A), for all 21 cell types. bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

α < 25 ºC > 30 ºC Temperature A B α′ C ∆F/F 1.5 APL>GCaMP3 32 α 20% α′ 0853>dTRPA1 50 s (α′β′ KCs) 30 1.0 28 0.5 ∆F/F 26 α 0.0

α' 5 µm (ºC) Temperature 24 -0.5 24 28 32 D E 34 ∆F/F F APL>GCaMP3 50% 2.5 α mb247>dTRPA1 32 50 s 2.0 α′ (αβ,γ KCs) 30 1.5 28 1.0 ∆F/F 26 0.5 α 24 5 µm (ºC) Temperature 0.0 α' 22 24 28 32 G c739>dTRPA1 (αβ KCs) H NP3061>dTRPA1 (αβ KCs) I 3 Temp. (ºC) α lobe 1.5 α 1.5 α α′ α′ α′ lobe 1.0 1.0 2 * * ** 0.5 0.5 ∆F/F 0.0 ∆F/F 0.0 1 -0.5 -0.5 -1.0 Max. ∆F/F above 30 ºC 24 28 32 22 24 26 28 30 32 0 Temp. (ºC) Temp. (ºC) 0853 mb247 c739 NP3061

Figure 3. Activating subsets of Kenyon cells only activates the correspond- ing lobe of APL (A) Time-averaged images of APL in a cross-section of the lower vertical lobe (dotted line in diagram) at room temperature (< 25 ºC) vs. heated (> 30 ºC). Activating α′β′ Kenyon cells expressing 0853-GAL4-driven dTRPA1 activates the α′ lobe, but not the α lobe, of APL. APL expresses GCaMP3 driven by GH146-QF. (B) Example responses to heating (black), by the α′ (red) and α (blue) lobes in the same APL recording. (C) ∆F/F for the α′ (red) and α (blue) lobes plotted against temperature. Each trace represents one recording forms a loop: it rises as the fly is heated and falls down a different path as the fly is cooled. (D-F) As for (A-C) except activating αβ and γ Kenyon cells (mb247-GAL4>dTR- PA1) drives activity in the α, but not the α′ lobe of APL. (G,H) As for (C) and (F) except activating αβ Kenyon cells with c739-GAL4 (G) or NP3061-GAL4 (H). (I) Maximum ∆F/F between 30 ºC and the peak temperature, summarizing data from (C,F-H). Lines indicate the same APL recording. * p < 0.05, paired t-test with Holm-Bonferroni multiple comparisons correction. n (# flies), left to right: 5, 5, 5, 6. bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

APL>GCaMP6f ATP APL>P2X2 A B KC>P2X2 C lexAop-P2X2 (no driver)

ATP ∆F/F ∆F/F ∆F/F 100% 100% 100% 5 s 5 s 5 s

D *** E F *** ## Response in: 5 5 5 4 4 4 Lobe 3 3 3 Calyx 2 2 2

∆F/F 1 ∆F/F 1 ∆F/F 1 0 0 0 -1 -1 -1 Stim calyx Stim lobe Stim calyx Stim lobe Stim calyx Stim lobe

Figure 4. Activity in the APL neuron is spatially restricted (A-C) Response of APL in the vertical lobe (red) or calyx (blue) to pressure ejection of 1.5 mM ATP (100 ms pulse, 12.5 psi) in the lobe or calyx, to stimulate APL (A), KCs (B), or negative control flies with lexAop-P2X2 but no LexA driver (C). Schematics show ROIs where responses were quantified (red/blue squares), and where ATP was applied (pipette symbol). Traces show mean ± SEM shading. Vertical lines on traces show time of ATP application; gray shading shows 5 s used to quantify response in (D-F). (D-F) Mean ∆F/F from (A-C), when stimulating APL (D), KCs (E), or negative controls (F). Error bars show SEM. n, given as # neurons (# flies): (A,D): 11 (9); (B,E): 11 (7); (C,F) 8 (4). *** p<0.001, t-tests with Holm Sidak multiple comparisons correction. ## p = 0.004, paired t-test: the ratio of (response in unstimulated site)/(response in stimulated) site is higher for calyx stimulation than lobe stimulation. bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

A B 260 V

C H

0 µm 180 240 50 μm

APL>GCaMP6f, P2X2

C V ATP D V ATP E ATP V C H C H C H

∆F/F GCaMP6f 200% response 5 s

∆F/F Red dye 20% indicator 5 s

F Dye Resp. G H V lobe 260 ATP 260 260 H lobe V V V C 0 C 0 C 0 ATP

ATP H H H 240 240 240 2 180 2 180 2 180

1 1 1

0 0 0 ∆F/F 60 120 180 240 60 120 180 240 60 120 180 240 -1 Dist -1 Dist -1 ## ## ## ### Dist *** ns 1 1 ***** 1 *** *** Normalized 0 0 0

-1 -1 -1 C H V C H V C H V

Figure 5. Quantification of activity spread in APL (A) 3D visualization of an example mushroom body manually outlined using mb247-dsRed as an anatomical landmark. The skeleton is shown as a red line passing through the center of each branch of the mushroom body, manually defined by the red dots. Evenly spaced nodes every 20 µm on the skeleton subdivide the mushroom body into segments, here color-coded according to distance from the dorsal calyx (scale on right). (B) Schematic of the ‘standard’ 3D skeleton with distances (µm) measured from the dorsal calyx. Color code as in panel A. In this and later figures, signals are quantified using the two outermost segments of the calyx (C, black), vertical lobe (V, green), and horizontal lobe (H, blue), as shown here. (C-E) Traces show the time course of the response in each segment of APL, averaged across flies, when stimulating APL with 0.75 mM ATP (10 ms puff at 12.5 psi) in the horizontal lobe (C), vertical lobe (D), or calyx (E). Upper panels: GCaMP6f signal. Lower panels: Red dye signal. The baseline fluores- cence for the red dye signal comes from mb247-dsRed. Color-coded skeleton indicates which segments have traces shown (dotted lines mean the data is omitted for clarity; the omitted data appear in panels F-H). Gray shading shows the time period used to quantify ∆F/F in (F-H). Vertical black lines indicate the timing of ATP application. (F-H) Mean response in each segment (∆F/F averaged over time in the gray shaded period in C-E). The color of the curves matches the vertical (green) and horizontal (blue) lobular branches depicted in the schematics. The responses in each panel were normalized to the highest responding segment (upper panels) or data point (lower panels). Error bars show SEM. n, given as # neurons (# flies): (C, F, D, G) 10 (6), (E, H) 6 (4). ## p<0.01, ### p<0.001, one-sample Wilcoxon test or one-sample t-test, vs null hypothesis (0) with Holm-Bonferroni correction for multiple comparisons. ** p<0.01, *** p<0.001, Friedman t-test with Dunn’s multiple comparisons test or repeated measures one-way ANOVA with Holm-Sidak’s multiple comparisons test, comparing the stimulated vs the unstimulated sites. See Table S2 for detailed statistics. bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

KC>GCaMP6f Normalized inhibitory effect (Odor+ATP - Odor alone)

ATP Odor Odor+ATP (Odor alone)max A A1 A2 A3 A4 Effect V ATP ∆F/F ∆F/F 100% 5 s 5 s C H 50% 50% 5 s

B B1 B2 B3 B4 APL> V ATP P2X2 C H

C1 C2 C3 C4 C ATP V C H

D1 D2 D3 D4 UAS- D ATP V P2X2 C alone H

Figure 6. Time courses of APL’s inhibitory effect on KC activity Traces show the time course of the response in each segment of KCs, averaged across flies, when stimulating APL with 0.75 mM ATP (10 ms puff at 12.5 psi) in the horizontal lobe (A), vertical lobe (B), or calyx (C). (D) shows responses in negative control flies (UAS-P2X2 alone). Columns 1-3 show responses of KCs to: (A1-D1) activation of the APL neuron by ATP, (A2-D2) the odor isoamyl acetate, (A3-D3) or both. (A4-D4) Normalized inhibitory effect of APL neuron activation on KC responses to isoamyl acetate (i.e., (column 3 - column 2)/(maximum of column 2). The color-coded skeleton indicates which segments have traces shown (dotted lines mean the data is omitted for clarity; the omitted data appear in Fig. 7). Vertical and hori- zontal bars indicate the timing of ATP and odor stimulation, respectively. Gray shading in panels A1-D1 and A4-D4 indicate the intervals used for quantification in Fig. 7A2-C2 and A4-C4, respectively. The data in D1-D4 is quantified in Fig. S2. n, given as # neurons (# flies): (A1-A4, B1-B4) 10 (9), (C1-C4) 9 (8), (D1-D4) 5 (3). ATP C C C bioRxiv preprint branch. See Table S2fordetailed statistics. responseatsegment200vs260 onthevertical (A1-A5), pairedt-testor Wilcoxon testcomparingthe the unstimulatedsites.Diagonalbracketsin comparisons test,comparing thestimulatedsitevs Dunn’s one-way multiplecomparisonstest,orrepeated-measures ANOVA withHolm-Sidakmultiple *p<0.05,***p<0.001,Friedmantestwith Holm-Bonferroni correctionformultiplecomparisons,. one-samplet-test,vsnullhypothesis(0)with # p<0.05###p<0.001,one-sampleWilcoxontest, or B1) 10(6),(C1)6(4),(A2, A4, B2,B4)10(9),(C2,C4)9(8)(A3, A5, B3, B5) 13(8),(C3,C5)11 (6). n,givenas#neurons(#flies):(A1, negligible comparedtotheincreaseinredsignal (150-300%). thechangeingreenbleedthrough(~10-40%)is were usedforreddyequantification,inthesetrials, thegreenchannel;onlytrialswithoutodour cence forthereddyecomesfrombleedthrough from ATP, mb247-LexA>GCaMP6f, APL>P2X2; forGABA,OK107-GAL4>GCaMP6f. The baselinefluores- 2+3,orcolumns4+5).Genotypes:for largest absolutevalueacrossmatchingconditions (columns panels)ordatapoint(lowerwiththe The responseswerenormalizedtothesegment (upper depictedintheschematicsshownonleft. vertical (green)andhorizontal(blue)lobularbranches Fig. 6). (averaged overtimeinthegrayshadedperiods The colorofthecurvesmatches (A5-C5) (A3-C3) of son. Columns2-3:KCresponsestolocalactivation APL by ATP (A2-C2)ortoGABA application Columns: Column1: APL’s responseto ATP stimulation(A1-C1),repeatedfromFig.5forcompari- lobe (B1-B5) Rows: Localapplicationof ATP (0.75mM)orGABA (7.5mM)inthehorizontallobe(A1-A5),vertical Figure 7.Quantificationoftheinhibitoryeffect GABA orthe APL neurononKCactivity C B A (which wasnotcertifiedbypeerreview)istheauthor/funder,whohasgrantedbioRxivalicensetodisplaypreprintinperpetuity.It ATP 0 0 0 180 180 180 260 260 260 V V V ATP on KC responses to isoamyl acetate. Data shown aremeanresponsesineachsegment onKCresponsestoisoamylacetate.Data . Columns4-5:Nnormalizedinhibitoryeffect of APL activation(A4-C4)orGABA application 240 240 240 H H H doi: Normalized ∆F/F Normalized ∆F/F Normalized ∆F/F orcalyx(C1-C5) -1 -1 -1 -1 -1 -1 0 1 2 0 1 2 0 1 0 1 0 1 0 1 2 https://doi.org/10.1101/2020.03.26.008300 C1 B1 A1 APL>P2X2 + ATPAPL>P2X2 APL>GCaMP6f C 01010240 180 120 60 C C ### 01010240 180 120 60 01010240 180 120 60 *** ***** Dist Dist Dist H H H ## * *** *** ns V V V ## ## *** made availableundera

. Normalized ∆F/F Normalized ∆F/F Normalized ∆F/F -1 -1 -1 -1 -1 -1 0 1 2 0 1 0 1 2 0 1 0 1 2 0 1 C2 B2 A2 APL>P2X2 + ATPAPL>P2X2 C C C ## 01010240 180 120 60 01010240 180 120 60 01010240 180 120 60 ** *** ns Dist Dist Dist H H ### H ## ## Effect onspontaneousactivity * *** *** ** V V V ## ## ## CC-BY-NC 4.0Internationallicense *** ; this versionpostedMarch26,2020.

Normalized ∆F/F Normalized ∆F/F Normalized ∆F/F -1 -1 -1 -1 -1 -1 0 1 0 1 2 0 1 0 1 2 0 1 2 0 1 C3 B3 A3 C C C 01010240 180 120 60 01010240 180 120 60 01010240 180 120 60 # # ** * * *** GABA ns Dist Dist Dist H H ## H ### ### * ns V ## V V ## ## KC>GCaMP6f **

Normalized inhibitory effect Normalized inhibitory effect Normalized inhibitory effect -1 -1 -1 -1 -1 -1 0 1 2 0 1 0 1 2 0 1 0 1 0 1 2 C4 B4 A4 . APL>P2X2 + ATPAPL>P2X2 C C C 01010240 180 120 60 01010240 180 120 60 01010240 180 120 60 # # * *** **** The copyrightholderforthispreprint ns Dist Dist Dist H H H ## ## # ** ns Effect onodorresponse V V V ## ## # **

Normalized inhibitory effect Normalized inhibitory effect Normalized inhibitory effect -1 -1 -1 -1 -1 -1 0 1 2 0 1 0 1 2 0 1 0 1 2 0 1 C5 B5 A5 ### ### C C C 01010240 180 120 60 01010240 180 120 60 01010240 180 120 60 # *** * * *** GABA ns Dist Dist Dist ### ### H H H ### * ns ### ### V V V ## * bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

Norm. dist. from A B C calyx (µm) KC-APL synapses APL-KC synapses Random points 270

0 D

50 µm V M P L A

260 ATP 260 260 D V V V C 0 C 0 C 0 ATP

ATP H H H 240 240 240 1.0 D1 180 1.0 D2 180 D3 1.0 180 Dye Fit V lobe H lobe 0.5 0.5 0.5

0.0 0.0 0.0 100 200 100 200 100 200

1.0 1.0 1.0 E E1 E2 Simulated, λ = E3 real 25 50 75 µm V lobe H lobe 0.5 0.5 0.5 Normalized ∆F/F at time of peak

0.0 0.0 0.0 100 200 100 200 100 200 Distance from dorsal calyx (µm) Distance from dorsal calyx (µm) Distance from dorsal calyx (µm)

KC1 (activating APL) F G γ αβ H I α′β′ γ γd a c sp

500 8000 200

{

KC1 KC2APL

KC2 (inhibited by APL) KC2 (inhibited by 0 0 0

λ = 50 µm λ = ∞ λ = 50 µm, APL-KC2 in calyx only

self other self other self other J K same subtype L same subtype

vs. vs. vs. APL-KC2 in calyx only

50 50 50 7 7 7 7 *** ns ns 7 *** ns ns 7 *** ns ns 6 6 6 on-diagonal 5 5 5 off-diagonal 4 4 4 KCs inhibit self 3 3 3 more than others 2 2 2 1 1 1 KCs inhibit self 0 0 0 less than others λ (µm): 25 50 75 ∞ 25 25 50 75 ∞ 25 25 50 75 ∞ 25 Synapse IDs: Real Scrambled Real Scrambled Real Scrambled

Figure 8 (legend in manuscript text) bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

A

VT43924-GAL4.2

50 µm B B1

474-GAL4 B2

20 µm

Figure S1. Expression patterns of driver lines (A) Maximum intensity projection of confocal image of VT43924-GAL4.2-SV40 > UAS-CD8::GFP. (B) Individual z-slices of 474-GAL4 > UAS-CD8::GFP (unfixed brain imaged on two-photon). B1 shows APL in mushroom body lobes (dashed white outline); B2 shows APL in the anterior peduncle, tip of the vertical lobe, and tip of the β′ lobe (dashed white outlines) and the APL cell body (arrow). B1 and B2 are 18 µm apart. Note the typical morphology of APL with neurites running largely parallel to Kenyon cells. A complete z-projection of 474-GAL4’s expression pattern is availa- ble at http://www.columbia.edu/cu/insitedatabase/adultbrain/IT.0474.jpg (Gohl et al., 2011). mb247-GAL4, c739-GAL4, NP3061-GAL4 and GH146-QF were described previ- ously (Potter et al., 2010; Qin et al., 2012; Zhou et al., 2019). The expression pattern of 853-GAL4 is available at http://www.columbia.edu/cu/insitedatabase/adultbrain/IT.0853.jpg bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

KC>GCaMP6f Effect on spontaneous activity Effect on odor response P2X2 (no driver) + ATP A1 A2 A 2 2 1 1

0 0 60 120 180 240 60 120 180 240 260 ∆F/F -1 -1 V Dist Dist 0 C ns ns ns ns 1 1 H 240 180 ATP Normalized 0 0

-1 Normalized inhibitory effect -1 C H V C H V B B1 B2 2 2

1 1

0 0 60 120 180 240 60 120 180 240

ATP ∆F/F -1 260 Dist -1 Dist V 0 C ns ns ns ns 1 1 H

240 180 Normalized 0 0 Normalized inhibitory effect -1 -1 C C H V C H V 2 C1 2 C2

1 1

0 0 260 60 120 180 240 60 120 180 240

V ∆F/F -1 Dist -1 Dist ATP 0 C ### ns ns ns ns H 1 1 240 180

Normalized 0 0

-1 Normalized inhibitory effect -1 C H V C H V

Figure S2. Additional data for Fig. 7: quantification of effect of ATP on negative control (UAS-P2X2 only) Rows: Local application of ATP (0.75 mM) in the horizontal lobe (A1-A2), vertical lobe (B1-B2) or calyx (C1-C2). Columns: KC responses to APL activation by ATP (A1-C1), or the normalized inhibitory effect of APL neuron activation on KC responses to isoamyl acetate (A2-C2). Data shown are mean responses in each segment (averaged over time in the gray shaded periods in Fig. 6). The color of the curves matches the vertical (green) and horizontal (blue) lobular branches depicted in the schematics shown on the left. The responses were normal- ized to the segment (upper panels) or data point (lower panels) with the largest absolute value in the correspond- ing experimental conditions (columns 2 and 3 in Fig. 7 for column 1; columns 4 and 5 in Fig. 7 for column 2). N: 5 neurons, 3 flies. # p<0.05, one-sample t-test, vs null hypothesis (0) with Holm-Bonferroni correction for multiple comparisons. ns, p>0.05, one-way ANOVA with Holm-Sidak’s multiple comparisons test, comparing the stimulat- ed site vs the unstimulated sites. Paired t-test comparing the response at segment 200 vs 260 on the vertical branch gives p=0.2218 (A1), p=0.9397 (A2). bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

KC>GCaMP6f Normalized inhibitory effect (Odor+GABA - Odor alone)

GABA Odor Odor+GABA (Odor alone)max

A A1 A2 A3 A4 V Effect ATP ∆F/F ∆F/F 100% 5 s C H 50% 5 s 50% 5 s

B1 B2 B3 B4 B V ATP C H

C1 C2 C3 C4 C ATP V C H

Figure S3. Time courses of GABA’s effect on KC activity Rows: Local application of ATP (7.5 mM) in the horizontal lobe (A1-A2), vertical lobe (B1-B2) or calyx (C1-C2). Columns: Responses of KCs to GABA application (A1-C1), the odor isoamyl acetate (A2-C2), or both (A3-C3). (A4-C4) Normalized inhibitory effect of GABA application on KC responses to isoamyl acetate. Traces show the time course of the response in each segment of KCs, averaged across flies. Color-coded skeleton indicates which segments have traces shown (dotted lines mean the data is omitted for clarity; the omitted data appear Fig. 7). Vertical and horizontal bars indicate the timing of GABA and odor stimulation, respectively. bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

260 ATP 260 260 V V V C 0 C 0 C 0 ATP

ATP H H H 180 240 180 240 180 240 A 1.0 1.0 1.0 Dye Fit V lobe H lobe Spread of red dye 0.5 0.5 0.5

0.0 0.0 0.0 100 200 100 200 100 200 B 1.0 1.0 Simulated, λ = 1.0 Spread of activity across real 25 50 75 µm APL neurite skeleton V lobe H lobe 0.5 0.5 0.5

0.0 0.0 0.0

Normalized ∆F/F at time of peak 100 200 100 200 100 200 1.0 1.0 1.0 C Spread of activity across Simulated, λ = straight-line MB skeleton real 25 50 75 µm V lobe 270 H lobe V 0.5 0.5 0.5

C H

0 µm 190 250 0.0 0.0 0.0 100 200 100 200 100 200 Distance from dorsal calyx (µm) Distance from dorsal calyx (µm) Distance from dorsal calyx (µm)

3 V lobe D H lobe

2 Maximum

1 95th %ile Mean Neurite diameter (µm) 5th %ile 0 0 100 200 Distance from dorsal calyx (µm)

Figure S4. Additional data for Fig. 8 (A-C) Simulating local activation of APL with space constants 25, 50 and 75 µm. (A) and (B) repeated from Fig. 8D,E for comparison. (C) Simulated activity ignoring APL neurite morpholo- gy, treating the Voronoi cells as points on perpendicular straight lines. The same exponential decay applies as in B, except that the distance between points is the cityblock distance, i.e., the distance along the straight-line skeleton, not the APL’s neurite skeleton (as in B) [see legend in manuscript file for formula]. Note that 50 µm gives the best fit for horizontal lobe and calyx stimulation, while 25 µm gives the best fit for vertical lobe stimulation. (D) Diameter of neurites in each Voronoi cell of APL. Line shows mean, shaded area shows 5th to 95th percentile, and thin line above shows the maximum. Mean and percentiles were calcu- lated by weighting each link in APL’s neurite skeleton by its length. bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

No inhibition Self inhibition All-to-all inhibition A No inhibition Self inhibition All-to-all inhibition 0 0 0 (6, 7) C (7, 6) 6 6 6 0.1 0.1 0.1 ) ) ) 2 2 2 0.2 0.2 0.2 4 4 4 1 φ 0.3 0.3 0.3 (1.5, 2) (1.25,2.25) 2 φ 2 φ 2 φ Neuron 2 (y =9º Neuron 2 (y =16º Neuron 2 (y =32º 0.4 0.4 0.4 φ (2,1.5) φ (2.25,1.25) 0 0 0 θ 0.5 0.5 0.5 0 2 4 6 0 2 4 6 0 2 4 6 0.6 0.6 0.6 Neuron 1 (y1) Neuron 1 (y1) Neuron 1 (y1) Cosine distance

Increasing threshold 0.7 0.7 No activity 0.7 0 (exc. below threshold) B 0.8 0.8 0.8 No inhibition Self inhibition All-to-all inhibition 0.9 0.9 0.9 20 20 20 1 1 1 18 18 18 0.2 0.4 0.6 0.8 1.0 0.2 0.4 0.6 0.8 1.0 0.2 0.4 0.6 0.8 1.0

16 16 16 D 0 0 0 14 14 14 1 0.1 0.1 0.1 12 12 12 0.2 0.2 0.2 10 10 10 1 0.3 0.3 0.3 8 8 8 0.4 0.4 0.4 θ 6 6 6 Cosine distance 0.5 0.5 0.5 0 4 4 4 0.6 0.6 0.6 Coding level Stronger excitation relative to threshold

No activity Increasing threshold 0.7 0.7 0.7 2 2 (exc. below threshold) 2 No activity 0 0.8 0.8 (exc. below threshold) 0.8 0.8 0.6 0.4 0.2 0.8 0.6 0.4 0.2 0.8 0.6 0.4 0.2 0.9 0.9 0.9 Stimuli more different 1 1 1 0.2 0.4 0.6 0.8 1.0 0.2 0.4 0.6 0.8 1.0 0.2 0.4 0.6 0.8 1.0 All-to-all inhibition E 1 improves decorrelation σ Stimuli more different 0.9 No inhibition Self-inhibition 0.8 All-to-all inhibition

0.7 φ )

0.6 Increasing threshold (θ)

0.5 Stimuli getting more different 0.4 (increasing σ) σ=1

Cosine distance (1 - cos 0.3 σ=0.9 σ=0.8 σ=0.7 σ=0.6 0.2 σ=0.5 σ=0.4 0.1 σ=0.3 σ=0.2 σ 0 =0.1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Coding level

Figure S5. All-to-all inhibition decorrelates population activity better than self-inhibition (see Appendix for full description) (A) For a toy example of two neurons and two stimuli, self-inhibition improves the stimulus separation (i.e, increases angle φ between the two stimulus vectors) by bringing activity down closer to spiking threshold, but all-to-all inhibition improves the separation more. Note that to simplify the model, we model the inhibitory interneuron as being activated by the principal neurons’ dendrites, as occurs with Kenyon cells and APL. (B) Generalization of result in (A) to wider activity range in the two neurons. Heat maps show cosine distance for

different values of x0 and a (increasing x0 means more excitation; decreasing a means the stimuli are more different). The self-inhibition panel is the same as the no-inhibition panel, just stretched vertically (i.e., self-inhibition acts as gain control), whereas the all-to-all inhibition panel expands the range of high cosine distances toward more similar stimulus pairs. Blank areas mean the activity is zero because excitation is below threshold, so cosine distance is undefined. (C) Generalization of (A,B) to population of 100 neurons. Stimulus 1 is sampled from a uniform distribution over (0, 1). Stimulus 2 is Stimulus 1 plus Gaussian noise (magnitude of noise governed by σ; higher σ means the two stimuli are more different). Heat maps show cosine distance for different thresholds (θ) and σ averaged over 100 trials. (D) Coding level (fraction of active neurons) for different thresholds and σ as in (C); note how decreasing coding level (increased sparseness) correlates with higher cosine distance. (E) Each curve is one column (one value of σ) from the heat maps in (C) and (D), showing how cosine distance improves with lower coding levels. Adding inhibition does not change this curve; it merely shifts the model to different points along the curve. All-to-all inhibition achieves higher cosine distance (more decorrelated activity) than self-inhibi- tion or no inhibition. bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

Appendix: Effect of self-inhibition vs. all-to-all inhibition on decorrelation of population activity

In this Appendix we develop and formalize all-to-all inhibition - then our intuition for why all-to-all lateral inhibition is better than self-inhibition for decorrelating y = relu(x − αhxi− θ) (4) population activity, i.e., for enhancing contrast where hxi is the average excitation across the between stimuli. population. Using the parameters as for self- Consider two linear rate-coding neurons such inhibition above, y(1) = (1.25, 2.25) and y(2) = that the population response of the two neu- (2.25, 1.25) (Fig. S5A). rons can be described as a vector y = (y1, y2), We quantify the separation in the population e.g., if neuron 1’s activity is 6 and neuron 2’s is response to these two stimuli using the cosine 7, then population activity y = (6, 7). Take a distance, i.e. 1 − cos(φ), where φ is the angle simple case where x = (x1, x2) is the excitation between the two vectors y(1) and y(2). It can be and θ represents the spiking threshold: seen in Fig. S5A that self-inhibition increases the angle between the two vectors, but all-to- y = relu(x − θ) (1) all inhibition increases it even more. We generalize this example to a wider range where relu is a rectified linear unit: of pairs of stimuli: ( (1) x if x ≥ 0 x = (x0, ax0) relu(x) = (2) x(2) = (ax , x ) 0 if x < 0 0 0 where x0 ranges from 1 to 20, a from 0.1 to Suppose the two neurons respond to two simi- 0.9. This generates pairs of stimuli that are lar stimuli, such that x(1) = (9, 10) and x(2) = very different when a is small, e.g., (1.5, 15) (10, 9). If θ = 3, then y(1) = (6, 7), y(2) = (7, 6) and (15, 1.5), or that are very similar when a (plotted on Fig. S5A). is large, e.g. (13.5, 15) and (15, 13.5). We set Consider a form of inhibition in which the θ = 2. principal neurons excite the inhibitory neuron In the no-inhibition case, cosine distances from their dendrites, not necessarily needing to are higher at lower x0 because this brings activ- depolarize above the spiking threshold. This is ity closer to the threshold (Fig. S5B). That is, similar to the mushroom body, where Kenyon (3, 4) and (4, 3) become more different from cells release from their dendrites each other once a threshold of 2 is applied, and locally activate the inhibitory APL. If each turning the vectors to (1, 2) and (2, 1), but principal neuron inhibits only itself by local in- the effect is not so strong for turning (13, 14) hibition - which we call self-inhibition - then and (14, 13) into (11, 12) and (12, 11). Compared to the no-inhibition case, self- y = relu(x−αx−θ) = relu((1−α)x−θ) (3) inhibition increases cosine distances for a given x0 and a. However, this is functionally equiva- where α is the gain on the inhibitory neuron lent to simply raising θ dynamically for higher (0 < α < 1). Here, the self-inhibition is equiv- x0. Visually, this is seen on Fig. S5B by alent to decreasing the gain on the excitation. the way the self-inhibition panel is simply the If we set α = 0.5 and θ = 3, then y(1) = (1.5, 2) no-inhibition panel stretched vertically. That and y(2) = (2, 1.5) (Fig. S5A). If in contrast, is, self-inhibition decorrelates mainly by using the inhibitory neuron adds up the activity of gain control to bring down the activity closer all principal neurons equally - which we call to threshold.

1 bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

In contrast, all-to-all inhibition improves fit created by all-to-all inhibition arises in part decorrelation for higher a (i.e., more similar from pushing the population activity up and stimuli). Visually, this is seen on Fig. S5 as to the left along the curve. A second bene- the zone of large distances expanding to the fit arises at the upper left end of the curve: right. That is, all-to-all inhibition can make this is where population activity falls silent be- similar stimuli appear more distinct. cause θ is so high (corresponding to the blank Next we generalize these intuitions to larger rows in the heat maps). All-to-all inhibition al- populations of neurons. Consider a population lows non-zero population activity to persist a of 100 neurons that receive excitation x: bit further on this curve, where the other two x = (x1, ..., x100) conditions have already fallen silent. In con- Stimulus 1 consists of random numbers be- trast, self-inhibition merely moves population tween 0 and 1 (uniform distribution): activity further along the curve at lower values (1) of θ without moving beyond the range allowed x = (x1, ..., x100) s.t. xi ∼ U(0, 1) Stimulus 2 is similar to Stimulus 1, which without inhibition. we simulate by making it equal to Stimulus 1 plus Gaussian noise with mean 0 and standard deviation σ: x(2) = x(1) + N (µ = 0, σ) We apply these excitations to the no- inhibition, self-inhibition, or all-to-all inhibi- tion conditions, with θ ranging from 0 to 0.1 and σ ranging from 0.1 to 1. For all three conditions, cosine distances increase for higher σ because the two stimuli are more different (Fig. S5C). They also increase for higher θ be- cause more neurons are silenced (i.e., the cod- ing level, or fraction of responsive neurons, is reduced) (Fig. S5D). Compared to the no-inhibition condition, self-inhibition reaches similar cosine distances but at lower θ, consistent with our earlier conclusion that self-inhibition mainly func- tions equivalently to dynamically adjusting the threshold. In other words, self-inhibition helps decorrelate by pushing neurons’ activity down closer to, or indeed below, the threshold. In contrast, all-to-all inhibition (1) reaches higher cosine distances than the other two conditions and (2) allows higher cosine distances at lower thresholds. This can be more clearly understood by plot- ting cosine distance against coding level for dif- ferent values of σ. In Fig. S5E, each line is one column (one value of σ) in the heat maps in Fig. S5C,D. Within this range of parame- ters, the fundamental relation between coding level and cosine distance is fixed for a given σ. That is, for a given σ, all three conditions follow the same curve on the cosine distance vs. coding level graph. What differs is where on the curve they fall. The decorrelating bene-

2 bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

Table S1: List of genotypes used

Figure Shorthand name / Full genotype Purpose

1 APL>GCaMP6f 474-GAL4,mb247-dsRed/+; UAS-GCaMP6f/+ or 474-GAL4,mb247-dsRed/UAS-GCaMP6f; UAS- GCaMP6f/Sb

3 APL>GCaMP3, UAS-dTRPA1/QUAS-GCaMP3; 853-GAL4/GH146-QF or 853>dTRPA1 UAS-dTRPA1/mb247-dsRed, QUAS-GCaMP3; 853- GAL4/GH146-QF

3 APL>GCaMP3, UAS-dTRPA1/QUAS-GCaMP3; mb247-GAL4/GH146-QF mb247>dTRPA1 or UAS-dTRPA1/mb247-dsRed, QUAS-GCaMP3; mb247- GAL4/GH146-QF

3 APL>GCaMP3, c739-GAL4/QUAS-GCaMP3; UAS-dTRPA1/GH146-QF or c739>dTRPA1 c739-GAL4/mb247-dsRed, QUAS-GCaMP3; UAS- dTRPA1/GH146-QF

3 APL>GCaMP3, UAS-dTRPA1/mb247-dsRed, QUAS-GCaMP3; NP3061- NP3061>dTRPA1 GAL4/GH146-QF

4 APL>P2X2 NP2631-GAL4,GH146-FLP,mb247-dsRed/tub>Gal80>, UAS-Cherry; UAS-P2X2/UAS-GCaMP6f

4 KC>P2X2, 474-GAL4,mb247-dsRed/lexAop-P2X2; mb247-LexA/UAS- APL>GCaMP6f GCaMP6f(VK00005)

4 >P2X2 (negative 474-GAL4,mb247-dsRed/UAS-GCaMP6f; +/lexAop-P2X2 control)

6 P2X2 (no driver, UAS-P2X2(attP40)/+; MBLexA, LexAop-GCaMP6f/+ KC>GCaMP6f

5-7 APL>P2X2, UAS-P2X2(attP40)/mb247-dsRed; UAS- GCaMP6f GCaMP6f/VT43924-Gal4.2-SV40

6,7 APL>P2X2, UAS-P2X2(attP40)/+ ; mb247-LexA::VP16, lexAop- KC>GCaMP6f GCaMP6ff/VT43924-Gal4.2-SV40

7 KC>GCaMP6f UAS-GCaMP6f/+ ; +/+ ; OK107-Gal4/+

S1A VT43924- VT43924-GAL4.2(attP2)/UAS-CD8::GFP GAL4.2>GFP

S1B 474-GAL4>GFP 474-GAL4/CyO; UAS-CD8::GFP

S2 P2X2 (no driver, UAS-P2X2(attP40)/+; MBLexA, LexAop-GCaMP6f/+ KC>GCaMP6f

S3 KC>GCaMP6f UAS-GCaMP6f/+ ; +/+ ; OK107-Gal4/+ bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license.

Table S2 - details of statistical analyses Figure Panel Data Statistical test P value Electric shock group V <0.001 One sample Wilcoxon test with Holm- Electric shock group S 0.0034 Bonferroni multiple comparisons Electric shock group γ <0.001 correction Electric shock group H 0.0033 Group V, S, γ, and H Friedman test <0.001 Electric shock V vs S 0.002 Electric shock V vs γ <0.001 Electric shock V vs H 0.004 Dunn's multiple comparisons test Electric shock S vs γ >0.999 Electric shock S vs H >0.999 Electric shock γ vs H >0.999 Fig. 1 C Odor Group V 0.0015 One sample Wilcoxon test with Holm- Odor Group S <0.001 Bonferroni multiple comparisons Odor Group γ 0.0034 correction Odor Group H 0.0034 Odor Group V, S, γ, and H Friedman test <0.001 Odor V vs S 0.772 Odor V vs γ 0.09 Odor V vs H >0.999 Dunn's multiple comparisons test Odor S vs γ <0.001 Odor S vs H 0.037 Odor γ vs H >0.999 853-GAL4, a v. a' 0.0236 mb247-GAL, a v. a' Paired t-tests with Holm-Bonferroni 0.0488 Fig. 3 I c739-GAL4, a v. a' multiple comparisons correction 0.0399 NP3061-GAL4, a v. a' 0.0402 Stim calyx, image calyx 0.0036 Stim calyx, image lobe 0.081 One sample t-test Stim lobe, image calyx 0.4679 D Stim lobe, image lobe <0.001 Stim calyx <0.001 Multiple t tests Stim lobe <0.001 Stim calyx, image calyx 0.0032 Stim calyx, image lobe 0.0015 One sample t-test Stim lobe, image calyx 0.0083 Stim lobe, image lobe <0.001 Fig. 4 Two-way Anova Row factor 0.98 E Stim calyx and stim lobe Two-way Anova Column factor 0.0575 Two-way Anova Interaction <0.001 Response ratio (unstimulated site/stimulated site) Paired t test 0.004 Stim calyx, image calyx 0.5624 Stim calyx, image lobe 0.6186 F One sample t-test Stim lobe, image calyx 0.414 Stim lobe, image lobe 0.5121 Group H One sample Wilcoxon test with Holm- 0.006 Group V Bonferroni multiple comparisons 0.006 Group C correction 0.084 F Group H, V, and C Friedman test <0.001 Group H vs V <0.001 Dunn's multiple comparisons test Group H vs C 0.742 Group H One sample Wilcoxon test with Holm- 0.375 Group V Bonferroni multiple comparisons 0.006 Group C correction 0.6446 Fig. 5 G Group H, V, and C Friedman test <0.001 Group V vs H <0.001 Dunn's multiple comparisons test bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is Fig. 5 G made available under aCC-BY-NC 4.0 International license.

Dunn's multiple comparisons test Group V vs C 0.003 Group H 0.1814 One sample t test with Holm-Bonferroni Group V 0.7177 correction Group C <0.001 H Group H, V, and C Repeated measures one-way Anova <0.001 Group C vs H <0.001 Holm-Sidak's multiple comparisons test Group C vs V <0.001 Green branch (node 200 vs A1 260) Paired t test <0.001 Group H <0.001 One sample t test with Holm-Bonferroni Group V 0.0022 multiple comparisons correction Group C 0.2057 Group H, V, and C Repeated measures one-way Anova <0.001 A2 Group H vs V 0.005 Multiple comparisons Group H vs C <0.001 Green branch (node 200 vs 260) Paired t test <0.001 Group H One sample Wilcoxon test with Holm- <0.001 Group V Bonferroni multiple comparisons 0.0048 Group C correction 0.0479 Group H, V, and C Friedman test <0.001 A3 Group H vs V 0.012 Dunn's multiple comparisons test Group H vs C <0.001 Green branch (node 200 vs 260) Wilcoxon test 0.0017 Group H One sample Wilcoxon test with Holm- 0.006 Group V Bonferroni multiple comparisons 0.006 Group C correction 0.0137 Group H, V, and C Friedman test <0.001 A4 Group H vs V 0.0278 Dunn's multiple comparisons test Group H vs C <0.001 Green branch (node 200 vs 260) paired t test 0.0033 Group H One sample Wilcoxon test with Holm- <0.001 Group V Bonferroni multiple comparisons 0.0034 Group C correction 0.0215 Group H, V, and C Friedman test <0.001 A5 Group H vs V 0.007 Dunn's multiple comparisons test Group H vs C <0.001 Green branch (node 200 vs 260) paired t test 0.0116 B1 Same as Fig. 5 - - Group H 0.0052 One sample t test with Holm-Bonferroni Group V 0.0057 multiple comparisons correction Group C 0.5626 B2 Group H, V, and C Repeated measures one-way Anova <0.001 Group H vs V 0.094 Multiple comparisons Group V vs C 0.003 Group H 0.0015 Fig. 7 One sample t test with Holm-Bonferroni Group V 0.0026 multiple comparisons correction Group C 0.9204 B3 Group H, V, and C Repeated measures one-way Anova <0.001 Group H vs V 0.387 Multiple comparisons Group V vs C 0.003 Group H One sample Wilcoxon test with Holm- 0.006 Group V Bonferroni multiple comparisons 0.006 Group C correction 0.0371 B4 Group H, V, and C Friedman test 0.0456 Group H vs V 0.7422 Dunn's multiple comparisons test Fig. 7

bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is B4 made available under aCC-BY-NC 4.0 International license.

Dunn's multiple comparisons test Group V vs C 0.0278 Group H One sample Wilcoxon test with Holm- <0.001 Group V Bonferroni multiple comparisons <0.001 Group C correction <0.001 B5 Group H, V, and C Friedman test 0.018 Group H vs V 0.866 Dunn's multiple comparisons test Group V vs C 0.012 C1 Same as Fig. 5 - - Group H 0.0012 One sample t test with Holm-Bonferroni Group V 0.007 multiple comparisons correction Group C 0.002 C2 Group H, V, and C Repeated measures one-way Anova <0.001 Group C vs H <0.001 Multiple comparisons Group C vs V <0.001 Group H <0.001 One sample t test with Holm-Bonferroni Group V 0.0158 multiple comparisons correction Group C 0.0208 C3 Group H, V, and C Repeated measures one-way Anova <0.001 Group C vs H 0.001 Multiple comparisons Group C vs V 0.093 Group H One sample Wilcoxon test with Holm- 0.0117 Group V Bonferroni multiple comparisons 0.0117 Group C correction 0.2031 C4 Group H, V, and C Friedman test 0.006 Group C vs H 0.0044 Dunn's multiple comparisons test Group C vs V 0.1187 Group H <0.001 One sample t test with Holm-Bonferroni Group V <0.001 multiple comparisons correction Group C <0.001 C5 Group H, V, and C Repeated measures one-way Anova 0.012 Group C vs H 0.049 Multiple comparisons Group C vs V 0.276 25 µm, all KCs <0.0001 50 µm, all KCs Wilcoxon test (vs. 1.0) with Holm- <0.0001 J 75 µm, all KCs Bonferroni multiple comparisons <0.0001 Inf, all KCs correction 0.9194 25 scrambled, all KCs >0.99 25 µm, within subtype <0.0001 50 µm, within subtype <0.0001 Wilcoxon test (vs. 1.0) with Holm- 75 µm, within subtype <0.0001 K Bonferroni multiple comparisons Fig. 8 Inf, within subtype 0.9478 correction 25 scrambled, within subtype 0.5145 25 µm, APL-KC calyx only <0.0001 50 µm, APL-KC calyx only <0.0001 Wilcoxon test (vs. 1.0) with Holm- 75 µm, APL-KC calyx only <0.0001 L Bonferroni multiple comparisons Inf, APL-KC calyx only 0.3028 correction 25 scrambled, APL-KC calyx only 0.1248 Group H 0.2246 One sample t test with Holm-Bonferroni Group V 0.2191 multiple comparisons correction Group C 0.2934 Group H, V, and C Repeated measures one-way Anova 0.082 A1 Group H vs V 0.738 Multiple comparisons Group H vs C 0.738 Green branch (node 200 vs Paired t test 260) 0.2218 Group H 0.114 One sample t test with Holm-Bonferroni Group V 0.2422 multiple comparisons correction B1

S. Fig. 2 bioRxiv preprint doi: https://doi.org/10.1101/2020.03.26.008300; this version posted March 26, 2020. The copyright holder for this preprint (which was not certified by peer review) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity. It is made available under aCC-BY-NC 4.0 International license. One sample t test with Holm-Bonferroni multiple comparisons correction Group C 0.531 B1 Group H, V, and C Repeated measures one-way Anova 0.036 Group H vs V 0.069 Multiple comparisons Group V vs C 0.158 Group H 0.0408 One sample t test with Holm-Bonferroni Group V 0.0496 multiple comparisons correction Group C 0.0327 C1 Group H, V, and C Repeated measures one-way Anova 0.149 Group C vs H 0.281 Multiple comparisons Group C vs V 0.212 S. Fig. 2 Group H 0.1542 One sample t test with Holm-Bonferroni Group V 0.2168 multiple comparisons correction Group C 0.1665 Group H, V, and C Repeated measures one-way Anova 0.709 A2 Group H vs V 0.934 Multiple comparisons Group H vs C 0.718 Green branch (node 200 vs Paired t test 260) 0.9397 Group H 0.3649 One sample t test with Holm-Bonferroni Group V 0.5698 multiple comparisons correction Group C 0.0783 B2 Group H, V, and C Repeated measures one-way Anova 0.581 Group H vs V 0.995 Multiple comparisons Group V vs C 0.483 Group H One sample Wilcoxon test with Holm- 0.1875 Group V Bonferroni multiple comparisons 0.25 Group C correction 0.1875 C2 Group H, V, and C Friedman test 0.124 Group C vs H 0.116 Dunn's multiple comparisons test Group C vs V 0.116

Decay constants (distance to reach 1/e) for curve fits of red dye in Fig. 8 Stimulus locationBranch direction of decay Decay constant (µm) H stim H to calyx 38.11 to lobe tip 25.94 V to calyx 33.58 to lobe tip 23.2 V stim V to calyx 11.47 C stim H/V to calyx 96.8 to lobe tips 19.98