Capturing sources of individual learning-dependent behaviour.

(A) Variation in behaviour between individuals can be caused by variation in genetic background, variation in environment (which can be fixed and shared between individuals or stochastically individual), and genotype x environment interactions. We can experimentally fix the genotype x environment interaction in the past and thus control the shared extent of individuality at the beginning of the task. When task behaviour is measured in parallel across individuals, we expect that the extent of behavioural variability within genotype will correlate between spontaneous and learning-dependent behaviour, while the genotype means may change (H0). Alternatively, learning may change the extent of individuality as well as genotype means over time (H1). (B) Schematic of the Y-maze design. (C) During the course of the assay each fly is first tested for its individual behavioural biases. Then, the task part of the assay is initiated for all flies simultaneously. Control flies are not shocked when choosing green colour during the task, while conditioned flies are. Shock delivery and shock removal timing in conditioned task for a bad decision (blue to green) and after a bad decision (green to blue) is depicted below. (When switching from blue to blue, no shock is ever applied.) (D) Representative tracks of two flies traversing a Y-maze in control and conditioned task. Lines on the bottom plane represent colour occupancy over time. (E) Top-down view of the 64-maze multiplexed platform. (F) Task performance of a wild-type genotype compared to the memory- and learning-deficient mutant (dnc1) and the visually impaired mutant (norpAEE5). Points are individual fly measurements. Mean and medians are represented as bar and red plus. Dashed line represents chance level Tshocked = 1/3. (G) Difference in mean task performance between conditioned and control flies in 90 genotypes. Grey shading is SE. Vertical dashed line indicates no change in average performance upon conditioning. Horizontal dashed lines indicate mean values of memory- and vision-deficient genotypes (dnc1 and norpAEE5, horizontal).

Fly rearing conditions

Residual individuality in task performance.

(A) Distributions of individual task performance for the 88 wild-type genotypes, for conditioned (yellow) and control (gray) groups. Vertical lines show mean task performance. Chance expectation of Tshocked shown at 1/3 (black). (B) An example of individual task performance distributions in two genotypes (shaded red and blue). Replicates are shown as lines. (C) Shapiro-Wilk test for normality for distributions of observed individual task performance in 88 genotypes, and individual task performance of simulated flies that could or could not learn. In blue is a random sample from a normal distribution matching the observed task performance. (D) Change in expressed residual individuality due to learning across genotypes. A few genotypes are highlighted to facilitate comparisons with other figures. (E) Mean task performance across genotypes (points). Lines connecting a genotype’s value in the two treatments indicate a significant correlation in mean task performance between conditioned and control groups. (F) Change in expressed residual individuality due to genetics indicates that the residual individuality is significantly more diverse between genotypes in conditioned flies. A point is a pairwise divergence between two genotypes. (G) Change in expressed residual individuality due to experimental procedures. There is no greater difference in residual individuality between replicates in conditioned flies, compared to control. Point is a pairwise divergence between two replicates of a genotype. (H) Divergence in residual individuality due to learning evolves with every decision and increases over time. Three representative genotypes are shown.

Task performance model: green place learning.

Task performance model: blue place learning.

Pearson product-moment correlation and significance between mean and individuality measures of behaviour between replicates (N = 32 flies per genotype per replicate (16 conditioned, 16 control) for 88 genotypes.

Divergence in individual task performance depends on learning through experience.

(A) Task performance distributions over the first 50 decisions is dependent on starting colour despite their initial colour bias or their final learning score (LS). The distributions of flies starting at the left and right blue arm are overlaid. Only flies that made at least 50 decisions are included. Distributions regardless of starting position are shown in black. (B) Schematic of the Y-maze and starting colours. For the conditioned flies, the green coloured arm (S) is associated with the shock, while for control flies it is not. (C) Alignment of 50 decisions made by conditioned flies (rows) with different learning score and colour bias combinations. Decisions are sequentially sorted. The yellow rectangles highlight flies with most persistent behaviour of alternating choices between colours. Black lines indicate flies that share the same first decision for easier comparison across groups. (D) Change in individual task performance depends more strongly on initial conditions for flies that learn. Each point is an individual fly. (E) Evolving change in Hresid between flies starting at different arms of the Y-maze, that made at least 50 decisions. Residual individuality is sensitive to initial experience and exacerbated by opposing forces of learning and unfavourable bias.

Experience, genetics and learning shape individuality.

(A) Variation in behaviour observed across genotypes is best explained by a model that includes genetically controlled but individually random prior life experience, and learning (individuality). (B) High Bayesian information criterion for models omitting variability in behaviour prior to the task, genetics, and learning demonstrate that they are necessary for close in silico recapitulation of observed individuality. (C) Change in individual behaviours during conditioning can be attributed to the effect of learning. Boxplots summarize the behaviours of observed, real flies and of flies simulated with and without learning. (D) Flies simulated under the assumption of genetic control over variability in life experience and with learning during task can faithfully reproduce observed mean task performance and individual variation in behaviour of real flies. Points are genotypes. (E) Genetic effect on behavioural policy projects to the entire individual behaviour space. Mean genotype policies and overlapping individual policies measured at the start and at the end of the experiment are projected on a multidimensional scaling plot. Points show genotypes and individuals. Highlighted points correspond to individuals from an outlier genotype (turquoise), two average genotypes (red and dark red) and a memory-deficient genotype (magenta). (F) Change from initial behavioural policy from the start until the end of the task changes more in flies that learn. Points are individuals.

Theoretical ranges of measured behaviours.

Model parameters.

The first five parameters are “static preference” parameters and the remaining parameters are “learning rate” parameters.

A) Schematic for the implementation of colour learning paradigm. As the fly enters the arm with shocked colour (green) and traverses the 2 mm boundary, it starts to experience the shock. At this point, the decision is recorded and with each decision the colours of the two unoccupied arms behind the fly randomly change colours. This way, the shock is associated with a colour and uncoupled from place. As the fly chooses the neutral colour (blue) the shock is removed (or not applied). B) Task performance in blue place learning for one wild-type DGRP line (DGRP-362), memory deficient genotype (dnc1) and blind genotype (norpAEE5). Each point is an individual fly. Control treatment is shown in grey and conditioned treatment in yellow. Dashed line marks the Tshocked = 1/3. C) Relative task performance in blue place learning for 12 wild-type DGRP genotypes, memory deficient genotype (dnc1) and blind genotype (norpAEE5). Grey shading indicates standard error. Vertical line points to no change in performance (0) and horizontal lines inidcate least square means for memory- and vision-deficient genotypes. In all panels for each genotype-treatment combination N = 32 flies were tested, but fewer are shown here (due to filtering for low activity; see Methods). For all boxplots: whiskers of boxplots show upper and lower quantiles, the bar indicates median and red plus indicates mean across individuals (points), yellow indicates the conditioned and grey the control flies, asterisk indicates significance threshold for the T-test (* < 0.05,** < 0.01, *** < 0.001), and horizontal lines indicate task performance expected by chance (1/3 or 1/2). D) Task performance in blue colour learning for one wild-type DGRP line (DGRP-362), memory deficient genotype (dnc1) and blind genotype (norpAEE5). Each point is an individual fly. Control treatment is shown in grey and conditioned treatment in yellow. Dashed line marks the Tshocked = 1/3. E) Task performance in green colour learning for one wild-type DGRP line (DGRP-362), memory deficient genotype (dnc1) and blind genotype (norpAEE5). Each point is an individual fly. Control treatment is shown in grey and conditioned treatment in yellow. Dashed line marks the Tshocked = 1/3.

A) Task performance across individuals is shown as boxplots, each for bias period of 5 minutes before conditioning where no shock is applied (”Bias”), 20-minute conditioning period (”Learning”) and 5-minute period where no shock is applied used to assess short-term memory based on the persistence of task performance (”Memory”). Shock was associated with the colour matching the colour of the boxplot (blue or green). B) Individual flies from the same experiment in A) are ranked based on their task performance during conditioning period on the first day from highest (red) to lowest (blue) Tshocked. Their task performance rank during conditioning period is tracked across consecutive days and paradigms. If the flies died or were lost during the experiment, their past relative ranking is depicted as the line, but the square is not shown for the days after they were lost. Pearson product-moment correlation (r) between ranking of flies on consecutive days is shown. The associated statistical significance of the correlation (p-value) is coloured red if it had passed the FDR corrected threshold of FDR < 0.05. For all boxplots, whiskers show upper and lower quantiles, the bar indicates median.

A) Density distributions of task performance for genotypes, ordered from highest mean Tshocked (top) to lowest mean Tshocked (bottom) for control (left panel; N = 32 for each genotype) and conditioned (right panel; N = 32 flies for each genotype) treatment. Distribution filled colours represent different genotypes. Solid vertical black lines represent chance level Tshocked = 1/3; B) Density distributions of replicates for genotypes shown in A); C-D) Correlation between replicates of mean task performance (C) and shock response (D) (N = 16 flies per replicate per genotype for 88 genotypes). Inset text show correlation equation, p-value and R2; E-I). Δ Hresid Experimental in behaviour for control and conditioned flies across genotypes (N = 88 genotypes, N.S. indicates no significant difference (T-test) between tested groups; left panel); and correlation of mean behaviour between replicates (N = 16 flies per replicate per genotype for 88 genotypes; right panel). Inset text show correlation equation, p-value and R2; Same is shown in E-I) where E represents correct decisions, F) handedness, G) velocity (mm/s), H) relative velocity, and I) learning score.

A-E) Individual fly behaviour and change in behaviour in conditioned (yellow) and control (grey) treatments is shown for A) task performance, B) Percentage of correct decisions, C) velocity (mm/s), D) relative velocity (mm/s) and E) handedness. F-J) Change in individual behaviour between 4th quarter (15 - 20. min) and 1st quarter (0 - 5 min) of the conditioning assay is shown for the same behaviours. K) Evolution of task performance over 20-min assay. Solid yellow and grey lines show the average cumulative task performance for all conditioned flies (N = 2611) and control flies (N = 2627), respectively. Shaded areas show 1 standard deviation. For all boxplots, whiskers show upper and lower quantiles, the bar indicates median and red plus indicates mean across individuals (points). In all panels yellow indicates the conditioned and grey the control flies. Asterisk indicates significance threshold for the T-test (* < 0.05,** < 0.01, *** < 0.001)

Heatmap shows Pearson’s product moment correlation matrix between individual’s behaviours in the conditioned and control treatment.

Pearson product-moment correlation coefficient (r) scale: Blue r = 1, white r= 0, red r = -1. Asterisks indicate p-value < 0.05 after Bonferroni correction for multiple testing. For all boxplots, whiskers show upper and lower quantiles, the bar indicates median. In all panels yellow points indicate the conditioned and grey the control flies. Asterisk indicates significance threshold for the T-test (* < 0.05,** < 0.01, ***< 0.001).

A) Correlation matrix for genotype scores of various measured fly behaviours (N = 88 genotypes). Yellow bands indicate the conditioned groups, grey bands the control groups, green bands represents scores measured over all flies regardless of the treatment. Pearson product-moment correlation coefficient (r) scale: Blue r = 1, white r= 0, red r = -1. Asterisks indicate p-value < 0.05 after Bonferroni correction for multiple testing. Inset shows the distribution of residual heterozygosity (total number of heterozygous loci) for 69 genotypes as reported in Mackay et al. (2012); B) Shock response for control (grey, N = 2627) and conditioned flies (yellow, N = 2611). For all boxplots whiskers of boxplots show upper and lower quantiles, the bar indicates median across individuals (points). Asterisk indicates significance threshold for the T-test (* < 0.05,** < 0.01, *** < 0.001). C) Kernel density distribution of shock response for control (grey) and conditioned (yellow) flies.

A) Task performance entropy (H) across 88 wild-type genotypes measured in the control (gray) and conditioned (yellow) treatment. Genotypes are sorted independently for control and conditioned treatment. Thin gray lines connect the same genotype across two treatments. Horizontal lines indicate mean entropy value across genotypes. Asterisks indicate a significant difference between the means across genotypes. B) Hellinger distance between the task performance distributions in control and conditioned flies is shown for each genotype. Geno-types are ranked based on the Hellinger distance, from lowest to highest. C) Task performance distributions are similar in replicate 1 and replicate 2.

A schematic representation of how scaling distributions to the same range can be used to assess the shape of the distribution independent of the distribution variance.

Assume some measurements with genotypes G1, G2 and G3 have a normal distribution under control condition (top figure, gray lines). In the conditioned case, the distributions are bimodal for G1 and G2, whereas it remains normal for G3 (top panel). For each genotype, the variance is the same in both conditions. If we simply compute the Hellinger distances, we find D(G1 conditioned, G2 conditioned) > D(G1 conditioned, G3 conditioned), because the Hellinger distances are dominated by the variance here and G1 and G3 have similar variances. However, when we transform the measurement variables to the same range [0, 1] (bottom panel), we find D(G1 conditioned shape, G2 conditioned shape) < D(G1 conditioned shape, G3 conditioned shape).

Phenotype means, residual entropies, Δ Hresid Genetics and Δ HresidExperimental (panels left to right) are shown for learning score, percent correctly made decisions, velocity, relative velocity and handedness (panels top to bottom).

Δ Hresid Experimental is ranked smallest to largest, independently across phenotypes.

Measures of residual entropy are calculated for the two groups (control and conditioned) separately.

Left panel is the correlation matrix heatmap, while the right panel shows the equivalent data scatterplots. Pearson product-moment correlation coefficient (r) scale: Blue r = 1, white r= 0, red r = -1.

A) Starting position reflects colour bias and affects task performance. Flies with a higher green bias (top panels) tend to find themselves on the green arm at the beginning of the assay for both control (N = 2627, left) and conditioned (N = 2611, right) flies. This is later reflected in the task performance (middle panel) and change in task performance (bottom panel), where flies starting at green colour have higher Tshocked and lower change in Tshocked in green place learning. In other words, biased flies, and those that start the experiment on green colour are both disadvantaged and poorer learners. For all boxplots whiskers of boxplots show upper and lower quantiles, the bar indicates median across individuals (points). Asterisk indicates significance threshold for the T-test (* < 0.05,** < 0.01, *** < 0.001). N.S. indicates non-significance; B) Correlation between genotype’s green bias and proportion of flies on the green arm at the start of the conditioning for each genotype (N = 64 flies per genotype for 88 genotypes). Inset text show correlation equation, p-value and R2; C) Change in task performance with respect to green bias is shown for flies (points) that started the task on green (shown in green) or blue position in the Y-maze (shown in blue). Inset text show correlation equation, p-value and R2. While change in task performance is significantly dependent on the green bias, the slope of this association is not affected by starting position of the fly in either treatment. D) The evolution of Hellinger distance between distributions of cumulative task performance over 50 decisions of flies starting at different arms of the Y-maze (neutral left NL, neutral right NR and shocked S) is shown for conditioned (yellow) and control treatment (grey). Note that the distributions differ substantially and persistently depending on where the fly starts the assay. This was independent of the flies’ bias. The divergence between distributions is, however, reduced with learning. Distributions of Tshocked are calculated for flies that have made at least 50 decisions. E-F) Pearson correlation coefficient (R2) for correlation between cumulative task performance and learning score (E), and between cumulative task performance and green bias (F), over the time span of the conditioning. In all panels yellow indicates the conditioned and grey the control flies.

Points show genotype statistic in conditioned (yellow) and control group (grey).

Behaviours shown are change in task performance, mean time to escape an arm, mean time to escape shock, change in time to escape an arm, Spearman’s rank correlation between four time intervals and relative number of visits to shocked arm (see Learning score in Methods), Spearman’s rank correlation between four time intervals and time spent in the shocked arm (see Learning score in Methods), number of made decisions and change the proportion of visits to the shocked arm. In all cases, the Individuality model provides the best representation of the observed data.

For each of the 9 behaviours, Hellinger distance is shown between observed data (N = 90 genotypes) and the equivalent data simulated 25 times based on three different models (Individuality, No learning, No individuality.

Distance between observed and simulated replicates is also shown, where the first 32 simulated flies are compared to the first 32 observed flies (replicate 1) and the second 32 simulated to the second 32 observed (replicate 2). The Individuality model is able to reproduce the observed data, while No individuality model fails to capture the observed variation in the number of decisions, escape duration, change in escape duration, and the proportion of visits to shocked arm. Similarly, No learning model underperforms compared to Individuality model in capturing the change in escape duration and proportion of visits to shocked arm.

A) Task performance and B) change in task performance depend significantly on the change in behaviour policy in the conditioned treatment (yellow, upper panels). This dependence is much weaker or insignificant in the control treatment (grey, lower panels). Each point represents an individual fly. Inset text shows correlation equation, p-value and R2.