DOI: 10.5061/dryad.fxpnvx153
title: Proprioceptive limit detectors mediate sensorimotor control of the Drosophila leg

description: The datasets in this repository were used to reveal that hair plate
 proprioceptors on the legs of fruit flies are limit detectors that
 reflexively transition the direction of leg movement. We first collected a
 calcium imaging dataset to characterize the joint angle encoding
 properties of one hair plate on the fly coxa, referred to as CxHP8. We
 then used an electron microscopy dataset of a female ventral nerve cord
 (FANC) to predict the role of CxHP8 neurons in leg motor control based on
 their direct and indirect connectivity with motor neurons. We validated
 the predictions derived from the connectome by collecting and analyzing
 datasets where we optogenetically activated CxHP8 neurons in standing
 flies and silenced CxHP8 neurons in behaving flies. Additionally, we
 collected datasets in which flies walked on an actuated treadmill and
 found that chronic silencing of CxHP8 neurons lead to impaired walking
 kinematics and resting posture. Having supported the sensorimotor control
 prediction of CxHP8 neurons, we returned back to the connectome to predict
 the role of each hair plate on the fly leg in controlling leg movement.
description: <strong>Calcium imaging to characterize joint angle
 encoding properties</strong> To determine the
 coxa joint angles in which CxHP8 neurons were active, we expressed GCaMP7f
 and tdTomato in them and slowly moved the platform that the front legs
 rested on using a 3-axis micromanipulator. We used a 2-photon microscopy
 setup to image the calcium activity of CxHP8 axons in the neuropil
 associated with the front left leg. tdTomato was used for motion
 correction and normalization. In addition to characterizing the joint
 angles encoded by CxHP8 neurons, we also determined when they are active
 during locomotion, grooming, and other behaviors. Analyses were done in
 the Jupyter notebooks, “calcium_imaging_analysis.ipynb” and
 “analyze_calcium_signals_during_behavior.ipynb”, found at this GitHub
 repository release: https://github.com/Prattbuw/Hair_Plate_Paper/releases/tag/v1.0.0. The relevant dataset is “R48A07_R20C06_GCaMP7f_tdTomato.parquet”. <strong>Hair plate reflex circuit connectivity</strong> Hair plate connectivity with motor neurons, either direct or indirect, was determined by using an electron microscopy dataset of a female ventral nerve cord (FANC)(Azevedo et al., 2024, Nature). Hair plate and motor neurons were identified in the dataset, along with interneurons based on their hemilineage. Hemilineages and their corresponding neurotransmitter type are found in “LacinHLTable - HL table.csv”. Connectivity analyses were done with “connectome_analysis.ipynb”, which is found here: https://github.com/Prattbuw/Hair_Plate_Paper/releases/tag/v1.0.0. <strong>Optogenetic effects on joint kinematics and behavior</strong> Optogenetic datasets were collected by expressing either ChrimsonR (activation) or GtACR1 (silencing) light-gated ion channels in CxHP8 neurons and using a spatiotemporally precise laser targeted at the left front leg thorax-coxa joint. In experimental trials, flies had CxHP8 neurons activated or silenced (trials were 2 seconds in duration and the laser was present for 1 second after 0.5 s from the start of the trial) while behaving on a spherical treadmill. Control trials consisted of the laser not being presented. We also collected a dataset to control for the light-effect of laser stimulation on behavior, which consisted of presenting a laser to flies that had the genetic construct GtACR1 or ChrimsonR, but not expressed in cells (i.e. R52A01 DBD &gt; GtACR1 and R52A01 DBD &gt; ChrimsonR). Analyses of kinematic and behavioral effects due optogenetic activation or silencing were done using “optogentics_analysis.ipynb” and “heuristic_grooming_classifier.ipynb”, which are found here: https://github.com/Prattbuw/Hair_Plate_Paper/releases/tag/v1.0.0. The relevant datasets are: “R48A07AD_R20C06DBD_ChrimsonR.pq”, “R48A07AD_R20C06DBD_GtACR1.pq”, “52A01DBD_ChrimsonR.pq” and “52A01DBD_GtACR1.pq”. Note that only data collected from the R52A01 DBD &gt; GtACR1 flies on 4.12.24 were analyzed because their experimental conditions matched those of the flies with CxHP8 neurons silenced. <strong>Chronic silencing of CxHP8 neurons on an actuated treadmill</strong> The effects of chronic silencing of CxHP8 neurons on walking kinematics and resting posture were determined using an actuated treadmill system (Pratt et al., 2024, Current Biology). CxHP8 neurons were chronically silenced throughout development by expressing the inward rectifying potassium channel, Kir 2.1, within them. The walking kinematics and resting posture of CxHP8 silenced flies were compared to genetically matched control flies (i.e. R48A07 AD &gt; Kir 2.1 and R39B11 AD &gt; Kir 2.1). 5 highspeed cameras recorded flies walking on or resting in the treadmill system with a driving speed of 10 mm/s. DeepLabCut (Mathis et al., 2018) and Anipose (Karashchuk et al., 2021) were used to reconstruct the 3D body and leg kinematics of flies. Kinematic analyses were conducted using “treadmill_analysis.ipynb” and the kinematic results were visualized using “treadmill_visualization.ipynb”. The code is located at the following GitHub repository: https://github.com/Prattbuw/Hair_Plate_Paper/releases/tag/v1.0.0. The corresponding datasets are: “R48A07_R20C06_kir_treadmill_dataset.csv”, “R48A07AD_kir_treadmill_dataset.csv”, and “R39B11_kir_treadmill_dataset.csv”.
description: # Proprioceptive limit detectors mediate sensorimotor control of the
 Drosophila leg Dataset DOI:
 [10.5061/dryad.fxpnvx153](10.5061/dryad.fxpnvx153) ## Data Description and
 File Structure ### Opening Parquet Files Parquet files were read using the
 Python Pandas library. Specifically, the data within parquet files were
 accessed using the following function: pd.read_parquet("file
 path" + "filename", engine='pyarrow'). ### Data
 Files #### File: LacinHLTable_-_HL_table.csv **Description:** Hemilineage
 classification table ##### Variables * Neuroblast: Neuroblast identity *
 Notch: Notch on or off * HL: hemilineage * NT: neurotransmitter *
 Marker_1: genetic marker 1 * Marker_2: genetic marker 2 *
 Marker_3: genetic marker 3 #### Files: 52A01DBD_GtACR1.pq,
 R48A07_R20C06_GtACR1.pq, R48A07_R20C06_ChrimsonR.pq, and
 52A01DBD_ChrimsonR.pq **Description:** Optogenetic silencing (GtACR1) and
 activation (ChrimsonR) of CxHP8 and genetic control datasets. ##### Joint
 Angles There are three types of angles: * {leg}{joint}_rot: rotation about
 the axis of the leg * {leg}{joint}_flex: flexion of the joint *
 {leg}{joint}_abduct: abduction of the joint where {leg} can be the
 following: * L1 - front left leg * L2 - mid left leg * L3 - hind left leg
 * R1 - front right leg * R2 - mid right leg * R3 - hind right leg And
 where {joint} can be the following: * A - body-coxa joint * B - coxa-femur
 joint (this point is roughly positioned at the trochanter) * C -
 femur-tibia joint * D - tibia-tarsus joint * E - tarsus tip ##### Joint
 Position * {leg}{joint}_x: medial-lateral position [px]. * {leg}{joint}_y:
 anterior-posterior (longitudinal) position [px]. * {leg}{joint}_z:
 vertical position [px].  ##### Ball Velocity FicTrac calculates 3 axes of
 velocity of the ball * fictrac_delta_rot_lab_x_mms: sideslip velocity in
 millimeters per second (i.e. sidestepping). Note the R52A01 dataset uses a
 Savitzky-Golay filter. Other optogenetic datasets do not. The same
 variable name with "raw" appended does not use the filter and
 was used for comparison with other optogenetic datasets. This applies to
 the fictrac variables below.  * fictrac_delta_rot_lab_y_mms: forward
 velocity in millimeters per second (i.e. forward walking). .  *
 fictrac_delta_rot_lab_z_mms: rotational velocity in millimeters per second
 (i.e. turning).  * fictrac_delta_rot_lab_x_deg/s: sideslip velocity in
 degrees per second * fictrac_delta_rot_lab_y_deg/s: forward velocity in
 degrees per second * fictrac_delta_rot_lab_z_deg/s: rotational velocity in
 degrees per second ##### Other variables * stim_on_off: frame-by-frame
 laser state, where 0 and 1 indicates the laser being off and on,
 respectively. * fnum: the frame number from the video * flyid: a unique
 identifier for the fly (formatted as '{mm}.{dd}.{yy} Fly
 {flynum}_{trialnum}', where the fly number is 1-indexed and the trial
 number is 0-indexed) * stimlen: length of laser stimulation. * cond: trial
 condition. * rep: repetition. * {behavior}_bout_number: a number
 identifying each bout of the behavior (i.e. walking, antennae_grooming,
 t1_grooming, abdomen_grooming, ball_push, t3_grooming, and standing). *
 {leg}_swing_stance, where swing = 0 and stance = 1 (Note that this
 variable is only included in 52A01DBD_GtACR1.pq and
 R48A07_R20C06_GtACR1.pq). #### File:
 R48A07_R20C06_GCaMP7f_tdTomato.parquet **Description:** Calcium imaging
 dataset revealing the joint angle encoding properties of CxHP8 neurons. 
 ##### Variables * driver: genetic driver line. * roi: calcium imaging
 region of interest in T1L. * animal_id: experimental animal identification
 label. * trial: trial number. * frame: frame number. * time: recording
 time [s].  * ball: 0 - ball absent; 1- ball present [bool]. Use this to
 select trials where the animal was behaving on the spherical treadmill. *
 platform: 0- platform absent; 1- platform present [bool]. Use this
 variable to filter for trials where the front leg was passively moved on
 the platform. * activity: normalized and motion corrected calcium
 activity.  * analyze: 0 - data that didn't pass manual inspection
 (i.e. tracking errors); 1 - data that is analyzable.  * L1_rest: 0 - left
 front leg not at rest; 1- left front leg at rest.  * L1_move: 0 - left
 front leg not moving; 1- left front leg moving.  * L1_walk: 0 - not
 walking; 1- walking. * L1_groom: 0 - not grooming; 1- grooming. *
 L1_other: 0 - behavior is one of those stated above; 1- other behavioral
 category. * vel_forward: forward ball velocity [mm/s]. * vel_side: side
 slip velocity [mm/s]. * vel_yaw: rotational velocity [mm/s]. Note that the
 reminder of the variables are joint angles and positions, which are
 described for the 52A01DBD_GtACR1.pq dataset. #### Files:
 R39B11_kir_treadmill_dataset.csv, R48A07AD_kir_treadmill_dataset.csv, and
 R48A07_R20C06_kir_treadmill_dataset.csv **Description:** CxHP8 chronic
 silencing and control datasets. ##### Key points tracked in 3D * head -
 between antennae * thorax - on the scutelum * abdomen - most distal point
 * r1 - distal tip of right front leg * r2 - distal tip of right middle leg
 * r3 - distal tip of right hind leg * l1 - distal tip of left front leg *
 l2 - distal tip of left middle leg * l3 - distal tip of left hind leg *
 top front of the chamber * top back of the chamber * back center of the
 chamber ##### 3D Positions and Other Tracking Variables * {key point}_x:
 longitudinal position [px] w.r.t. to the back-to-front axis of the
 treadmill chamber * {key point}_y: medial-lateral position [px] * {key
 point}_z: vertical position [px] * {key point}_error: tracking error [px]
 * {key point}_ncams: number of cameras used for triangulation *  {key
 point}_score: confidence score of key point detection ##### Variables *
 genotype: the genotype of the fly * filename: trial filename that contains
 information about the fly identity, trial number within the presplit,
 split, and post-split periods of the task, whether the left or right belt
 is moving faster during the split period (i.e. RS_H: right belt moving
 faster; RS_L: right belt moving slower), and the speed of each belt in
 mm/s. Only periods where the belts ran at the same speed were analyzed. *
 fly number: identity of the fly * trial number: trial number within an
 experiment * split period: presplit (period before the split period where
 the belts moved at the same speed), split (belts moved at different
 speeds), and post-split (period after the split period where the belts
 moved at the same speed) * left belt speed (mm/s): speed of the left belt
 during the trial * right belt speed (mm/s): speed of the right belt during
 the trial * fnum: frame number ## Code/software All Jupyter notebooks used
 for analyses described in the data description section are found at this
 GitHub repository
 release: [https://github.com/Prattbuw/Hair_Plate_Paper/releases/tag/v1.0.0](https://github.com/Prattbuw/Hair_Plate_Paper/releases/tag/v1.0.0). Python libraries required for each Jupyter  notebook are specified in the first cell. Directions for loading datasets is specified in each notebook.