Proprioceptive limit detectors contribute to sensorimotor control of the Drosophila leg

Domain: neuroscience
Published: 2026-02-12
Editorial outcome: accept

Abstract
Many animals possess mechanosensory neurons that fire when a limb nears the limit of its physical range, but the function of these proprioceptive limit detectors remains poorly understood. Here, we investigate a class of proprioceptors on the Drosophila leg called hair plates. Using calcium imaging in behaving flies, we find that a hair plate on the fly coxa (CxHP8) detects the limits of anterior leg movement. By reconstructing CxHP8 axons in an electron microscopy dataset, we found that they are wired to excite posterior leg movement and inhibit anterior leg movement. Consistent with this connectivity, optogenetic activation of CxHP8 neurons elicited posterior postural reflexes, while silencing altered the swing-to-stance transition during walking. Finally, we use comprehensive reconstruction of peripheral morphology and downstream connectivity to predict the function of other hair plates distributed across the fly leg. Our results suggest that each hair plate is specialized to control specific sensorimotor reflexes that are matched to the joint limit it detects. They also illustrate the feasibility of predicting sensorimotor reflexes from a connectome with identified proprioceptive inputs and motor outputs.

Introduction
Animals rely on proprioception to sense and coordinate movements of the body. One key function of the proprioceptive system is to detect when a body part has reached the limits of its normal range. In vertebrates, including mammals, the extremes of joint position are detected by low-threshold Ruffini endings and Pacinian corpuscles embedded within joint capsules1. In arthropods, including insects, joint limits may be detected by hair plates, fields of small, stiff mechanosensory hairs positioned at cuticular folds within joints2. Compared to proprioceptors that encode limb position and movement, such as vertebrate muscle spindles and invertebrate chordotonal organs, less is known about the physiology and behavioral function of proprioceptors that detect joint limits3.

Early recordings from joint receptors in cats found that single afferents fired in a phasic or tonic manner near the limit of the range of joint movement1. For much of the 20th century, it was believed that these receptors were the primary source of our conscious sense of body position, or kinesthesia4. However, humans retain their kinesthetic sense after joint capsules are removed following hip replacement surgery5. This and other evidence6 suggest that muscle spindles are the primary proprioceptors underlying kinesthesia in mammals. Compared to muscle spindles, far less is known about the downstream connectivity and function of vertebrate joint receptors4.

In insects and other invertebrates, feedback from proprioceptive limit detectors has been shown to initiate stabilizing reflexes that sculpt motor patterns and protect the limbs from injury7. For example, classic work in the cockroach showed that hair plate neurons at a proximal leg joint monosynaptically excite extensor motor neurons and indirectly inhibit flexor motor neurons, restricting the range of joint flexion8,9. The ablation of this hair plate caused the corresponding leg to overstep and collide with the more anterior leg during walking, indicating that limit detection is important for controlling phase transitions of the step cycle8. Past work has identified specific sensorimotor reflexes mediated by insect hair plates, but it has been difficult to synthesize into a more comprehensive understanding of the underlying feedback circuits and their function. Like many proprioceptors, hair plates are distributed throughout the animal’s body, which raises the possibility that each sensory organ is specialized for sensing and controlling specific movements.

With emerging connectomic wiring maps10–18 and genetic tools to target specific cell types19,20, the fruit fly, Drosophila, has recently emerged as an important model system to investigate neural mechanisms of limb proprioception. A suite of techniques, including connectomics14,21,22, electrophysiology23, calcium imaging24–28, genetic manipulations29,30, and perturbations during behavior28,31–38, have been applied to investigate the function of proprioceptors in the fly’s femoral chordotonal organ (FeCO). The FeCO contains subtypes of mechanosensory neurons that detect the position, movement, and vibration of the fly femur-tibia joint, in a manner analogous to vertebrate muscle spindles26,27,39. However, compared to the FeCO, little is currently known about the anatomy, physiology, and behavioral function of hair plates on the Drosophila leg.

The six Drosophila legs have 214 hair plate mechanosensory neurons that are clustered into 42 hair plates (Supplementary Fig. S1A)40–42. Investigating the physiology and function of each hair plate, one by one, would be experimentally intractable, even in the tiny fruit fly. Instead, we start by studying one specific hair plate on the coxa of the fly’s front legs (CxHP8) using in vivo calcium imaging (Fig. 1), connectomics (Fig. 2), and genetic manipulations during behavior (Figs. 3, 4). We find that the sensory tuning and motor reflex action of CxHP8 are well predicted by its external morphology and downstream connectivity to leg motor neurons. We therefore extend these sensorimotor reflex predictions to other hair plates positioned at different locations on the leg (Fig. 5). Overall, our results provide insight into the behavioral function of proprioceptive limit detectors.

Results
CxHP8 neurons detect the limits of coxa rotation and adduction
On the fly’s front leg, three hair plates are located at the junction between the coxa (Cx) and thorax (Fig. 1A). These hair plates (CxHP8, CxHP3, CxHP4) wrap the joint along the anterior-posterior axis. We screened Split-GAL4 driver lines to identify lines that label coxa hair plates (Supplementary Table S1). The most specific and complete line we found43 labeled CxHP8 neurons on the front and middle legs (6 and 3 out of 8 cells, respectively). Using this specific driver line, which we refer to as CxHP8-GAL4 (Fig. 1B and Supplementary Fig. S1B), we investigated the joint angle encoding properties of CxHP8 neurons.

We used a setup25 that combines 2-photon calcium imaging with high-speed video to simultaneously record the activity of CxHP8 axons in the fly’s ventral nerve cord (VNC) and 3D leg joint kinematics in CxHP8-GAL4 flies expressing GCaMP7f and tdTomato (Fig. 1C). To overcome the slow temporal dynamics of GCaMP7f relative to the dynamics of active leg movement in flies, we passively (and slowly) moved the left front leg using a manually controlled 3-axis platform (Supplementary Video 1). We then used DeepLabCut44 and Anipose45 to compute the 3 angles corresponding to the rotation, adduction, and flexion of the front leg thorax-coxa joint (Fig. 1D). Increases in rotation, adduction, and flexion angles correspond to the coxa rotating inward, translating medially, and flexing, respectively (Supplementary Fig. S1C). Our goal in these experiments was to determine the relationship between thorax-coxa joint angles and CxHP8 calcium activity (Fig. 1E).

Based on the anterior position of CxHP8 at the thorax-coxa joint, we hypothesized that its hairs would be deflected during anterior and medial movements, and inward rotations of the coxa (Supplementary Video 2). A representative trial illustrates that calcium activity peaked when the coxa was inwardly rotated and adducted (Fig. 1F). Across flies, we found similar tuning to coxa rotation and adduction (Fig. 1G). Although with greater variability, CxHP8 axons showed higher activity when the coxa was extended. Because coxa rotation and adduction produced strong calcium responses, we next investigated how the two angles jointly influenced the activity of CxHP8 neurons. We found that the combination of both adduction and inward rotation resulted in maximal calcium activity of CxHP8 axons (Fig. 1H). Altogether, our results show that CxHP8 neurons detect the limits of anterior leg movement.

CxHP8 neurons are active across behaviors
We next sought to determine the activity of CxHP8 neurons during different behaviors. We used a similar imaging setup25 but replaced the platform with an air-supported ball and allowed the fly to spontaneously behave (Supplementary Video 3). We found that resting, walking, and grooming produced rotation and adduction coxa joint angles within the range that CxHP8 neurons were active (Fig. 1I). As illustrated by a representative trace, calcium activity increased during grooming and walking compared to adjacent resting states (Supplementary Fig. S1D). The CxHP8 calcium signal varied across different grooming bouts, likely a reflection of the variation in front leg kinematics across those bouts and the corresponding differences in the amplitude of hair plate deflection. Peak calcium activity was largest for front leg grooming bouts, likely because CxHP8 cuticular hairs are continuously deflected when the legs extend in front of the fly. Thresholding peak calcium activity (Supplementary Fig. S1E), we found CxHP8 neurons were active across behaviors (Fig. 1J), particularly during extreme adduction and rotation angles (Supplementary Fig. S1F).

Connectomics predicts that CxHP8 neurons drive posterior leg movement
Using connectomics, we next reconstructed and analyzed hair plate sensorimotor circuits to predict the role of limit detection in leg motor control. Some hair plate axons were previously reconstructed in an electron microscopy (EM) dataset of a male adult nerve cord (MANC)22. However, specific hair plate axons could not be identified in MANC due to poor reconstruction quality. We therefore reconstructed hair plate axons within an EM dataset of the Female Adult Nerve Cord (FANC)10,14. We first used previous annotations14 to identify and proofread all CxHP8 axons projecting into the left leg neuromere (Fig. 2A). We identified the peripheral location of each hair plate axon in the FANC connectome using a combination of genetic driver lines, axonal morphology, axonal projection patterns, and an x-ray holographic nano-tomography dataset of the fly leg42 (See Methods for details). For example, CxHP8 cells are identifiable in the X-ray dataset because they are the only hair plate axons that project into the VNC through the ventral prothoracic nerve (VProN).

The entire FANC dataset has been automatically segmented into neurons using convolutional neural networks10, but many cells still required manual proofreading. We proofread and annotated cells downstream of CxHP8 neurons and found that CxHP8 axons allocate 75% of their output synapses (2279 ± 482 synapses per CxHP8 axon) to premotor (interneurons that synapse on motor neurons: 58%) and motor (17%) neurons. These percentages are significantly higher than that of exteroceptive leg sensory neurons, but similar to FeCO proprioceptors21, suggesting that hair plates are primarily involved in leg motor control.

The 69 motor neurons controlling the fly’s left front leg are organized into 14 motor modules – motor neurons within a module receive common presynaptic input and control the same joint10. Premotor neurons in FANC have also been annotated based on their developmental hemilineage46, from which it is possible to infer the neurotransmitter released by each cell (acetylcholine, GABA, or glutamate). We first examined the connectivity from CxHP8 axons to premotor neurons to leg motor neurons (Fig. 2B). CxHP8 neurons provide strong monosynaptic input to motor neurons within the coxa posterior module (Fig. 2B, C). They also connect indirectly, via excitatory and inhibitory premotor neurons, to multiple other motor modules across the leg (Fig. 2C and Supplementary Fig. S2A). CxHP8’s strongest inhibitory connections are onto the coxa promote module, an antagonist of the coxa posterior module (Fig. 2B). We also found extensive recurrent connectivity within and across premotor neurons, as well as between CxHP8 axons and 19A premotor neurons (Supplementary Fig. 2B). Overall, CxHP8 neurons are positioned to provide feedback to multiple motor modules, but with the strongest excitation to motor neurons driving posterior leg movement and inhibition to motor neurons driving anterior movement. These connectivity patterns lead us to hypothesize that activity in CxHP8 neurons drives posterior leg movement when the coxa reaches its anterior limit. For example, CxHP8 feedback could contribute to the swing-to-stance transition during walking (Fig. 2E).

CxHP8 activation drives posterior leg movement and silencing alters swing-to-stance transitions during walking
We next tested whether CxHP8 activation contributes to posterior leg movements, as predicted by their synaptic connectivity to leg motor neurons. As in prior studies23,47, we used a setup that enables spatio-temporally precise optogenetic activation or silencing of neurons in tethered flies behaving on an air-supported ball (Fig. 3A). Using six high-speed cameras, we reconstructed full 3D leg joint kinematics using DeepLabCut44 and Anipose45. To optogenetically activate CxHP8 neurons, we genetically expressed ChrimsonR within the CxHP8 neurons and illuminated the thorax-coxa joint of the left front leg with a red laser. In a representative standing fly, we observed that its left front leg moved posteriorly shortly after the onset of the laser, which was accompanied by outward rotation, lateral movement, and flexion of the coxa (Fig. 3B, C and Supplementary Video 4). We observed the same changes in thorax-coxa joint angles across standing flies when CxHP8 neurons were optogenetically activated (Fig. 3D), whereas control flies lacking Chrimson showed negligible kinematic changes during laser stimulation (Supplementary Fig. S3A). These joint angle changes were accompanied by posterior, lateral, and downward displacement of the distal tarsus (Fig. 3E). Overall, the activation of CxHP8 neurons produced posterior and lateral movement of the stimulated leg, without impacting the other legs.

We next optogenetically silenced CxHP8 neurons through the expression of a light-gated chloride channel (GtACR1) during spontaneous behaviors. When CxHP8 feedback was silenced during forward walking, the thorax-coxa adduction angle of the left front leg was slightly but significantly more medial, particularly at the swing-to-stance transition of the step cycle (Fig. 3F). We did not observe medial coxa displacements in control flies that experienced the same laser stimulation (Supplementary Fig. S3B). Optogenetic silencing of CxHP8 neurons also subtly but significantly altered the tarsus position at the swing-to-stance transition (Fig. 3G). Thus, the lack of CxHP8 activity appeared to cause the coxa to slightly but significantly overshoot the normal kinematic range associated with the swing-to-stance transition, leading to a displacement of the entire leg. We also assessed the role of CxHP8 feedback in left (Supplementary Fig. S3C) and right turns (Supplementary Fig. S3D), and front leg grooming (Supplementary Fig. S3E). Although joint angles were not affected during left turns, we found that the coxa was significantly more extended and rotated inward at the swing-to-stance transition when CxHP8 neurons were silenced during right turns. An explanation for this asymmetry is that the left leg moves inward during right turns (but not left turns), which would deflect the hairs of CxHP8 to a greater extent, given their anterior, inward position within the thorax-coxa joint. The coxa was also subtly but significantly more rotated, adducted, and extended in flies with CxHP8 neurons silenced during front leg grooming (Supplementary Fig. S3E).

CxHP8 facilitates the swing-to-stance transition and controls resting posture in untethered flies
Although convenient for delivering targeted optogenetic stimuli and tracking joint kinematics, flies walking in the tethered configuration have slightly different walking kinematics than untethered flies35. To test whether CxHP8 feedback is important for the control of swing-to-stance transitions in untethered walking flies, we used a linear treadmill system35. We genetically expressed an inward rectifying potassium channel, Kir2.1, to chronically hyperpolarize CxHP8 neurons. As flies walked on the treadmill, driven at a belt speed of 10 mm/s, we recorded their movement at 200 fps with 5 high-speed cameras (Fig. 4A). From the high-speed videos, we reconstructed the 3D positions of the head, thorax, abdomen, and each leg tip using DeepLabCut44 and Anipose45. We then used these reconstructed 3D positions to quantify kinematics and posture during walking and rest periods, respectively (see Methods for details; Fig. 4B).

Like tethered flies, we found that silencing CxHP8 neurons in flies walking on the treadmill impaired step kinematics of the front legs near the swing-to-stance transition. In particular, the anterior extreme position (AEP), where a leg first enters stance, was displaced medially and posteriorly compared to controls (Fig. 4C). The posterior extreme position (PEP), where a leg first enters swing, was also significantly displaced in a similar manner to the AEP. Given that the AEP marks the swing-to-stance transition, and that changes in the AEP may drive changes in the PEP, we focused on understanding the kinematic changes that facilitate the displacement of the AEP in CxHP8-silenced flies. In examining the average swing trajectories of the front legs, we found a significant medial deviation of the trajectory near the swing-to-stance transition in CxHP8 silenced flies compared to controls (Fig. 4D). Although this deviation did not result from a significantly longer mean swing duration (Fig. 4E), the mean swing distance was significantly greater in flies with CxHP8 neurons silenced (Fig. 4F). Unlike front leg step kinematics, inter-leg coordination was not significantly altered in flies with CxHP8 neurons silenced (Fig. 4G). Overall, the silencing of CxHP8 neurons in flies walking on the treadmill resulted in more medial front leg movement near the swing-to-stance transition. Although kinematic results were largely consistent between tethered and untethered flies, the tarsus position was not significantly displaced medially in untethered flies when CxHP8 neurons were silenced. This difference could be a consequence of the difference in substrate35, tethering, or silencing method.

In larger insects, hair plates have been shown to be important for controlling resting body48 and leg posture7,49. We therefore examined the posture of flies during rest periods on the treadmill. Even though flies with CxHP8 neurons silenced did not have significantly different body heights (Supplementary Fig. S4A) or angles (Supplementary Fig. S4B), the resting positions of their tarsi were significantly more splayed out than controls (Supplementary Fig. S4C). We further quantified this by calculating the area of the polygon formed by the tarsi positions (Supplementary Fig. S4D). The mean polygon area of CxHP8 silenced flies was significantly greater than controls, providing further support that CxHP8 neurons control the resting posture of the legs.

Connectome analysis enables functional predictions for other hair plates on the fly leg
Our calcium imaging data indicate that CxHP8 neurons function as limit detectors of anterior coxa movement (Fig. 1). Based on analysis of the connectome, we hypothesized that feedback from CxHP8 neurons helps transition the coxa away from its anterior limit by driving posterior movement (Fig. 2). We tested and confirmed this prediction by genetically manipulating the activity of CxHP8 neurons in behaving flies (Figs. 3, 4). Having validated the predicted reflex function for one hair plate, we now return to the connectome to predict the role of other front leg hair plates in leg motor control.

We focused on the two other hair plates on the front leg coxa, CxHP3 and CxHP4, along with the three hair plates located at the coxa-trochanter joint, TrHP5, TrHP6, and TrHP7 (Fig. 5A, Supplementary Fig. S1A and Supplementary Video 2). In FANC, we reconstructed the axons of each of these hair plates (Fig. 5B and Supplementary Fig. S5A). Of the thousands of output synapses from these hair plate axons (Supplementary Fig. S5B), the majority of synapses are onto local premotor and motor neurons (Fig. 5C). Interestingly, we also found that some hair plate axons synapse onto glia (Fig. 5C and Supplementary Fig. S5C), suggesting that their signaling may be used for non-motor related functions, such as detecting injury. The axons of each hair plate connect to distinct populations of motor neurons that actuate the leg segment the hair plate is located on (Fig. 5D). For instance, CxHP4 axons provide strong connectivity to motor neurons of the coxa rotate motor module, which drives anterior coxa movement, where as the antagonistically positioned CxHP8 connects to the antagonistic coxa posterior motor module. We also found that the axons of each hair plate synapse onto diverse premotor neurons (Supplementary Fig. S5D). By combining the connectivity of hair plates onto premotor and motor neurons, we constructed 2-layer sensorimotor circuits for each hair plate (Supplementary Fig. S5E). We also computed the motor impact score for each hair plate (Fig. 5E), a measure that weights direct and indirect connectivity between sensory and motor neurons, incorporating the neurotransmitter of any intervening interneurons21. This impact score is useful to understand trends or differences in motor connectivity, but, importantly, does not consider factors such as activity dynamics or intrinsic neural properties. Nonetheless, comparing impact scores revealed clear differences in motor connectivity among hair plates on different parts of the leg. For example, our analysis predicts that CxHP4 drives anterior leg movement, CxHP3 reinforces both anterior and posterior leg movement, TrHP5 and TrHP7 drive posterior leg movement, and TrHP6 drives anterior leg movement. Overall, the connectivity of hair plates suggests each limit detector is specialized for controlling specific leg movements that are matched to the different extremes of joint movement that they detect (Fig. 5F).

Methods
Fly husbandry and genotypes
Experiments were performed on adult male flies, Drosophila melanogaster, between 2-5 days post-eclosion. Flies were reared in a 25°C incubator with 14:10 light:dark cycle with in vials filled with a standard cornmeal and molasses medium. Genotypes used in experiments are listed in Table 1.

Blender model of Drosophila body and front leg hair plates
A morphologically accurate model of an adult Drosophila melanogaster containing the hair plates at the thorax-coxa and coxa-trochanter joints of the front leg was constructed using the 3D rendering and modeling software, Blender60. The body of the fly, and the anatomy and location of hair plates in the model, were based on high-resolution confocal images. We replayed the 3D walking kinematics of the left front leg coxa measured from a tethered fly walking on the ball to this model to illustrate the phases during the step cycle when the hairs of each coxa hair plate would be deflected (Supplementary Video 2).

Confocal imaging of proprioceptor expression
Peripheral expression of proprioceptors in legs. Front, middle, and/or hind legs of male flies associated with the driver lines in Supplementary Table S1 crossed with the UAS-mcD8GFP; red stinger reporter line were fixed in a 4% formaldehyde (PFA) PBS solution for 20 min and then washed three times in a 0.2% Triton X-100 PBS solution. Legs were then cleared with Focus Clear (CelExplorer) and mounted on slides in Mount Clear (CelExplorer). The expression at each hair plate was assessed using an Olympus FV1000 confocal microscope. The number of proprioceptor cells labeled by each driver line was then determined through visual inspection of the volumetric imaging stacks in FIJI61.

Central expression of proprioceptors in the brain and VNC. The brain and VNC were dissected from male flies associated with the split-GAL4 driver lines that showed interesting peripheral expression in hair plates, such as the CxHP8 split-GAL4 driver line (i.e., R48A07 AD; R20C06 DBD). Unlike above, the GAL4 driver resulted in the expression of pJFRC7-20XUAS-IVS-mCD8::GFP. The brains and VNCs were fixed in the same manner as legs, but then were put into a blocking solution (5% goat serum, PBS, 0.2% Triton-X) for 20 min followed by being incubated in a blocking and primary antibody solution (1:50 concentration of anti-GFP chicken antibody, 1:50 concentration of anti-brp mouse) for 24 h at room temperature. The brains and VNCs were then washed three times in PBS with 0.2% Triton-X and incubated in a blocking and secondary antibody solution (1:250 concentration of anti-chicken-Alexa 488, 1:250 concentration of anti-mouse-Alexa 633). After this, the brains and VNCs were washed three times with PBST and mounted on a slide in Vectashield (Vector Laboratories). The brains and VNCs were imaged with the same Olympus confocal microscope as legs and image stacks were analyzed in FIJI61.

Reconstruction and identification of hair plate axons in FANC EM dataset
Hair plate axon reconstruction and connectivity. Hair plate axons were reconstructed in the electron microscopy dataset of the female ventral nerve cord, FANC10,14, through manual proofreading of the automatically segmented cell fragments in Neuroglancer62. Annotations containing information about the reconstructed hair plate axons, such as what hair plate they project from, we uploaded to the Connectome Annotation Versioning Engine (CAVE)63 and are publicly available to those that have access to the FANC dataset. We then determined and proofread the cell fragments that received or provided at least 3 synapses from or onto hair plate axons. In addition to proofreading the upstream and downstream partners of hair plates, we classified them, if possible, into general cell types and specific cell classes using pre-existing CAVE annotation tables and/or expert knowledge10,46,64,65. Note, we classified glutamatergic neurons as inhibitory66. Our neuronal annotations were uploaded to CAVE and are publicly available. We determined the downstream and upstream partners of hair plates and performed connectivity analyses using a custom Python script. Note that only neurons that had 4 or more output synapses on average per neuron within a cell class onto individual downstream neurons were used in the reflex circuit analyses.

Hair plate identification. Hair axons were identified from previously traced backbones and annotations in CATMAID14,42. The axons of CxHP8, CxHP3, and CxHP4 were identified based on if they projected through the ventral prothoracic, dorsal prothoracic, or prothoracic accessory nerves, respectively (Supplementary Fig. S5A). All trochanter hair plate axons project through the prothoracic leg nerve (Supplementary Fig. S5A), so TrHP5, TrHP6, and TrHP7 neurons were instead identified based on their location in the nerve bundle, axonal morphology, and downstream connectivity with motor neurons (Fig. 5D). TrHP6 axons were identified because they make distinct connections onto motor modules compared to TrHP5 and TrHP7 (Fig. 5D). TrHP5 and TrHP7 axons could be differentiated because they enter the leg neuropil through the ProLN at different locations (Supplementary Fig. S5A).

Motor impact score. Motor impact score21 was computed by first calculating the monosynaptic weight between a hair plate and motor module, which is the total number of synapses that all neurons within a hair plate make onto the motor neurons within a motor module, divided by the total number of synapses onto that motor module across all neurons. Next, we calculated the di-synaptic weight between a hair plate and motor module by finding and summing the proportion of hair plate input synapses provided to each premotor neuron connected to the motor module of interest, multiplied by the proportion of input synapses those premotor neurons make onto the motor module. Note that the fractional input between these premotor neurons and the motor module is signed, based on the hemilineages of the premotor neurons. The motor impact score is then derived by summing the monosynaptic and di-synaptic weights.

Calcium imaging of hair plate axons
The following preparation, setup, and analysis pipeline25 was used to image calcium signals in hair plate axons in the neuromere of the left front leg during active and passive leg movements.

Preparation. We attached a fly to a custom-made holder, removed a rectangular piece of cuticle from the dorsal thorax, removed the underlying indirect flight muscles, and used an insect pin to displace the digestive system. This provided a dorsal view on the hair plate axons entering the VNC from the left front leg.

Two-photon image acquisition. Calcium signals in hair plate axons were recorded with a two-photon Movable Objective Microscope (MOM; Sutter Instruments) with a 20x water-immersion objective (Olympus XLUMPlanFI, 0.95 NA, 2.0mm wd; Olympus). Hair plate neurons expressed the calcium indicator GCaMP7f (green fluorescence) and the structural marker tdTomato (red fluorescence). Fluorophores were excited at 920 nm by a mode-locked Ti:sapphire laser (Chameleon Vision S; Coherent). We used a Pockels cell to keep the power at the back aperture of the objective below ~35 mW. Emitted fluorescence was directed to two high-sensitivity GaAsP photomultiplier tubes (Hamamatsu Photonics) through a 705nm edge dichroic beamsplitter followed by a 580nm edge image-splitting dichroic beamsplitter (Semrock). Fluorescence was band-passed filtered by either a 525/50 (green) or 641/75 (red) emission filter (Semrock). Image acquisition was controlled with ScanImage 5.2 (Vidrio Technologies) in Matlab (MathWorks). The microscope was equipped with a galvo-resonant scanner, and the objective was mounted onto a piezo actuator (Physik Instrumente; digital piezo controller E-709). We acquired volumes of three 512×512 pixel images spaced 5 μm apart in depth (10 μm total) at a speed of 8.26 volumes per second.

Two-photon image analysis. Two-photon images were smoothed with a Gaussian filter (sigma = 3 pixels; size = 5×5 pixels). Each tdTomato image was aligned to the average tdTomato signal of the recorded trial using a cross-correlation-based image registration algorithm67. The same alignment was used for the GCaMP images. We averaged the three GCaMP and tdTomato images per volume. Then, we extracted the mean fluorescence in manually drawn regions of interest (ROIs). To correct for vertical movement of the VNC, we computed the ratio of GCaMP fluorescence to tdTomato fluorescence in each frame. To facilitate comparisons across trials and flies, ratio values were z-scored by subtracting the mean of a baseline ratio and dividing by the standard deviation of that baseline ratio. The baseline was defined in each trial as the 10% smallest ratio values. Finally, z-scored ratio values were upsampled to the sampling rate of leg tracking (300 Hz) using cubic spline interpolation and then low-pass filtered using a moving average filter with a time window of 0.2 s.

Platform and treadmill. The platform consisted of a metal pin (0.5 mm diameter, 4.4 mm length) mounted onto a three-axis micromanipulator (MP-225; Sutter Instruments). The pin was wrapped in black sandpaper to provide sufficient grip for the flies’ tarsi. The micromanipulator was controlled manually.

The treadmill consisted of a patterned Styrofoam ball (9.1 mm diameter; 0.12 g) floating on air in an aluminum holder. The airflow was set to ~500 ml/min. The ball was illuminated by two infrared LEDs (850–nm peak wavelength; ThorLabs) via optical fibers. Ball movements were recorded at 30 Hz with a camera (Basler acA1300-200um; Basler AG) equipped with a macro zoom lens (Computar MLM3X-MP; Edmund Optics). Ball rotations around the fly’s cardinal body axes (forward, rotational, sideward) were reconstructed offline using FicTrac68. Rotational velocities of the fly were calculated based on the known diameter of the ball. Velocities were upsampled to the sampling rate of leg tracking (300 Hz) using cubic spline interpolation and low-pass filtered using a moving average filter with a time window of 0.2 s.

Leg tracking. Movement of the left front leg was recorded at 300 Hz with two cameras (Basler acA800-510um; Basler AG) equipped with a 1.0x InfiniStix lenses (68 mm wd; Infinity) and 875 nm short pass filters (Edmund Optics). The leg was illuminated by an infrared LED (850–nm peak wavelength; ThorLabs) via an optical fiber. We used a previously trained25 deep neural network44 to automatically track all leg joints in each camera view. 2D tracking data from both camera views were then combined to reconstruct leg joint positions and angles in 3D using Anipose45.

Behavior classification. Fly behavior was classified semi-automatically based on thresholds on the velocity of the front and middle leg tarsi as described previously25. Flies on the platform were classified as resting or actively moving. Flies on the treadmill were classified as resting, walking, or grooming. All classifications were reviewed and manually corrected if necessary.

Data selection. Frames were manually excluded from the analysis if the front leg was involved in movements other than walking or grooming on the treadmill (e.g., extended downward pushing), the femur-tibia joint of the front leg was not tracked correctly, or the two-photon image registration failed (e.g., the VNC moved out of the imaging volume).

Optogenetic activation and silencing experiments
Optogenetic experiments were performed on adult male flies that were raised on 35 mM in 95% EtOH ATR for 1–3 days, were 2–5 days old, de-winged, and fixed to a rigid tether (0.1 mm thin tungsten rod) with UV glue (KOA300). These flies were placed onto a spherical foam ball (weight: 0.13 g; diameter: 9.08 mm) suspended by air within a visual arena. A dark bar with a width of 30 degrees with respect to the fly oscillated at 2.7 Hz in front of the fly. A spatially precise red (638 nm; 1200 Hz pulse rate; 30% duty cycle, Laserland) or green (532 nm; 1200 Hz pulse rate; 60% duty cycle, Laserland) laser was then positioned on the thorax-coxa joint of the left front leg. Optogenetic activation experiments were conducted on flies in which their CxHP8 neurons expressed ChrimsonR, whereas silencing experiments were performed on those that expressed GtACR1 in those neurons (Table 1). Trials were 2 s in duration and consisted of turning the laser on (experimental trials) or keeping it off (control trials) 0.5 seconds into the trial for 1 second. During each trial, the behavior each fly was recorded with 6 high-speed cameras (300 fps; Basler acA800-510µm; Balser AG) and the movement of the ball was recorded at 30 fps with a camera (FMVU-03MTM-CS) and processed using FicTrac68. The 3D positions of each leg joint and the corresponding joint angles were determined by using DeepLabCut44 and Anipose45. Kinematic analyses were performed in a custom Python script. Behaviors were classified using a random forest classifier45. In addition, front leg grooming was also classified based on the proximity and velocity of the front legs.

Treadmill experiments
Treadmill experiments were performed on 2-5 day old CxHP8 silenced and genetically-matched control male flies (Table 1) using an actuated treadmill system35. The inward rectifying potassium channel, Kir 2.1, was used to silence the activity of CxHP8 neurons throughout development. In short, trials consisted of placing a de-winged fly into a chamber and moving the belts of the split-belt treadmill at a steady-state speed of 10 mm/s for 20 minutes in total. During which, we recorded the behavior of the fly at 200 fps and in 20 second bouts with 5 high-speed cameras (Basler acA800-510µm; Basler AG). We then used DeepLabCut44 and Anipose45 to reconstruct the 3D positions of head, thorax, abdomen, and each leg tip. Custom Python scripts were used to analyze and visualize walking kinematics and posture.

Kinematic classification and parameters
The classification and quantification of behavior, swing and stance, and most walking kinematic parameters for tethered flies and flies walking on the treadmill were conducted in the same manner as a prior study35. For the tethered flies in both the calcium imaging and optogenetic experiments, steps or frames were classified as forward walking if the instantaneous forward velocity and absolute rotational velocity of the ball was greater than 5 mm/s and less than 25 degrees/s, respectively. Left turns were classified as periods where the rotational velocity was less than −25 degrees/s and greater than −50 degrees/s. Right turns had a rotational velocity greater than 25 degrees/s and less than 50 degrees/s. Other behaviors, like rest/standing and front leg grooming, were determined by using a behavioral classifier45. For flies walking on the treadmill, forward walking was classified as periods where the body velocity had a forward velocity greater than 5 mm/s and the absolute heading angle with respect to the front of the chamber was less than 15 degrees. Rest periods are classified as those where the instantaneous velocity of the body and all tarsi was less than 5 mm/s (i.e., all legs in stance).

During walking, the classification of each leg into swing and stance was based on the smoothed (i.e., with a Gaussian Kernel) instantaneous velocity of the tarsus of each leg. Instantaneous values were negative during periods where the tarsus moved posteriorly along the longitudinal axis of the body. A leg was classified as being in swing if its tarsus had an instantaneous velocity greater than 5 mm/s or less than −25 mm/s. Otherwise, the leg was classified as being in stance. Short, 1 video frame, classifications of swing or stance were corrected and reclassified as the other phase of the step cycle.

Classified forward walking steps were further filtered to remove steps that occurred during the transition into forward walking or produced kinematics that were inconsistent with what was previously published34,69–71. Any step that didn’t meet the following criteria for a forward walking step was removed: step frequency between 5 and 20 steps/s, a swing duration between 15 and 75ms, and a stance duration less than 200ms. Steps that passed these filtering criteria were used for further kinematic analyses and comparisons.

All kinematic analyses and visualizations were done in custom Python scripts, which are publicly available on GitHub (https://github.com/Prattbuw/Hair_Plate_Paper/releases/tag/v1.0.0).

Statistical analyses
Linear mixed-effects models, which account for repeated measurements within flies, were used to statistically compare joint angle or tarsi position distributions in walking (at the swing-to-stance transition) and grooming flies during green laser presentation (optogenetic inactivation) and absence. These models were also used to statistically evaluate the anterior and posterior extreme positions and resting leg positions between control flies and flies with CxHP8 neurons chronically silenced. In these models, the fixed effects were the laser state or experimental group (predictor/independent variable) and the joint angles or positions, or leg positions (dependent variable). The random effect was fly identity, which accounted for the repeated and non-independent measures within flies, and common-group effects. Note that the linear mixed-effects models were implemented using the statmodels Python library. t-tests were used to compare posture and step kinematics between CxHP8 chronically silenced and control flies. A Kuiper two-sample test was used to assess statistical significance for inter-leg coordination. If multiple comparisons were performed, a Bonferroni correction was employed to adjust the threshold of significance.

Peer review rounds
[{"round": 1, "reviewer_comments": {"reviewer_4": "Pratt et al aim at investigating the role of hair plates, known as limit detectors of limb movements in insects. Using a combination of behavior tracking, genetic manipulation, physiological recording, they characterize a specific class of hair plates on the fly coxa, CxHP8, which is recruited during extreme positions of leg movements that are potentially necessary for behaviors like grooming. They also use connectomics to predict the involvement of other hair plates based on their morphology and downstream circuits. Future investigations will be needed to verify those predictions by characterizing the different hair plate types and their efferent circuitry using specific genetic reagents.\nWhile more is known about proprioceptors encoding limb position and movement, this study is the first looking at this class of proprioceptors in Drosophila, establishing a new foundation for studying motor control in the fly. I think this merits publication even if hair-plates have been examined in other insects, given the genetic and connectomic toolkit of Drosophila will allow building on these results. The paper is well written, the figures are clear and the methodology/results are sounds. In addition, the authors have addressed most of the points raised by reviewers in the first round. Here are a few more comments/suggestions, although I think the paper is more or less ready for publication as is.\nComments/suggestions:\n- I understand that most other genetic lines are not as specific as the CxHP8 line, which limits the ability to precisely investigate the role of other hair plates. However, Table S1 indicates a line (VT038115AD:VT061711DBD) that covers TrHP5 and TrHP7, both predicted to be involved in posterior movement in Figure 5F. An experimental set consisting in manipulating these hair plates during walking/resting using this line might strengthen the point of the paper, which is to verify connectome-based predictions of hair plates functions.\n- In addition, using broader lines presented in this paper might address if combinatorial manipulation of multiple hair plates leads to more drastic effect on locomotion. In a way, this could address the author statements lines 354/55.\n- In Figure 3G, silencing of CxHP8 does not change the lateral position of the tarsus (only vertical), while it does in Figure 4C-D. Do the authors think those differences are potentially due to different behavioral paradigm (ball vs treadmill) and/or genetic silencers (GtACR1 vs Kir2.1)?\n- In Figure 3D, Figure 4C-D, does the change in tarsus position during CxHP8 manipulation is a consequence of the effect on thorax-coxa joint, or rather an indirect effect on tarsus motor module (although Figure 2B, D show weaker connectivity from CxHP8 to tarsus pre-MNs/MNs).\n- In Figure S1D, the activity of CxHP8 correlates with front leg grooming. It seems there is some variability in calcium signal/kinetics despite the similar duration of grooming? Also, shall we expect different (potentially higher) calcium signal during head grooming since the position of the front legs might right reach even more extreme positions?\n- In Figure 4, since the treadmill can be used to modulate speed, can we expect more drastic effects of CxHP8 silencing during faster walking bouts (i.e. >10mm/s)? Also, it would be interesting to see effect of broad optogenetic activation of CxHP8 in such paradigm.", "reviewer_5": "I co-reviewed this manuscript with one of the reviewers who provided the listed reports. This is part of the Nature Communications initiative to facilitate training in peer review and to provide appropriate recognition for Early Career Researchers who co-review manuscripts."}, "author_response": "Responses to reviewer comments on “Proprioceptive limit detectors contribute to sensorimotor control of the Drosophila leg”\n(Reviewer comments in black, our responses in red).\nReviewer #4:\nPratt et al aim at investigating the role of hair plates, known as limit detectors of limb movements in\ninsects. Using a combination of behavior tracking, genetic manipulation, physiological recording,\nthey characterize a specific class of hair plates on the fly coxa, CxHP8, which is recruited during\nextreme positions of leg movements that are potentially necessary for behaviors like grooming.\nThey also use connectomics to predict the involvement of other hair plates based on their\nmorphology and downstream circuits. Future investigations will be needed to verify those\npredictions by characterizing the different hair plate types and their efferent circuitry using specific\ngenetic reagents.\nWhile more is known about proprioceptors encoding limb position and movement, this study is the\nfirst looking at this class of proprioceptors in Drosophila, establishing a new foundation for studying\nmotor control in the fly. I think this merits publication even if hair-plates have been examined in\nother insects, given the genetic and connectomic toolkit of Drosophila will allow building on these\nresults. The paper is well written, the figures are clear and the methodology/results are sounds. In\naddition, the authors have addressed most of the points raised by reviewers in the first round. Here\nare a few more comments/suggestions, although I think the paper is more or less ready for\npublication as is.\nComments/suggestions:\nI understand that most other genetic lines are not as specific as the CxHP8 line, which limits the\nability to precisely investigate the role of other hair plates. However, Table S1 indicates a line\n(VT038115AD:VT061711DBD) that covers TrHP5 and TrHP7, both predicted to be involved in\nposterior movement in Figure 5F. An experimental set consisting in manipulating these hair plates\nduring walking/resting using this line might strengthen the point of the paper, which is to verify\nconnectome-based predictions of hair plates functions.\nWe appreciate the suggestion and have previously considered this approach of using lines that\nlabel neurons of just two hair plates to infer their function during various behaviors. However, we\nhave two concerns with such an approach. First, prior work in stick insects showed that ablating\nadditional hair plates on the middle leg had non-linear effects on the positioning of the ipsilateral\nhind leg (Cruse et al., 1984, J. Comp. Physiol. A; Fig. 3). Therefore, the relative contribution of a\nsingle hair plate to the control of the leg may be difficult to gleam from manipulations of multiple\nhair plates, such as TrHP5 and TrHP7. Second, VT038115AD:VT061711DBD and other hair plate\ndriver lines we made label only a subset of the neurons of each hair plate (i.e. 2 neurons of TrHP5\nand 2 neurons of TrHP7). Given this incomplete labeling, it would be challenging to dissect the\nrelative effect of the 2 cells from each hair plate on leg motor control. Having said all that, we think\nthe approach you proposed may be feasible in the case where driver lines have nearly complete\nlabeling of neurons with each hair plate, and when there are lines that label neurons of one unique\nand one overlapping hair plate, which would enable pairwise assessments of hair plate function.\nWe have added this potential approach to revealing hair plate sensorimotor function to the\ndiscussion (lines: 283-285).\nIn addition, using broader lines presented in this paper might address if combinatorial manipulation\nof multiple hair plates leads to more drastic effect on locomotion. In a way, this could address the\nauthor statements lines 354/55.\nThank you for the suggestion. In a previous study (Pratt et al., 2024, Current Biology; Fig. S2), we\nshowed that chronically silencing subsets of CxHP4, TrHP5, TrHP6, TrHP7, and TrCS3 neurons in\naddition to a subset of CxHP8 neurons resulted in impaired step kinematics and inter-leg\ncoordination, particularly at faster walking speeds. Therefore, manipulations of multiple hair plates\ndo result in more drastic effects on locomotion. Recoginizing that this finding would be useful to\nmention in this study, we have now included it to provide support for the statements in now lines\n356-357 (lines: 268-270).\nIn Figure 3G, silencing of CxHP8 does not change the lateral position of the tarsus (only vertical),\nwhile it does in Figure 4C-D. Do the authors think those differences are potentially due to different\nbehavioral paradigm (ball vs treadmill) and/or genetic silencers (GtACR1 vs Kir2.1)?\nThank you for pointing out this key difference in tarsus position between the ball and treadmill\nsetups. We think that the difference in tarsus position is the result of both the behavioral paradigm\nand silencing method. We previously showed that step kinematics and inter-leg coordination are\ndifferent between tethered flies walking on the ball and untethered flies walking freely or on the\ntreadmill, which we attributed to differences in substrate (i.e. flat versus spherical) and the fact that\ntethered flies don’t bear their weight (Pratt et al., 2024, Current Biology; Fig. 2-3). In regard to\ngenetic silencing, Kir 2.1 is expressed throughout development, silencing CxHP8 neurons for the\nlife of the fly, which may lead to compensatory effects on kinematics. On the contrary, GtACR1\nallows for temporally precise control over the inhibition of CxHP8 neurons, likely mitigating the\nchance of cellular or circuit compensation. In fact, significant changes in extreme leg positioning\nonly became apparent 3 days after the hairs of a hair plate were chronically deflected with\nplasticine and hair rows removed in a stick insect (Bässler, 1977, Biol. Cybernetic), suggesting that\ncompensatory effects can occur after hair plate manipulations. We have now added a sentence to\nthe results (lines: 186-189) that describes our thoughts on the difference in tarsus position.\nIn Figure 3D, Figure 4C-D, does the change in tarsus position during CxHP8 manipulation is a\nconsequence of the effect on thorax-coxa joint, or rather an indirect effect on tarsus motor module\n(although Figure 2B, D show weaker connectivity from CxHP8 to tarsus pre-MNs/MNs)?\nThank you for the insightful question. The change in tarsus position after CxHP8 manipulations is\nmost likely a consequence of impaired thorax-coxa joint movement through altered coxa posterior\nmotor module activity. First, our motor impact analysis (Fig. 5E) showed that when considering a 2-\nlayered network (i.e. all direct and disynaptic connections) that CxHP8 connectivity has very little\nimpact on tarsus related motor modules, but very strong excitatory impact on the coxa posterior\nmotor module. Second, our optogenetic activation experiments in standing flies (Fig. 3E-D)\nshowed that activating CxHP8 neurons resulted in thorax-coxa movement that supported the\ncorresponding changes in tarsus movement. However, to your point, sensorimotor networks are\nmore complex than what we analyzed here, having state-dependent dynamics and recurrent\nconnections, so we can’t rule out the possibility that some of the tarsus movement we observed\nafter CxHP8 manipulations was due to tarsus motor modules. We mention this possibility of leg-\nwide control rather than leg segment only control of hair plates in the Discussion (lines: 246-250).\nIn Figure S1D, the activity of CxHP8 correlates with front leg grooming. It seems there is some\nvariability in calcium signal/kinetics despite the similar duration of grooming? Also, shall we expect\ndifferent (potentially higher) calcium signal during head grooming since the position of the front\nlegs might right reach even more extreme positions?\nThank you for your keen observation. Yes, calcium signals during different front leg grooming\nbouts vary, likely because of the exact kinematic nature of the grooming bout and its consequence\non the number and degree to which CxHP8 cuticular hairs are deflected. In this study, we were\ncoarse in our classification and kinematic characterization of front leg grooming, but given a more\ngranular analysis, we suspect the variability in calcium activity would be explained by differences in\nhow the fly was grooming their front legs. As for calcium signals during head grooming, we expect\nthey would also be variable on a grooming bout-by-bout basis, but possibly different in both their\nkinetics and magnitude than front leg grooming because of the inherently different limb\narticulations and kinematics (e.g. Ravbar et al., 2021, eLife and Lobato-Rios et al., 2022, Nature\nMethods). A detailed 3D kinematic description of joint angle distributions would be valuable in\ndetermining how CxHP8 calcium signals map onto different types of grooming. We now provide an\nexplanation of the calcium signal variability in the Results (lines: 97-99).\nIn Figure 4, since the treadmill can be used to modulate speed, can we expect more drastic effects\nof CxHP8 silencing during faster walking bouts (i.e. >10mm/s)? Also, it would be interesting to see\neffect of broad optogenetic activation of CxHP8 in such paradigm.\nFor this study, we collected data of flies with CxHP8 neurons silenced walking on the treadmill at\none driving speed (i.e. 10 mm/s) to simplify comparisons. However, as mentioned in the second\ncomment above, we previously found that flies with a swath of proprioceptors silenced, including a\nsubset of CxHP8 neurons, had impaired step kinematics and inter-leg coordination, especially as\nwalking speed increased (Pratt et al., 2024, Current Biology; Fig. S2). Therefore, we would expect\na similar finding for flies that just had CxHP8 neurons silenced.\nWe agree, it would be interesting to see the effect of broad optogenetic activation of CxHP8\nneurons in flies walking on the treadmill. Nevertheless, we steered away from this direction in this\nstudy because we find it difficult to interpret the impact of injecting mistimed sensory feedback\nrelated signals into sensorimotor circuits in walking flies. Specifically, it is unclear to us how\nactivating CxHP8 at times when they would not be active during the step cycle would inform us\nabout how CxHP8 feedback is used to control leg movement compared to using silencing\nmethods. Our expectation given the optogenetic results shown in Fig. 3 would be that optogenetic\nactivation would result in posterior leg movement in regions of the step cycle where anterior drive\nisn’t as strong, presumably the end of swing and during the stance phase. An interesting future\nexperiment would be to precisely and transiently activate CxHP8 neurons during a specific phase\nof the step cycle using closed-loop methods and determine how the fly compensates for such a\nperturbation.\nReviewer #5:\nI co-reviewed this manuscript with one of the reviewers who provided the listed reports. This is part\nof the Nature Communications initiative to facilitate training in peer review and to provide\nappropriate recognition for Early Career Researchers who co-review manuscripts.\nThank you for co-reviewing this manuscript. We appreciate and value your feedback."}]

Decision letter