Figures and data

Quantitative analysis of self-righting behaviour
(A) Photographs (top) and diagrams (bottom) of the self-righting sequence of a first-instar Drosophila larva. After inversion of the normal posture, the self-righting sequence involves a 180° rotation of the body that begins at the head and takes around 3-5 seconds on average. B) A phylogenetic tree of common model organisms, with the reported occurrence of self-righting behaviour being indicated on the right. C) Experimental procedure for consistent recording of self-righting behaviour. Third-instar larvae were positioned on a dry coverslip with the dorsal side in contact with the surface before being placed in an arena for recording. Behaviour was ‘unlocked’ at the desired moment through the application of water with a moistened paintbrush. D) Extraction of behavioural features with video tracking. Video frames were analysed using DeepLabCut, where four points along the anterior-posterior axis were labelled. The coordinates of these points were used to calculate speed of movement as well as angles of body curvature. E) Mean head speed and F) tail speed over the course of recordings. The lines show the mean taken over all samples while the shaded areas indicate the 95% CI. The time course has been normalised to account for differences in the length of behaviour. The dotted line in E indicates where the self-righting sequence is predicted to begin on average, based on head movement. G) Mean speed of movement for the head and tail during the self-righting sequence. Points indicate mean speeds for individual samples, with measurements from the same larva being connected by lines. The box and whisker plots indicate the median, IQR and 1.5 IQR. ‘***’ = P < 0.001 for Wilcoxon signed rank tests, n = 30. H) Absolute angles of curvature of the head (purple) and tail (red) over the course of the self-righting sequence. The lines show the mean absolute angle while the shaded areas indicate the 95% CI. Due to the apparent curvature of the head in three discreet bursts, the head angles have been labelled I, II and III. I) The distribution of curvature angles for the head (purple) and tail (red), where negative values are left-handed bends and positive values are right-handed bends. The lines show a smoothed kernel density estimation for the probability density while the bars indicate counts binned to each 10°. J) Mean absolute angle for the head and tail during the self-righting sequence. Points indicate mean speeds for individual samples, with measurements from the same larva being connected by lines. The box and whisker plots indicate the median, IQR and 1.5 IQR. ‘***’ = P < 0.001 for Wilcoxon signed rank tests, n = 30.

List of Drosophila stocks used in this study.

Antibodies used in immunohistochemistry.
All solutions were prepared in PBS supplemented with 0.3% v/v Triton-X.

Sequences of primers used in RT-PCR.

Effects of localised substrate contact on self-righting.
A) Experimental procedure for investigating localised dorsal substrate contact. Third instar larvae were first placed dorsal side down on a dry glass coverslip in the desired position. Movement was then unlocked via the application of water with a paintbrush. B) Photographs of larvae in three conditions of dorsal substrate contact. The red dashed line indicates the boundary of the coverslip. C) Proportion of larvae that performed self-righting in the three conditions of dorsal substrate contact. Group comparison: Cochran’s Q(2) = 28.35, P < .001, n = 20. ‘***’ = P < .001, ‘**’ = P < .01 for pairwise Cochran Q tests. D) Self-righting times in the three conditions of dorsal substrate contact. For larvae that didn’t self-right within 60s, the time is shown as 60. Points show times for individual tests, with measurements from the same larva being connected by lines. The box and whisker plots indicate the median, IQR and 1.5 IQR. P = 0.047 for a Wilcoxon signed rank test comparing the anterior and whole-body conditions, n = 17. E) Experimental procedure for investigating the combination of whole-body dorsal substrate contact with localised ventral substrate contact. A coverslip was held inside a custom 3D-printed mount (red box) to provide consistent contact. Third instar larvae were placed ventral side down on the coverslip in the desired position. The coverslip and larva were then placed onto agar, providing whole-body dorsal contact and sufficient moisture for movement. Larvae generally performed crawling or self-righting. F) Snapshots of larvae in the three conditions of ventral substrate contact. The red dashed line indicates the boundary of the coverslip. G) Proportion of larvae that performed self-righting in the three conditions of ventral substrate contact. Group comparison: Cochran’s Q(2) = 29.50, P < .001, n = 20. ‘****’ = P < .0001, ‘***’ = P < .001 for pairwise Cochran Q tests.

Conditional thermogenetic inhibition of multidendritic sensory neurons
A) The peripheral nervous system of the Drosophila larva. The diagram (top) shows the larva with the segmentally repeated clusters of sensory organs. The canonical hemisegmental arrangement (bottom) shows the es organs (grey circles), chordotonal organs (yellow triangles) and multidendritic neurons (green diamonds). Adapted from Orgogozo & Grueber (2005). B) A confocal z projection of a stage 16 embryo with GFP expression in the 109(2)80-Gal4 domain. The embryo has been immunolabelled with anti-GFP (green), 22C10 (axonal tracts, red) and DAPI (nuclei, blue). C) Experimental procedure for conditional inhibition of sensory neurons expressing shibire[ts] (shi[ts]). Self-righting is first performed with first instar larvae at 25 °C, at which shibire is functional and synaptic transmission occurs normally. The substrate is then heated to 32 °C and self-righting is tested again. This temperature impairs shibire function and inhibits synaptic vesicle recycling and release. The temperature is then lowered back to 25 °C allowing restoration of shibire function. Self-righting is tested again to ensure recovery from the conditional inhibition. D-F) Self-righting times for first-instar larvae expressing shibire in different sets of sensory neurons. In each case, the location of the sensory neuron population within the hemisegmental arrangement is shown (left). Box and whisker plots indicate self-righting times in each temperature condition, for UAS-shi[ts] controls (left) and age-matched experimental genotypes (right). The temporal order of the temperature conditions follows from top to bottom of each plot. ‘*’ = P < .05, ‘**’ = P < .01, ‘***’ = P < .001 for pairwise Wilcoxon signed-rank tests. C) Self-righting times of 109(2)80>shi[ts] larvae, expressing shi[ts] in all multidendritic neurons. n[exp] = 38, n[control] = 37. D) Self-righting times of NompC>shi[ts]larvae, expressing shi[ts] in daIII neurons. n[exp] = 17, n[control] = 17. E) Self-righting times of ppk>UAS-shi[ts] larvae, expressing shi[ts] in daIV neurons. n[exp] = 39, n[control] = 40.

Localised optogenetic inhibition of multidendritic sensory neurons along the anterior-posterior axis.
A) Experimental setup for localised optogenetic inhibition. Inhibitory light was spatially restricted by means of a small slit in the base of a 3D-printed arena (left). The LED was positioned under the slit and operated by a switch, while an infrared camera recorded from above (right). B) Experimental procedure for testing the effects of localised inhibition on self-righting. Larvae were positioned dorsal side down on a coverslip above the slit such that incoming light illuminated a group of three segments. After light activation, larvae were quickly unlocked through application of water and the time to complete self-righting was timed. C) Photographs of the five experimental conditions of localised illumination. In each condition, light targeted a group of three segments along the anterior-posterior axis, while no light was used as a control condition. D) Log-transformed time to self-right across the five illumination conditions for larvae expressing GtACR2 in the 109(2)80 domain. The bars show mean values, and points show individual measurements with measurements from the same larva being joined by grey lines. Analysis of deviance for a mixed model including control genotypes revealed a significant interaction of illumination condition and genotype (F(8, 468) = 10.35, P < .001, n = 40). ‘****’ = P < .0001, NS = P > .05 for post-hoc one-sided comparisons between conditions of light illumination, following Dunnet’s approach with Sidak’s adjustment for multiple comparisons. E) Log-transformed time to self-right across the five illumination conditions for Gal4 (left) and UAS (right) genetic control lines. No statistical differences were observed between the control condition and the experimental illumination conditions for either control line.

Behavioural changes occurring under localised optogenetic inhibition of sensory neurons
A) Labelling of recordings using DeepLabCut. Recordings of optogenetically-inhibited larvae were first manually trimmed so they contained only the time from movement unlocking to completion of self-righting (top). These videos were then analysed by DeepLabCut, which tracked four points along the anterior-posterior axis: head (purple), anterior middle (cyan), posterior middle (yellow), and tail (red). The coordinates of these tracked points were then used to calculate features of self-righting. B) Counts of the changes in head curvature direction under localised optogenetic inhibition of multidendritic neurons. The counts were calculated as the number of times a larva went from bending towards one direction with the head to bending in the other direction. Bars show the mean values for each condition, while points show counts for individual samples with measurements from the same larva being connected by lines. Analysis of deviance for a negative binomial model including control genotypes revealed a significant interaction of illumination condition and genotype (Χ2 = 40.41, P < .001, n = 40). ‘****’ = P < .0001 for post-hoc one-sided comparisons between conditions of light illumination, following Dunnet’s approach with Sidak’s adjustment for multiple comparisons. C) Correlations between count of head direction changes and self-righting times, for all illumination conditions (left) and just the anterior illumination conditions (right) in 109(2)80>GtACR2 larvae. Points show individual observations, while the red line indicates a linear regression. P < .0001 for both Spearman correlations.

Hox expression in the sensory system and its influence on self-righting behaviour
A) Quantification of Hox RNA expression in larval sensory neurons. The flow diagram (beginning bottom left) shows how sensory neurons were collected from dissected first instar larvae using fluorescence-activated cell sorting (FACS). RNA was extracted from the sorted cells and reverse transcribed to DNA for amplification of Hox gene products via PCR. The photograph (bottom right) shows an agarose gel electrophoresis following RT-PCR of Hox genes Antp, Ubx, abd-A and Abd-B. For each gene, ‘no tem’ indicates a no template cDNA control, ‘no RT’ indicates a no reverse transcription control, and ‘exp’ indicates the experimental lane. B) Self-righting times of first instar larvae expressing a Hox gene RNAi construct in the sensory system. ‘***’ = P < .001, ‘*’ = P < .05 for Wilcoxon rank sum tests, n = 19-30. C-F) Confocal images of immunolabelled stage 16 109(2)80>mCD8::GFP embryos. In each case, the large left panel is a maximum intensity z-projection. The white square indicates the region that is zoomed in the smaller panels to the right. These smaller panels show an individual z slice in the two separate channels and the channel overlay. Triangles indicate cells showing clear signal for Hox protein, and arrowheads indicate cells lacking signal for Hox protein. The strips on the right are zoomed sections of the z-projection, showing a range of cells in one embryonic hemisegment. The putative identities of these cells are indicated by red lines in accordance with the canonical hemisegmental diagram on the far right. C) Embryo immunolabelled for Antp and GFP, dorsal view. D) Embryo immunolabelled for Antp and GFP, ventrolateral view. E) Embryo immunolabelled for Abd-B and GFP, dorsal view. F) Embryo labelled for Abd-B and GFP, ventrolateral view.