Neural correlates of individual odor preference in Drosophila

Behavior varies even among genetically identical animals raised in the same environment 1–10 . However, little is known about the circuit or anatomical underpinnings of this individuality 11,12 . Drosophila olfaction is an ideal sys-tem for discovering the origins of behavioral individuality among genetically identical individuals. The fly olfactory circuit is well-characterized 13–16 ,17–19 and stereotyped 15 , yet stable idiosyncrasies in odor preference 4 , neural coding 4 , and neural wiring 20,21 are present and may be relevant to behavior. Using paired behavior and two-photon imaging measurements, we show that individual odor preferences in odor-vs-air and odor-vs-odor assays are predicted by idiosyncratic calcium dynamics in Olfactory Receptor Neurons (ORNs) and Projection Neurons (PNs), respectively. This suggests that circuit variation at the sensory periphery determines individual odor preferences. Furthermore, paired behavior and immunohistochemistry measurements reveal that variation in ORN presynaptic density also predicts odor-vs-odor preference. This point in the olfactory circuit appears to be a locus of individuality where microscale variation gives rise to idiosyncratic behavior. To unify these results, we constructed a leaky-integrate-and-fire model of 3,062 neurons in the antennal lobe. In these simulations, stochastic fluctuations at the glomerular level, like those observed in our ORN immunohistochemistry, produce variation in PN calcium responses with the same structure as we observed experimentally, the very structure that predicts idiosyncratic behavior. Thus, our results demonstrate how minute physiological and structural variations in a neural circuit may produce individual behavior, even when genetics and environment are held constant.


Main Text
Individuals respond differently to identical sensory stimulation.We hypothesize that as sensory cues are encoded and transformed to produce motor outputs, their representation in the nervous system will become increasingly idiosyncratic and predictive of individual behavioral responses.We refer to the ….sites at which this idiosyncrasy emerges as "loci of individuality."To find these loci in the olfactory circuit (Fig  1a), we measured odor preferences and neural responses 4 in the same individuals, and asked whether the latter predicted the former (Fig 1b-d).Focusing on behavioral variation within a genotype, we used isogenic animals expressing the fluorescent calcium reporter GCamp6m 22 in either of the two most ………… ORNs of the same class (gray shading) sense odors in the antennae and synapse together on dendrites of PNs of the same class in ball-shaped structures called glomeruli located in the antennal lobe (AL).Local neurons (LNs, green outline) mediate interglomerular cross-talk and presynaptic inhibition, amongst other roles 73,74 .Odor signals are normalized and whitened in the AL before being sent to the mushroom body and lateral horn for further processing.Schematic adapted from 4 .(b) Experiment outline.(c) Odor preference behavior tracking setup (reproduced from 4 ) and example individual fly ethograms.OCT (green backdrop) and MCH (magenta backdrop) were presented for 3 minutes.(d) Head-fixed 2-photon calcium imaging and odor delivery setup (reproduced from 4 ).(e) Orco and GH146 driver expression profiles (left) and example segmentation masks (right) extracted from 2-photon calcium images for a single fly expressing Orco>GCaMP6m (top, expressed in a subset of all ORN classes) or GH146>Gcamp6m (bottom, expressed in a subset of all PN classes). .We performed head-fixed 2-photon calcium imaging after measuring odor preference in an untethered assay 4 (Fig 1b-d, Fig S1a).Importantly, individual odor preferences are stable over timescales longer than this experiment (Fig S1b).Individual identity was maintained between behavior and imaging experiments by housing flies singly in 96well culture plates 23 .
We measured volumetric calcium responses in the antennal lobe (AL), the site at which ORNs synapse onto PNs in ~50 discrete microcircuits called glomeruli (Fig 1a) 19,24 .Flies were stimulated with a panel of 12   19 .We found that both ORN and PN odor responses were roughly stereotyped across individuals (Fig 1g,h), but also idiosyncratic as expected 4 .Responses in PNs appeared to be more idiosyncratic than ORNs (Fig 1j).We quantified this by training a logistic linear classifier to decode fly identity from glomerular responses.The classifier always attained a higher accuracy when trained on PN than ORN responses (Supplementary Figure 5a).While the responses of single ORNs are known to vary more than those of single PNs 17 , our recordings represent the total response of all ORNs or PNs in a glomerulus.This might explain our observation that ORNs exhibited less idiosyncrasy than PNs.We also found that PN responses were more variable within flies, as measured across the left and right hemisphere ALs, compared to ORN responses (Fig S5c).Higher idiosyncrasy in PNs is consistent with the hypothesis that odor representations become more idiosyncratic farther from the sensory periphery.
Next we analyzed the relationship of idiosyncratic coding to odor preference, by asking in which neurons (if any) did calcium responses predict individual preferences of flies choosing between air and an aversive odor (3-octanol, OCT; Fig S1b,c; Movie 1).Because we could potentially predict preference (a single value) using numerous glomerular-odor predictors, and had a limited number of observations (dozens), we used dimensional reduction to make parsimonious predictions.We computed the principal components (PCs) of the glomerulus-odor responses (in either ORNs or PNs) across individuals (Fig 1g-i, Fig S5-7).Using each of the first 5 PCs of PN calcium responses to linearly predict individual behavior, we found that PC 1 explained 16% of preference variance in a training set of 18 flies (Fig 1k,l).This PC 1-based model explained 10% of preference variance when evaluated on data from test flies (n=35) acquired after fitting the model (Fig 1m).Moreover, we found that PC 1 of ORN neural activity explained 23% of preference variance (Fig 1k, n).Our interpretation is that ORN responses are idiosyncratic and predict individual odor-vs-air preference, and that these idiosyncrasies are transmitted to PNs, where they remain predictive of behavioral responses.
How should we interpret PC1 of ORN responses predicting 23% of the variance of odor preference?This value will fall short of 100% through a combination of two factors: 1) ORN responses not having a linear relationship to behavior, and 2) noise in the measurement of ORN responses and behavior fundamentally capping the prediction performance.To disentangle these effects, and estimate the extent to which the model captured meaningful biological signal, we performed a statistical analysis (Fig S8 ) that factored out estimated error in measuring behavior (Fig S1be) from the model performance.This analysis implies that our model predicting odor-vs-air behavior from PC1 of ORN calcium responses (nominal R 2 =0.23) explains ~80% of the biological signal between these measures.This makes intuitive sense because the raw model R 2 (0.23) is close to the behavior repeatability R 2 (0.27), an upper-limit (Fig S1b).In contrast, the model predicting odor-vs-air behavior from PC1 of PN calcium responses explains ~50% of the biological signal (Fig S9a).
Variation in the sensory periphery has been previously implicated as a driver of behavioral variation 25,26 , but we wondered whether ORNs would be a locus of individuality for a behavior requiring the comparison of two odors (rather than just the sensation of a single odor).So we next determined if idiosyncratic calcium responses (in ORNs or PNs) could predict individual preferences in an odor-vs-odor choice (Fig S1d,e; 4 ; Movie 2), specifically between one aversive monomolecular odorant (OCT) and another (4-methylcyclohexanol, MCH).As before, we assessed if any of the first 5 PCs of PN calcium responses was a linear predictor of individual odor-vs-odor preferences.In this case, we found that PC 2 predicted 15% of preference variance in a training set of 47 flies (Fig 1o-p).This PC 2-based model explained 26% of preference variance when evaluated on test measurements acquired after fitting the model (n=22 flies) (Fig 1q).We infer that this performance corresponds to explaining ~80% of the biological signal between PN calcium responses and odor-vs-odor behavior (Fig S9b model).As expected, this did not predict odor-vs-odor behavior (R 2 =0.06).Therefore, whereas idiosyncratic ORN responses (and PN responses) were predictive of odor-vs-air preferences, only PN responses were predictive of odor-vs-odor preferences.
We next sought an intuitive understanding of the models linking calcium responses and odor preference.We examined the loadings of the ORN and PN PCs and observed that variation across individuals was correlated at the level of glomeruli much more strongly than odorant (Figs S6,7).This suggests that stochastic variation in the olfactory circuit results in individual-level fluctuations in the responses of glomeruli rather than odor-specific responses.Thus, we proceeded to interpret the models in terms of how they were tuned to glomerulus-level responses.In the case of the odor-vs-air model, we noted that the loadings of PC Odor experience has been shown to modulate subsequent AL responses [27][28][29] .This raises the possibility that our models were actually predicting individual flies' past odor experiences (i.e., the specific pattern of odor stimulation flies received in the behavioral assay) rather than their preferences.To address this possibility, we imposed the specific odor experiences of previously monitored untethered flies (in the odor-vs-odor assay) on naive ! 4 Previous work found that PN response transients, rather than fixed points, contain more odor identity information 30 .We therefore asked at which times during odor presentation an individual's neural responses could best predict odor preference.Applying each of our three successful calcium-to-behavior models (ORN PC1-odor-vs-air, PN PC1-odor-vs-air, PN PC2-odor-vsodor) to the time-varying calcium signals, we found that in all cases that behavior prediction generally rose during odor delivery (Fig S10a-c).In ORNs, the predictive accuracy remained high after odor offset, whereas in PNs it declined.Thus, the overall sensitivity of ORNs that appears to predict odor-vs-air preferences may persist after odor stimulation ends.The times during which calcium responses predicted individual behavior generally aligned to the times during which a linear classifier could decode odor identity from ORN or PN responses (Fig S10d ), suggesting that idiosyncrasies in odor encoding predict individual preferences.
Pivoting to another level of biological regulation, we next investigated how structural variation in the nervous system might underlie the variations in neural activity that correlate with idiosyncratic behavior.Because PN, but not ORN, calcium responses predicted odor-vs-odor preference, we hypothesized that a circuit element between ORNs to PNs could confer onto PNs behaviorally-relevant physiological idiosyncrasies that are absent in ORNs.The ORN-PN synapse is an obvious candidate.
We therefore visualized presynaptic T-bar density in ORNs using transgenic mStrawberry-tagged Brp-Short, immunohistochemistry and confocal microscopy 31  We used a semi-automated custom software to segment 4 of the 5 focus glomeruli from confocal volumes of the AL (Fig 3b ; DL5 was not readily segmentable across samples, but was dispensable in all behavior-predicting models).We then quantified the volume, fluorescent intensity and "density" (intensity/volume) of Brp-Short staining within each glomerulus (Fig S11a-f).Of these measures, density was the most consistent across hemispheres, while also showing variation across individuals, so we focused on this metric in subsequent analyses.
To begin assessing the relationship between presynaptic structural variation and behavior, we calculated the principal components of Brp-Short density across individuals and found that PCs 1 and 2 were qualitatively similar to those measured in our calcium imaging experiments in that PC 1 was non-negative positive across glomeruli, reflecting global average staining intensity, and PC 2 exhibited a large magnitude loading for DC2 against negative loadings for the other glomeruli (Fig S11g  2).This is consistent with the beta parameter of the PN calcium response model.
The range of differences between DM2 and DC2 Brp-Short staining across individuals (-50% to 40%; normalized by the average of the two glomeruli) was less than that of PN calcium response differences (-60% to 100%; Fig S12), suggesting that variation in presynaptic density is likely not the full explanation of variability in calcium responses.This is also consistent with the observation that the best presynaptic density models are less ! 5 predictive of behavior than the the best calcium response models (R 2 =.09 vs R 2 =0.23; capturing ~30% and ~80% of biological signal, respectively; Fig 1p,q vs Fig 3f ,g).Nevertheless, these results suggest that differences in presynaptic inputs to DM2 and DC2 PNs may contribute to variation in DM2 and DC2 calcium dynamics, in turn giving rise to individual preferences for OCT versus MCH.
To better understand what variable Brp-Short staining represented on a microstructural level, we performed paired behavior and expansion microscopy in flies expressing Brp-Short specifically in DC2-projecting ORNs (Movie 3).Using expansion microscopy 32,33 , we achieved a ~4-fold increase in linear resolution in immunostained samples, allowing us to visualize individual Brp-Short puncta (Fig 3i) 32 .While the sample size (n=8) of this imaging pipeline did not warrant a formal modeling analysis, we observed that the trend between density of Brp-Short in DC2 and odor-vs-odor preference was consistent with a positive correlation, whereas the trend between Brp-Short volume and odor-vsodor preference was not (Fig 3j,k).These results hint that variation in the density of presynaptic sites, rather than other biophysical properties, may be a critical factor underlying physiological and behavioral individuality.
Finally, we sought an integrative understanding of how synaptic variation plays out across the olfactory circuit to produce behav -iorally-relevant physiological variation.We developed a leakyintegrate-and-fire model of the entire AL, comprising 3,062 spiking neurons and synaptic connectivity taken directly from the Drosophila hemi brain connectome 34 .Our overall approach with this model (Fig 4a) was to 1) confirm that it could perform canonical AL computations, particularly the transformation of odor representations from ORNs to PNs, 2) introduce different kinds of stochastic variations to the circuit (corresponding to idiosyncratic developmental variants of the AL), and 3) determine what kind(s) of stochastic variation produce the patterns of idiosyncratic PN physiological variation we observed in our calcium imaging experiments.This strategy has the potential to link developmental variation at the synapse level to the physiological variation that appears to be driving behavioral individuality.
The biophysical properties of neurons in our model (Fig 4b, Table 3) were determined by published electrophysiological studies (See Modeling Supplementary Methods) and similar to those used in previous fly models 35,36 .The polarity of neurons was determined largely by their cell type (ORNs are excitatory, PNs predominantly excitatory, and LNs predominantly inhibitory.See Supplementary Methods for details).The strength of synaptic connections between any pair of AL neurons was given by the hemibrain connectome 34 (Fig 4c).Odor inputs were simulated by injecting current into ORNs to produce firing rates in those neurons that match published ORN-odor recordings 37 , and the out-  18,[38][39][40] , 2) a more uniform distribution of PN firing rates compared to ORN rates 18 , 3) greater separation of PN odor representations compared to ORN representations 18 , and 4) a sub-linear transfer function between ORNs and PNs 18 .Thus, our simulated AL appeared to perform the fundamental computations of real ALs, providing a baseline for assessing the effects of idiosyncratic variation.
We simulated stochastic individuality in the AL circuit in two ways (Fig 4e

Discussion
We found elements of the Drosophila olfactory circuit where patterns of physiological activity emerge that are predictive of individual behavioral preferences.These circuit elements can be considered loci of individuality, as they appear to harbor the origins of idiosyncratic preferences among isogenic animals reared in the same environment.Specifically, we found that the total responsiveness of ORNs predicts idiosyncratic preferences in an odor-vs-air assay, and that contrasting glomerular activation in PNs predicts idiosyncratic preferences in an odor-vs-odor assay (Figs 1, 2).Both of these circuit elements are in the olfactory sensory periphery, suggesting that behavioral idiosyncrasy arises early in the sensorimotor transformation.
Previous work has found mammalian peripheral circuit areas are predictive of individual behavior 25,26,41,42 , but this study is among the first 11,12,43 to link cellular-level circuit variants and individual behavior in the absence of genetic variation.Another key conclusion of our study is that loci of individuality are likely to vary, even within the sensory periphery, with the specific behavioral paradigm (i.e., odor-vs-odor or odor-vs-air).Our ability to predict behavioral preferences was limited by the repeatability of the behavior itself (Fig S8).Low persistence of odor preference may be attributable to factors like internal states or plasticity.It may be fruitful in future studies to map circuit elements whose activity predicts trial-to-trial behavioral fluctuations within individuals.
Seeking insight into the molecular basis of behaviorally-relevant physiological variation, we imaged Brp in the axon terminals of the ORN-PN synapse, using confocal and expansion microscopy.We found that Brp glomerular (and probably puncta) density was a predictor of individual odor-vs-odor preferences (Fig 3).Higher Brp in the DM2 glomerulus predicted stronger MCH preference, like higher calcium responses in DM2 PNs, suggesting that variation in PN inputs might underlie PN physiological variation.This is consistent with the recent finding of a linear relationship between synaptic density and excitatory postsynaptic potentials 44 and another study in which idiosyncratic synaptic density in central complex output neurons (measured by light microscopy) predicts individual locomotor behavior 12 .The predictive relationship between Brp and behavior was weaker than that of PN calcium responses, suggesting there are other determinants, such as other synaptic proteins, neurite morphology, or the influence of idiosyncratic LNs 21 modulating the ORN-PN transformation 45 .
To integrate our synaptic and physiological results, in the context of the whole olfactory circuit, we implemented a spiking model with 3,062 neurons and synaptic weights drawn directly from the fly connectome 34 (Fig 4).With light parameter tuning, this model recapitulated canonical AL computations, providing a baseline for assessing the effects of idiosyncratic stochastic variation.We simulated individual ALs with a variety of sources of variation, !7 reflecting developmental stochasticity in PN input synapse density and the population composition of AL cell types.Two sources of variation (PN input synapse density and ORN bootstrapping) produced patterns of PN response variation that matched our experimental results, namely correlated responses across odors in the DC2 and DM2 glomeruli.These sources of variation specifically implicate the ORN-PN synapse (like our Brp results) as an important substrate for establishing behaviorally-relevant patterns of PN response variation.
The flies used in our experiments were isogenic and reared in standardized laboratory conditions that produce reduced behavioral individuality compared to enriched environments [46][47][48] .Yet, even these conditions yield substantial behavioral individuality.How this happens is unclear, with possibilities ranging from thermal fluctuations at the molecular scale to macroscopic, but seemingly irrelevant, variations like the exact fill level of the culture media 49 .Developing nervous systems employ various compensation mechanisms to dampen out the effects of these fluctuations 9,20 .But behavioral variation may be beneficial, supporting a bet-hedging strategy 50 to counter environmental fluctuations 4,[51][52][53] .Empirically, the net effect of dampening and accreted ontological 54 fluctuations is individuals with diverse behaviors.This process unfolds across all levels of biological regulation.Just as PN response variation appears to be partially rooted in glomerular Brp variation, the latter has its own molecular roots, including, perhaps, stochasticity in gene expression 55,56 , itself a predictor of idiosyncratic behavioral biases 57 .Improved methods to longitudinally assay the fine-scale molecular and anatomical makeup of behaving organisms throughout development and adulthood will be invaluable to further illuminate the mechanistic origins of individuality.

Data and code
All data supporting these results and the analysis code are available at http://lab.debivort.org/odor-loci-of-individuality/.

Fly rearing
Experimental flies were reared in a Drosophila incubator (Percival Scientific DR-36VL) at 22° C, 40% relative humidity, and 12:12h light:dark cycle.Flies were fed cornmeal/dextrose medium, as previously described 4 .Mated female flies aged 3 days post-eclosion were used for behavioral persistence experiments.Mated female flies aged 7 to 15 days post-eclosion were used for all paired behavior-calcium imaging and immunohistochemistry experiments.

Fly stocks
The following stocks were obtained from the Bloomington Drosophila Stock Center: P{20XUAS-IVS-GCaMP6m}attP40 (BDSC #26818).Transgenic lines were outcrossed to the iso-genic line isokh11 4 for at least 5 generations prior to being used in any experiments.GH146-Gal4 was a gift provided by Y. Zhong 4 .w; UAS-Brp-Short-mStrawberry; UAS-mCD8-GFP; + was a gift of Timothy Mosca and was not outcrossed to the isokh11 background 31 .

Odor delivery
Odor delivery during behavioral tracking and neural activity imaging was controlled with isolation valve solenoids (NResearch Inc.) 4 .Saturated headspace from 40 ml vials containing 5 ml pure odorant were serially diluted via carbon-filtered air to generate a variably (10-25%) saturated airstream controlled by digital flow controllers (Alicat Scientific) and presented to flies at total flow rates of ~100 mL/min.

Odor preference behavior
Odor preference was measured at 25°C and 20% relative humidity.As previously described 4 , individual flies confined to custom-fabricated tunnels were illuminated with infrared light and behavior was recorded with a digital camera (Basler) and zoom lens (Pentax).The odor choice tunnels were 50 mm long, 5 mm wide, and 1.3 mm tall.Custom real-time tracking software written in Matlab was used to track centroid, velocity, and principal body axis angle throughout the behavioral experiment, as previously described 4 .After a 3-minute acclimation period, odorants were delivered to either end of the tunnel array for 3 minutes.
Odor preference score was calculated as the fraction of time spent in the reference side of the tunnel during odor-on period minus the time spent in the reference side of the tunnel during the pre-odor acclimation period.

Behavioral preference persistence measurements
After measuring odor preference, flies were stored in individual housing fly plates (modified 96-well plates; FlySorter, LLC) on standard food, temperature, humidity, and lighting conditions.Odor preference of the same individuals was measured 3 and/or 24 hours later.In some cases, fly tunnel position was randomized between measurements.We observed that randomization had little effect on preference persistence.

Calcium imaging
Flies expressing GCaMP6m in defined neural subpopulations were imaged using a custom-built two-photon microscope and ultrafast Ti:Sapphire laser (Spectra-Physics Mai Tai) tuned to 930 nm.For paired behavior and imaging experiments, the time elapsed between behavior measurement and imaging ranged from 15 minutes to 3 hours.Flies were anesthetized on ice and ! 8 immobilized in an aluminum sheet with a female-fly-sized hole cut in it.The head cuticle between the antennae and ocelli was removed along with the tracheae to expose the ALs from the dorsal side.Volume scanning was performed using a piezoelectric objective mount (Physik Instrumente).ScanImage 2013 software (Vidrio Technologies) was used to coordinate galvanometer laser scanning and image acquisition.Custom Matlab (Mathworks) scripts were used to coordinate image acquisition and control odor delivery.256 by 192 (x-y) pixel 16-bit tiff images were recorded.The piezo travel distance was adjusted between 70 and 90 µm so as to cover most of the AL.The number of z-sections in a given odor panel delivery varied between 7 and 12 yielding a volume acquisition rate of 0.833 Hz.Odor delivery occurred from 6-9.6s of each recording.
Each fly experienced up to four deliveries of the odor panel.The antennal lobe being recorded (left or right) was alternated after each successful completion of an odor panel.Odors were delivered in randomized order.In cases where baseline fluorescence was very weak or no obvious odor responses were visible, not all four panels were delivered.

Glomerulus segmentation and labeling
Glomerular segmentation masks were extracted from raw image stacks using a k-means clustering algorithm based on time-varying voxel fluorescence intensities, as previously described 4 .Each image stack, corresponding to a single odor panel delivery, was processed individually.Time-varying voxel fluorescence values for each odor delivery were concatenated to yield a voxel-bytime matrix consisting of each voxel's recorded value during the course of all 13 odor deliveries of the odor panel.After z-scoring, principal component analysis was performed on this matrix and 75% of the variance was retained.Next, k-means (k=80, 50 replicates with random starting seeds) was performed to produce 50 distinct voxel cluster assignment maps which we next used to calculate a consensus map.This approach was more accurate than clustering based on a single k-means seed.
Of the 50 generated voxel cluster assignment maps, the top 5 were selected by choosing those maps with the lowest average within-cluster sum of distances, selecting for compact glomeruli.The remaining maps were discarded.Next, all isolated voxel islands in each of the top 5 maps were identified and pruned based on size (minimum size = 100 voxels, maximum size = 10000 voxels).Finally, consensus clusters were calculated by finding voxel islands with significant overlap across all 5 of the pruned maps.Voxels which fell within a given cluster across all 5 pruned maps were added to the consensus cluster.This process was repeated for all clusters until the single consensus cluster map was complete.In some cases we found by manual inspection that some individual glomeruli were clearly split into two discrete clusters.These splits were remedied by automatically merging all consensus clusters whose centroids were separated by a physical distance of less than 30 voxels and whose peak odor response Spearman correlation was greater than 0.8.Finally, glomeruli were manually labeled based on anatomical position, morphology, and size 24 .We focused our analysis on 5 glomeruli (DM1, DM2, DM3, DL5, and DC2) which could be observed in most of our recordings.However, not all 5 glomeruli were identified in all recordings (Fig S3).Missing glomerular data was later mean-imputed.

Calcium image data analysis
All data was processed and analyzed in Matlab 2018a (The Mathworks, Natick, MA USA).Calcium responses for each voxel were calculated as Δf/f = [f(t) -F]/F, where f(t) and F are the instantaneous and average fluorescence, respectively.Each glomerulus' time-dependent calcium response was calculated as the mean Δf/f across all voxels falling within the glomerulus' automatically-generated segmentation mask during a single volume acquisition.Time-varying odor responses were normalized to baseline by subtracting the median of pre-odor Δf/f from each trace.Peak odor response was calculated as the maximum fluorescence signal from 7.2s to 10.8s (images 6 through 9) of the recording.
To compute principal components of calcium dynamics, each fly's complement of odor panel responses (a 5 glomeruli by 13 odors = 65-dimensional vector) was concatenated.Missing glomerulus-odor response values were filled in with the mean glomerulus-odor pair across all fly recordings for which the data was not missing.After infilling, principal component analysis was carried out with individual odor panel deliveries as observations and glomerulus-odor responses pairs as features.
In a subset of experiments in which we imaged calcium activity, some solenoids failed to open, resulting in the failure of odor delivery in a small number of trials.In these cases, we identified trials with valve failures by manually recognizing that glomeruli failed to respond during the nominal odor period.These trials were treated as missing data and infilled, as described above.
Fewer than ~10% of flies and 5% of odor trials were affected.
For all predictive models constructed, the average principal component score or glomerulus-odor Δf/f response across trials was used per individual; that is, each fly contributed one data point to the relevant model.Linear models were constructed from behavior scores and the relevant predictor (principal component, average Δf/f across dimensions, specific glomerulus measurements) as described in the text and Tables 1-2.To predict behavior as a function of time during odor delivery, we analyzed data as described above, but considered only Δf/f at each single time point (Fig S10 ), rather than averaging during the peak response interval.
To decode individual identity from neural responses, we first performed PCA on individual odor panel peak responses.We retained principal component scores constituting specified fractions of variance (Extended Figure 4d) and trained a linear logistic classifier to predict individual identity from single odor panel deliveries.
To decode odor identity from neural responses, each of the 5 recorded glomeruli were used as features, and the calcium response of each glomerulus to a specific odor at a specified time point were used as observations (PNs, n=5317 odor deliveries; ORNs, n=2704 odor deliveries).A linear logistic classifier was trained to predict the known odor identity using 2-fold crossvalidation.That is, a model was trained on half the data and evaluated on the remaining half, and then this process was repeated with the train and test half reversed.The decoding accuracy was quantified as the fraction of odor deliveries in which the predicted odor was correct.

DoOR data
DoOR data for the glomeruli and odors relevant to our study was downloaded from http://neuro.uni-konstanz.de/DoOR/default-.html 37.

Yoked odor experience experiments
We selected six flies for which both odor preference and neural activity were recorded to serve as the basis for imposed odor experiences for yoked control flies.The experimental flies were chosen to represent a diversity of preference scores.Each experimental fly's odor experience was binned into discrete odor bouts to represent experience of either MCH or OCT based on its location in the tunnel as a function of time (Figure 2j).Odor bouts lasting less than 100 ms were omitted due to limitations on odor-switching capabilities of the odor delivery apparatus.To deliver a given experimental fly's odor experience to yoked controls, we set both odor streams (on either end of the tunnel apparatus) to deliver the same odor experienced by the experimental fly at that moment during the odor-on period.No odor was delivered to yoked controls during time points in which the experimental fly resided in the tunnel choice zone (central 5 mm).See Figure 2j for an example pair of experimental fly and yoked control behavior and odor experience.

Confocal imaging
All confocal imaging was carried out at the Harvard Center for Biological Imaging.Unexpanded samples were imaged on an LSM700 (Zeiss) inverted confocal microscope equipped with a 40x oil-immersion objective (1.3 NA, EC Plan Neofluar, Zeiss).Expanded samples were imaged on an LSM880 (Zeiss) inverted confocal microscope equipped with a 40x water-immersion objective (1.1 NA, LD C-Apochromat, Zeiss).Acquisition of Zstacks was automated with Zen Black software (Zeiss).

Standard confocal image analysis
We used custom semi-automated code to generate glomerular segmentation masks from confocal z-stacks of unexpanded Orco>Brp-Short brains.Using Matlab, each image channel was median filtered (σx, σy, σz = 11, 11, 1 pixels) and downsampled in x and y by a factor of 11.Next, an ORN mask was generated by multiplying and thresholding the Orco>mCD8 and Orco>Brp-Short channels.Next, a locally normalized nc82 and Orco>mCD8 image stack were multiplied and thresholded, and the ORN mask was applied to remove background and other undesired brain structures.This pipeline resulted in a binary image stack which maximized the contrast of the glomerular structure of the antennal lobe.We then applied a binary distance transform and watershed transform to generate discrete subregions which aimed to represent segmentation masks for each glomerulus tagged by Orco-Gal4.
However, this procedure generally resulted in some degree of under-segmentation; that is, some glomerular segmentation masks were merged.To split each merged segmentation mask, we convolved a ball (whose radius was proportional to the cube root of the volume of the segmentation mask in question) across the mask and thresholded the resulting image.The rationale of this procedure was that 2 merged glomeruli would exhibit a mask shape resembling two touching spheres, and convolving a similarly-sized sphere across this volume followed by thresholding would split the merged object.After ball convolution, we repeated the distance and watershed transform to once more generate discrete subregions representing glomerular segmentation masks.This second watershed step generally resulted in over-segmentation; that is, by visual inspection it was apparent that many glomeruli were split into multiple subregions.Therefore, we finally manually agglomerated the over-segmented subregions to generate single segmentation masks for each glomerulus of interest.We used a published atlas to aid manual identification of glomeruli 24 .The total Brp-Short fluorescence signal within each glomerulus was determined and divided by the volume of the glomerulus' segmentation mask to calculate Brp-Short density values.

Expansion microscopy image analysis
The spots function in Imaris 9.0 (Bitplane) was used to identify individual Brp-Short puncta in expanded sample image stacks of Or13a>Brp-Short samples 31 .The spot size was set to 0.5 um, background subtraction and region-growing were enabled, and the default spot quality threshold was used for each image stack.
! 10 Identified spots were used to mask the Brp-Short channel and the resultant image was saved as a new stack.In Matlab, a glomerular mask was generated by smoothing (σx, σy, σz = 40, 40, 8 pixels) and thresholding (92.5th percentile) the raw Brp-Short image stack.The mask was then applied to the spot image stack to remove background spots.Finally, the masked spot image stack was binarized and spot number and properties were quantified.

Antennal Lobe modeling
We constructed a model of the antennal lobe to test the effect of circuit variation on PN activity variation across individuals.Our general approach to producing realistic circuit activity with the AL model was 1) using experimentally-measured parameters whenever possible (principally the connectome wiring diagram and biophysical parameters measured electrophysiologically), 2) associating free parameters only with biologically plausible categories of elements, while minimizing their number, and 3) tuning the model using those free parameters so that it reproduced high-level patterns of activity considered in the field to represent the canonical operations of the AL.Simulations were run in Python (version 3.6) 59 , and model outputs were analyzed using Jupyter notebooks 60 and Python and Matlab scripts.

AL model neurons
Release 1.2 of the hemibrain connectomics dataset 34 was used to set the connections in the model.Hemibrain body IDs for ORNs, LNs, and PNs were obtained via the lists of neurons supplied in the supplementary tables in 61 .ORNs and PNs of non-olfactory glomeruli (VP1d, VP1l, VP1m, VP2, VP3, VP4, VP5) were ignored, leaving 51 glomeruli.Synaptic connections between the remaining 2574 ORNs, 197 LNs, 166 mPNs, and 130 uPNs were queried from the hemibrain API.All ORNs were assigned to be excitatory 62 .Polarities were assigned to PNs based on the neurotransmitter assignments in 63 .mPNs without neurotransmitter information were randomly assigned an excitatory polarity with probability equal to the fraction of neurotransmitter-identified mPNs that are cholinergic; the same process was performed for uPNs.After confirming that the model's output was qualitatively robust to which mPNs and uPNs were randomly chosen, this random assignment was performed once and then frozen for subsequent analyses.
Of the 197 LNs, we assigned 31 to be excitatory, based on the estimated 1:5.4 ratio of eLNs to iLNs in the AL 64 .To account for observations that eLNs broadly innervate the AL 65 , all LNs were ranked by the number of innervated glomeruli, and the 31 eLNs were chosen uniformly at random from the top 50% of LNs in the list.This produced a distribution of glomerular innervations in eLNs qualitatively similar to that of krasavietz LNs in Supplementary Fig 6 of 21 .

Voltage model
We used a single-compartment leaky-integrate-and-fire voltage model for all neurons as in 35 , in which each neuron had a voltage Vi(t) and current Ii(t).When the voltage of neuron i was beneath its threshold Vi, thr, the following dynamics were obeyed: Each neuron i had electrical properties: membrane capacitance Ci, resistance Ri, and resting membrane potential Vi,0 with values from electrophysiology measurements (Table 3).
When the voltage of a neuron exceeded the threshold Vi, thr, a templated action potential was filled into its voltage time trace, and a templated postsynaptic current was added to all downstream neurons, following the definitions in 35 .
Odor stimuli were simulated by triggering ORNs to spike at frequencies matching known olfactory receptor responses to the desired odor.The timing of odor-evoked spikes was given by a Poisson process, with firing rate FR for ORNs of a given glomerulus governed by: FRmax, the maximum ORN firing rate, was set to 400 Hz.Dglom, odor is a value between 0 and 1 from the DoOR database, representing the response of an odorant receptor/glomerulus to an odor, estimated from electrophysiology and/or fluorescence data 37 .ORNs display adaptation to odor stimuli 62 , captured by the final term with timescale ta = 110 ms to 75% of the initial value, as done in 66 .Thus, the functional maximum firing rate of an ORN was 75% of 400 Hz = 300 Hz, matching the highest ORN firing rates observed experimentally 67 .After determining the times of ORN spikes according to this firing-rate rule, spikes were induced by the addition of 10 6 picoamps in a single time step.This reliably triggered an action potential in the ORN, regardless of currents from other neurons.In the absence of odors, spike times for ORNs were drawn by a Poisson process at 10 Hz, to match reported spontaneous firing rates 68 .
For odor-glomeruli combinations with missing DoOR values (40% of the dataset), we performed imputation via alternating least squares (using the pca function with option 'als' to infill missing values 69 ) on the odor x glomerulus matrix 1000 times and taking the mean infilled matrix, which provides a closer match to ground truth missing values than a single run of ALS (Figure S4 of 70 ).
A neuron j presynaptic to i supplies its current Ij(t) scaled by the synapse strength Wji, the number of synapses in the hemibrain dataset from neuron j to i. Rows in W corresponding to neurons with inhibitory polarity (i.e.GABAergic PNs or LNs) were set negative.Finally, post-synaptic neurons (columns of the connectivity matrix) have a class-specific multiplier ai, a hand-tuned value, described below.

AL model tuning
Class-specific multiplier current multipliers (ai) were tuned using the panel of 18 odors from 18  "administered" for 400 ms each, with 300 ms odor-free pauses between odor stimuli.
The high-level functions of the AL that represent a baseline, working condition were: (1) firing rates for ORNs, LNs, and PNs matching the literature (listed in Table 3 18,[38][39][40] , (2) a more uniform distribution of PN firing rates during odor stimuli compared to ORN firing rates, (3) greater separation of representations of odors in PN-coding space than in ORN-coding space, and (4) a sublinear transfer function between ORN firing rates and PN firing rates.Features ( 2) -( 4) relate to the role of the AL in enhancing the separability of similar odors 18 .
To find a parameterization with those functions, we tuned the values of ai as scalar multipliers on ORN, eLN, iLN, and PN columns of the hemibrain connectivity matrix.Thus, these values represent cell type-specific sensitivities to presynaptic currents, which may be justified by the fact that ORNs/LNs/PNs are genetically distinct cell populations 71,72 .A small grid search of the four class-wise sensitivity parameters produced a configuration that reasonably satisfied the above criteria (Fig S14).In this configuration, the ORN columns of the hemibrain connectivity matrix are scaled by 0.1, eLNs by 0.04, iLNs by 0.02, and PNs by 0.4.The relatively large multiplier on PNs is potentially consistent with the fact that PNs are sensitive to small differences between weak ORN inputs 18 .Model outputs were robust over several different sets of ai, provided iLN sensitivity ≃ eLN < ORN < PN.
Notable ways in which the model behavior deviates from experimental recordings (and thus caveats on the interpretation of the model) include: 1) Model LNs appear to have more heterogeneous firing rates than real LNs, with many LNs inactive for this panel of odor stimuli.This likely reflects a lack of plastic/homeostatic mechanisms in the model to regularize LN firing rates given their variable synaptic connectivity 21 .2) Some PNs had off-odor rates that are high compared to real PNs, resulting in a distribution of ON-OFF responses that had a lower limit than in real recordings.Qualitatively close matches were achieved between the model and experimental data in the distributions of odor representations in ORN vs PN spaces and the non-linearity of the ORN-PN transfer function.

AL model circuit variation generation
We generated AL circuit variability in two ways: cell-type bootstrapping, and synapse density resampling.These methods assume that the distribution of circuit configurations across individual ALs can be generated by resampling circuit components within a single individual's AL (neurons and glomerular synaptic densities, respectively, from the hemibrain EM volume).
To test the effect of variation in the developmental complement of neurons of particular types, we bootstrapped populations of interest from the list of hemibrain neurons.Resampling with replacement of ORNs was performed glomerulus-by-glomerulus, i.e., separately among each pool of ORNs expressing a particular Odorant receptor gene.The same was done for PNs.For LNs, all 197 LNs were treated as a single pool; there was no finer operation based on LN subtypes or glomerular innervations.This choice reflects the high developmental variability of LNs 21 .The number of synapses between a pair of bootstrapped neurons was equal to the synapse count between those neurons in the hemibrain connectivity matrix.
In some glomeruli, bootstrapping PNs produced unreasonably high variance in the total PN synapse count.For instance, DP1m, DC4, and DM3 each harbor PNs that differ in total synapse count by a factor of ~10.Since these glomeruli have between two to three PNs each, in a sizable proportion of bootstrap samples, all-highly connected (or all-lowly) connected PNs are chosen in such glomeruli.To remedy this biologically unrealistic outcome, we examined the relationship between total input PN synapses within a glomerulus and glomerular volume (Fig S15).
In the "synapse density resampling" method, we required that the number of PN input synapses within a glomerulus reflect a draw from the empirical relationship between total input PN synapses and glomerular volume as present in the hemibrain data set.This was achieved by, for each glomerulus, sampling from the following distribution that depends on glomerular volume, then multiplying the number of PN input synapses by a scalar to match that sampled value: Here Sg is the PN input synapse count for glomerulus g, Vg is the volume of glomerulus g (in cubic microns), ε is a Gaussian noise variable with standard deviation σ, and a, d are the scaling factor and exponent of the volume term, respectively.The values of these parameters (a = 8.98, d = 0.73, σ = 0.38) were fit using maximum likelihood.

Figure 1 :
Figure 1: Idiosyncratic calcium dynamics predict individual odor preferences (a) Olfactory circuit schematic.Olfactory receptor neurons (ORNs, peach outline) and projection neurons (PNs, plum outline) are comprised of ~51 classes corresponding to odor receptor response channels.ORNs of the same class (gray shading) sense odors in the antennae and synapse together on dendrites of PNs of the same class in ball-shaped structures called glomeruli located in the antennal lobe (AL).Local neurons (LNs, green outline) mediate interglomerular cross-talk and presynaptic inhibition, amongst other roles 73,74 .Odor signals are normalized and whitened in the AL before being sent to the mushroom body and lateral horn for further processing.Schematic adapted from 4 .(b) Experiment outline.(c) Odor preference behavior tracking setup (reproduced from 4 ) and example individual fly ethograms.OCT (green backdrop) and MCH (magenta backdrop) were presented for 3 minutes.(d) Head-fixed 2-photon calcium imaging and odor delivery setup (reproduced from 4 ).(e) Orco and GH146 driver expression profiles (left) and example segmentation masks (right) extracted from 2-photon calcium images for a single fly expressing Orco>GCaMP6m (top, expressed in a subset of all ORN classes) or GH146>Gcamp6m (bottom, expressed in a subset of all PN classes).(f) Time-dependent Δf/f for glomerular odor responses in ORNs (peach) and PNs (plum) averaged across all individuals: DC2 to OCT (upper left), DM2 to OCT (upper right), DC2 to MCH (lower left), and DM2 to OCT (lower right).Shaded error bars represent S.E.M. (g) Peak Δf/f for each glomerulus-odor pair averaged across all flies.(h) Individual neural responses measured in ORNs (left) or PNs (right) for 50 flies each.Columns represent the average of up to 4 odor responses from a single fly.Each row represents one glomerulus-odor response pair.Odors are the same as in panel (g).(i) Principal component analysis of individual neural … ooooo Figure 1: Idiosyncratic calcium dynamics predict individual odor preferences (a) Olfactory circuit schematic.Olfactory receptor neurons (ORNs, peach outline) and projection neurons (PNs, plum outline) are comprised of ~51 classes corresponding to odor receptor response channels.ORNs of the same class (gray shading) sense odors in the antennae and synapse together on dendrites of PNs of the same class in ball-shaped structures called glomeruli located in the antennal lobe (AL).Local neurons (LNs, green outline) mediate interglomerular cross-talk and presynaptic inhibition, amongst other roles 73,74 .Odor signals are normalized and whitened in the AL before being sent to the mushroom body and lateral horn for further processing.Schematic adapted from 4 .(b) Experiment outline.(c) Odor preference behavior tracking setup (reproduced from 4 ) and example individual fly ethograms.OCT (green backdrop) and MCH (magenta backdrop) were presented for 3 minutes.(d) Head-fixed 2-photon calcium imaging and odor delivery setup (reproduced from 4 ).(e) Orco and GH146 driver expression profiles (left) and example segmentation masks (right) extracted from 2-photon calcium images for a single fly expressing Orco>GCaMP6m (top, expressed in a subset of all ORN classes) or GH146>Gcamp6m (bottom, expressed in a subset of all PN classes).(f) Time-dependent Δf/f for glomerular odor responses in ORNs (peach) and PNs (plum) averaged across all individuals: DC2 to OCT (upper left), DM2 to OCT (upper right), DC2 to MCH (lower left), and DM2 to OCT (lower right).Shaded error bars represent S.E.M. (g) Peak Δf/f for each glomerulus-odor pair averaged across all flies.(h) Individual neural responses measured in ORNs (left) or PNs (right) for 50 flies each.Columns represent the average of up to 4 odor responses from a single fly.Each row represents one glomerulus-odor response pair.Odors are the same as in panel (g).(i) Principal component analysis of individual neural … ooooo odors plus air (Fig 1d, Figs S2,3) and we used k-means clustering to automatically segment the voxels of 5 glomeruli from the resulting 4-D calcium image stacks (Fig 1e, Fig S4, Methods)

Figure 2 :
Figure 2: Variation in global and relative glomerular responses explains individual preferences (a) PC 1 loadings of PN activity for flies tested for OCT-AIR preference (n=53 flies).(b) Interpreted PN PC 1 loadings.(c) Measured OCT-AIR preference versus preference predicted by the average peak response across all PN coding dimensions (n=53 flies).(d) PC 1 loadings of ORN activity for flies tested for OCT-AIR preference (n=30 flies).(e) Interpreted ORN PC 1 loadings.(f) Measured OCT-AIR preference versus preference predicted by the average peak response across all ORN coding dimensions (n=30 flies).(g) PC 2 loadings of PN activity for flies tested for OCT-MCH preference (n=69 flies).(h) Interpreted PN PC 2 loadings.(i) Measured OCT-MCH preference versus preference predicted by the average peak PN response in DM2 minus DC2 across all odors (n=69 flies).(j) Yoked control experiment outline and example behavior traces.Experimental flies are free to move about tunnels permeated with steady state OCT and MCH flowing into either end.Yoked control flies are delivered the same odor at both ends of the tunnel which matches the odor experienced at the nose of the experimental fly at each moment in time.(k) Imposed odor experience versus the odor experience predicted from PC 2 of PN activity (n=27 flies) evaluated on the model trained from data in Figure 1p.
after measuring individual preference for OCT versus MCH (Fig 3a, Fig S11).

Figure 3 :
Figure 3: Idiosyncratic presynaptic marker density in DM2 and DC2 predicts OCT-MCH preference (a) Experiment outline.(b) Example slice from a z-stack of the antennal lobe expressing Orco>Brp-Short (green) with DC2 and DM2 visible (white dashed outline).nc82 counterstain (magenta).(c) Example glomerulus segmentation masks extracted from an individual z-stack.(d) Bootstrapped R 2 of OCT-MCH preference prediction from each of the first 4 principal components of Brp-Short density measured in ORNs (training set, n=22 flies).(e) PC 2 loadings of Brp-Short density.(f) Measured OCT-MCH preference versus preference predicted from PC 2 of ORN Brp-Short density in a training set (n=22 flies).(g) Measured OCT-MCH preference versus preference predicted from PC 2 on ORN Brp-Short density in a test set (n=31 flies) evaluated on a model trained on data from panel (f).(h) Measured OCT-MCH preference versus preference predicted from ORN Brp-Short density in DM2 minus DC2 (n=53 flies).(i) Example expanded AL expressing Or13a>Brp-Short (left) and Imaris-identified puncta from that sample (right).(j) OCT-MCH preference score plotted against Brp-Short puncta density in expanded Or13a>Brp-Short samples (n=8 flies).(k) OCT-MCH preference score plotted against Brp-Short median puncta volume in expanded Or13a>Brp-Short samples (n=8 flies).

Figure 4 :
Figure 4: Simulation of developmentally stochastic olfactory circuits (a) AL modeling analysis outline.(b) Leaky-integrator dynamics of each simulated neuron.When a neuron's voltage reaches its firing threshold, a templated action potential is inserted, and downstream neurons receive a postsynaptic current.See Modeling Supplementary Methods.(c) Synaptic weight connectivity matrix, derived from the hemibrain connectome 34 .(d) Spike raster for randomly selected example neurons from each AL cell type.Colors indicate ORN/PN glomerular identity and LN polarity (i=inhibitory, e=excitatory).(e) Schematic illustrating sources of developmental stochasticity as implemented in the simulated AL framework.See Movies 4-6 for the effects of these resampling methods on the synaptic weight connectivity matrix.(f) PN glomerulus-odor response vectors for 8 idiosyncratic ALs subject to Input spike Poisson timing variation, PN input synapse density resampling, and ORN and LN population bootstrapping.(g) Loadings of the principal components of PN glomerulus-odor responses as observed across experimental flies (top).Dotted outlines highlight loadings selective for the DC2 and DM2 glomerular responses, which underlie predictions of individual behavioral preference.(h-k) As in (g) for simulated PN glomerulus-odor responses subject to Input spike Poisson timing variation, PN input synapse density resampling, and ORN and LN population bootstrapping.See Fig S16 for additional combinations of idiosyncrasy methods.In (f-k) the sequence of odors within each glomerular block is: OCT, 1-hexanol, ethyl-lactate, 2-heptanone, 1-pentanol, ethanol, geranyl acetate, hexyl acetate, MCH, pentyl acetate and butanol.

Supplementary Figure 4 : 18 Supplementary Figure 5 : 19 Supplementary Figure 7 : 21 Supplementary Figure 8 : 22 Supplementary Figure 11 : 24 Supplementary Figure 12 : 25 Supplementary Figure 13 : 26 Supplementary Figure 14 : 27 Supplementary Figure 15 : 28 Supplementary Figure 17 : 30 Churgin&Movie 2 : 33 Churgin&
Glomerulus responses and identification (a) Glomerulus odor responses measured in PNs versus those measured in ORNs.Points correspond to the odorants listed in Figure 1g.(b) Cross-odor trial correlation matrix between glomerular odor responses in ORNs and PNs.(c) Peak calcium responses for each glomerulus-odor pair measured in this study plotted against those recorded in the DoOR dataset 37 .(d) Peak calcium responses for each individual glomerulus plotted against those recorded in the DoOR dataset.!Idiosyncrasy of ORN and PN responses (a) Logistic regression classifier accuracy of decoding individual identity from individual odor panel peak responses.PCA was performed on population responses and the specified fraction of variance (x-axis) was retained.Individual identity can be better decoded from PN responses than ORN responses in all cases.(b) Individual trial-to-trial glomerulus-odor responses embedded in PC 1-2 space.Responses for the same flies as Figure 1k-l are shown.Each linked color represents one fly.Trial 1 and trial 2 responses are shown for ORN left lobe (upper left), ORN right lobe (upper right), PN left lobe (lower left), and PN right lobe (lower right).(c) Distance in the full glomerulus-odor response space between recordings within a lobe (trial-to-trial), across lobes (within fly), and across flies for ORNs and PNs.Points represent the median value, boxes represent the interquartile range, and whiskers the range of the data.!Calcium imaging principal component loadings (a-b) First 10 principal component loadings measured from calcium responses in ORNs (a, n=65 flies) and PNs (b, n=122 flies).Loadings are grouped by glomerulus, with each loading within a glomerulus representing the response of that glomerulus to one odor in the odor panel.Odors are the same as those listed in Figure 1g.(c-d) The same 10 principal component loadings as those shown in panels (a-b) grouped by odor rather than glomerulus.Glomeruli within each odor block are given in the order of panels (a) and (b).! Estimating the biological signal explained by Ca-behavior models (a) Schematic of modeling approach to estimate the fraction of biological signal variance (R3 2 , green), as opposed to noise variance, explained by calcium response-behavior models.(b) Estimated fraction of behavioral variance explained (R3 2 , green) by calcium response-behavior models (colormap) as a function of the behavioral persistence (R1 2 , y-axis, pink) and neural-behavior variance explained (R2 2 , x-axis, blue).R1 2 can be estimated from the repeatability of behavior measures over the timescale of the experiment (FigS1b-e) and R2 2 is the calcium response-behavior model performance (e.g., Fig1l-n, p-r, Fig3c,f,i).! ORN>Brp-Short characterization and model predictions(a-c) Right versus left glomerulus properties measured from z-stacks of stained Orco>Brp-Short samples.(a) Volume, (b) total Brp-Short fluorescence, (c) Brp-Short fluorescence density.(d-f) Same data as panels (a-c) represented in violin plots (kernel density estimated).(g) Principal component loadings of Brp-Short density calculated using only training data (n=22 flies).(h) Principal component loadings of Brp-Short density calculated using all data (n=53 flies).!Calcium and Brp-Short predictor variation (a) Histogram of average PN Δf/f across all coding dimensions in flies in which OCT-AIR preference was measured.(b) Measured OCT-AIR preference versus average PN Δf/f (n=53 flies).(c) Histogram of average ORN Δf/f across all coding dimensions in flies in which OCT-AIR preference was measured.(d) Measured OCT-AIR preference versus average ORN Δf/f (n=30 flies).(e) Histogram of % Δf/f difference between DM2 and DC2 PN responses in flies in which OCT-MCH preference was measured.(f) Measured OCT-MCH preference versus % Δf/f difference between DM2 and DC2 PN responses df/f (n=69 flies).(g) Histogram of % Brp-Short density difference between DM2 and DC2 ORNs in flies in which OCT-MCH preference was measured.(h) Measured OCT-MCH preference versus % Brp-Short density difference between DM2 and DC2 ORNs (n=53 flies).!AL model raster plot (a) Action potential raster plot of ORNs in the baseline simulated AL.Rows are individual ORNs, black ticks indicate action potentials.Random shades of orange at left indicate blocks of ORN rows projecting to the same glomerulus.(b) As in (a) for the remaining neurons in the model.Shades of green indicate excitatory vs inhibitory LNs and shades of purple indicate PNs with dendrites in the same glomeruli.! AL model baseline outputs compard to experimental data (a) Distributions of model neuron firing rates by cell type across odors (transparent black points are individual neuron-odor combinations).Black lozenge symbols indicate the mean firing rate of the points to the right.Yellow stars indicate the comparable experimental values reported in 15,21,45,68 .(b) Scatter plots of average PN firing rate vs ORN firing rate during odor stimuli in the model vs experimental values 18 .Points are odors, colors are glomeruli.(c) Histograms of ON odor minus OFF odor glomerulus-average PN and ORN firing rates in the model vs experimental values 18 , showing flatter distributions in PNs.(d) Odor representations in the first 2 PCs of glomerulus-average ORN responses and PN responses in the model and experimental results 18 .Points are odors.Pairwise distances between PN representations are more uniform than in ORNs in both the model and experimental data.Panels (b)-(d) use glomerulus-average PN and ORN firing rates from six of the seven glomeruli in 18 , as VM2 is significantly truncated in the hemibrain 34 .Literature features in panels (b)-(d) were extracted from 18 using WebPlotDigitizer 76 .! Synapse counts vs glomerular volume in the hemibrain and AL model (a) Left) Scatter plot of total PN input synapses within a glomerulus vs that glomerulus' volume from the hemibrain data set.Solid line represents the maximum likelihood-fit mean synapse count vs glomerular volume, and dashed lines the fit +/-1 standard deviation.Middle) As (left) but for a single sample from the parameterized distribution of PN input synapses vs glomerular volume.Right) As in previous for a single bootstrap resample of PNs.Colorhighlighted glomeruli illustrate that when PNs within a glomerulus have highly asymmetrical synapse counts, bootstrapping them alone can result in apparent synapse densities that lie outside the empirical distribution (left).(b) As in (a) but on log-log axes, showing the linear relationship between synapse density and glomerular volume after this transformation, and bootstrapped densities falling outside this distribution at right.!Classifiability of simulated idiosyncratic behavior under different sources of circuit idiosyncrasy.Simulated PN odor-glomerulus firing rates projected into their first 3 principal components.Individual points represent single runs of resampled AL models, under four different sources of idiosyncratic variation.PN responses in all odor-glomerulus dimensions were used to calculate simulated behavior scores for each resampled AL, by applying the PN calcium-odor-vs-odor linear model (Fig 2g).Magenta points represent flies with simulated preference for MCH in the top 50%, and green OCT preference.% Misclassification refers to 100% -the accuracy of a linear classifier trained on MCH-vs-OCT preference in the space of the first three PCs.This measures how much of the variance along the PN calcium-odor-vs-odor linear model lies outside the first three PCs of simulated PN variation.!Lavrentovich et al., 2021 -preprint version -www.biorxiv.orgMovie 1: Example recording with automated tracking of an odor-vs-air behavioral assay.The recent positions of each fly (green line) are shown in different colors.Red bar indicates when the odor stream is turned on.http://lab.debivort.org/odor-loci-of-individuality/movies/OLOI-Movie-1-odor-vs-air-behavior.mp4Example recording with automated tracking of an odor-vs-odor behavioral assay.The recent positions of each fly (green line) are shown in different colors.Magenta and green bars at right indicate when MCH and OCT are respectively flowing into the top and bottom halves of each arena.http://lab.debivort.org/odor-loci-of-individuality/movies/OLOI-Movie-2-odor-vs-odor-behavior.mp4! 31 Movie 3: Confocal image stack of expanded DC2>Brp-Short.Magenta is nc82 stain, Green is Or13a>Brp-Short.Frames are z-slices spaced at 0.54 µm.Image height corresponds to a post-expansion field of view of 107 x 90 µm (a ~2.5 x linear expansion factor).http://lab.debivort.org/odorloci-of-individuality/movies/OLOI-Movie-3-Brp-expansion-stack.aviMovie 4: Simulated AL connectivity matrices under glomerular density resampling.Each frame corresponds to the hemibrain connectome synaptic weights, rescaled according to a sample from the relationship between synapse count and volume parameterized in Fig S15.http://lab.debivort.org/odor-loci-of-individuality/movies/OLOI-Movie-4-synapse-density-resampling.gif!32 Movie 5: Simulated AL connectivity matrices under ORN bootstrapping.Each frame corresponds to the hemibrain connectome synaptic weights, but with the population of ORNs projecting to each glomerulus resampled with replacement.See Modeling Methods.http:// lab.debivort.org/odor-loci-of-individuality/movies/OLOI-Movie-5-ORN-bootstrapping.gifMovie 6: Simulated AL connectivity matrices under LN bootstrapping.Each frame corresponds to the hemibrain connectome synaptic weights, but with the population of LNs resampled with replacement.See Modeling Methods.http://lab.debivort.org/odor-loci-of-individuality/movies/OLOI-Movie-6-LN-bootstrapping.gif!Lavrentovich et al., 2021 -preprint version -www.biorxiv.org!34 … responses.Fraction of variance explained versus principal component number (left).Trial 1 and trial 2 of ORN (middle) and PN (right) responses for 20 individuals (unique colors) embedded in PC 1-2 space.Note the variance explained by each PC is different in the case of ORN and PN responses.(j) Euclidean distances between glomerulus-odor responses within and across flies measured in ORNs (n=65 flies) and PNs (n=122 flies).Distances calculated without PCA compression.Points represent the median value, boxes represent the interquartile range, and whiskers the range of the data.(k) Bootstrapped R 2 of OCT-AIR preference prediction from each of the first 5 principal components of neural activity measured in PNs (top, training set) or ORNs (bottom, all data).(l) Measured OCT-AIR preference versus preference predicted from PC 1 of PN activity in a training set (n=18 flies).(m) Measured OCT-AIR preference versus preference predicted from PC 1 on PN activity in a test set (n=35 flies) evaluated on a model trained on data from panel (l).(n) Measured OCT-AIR preference versus preference predicted from PC 1 of ORN activity (n=30 flies).(o) Bootstrapped R 2 of OCT-MCH preference prediction from each of the first 5 principal components of neural activity measured in PNs (top, training set) or ORNs (bottom, all data).(p) Measured OCT-MCH preference versus preference predicted from PC 2 of PN activity in a training set (n=47 flies).(q) Measured OCT-MCH preference versus preference predicted from PC 2 on PN activity in a test set (n=22 flies) evaluated on a model trained on data from panel (p).(r) Measured OCT-MCH preference versus preference predicted from PC 1 of ORN activity (n=35 flies).
).In contrast, we found that no PCs of ORN neural activity could linearly predict odor preference beyond the level of shuffled controls (n=35 flies) (Fig1o,r; FigS9b).The best ORN PC model only predicted odor-vs-odor behavior with a nominal R 2 of 0.03 (~5% of biological signal).As another check that ORN responses were not predictive of odor-vs-odor behavior, we projected the ORN data onto PC 2 of PN responses (the successful ! 3 Figure 1 caption (continued): ): glomerular-level variation in PN input-synapse density and bootstrapping of neuronal compositions within cell types.The former reflects a statistical relationship observed between glomerular volume and synapse density within the hemibrain connectome (FigS15).The latter reflects variety in the outcomes of the developmental programs for ORNs, PNs, etc.
Movies 4-6show the diverse connectivity matrices attained under these resampling approaches.We simulated odor responses in thousands of ALs made idiosyncratic by these sources of variation, and in each, recorded the firing rates of PNs when stimulated by the 12 odors from our experimental panel(Fig 4f, Fig  S13).We also recorded the effect of random Poisson timing of input spikes in the absence of circuit idiosyncrasy.To determine which, if any, sources of variation produced patterns of PN coding variation consistent with our empirical measurements, we examined the loadings of the principal components of PN responses across real idiosyncratic flies and simulated idiosyncratic ALs.Per above, empirical PN responses are strongly correlated at the level of glomeruli (Figs4g, Figs S6, S7).In the model, resampling PN input-synapse density across glomeruli produced PN response correlations strongly organized by glomerulus, not surprisingly (Fig4h).This served as a positive control that the AL model can recapitulate the empirical structure of PN response variation.As a negative control, variation in PN responses due solely to poisson timing of ORN input spikes (i.e., absent any circuit idiosyncrasy) was not formalize this analysis, for each idiosyncratic AL, we computed a "behavioral preference" by applying the PN PC2 linear model in Fig1o-q.We then determined how accurately a linear classifier could distinguish OCT-vs MCH-preferring ALs in the space of the first 3 principal components of PN responses, as a function of the source of idiosyncrasy (FigS17).High accuracy was attained with sources of circuit variation within PN loadings