ABSTRACT

Locomotion is necessary for survival in most animal species. However, injuries to the appendages mediating locomotion are common. We assess the recovery of walking in Drosophila melanogaster following leg amputation. Whereas flies pre-amputation explore open arenas in a symmetric fashion on average, foreleg amputation induces a strong turning bias away from the side of the amputation. However, we find that unbiased walking behavior returns over time in wild-type flies, while recovery is significantly impaired in proprioceptive mutants. To identify the biomechanical basis of this locomotor impairment and recovery, we then examine individual leg motion (gait) at a fine scale. A minimal mathematical model that links neurodynamics to body mechanics during walking shows that redistributing leg forces between the right and left side enables the observed recovery. Altogether, our study suggests that proprioceptive input from the intact limbs plays a crucial role in the behavioral plasticity associated with locomotor recovery after injury.

Given the varied environment in which organisms move, injury to locomotor systems is very common in nature (Movie 1). Therefore, it is not surprising that animals will often prioritize leg safety in locomotor strategies (Birn-Jeffery et al., 2014). However, damage can be unavoidable; if locomotor systems were not robust to damage, or were incapable of plasticity, limb injury would pose an insurmountable challenge to survival. In humans, a number of studies have shown that damage to the control mechanism (e.g. spinal cord injury) can be overcome to an extent by training using manually assisted signals to the limbs, which reorganize the spinal network and allow it to adapt (Harkema, 2001; Dietz et al., 2009). Plasticity leading to locomotor recovery after spinal cord injury is seen in animal models such as rats as well (Ballermann and Fouad, 2006). After direct injury or amputation of a limb itself, animals can recover mobility over time (Kirpensteijn et al., 1999) – indeed, three-legged dogs and cats walking and even running are familiar images. In humans, a number of medical interventions such as prosthetic limbs after amputation or reconstructive surgery (Bosse et al., 2002) can help patients recover mobility. Thus, the locomotor system is remarkably robust. Moreover, the idea of plasticity after limb injury is not limited to the animal world: even in engineered systems such as legged robots, instilling the ability to recover locomotion after injury is an active research topic (Christensen et al., 2013; Cully et al., 2015).

In particular, we ask the questions of (1) whether and (2) how the recovery of locomotion takes place after a significant biomechanical injury (leg amputation). While many walking parameters have been characterized for freely walking Drosophila (Strauss and Heisenberg, 1990; Mendes et al., 2013; Berman et al., 2014), fewer studies have considered recovery of walking after injury. A notable exception is Wosnitza et al. (2013) – even immediately after amputation of a fly's hind leg, these authors observed several important changes in an amputated fly's behavior that allowed it to continue walking but at a slower speed and with a shift in leg stepping patterns (gait coordination). Intriguingly, a study where fly walking was impeded by adding weights to the body (Mendes et al., 2014) found evidence for adaptation of step parameters over time to maintain coordinated walking, as well as increased sensitivity to load and other locomotor defects in proprioceptive mutants. These observations beg for the exploration of recovery after amputation over longer times.

Therefore, we examined the immediate and days-long recovery of walking behavior after leg amputation in D.melanogaster. By using video recording before and after injury, we show that amputation impairs exploratory locomotion, i.e. the paths followed in an open arena. Specifically, amputation of the right foreleg induces a counter-clockwise bias to exploratory locomotion. Interestingly, unbiased locomotion recovers well over time in wild-type flies, but this recovery is significantly hampered in proprioceptive mutants. To understand how this might happen, we start by considering individual leg motion (gaits), quantifying them from high-speed video of walking flies before, immediately after and for several days after amputation. Typically, gaits in hexapods are categorized into three distinct patterns, ‘tripod’, ‘tetrapod’, and ‘wave’ or ‘non-canonical’ (Hughes, 1952). The tripod gait is considered to be the alternating movement of two groups of three legs, with the legs in each group simultaneously taking off. These groups are traditionally defined as legs (135)(246) – with groups separated by parentheses and leg numbering as in Fig. 1A. The tetrapod gait consists of three groups of two moving legs each, with the legs again taking off simultaneously. Here, the groups can be arranged as either (15)(26)(34) or (24)(35)(16), because of a left–right symmetry. In a traditional wave gait, the legs proceed forward along a side before switching to the next side, as in (3)(2)(1)(6)(5)(4), though a number of sources (e.g. Mendes et al., 2013; Kain et al., 2013) label gaits only as ‘tripod’, ‘tetrapod’ or ‘non-canonical’. In reality, strict boundaries between gaits are not always well defined.

We observed all of these gaits in our video analysis and found that injury resulted in permanent changes to their relative frequency during walking. This presents a puzzle: if injury permanently alters gaits, what mechanism explains the recovery in exploratory locomotion turning bias? Using a neuromechanical model strongly informed by experimental data, we show that amputated flies may redistribute the forces applied by the legs to enable the observed recovery in the absence of gait recovery, suggesting that a consequence of proprioceptive defects is the inability to precisely control leg forces. Altogether, combining behavioral observations and gait analysis of normal and proprioception-deficient flies with a physical model provides us with a mechanistic description of recovery of locomotion after injury in D. melanogaster.

Centroid tracking in open arenas

Three-by-three arrays of 5.08 cm (2 inch) diameter arenas were fabricated from clear acrylic cut with a laser engraver (Epilog, Golden, CO, USA). Walls 10 cm high between neighboring arenas were frosted with a random orbital sander to prevent flies from viewing each other. Four-day-old wing-clipped flies were placed into the arenas and allowed to walk freely for 2 h. Arenas were uniformly illuminated from below by an array of LEDs (5500K, LuminousFilm, Shreveport, LA, USA) covered by a diffuser fabricated from two sheets of 0.64 cm (1/4 inch)-thick clear acrylic frosted on both sides by sanding. Arenas were imaged from above by 2 MP digital cameras (Logitech, Newark, CA, USA, and Point Grey, Richmond, BC, Canada) and the x–y position of individual flies’ centroids was identified and tracked by custom software written in LabView (National Instruments, Austin, TX, USA). The next day, the right foreleg was amputated within the femur and flies were tested 1, 24, 48 and 72 h post-injury. These observations are termed the 0, 1, 2 and 3 day post-amputation time points. More proximal amputation resulted in higher mortality. More distal amputation risked leaving the animal with enough leg to support itself. The direction of motion was inferred as the angle between centroids of successive frames. To characterize turning bias, we considered the tangential component of the velocity (θ–δ) relative to the center of the arena (Fig. 1B). To exclude edge artifacts, data collected within 80% of the radius of the arena were analyzed.

Amputation protocol and schematic of walking bias parameters. (A) Amputation protocol: the right foreleg is removed between the mid-femur and the femur–tibia joint. The given leg numbering is used throughout the paper. (B) Schematic of analysis parameters used in constructing histograms of walking bias and calculating μ. The value of θ–δ characterizes the degree of clockwise/counter-clockwise behavior.

Gait experiments

Single, lidded, circular arenas were fabricated from acrylic. Individual four-day-old wild-type (N=56), inactive (N=17) and nanchung (N=15) females were placed inside and the camera was refocused on a region roughly 2×3 cm. Wings were not clipped for gait experiments. Arenas were illuminated as in centroid tracking experiments and video was collected at 60 Hz using FlyCap software (Point Grey). The data collected from each trial consisted of two videos per fly, taken when the fly was performing a quick, straight run segment (subjectively assessed during data collection). In post-processing, the faster and straighter of the two videos was chosen for analysis. Both videos were rejected if the straight run segment had fewer than three full strides uninterrupted by pauses or large angular reorientations. Several animals perished over the course of the experiment. The five time points had N=56, 52, 52, 50, 51 (wild type), N=17, 17, 16, 16, 16 (inactive) and N=14, 13, 15, 15, 14 (nanchung). Before each assay, flies were anesthetized with CO2 and then allowed at least 45 min of recovery. On the first experimental day, each fly performed two assays. First, a pre-amputation assay was performed. Flies were subsequently anesthetized and amputated. On subsequent days (1 to 3 days post-amputation) each fly performed one assay.

Statistics

For between-group (wild type to mutant) parameter comparisons, P-values at corresponding time points were determined using unpaired t-tests with Welch's correction to the degrees of freedom. Change within groups was assessed by regression on time post-amputation using all available data for each time point, with P-values corresponding to an F-test against the null hypothesis that the slope is not significantly different from zero.

Computation

Image analysis was implemented using MATLAB release 2015a with the Image Processing and Statistics toolboxes (MathWorks, Natick, MA, USA). Scripts for determining locomotion turning bias, the calibration curve path simulation and the physical model simulation were also implemented in MATLAB. All other analyses were performed using the statistical software R3.0.3 (R Core Team, 2014).

Gait video analysis

Video analysis was performed in several steps (Fig. S1). Movies were first temporally cropped to encompass the full straight run and exclude all other frames. Cropped movies were then run through a semi-automated tracking algorithm (Fig. S2) to determine the fly centroid and the endpoints of the legs.

We then went frame-by-frame and either accepted the automatic recommendation or hand-corrected the leg endpoints. Then, an algorithm automatically sorted legs by calculating the angle between the centroid-to­-head vector and the centroid­-to-leg vector. See Movies 2–4 (wild type: pre-amputation, day 0 post-amputation, day 3 post-amputation) for examples of final videos with tracked legs.

Finally, we binarized leg motions into ‘swing’ (off the ground) and ‘stance’ (on the ground) for determining gaits. Fig. 2A shows an example of annotated movie frames, which can also be visualized in stride–stance plots (Fig. 2B) that show the legs in stance (white) and swing (blue) as a function of time. To choose the motion threshold, we noted that apparent motion in the end position of a leg has two components: true leg motion and experimenter/measurement error when clicking on leg endpoints. We used a Gaussian mixture model to decompose the observed distribution of leg motion into these components and chose a threshold of 8 pixels per frame (Fig. S3). We excluded frames that indicate four legs moving (<1%) from analysis.

Example of gait and schematic of hidden Markov model. (A) Example of a fly with legs moving in alternating tripod gait. Blue circles indicate that a leg will remain stationary in the next frame. (B) Examples of stride–stance plots for a wild-type fly at pre-amputation (top), immediately post-amputation (middle) and 3 days post-amputation (bottom). Frames are on the horizontal axis and legs are on the vertical axis. White indicates that a leg is in swing in that frame, blue indicates that a leg is in stance and gray indicates amputated legs. The top panel shows a typical tripod gait. On day 0 post-amputation, there is a mix of non-canonical gait as well as potential remnants of tetrapod and tripod gaits. On day 3 post-amputation, a clearer tetrapod-like pattern emerges. (C) A schematic of the hidden Markov model used to determine gaits. Three hidden states (1-leg, 2-leg and 3-leg gaits) each have a probability of emitting frames with 0, 1, 2 or 3 legs in swing phase. Line weights correspond to probabilities for wild-type flies pre-amputation. See Fig. S4 for transition probabilities.

Hidden Markov model

A hidden Markov model (HMM) (Baum and Petrie, 1966) assumes unobserved (‘hidden’) internal states for a system (e.g. gait), each of which results in emitting a measured signal from a set (e.g. number of observed legs moving) with some probability. We used three hidden states (1-leg, 2-leg and 3-leg gaits) and four observed states (0–3 legs moving). Fig. 2C shows a schematic of the HMM with emission and transition probabilities for wild-type flies pre-amputation. To fit the parameters of this model, we used the Baum–Welch algorithm. First, we aggregated all fly information by strain, stratifying into pre- and post-amputation, and found emission probabilities. Then, we obtained transition probabilities for each strain and day (Fig. S4). Finally, we fit internal states using the Viterbi algorithm to obtain gaits: at each step through the chain, we stored the probability of being in every hidden state at the previous step, having come along the likeliest path so far. We then calculated the probability of being in each hidden state at the current step given the probabilities of being in each hidden state at the previous step (using the transition probability) and the observed value at the current step (using the emission probability), and appended the hidden state that is most likely from this set of options to the likeliest path, repeating until the end of the chain. This creates the likeliest path through the hidden states. For a high-level introduction to HMMs with an application to biology, see Eddy (1996).

We verified the results of the HMM on a frame-by-frame analysis (Fig. S5) of leg motion in the pre-amputation data. Although the boundaries between ‘canonical’ gaits even in intact animals are not always sharp, a frame-by-frame analysis of the most frequent pattern of leg striding during 3-leg gaits pre-amputation was the standard alternating tripod (135)(246), and the most frequent patterns of 2-leg and 1-leg gaits correspond, respectively, to traditional tetrapod and wave patterns (Fig. S6). We found qualitative consistency between the methods: more frames (5%) were labeled tripod by the HMM overall than with the traditional approach, as expected, and 83% of frames agreed on tripod labeling with a frame-by-frame approach; more importantly, 15% of frames with two legs moving and 10% of frames with one leg moving were labeled tripod. Also intuitively, the state transition probabilities from 1-leg, 2-leg and 3-leg gaits to the 3-leg gait from the HMM were high, suggesting that this gait was both more common and more persistent when it occurred (Fig. S4). This is not surprising, as we selected for fast locomotor bouts and higher speed is associated with greater persistence of an alternating tripod (Mendes et al., 2013; Strauss and Heisenberg, 1990). A comparison of statistical significance of post-amputation trends also yielded similar results to frame-by-frame analysis (Fig. S5).

Neuromechanical model

Complementing the experiment, we also built a neuromechanical model that takes into account body motion, leg motion and a neural controller (see schematic in Fig. 3A; capital letter variables (Roman and Greek) represent the body, n represents neural modules, other lowercase letters represent the legs, and indices run from 1 to 6). Without loss of generality, we let module 1, corresponding to the front left leg, be the ‘clock’ relative to which all other leg phases were measured. When a module is excited beyond a threshold, it drives its corresponding leg to enter swing phase. Legs relax quickly (relative to the excitation duration) to their respective forward-most position relative to the body. When the module activity drops below the threshold, the leg is placed down on the substrate and exerts force on the body until the next neuronal excitation lifts the leg. Body dynamics obey Newton's laws (forces determine translational motion in two dimensions and torques determine rotational motion).

Schematic of neuromechanical model of walking. (A) Schematic of the theoretical model. Data were used to fit all relevant parameters except leg forces (Table 1), which were fit through an optimization procedure. A central pattern generator sends a signal to the excitable system (neuronal module). Once the neuron reaches a threshold, it fires and the leg that it controls lifts up and follows its own dynamics relative to the body to prepare for the next step. When the neuron drops below the threshold, the leg exerts forces on the body, which undergoes Newtonian dynamics in (x,y,θ). A joint parameter, coupling back to the neural system, prevents infinite stretch. A full stride occurs when all six legs (five in the amputated case) and the central pattern generator repeat the pattern. (B) Schematic showing model notation corresponding to Eqns 1–9 and Table 1. A signal from the central pattern generator (located in the fly's ventral nerve cord in the thorax) to one limb is shown in the inset and mediates the neuronal dynamics that control that limb. See Materials and methods for details.

Following the notation used in Table 1 and Fig. 3B, we can then write the governing equations coupling the neurodynamics to the body and limb mechanics, as:
(1)(2)(3)(4)(5)(6)(7)(8)(9)
where Eqns 1–3 determine the location of the body center of mass and its orientation as a function of the leg forces and torques, Eqn 4 determines the positions of the tips of the legs in terms of the location and orientation of the body, Eqns 5 and 6 characterize the over-damped dynamics of the legs as a function of the neuronal dynamics, Eqns 7 and 8 characterize the forces and torques exerted by the legs, and Eqn 9 characterizes the neuronal dynamics controlling the legs. To ensure that the effective leg lengths did not exceed their total lengths and prevent unrealistic stances, we also imposed some physical length limits via feedback into neural excitation. Because of the number of legs and degrees of freedom, the model necessarily has a number of parameters. Of the 48 independent equation parameters, 13 were fit for each fly and day (means±s.d. for wild-type pre-amputation; see Results for additional details): the excitation pulse frequency (ω) (11.4±1.8 pulses s−1), the proportion of time per stride that each leg spent in stance (δi=1:6) ([0.62, 0.70, 0.66, 0.65, 0.70, 0.68]±[0.07, 0.06, 0.06, 0.07, 0.06, 0.06]) and the phase of each leg relative to leg 1 (φi=1:6) ([0, 0.58, 0.17, 0.48, 0.13, 0.60]±[0, 0.07, 0.07, 0.06, 0.07, 0.09]). The other parameters were fixed from average values reported in the literature and observed in the experiments.

We used this model to simulate multiple strides with a first-order method for numerical simulation with a step size h=0.001. After a short transient (two to three strides), the walking behavior converged to a steady state and generated a speed of approximately 0.65 body lengths per stride, consistent with published results (Wosnitza et al., 2013) and our own measurements. As in experimental observations, flies with right foreleg amputation have a counter-clockwise locomotor angular bias (see Movies 5,6).

Angular bias-turning bias calibration

To convert model angular bias output to experimentally observed turning bias in the arena, we built a calibration curve. We simulated simple rules for walking flies in an arena: start at a random place in the arena facing in a random direction. Move at a constant speed in the chosen direction. At each step k, choose a new direction using a local rule: φk=φk–1+φ′, where φ′∼N(β,Δ). Here, β is the angular bias (the x-axis of the calibration curve) and Δ is random heading drift (the standard deviation of the normal distribution). If a wall collision occurs, choose a new heading by disallowing angles that would result in a wall collision and renormalizing the probability distribution (correcting for machine precision). The paths formed by this procedure qualitatively mimic those of real flies (compare Fig. 4A and Fig. S7A). As in the calculation of µ – the weighted average (θ–δ) (Fig. 1B) – from our experimental arena data, we calculated µ from simulated paths by only examining behavior when the fly is within a distance 0.8Ra from the arena center (Ra is the arena radius).

Turn bias recovery. (A) Top: representative sample fly paths over time. Gray is pre-amputation, yellow is day 0 post-amputation and dark green is day 3 post-amputation. Bottom: paths divided into segments of equal length, and aligned to start all in the same direction (arrow). The strong turning bias 0 days post-amputation is evident. (B) Histograms of turning behavior. Inset numbers indicate average µ value. Histogram symmetry about the center indicates unbiased behavior and µ values close to 0. Shaded regions indicate ±1 s.e.m. (9<N<30 for all experimental groups). From a bootstrapping analysis, we find that the distribution for wild-type flies is not significantly different between pre-amputation and day 3 post-amputation (P=0.372), while the distributions are significantly different between pre-amputation and all days post-amputation in inactive and nanchung mutants (P<0.001). Asterisks indicate significance levels, here and elsewhere: **P<0.01, ***P<0.001. For details on the bootstrap test, see Results.

We first matched heading drift by fitting simulated θ–δ histograms at a fixed bias β=0 to the corresponding wild-type pre-amputation histogram and minimizing least squares error. Because the fitted heading drift (Δ=0.035) did not give a large enough dynamic range for μ to recapture all experimental results, we shifted it to be as close as possible to the fit while capturing the necessary dynamic range (Δ=0.029). The paths generated by this compromise heading drift value are still qualitatively reasonable (Fig. S7). Finally, we built the calibration curve (Fig. S8) by sweeping β and plotting μ (averaged over 50 runs, each consisting of 104 simulation steps). Fitting a quadratic function over the range of interest gives an almost perfect fit (R2=0.999). We used the analytical expression for the fit as the final calibration curve. See Table S1 for definitions of calibration curve parameters.

Optimization

The optimization goal was to find a set of leg forces acting on a fly with averaged parameters to match the experimental μ from the calibration curve (for each of the three strains and each day determined separately). We ran the model to five strides (to steady state) and took the angular bias in the last stride to calculate the energy of the proposed solution. We ran a simulated annealing optimization procedure (Kirkpatrick et al., 1983) for 1.5×103 steps, which was sufficient for convergence. See Table S1 for definitions of optimization parameters. Starting with force magnitudes of 0.25 units on each leg, we allowed the forces on the left side to change (allowing all forces to change leads to similar results) – ci,proposed=ci,current+u, where u∼U(–Tcurrentτm,Tcurrentτm) – and constrained for faster convergence to (in practice, the average optimal forces on the left side were not even close to the lower bound, even for the lowest target μ). The energy of a proposed solution was the distance between the absolute values of the target bias given the real μ (from the calibration curve) and the angular bias calculated from model output (angle difference during the last stride/distance moved during the last stride). The acceptance probability was a Boltzmann function with normalized energy and a multiplicative convergence factor γ:
(10)

RESULTS

Proprioception mediates locomotor recovery after injury

First, we investigated path-level behavior of adult D. melanogaster before and after amputation of the right foreleg. Visual inspection of characteristic paths of wild-type flies (Fig. 4A) suggests that injury caused behavior to change from (1) paths composed of roughly equal portions of clockwise and counterclockwise segments to (2) highly biased, slow walking in the direction opposite to the leg that was removed immediately post-amputation and then (3) back to a largely unbiased walk 3 days post-amputation. To provide a quantitative characterization of locomotor bias, we measured the ‘mu score’ (Buchanan et al., 2015): the weighted average direction (μ) of the tangential component of the velocity relative to the center of the arena (Fig. 1B). The vast majority of paths were around the edges of the arena rather than directly inwards or outwards. Consequently, µ is largely invariant across spatial scales used in its calculation (i.e. the frame rate or mean interval used to determine direction of motion) within a broad range (Fig. S9), suggesting that it is a robust measure of bias. A score of μ=0 corresponds to perfectly unbiased locomotion (flies moving clockwise and counterclockwise to the same extent) whereas −1<μ<0 corresponds to an overall counterclockwise bias and 0<μ<1 corresponds to an overall clockwise bias. For wild-type animals, we find that on average they start unbiased before amputation (μ=−0.006), develop a very strong bias immediately post-amputation (μ=−0.410), and steadily recover towards an unbiased state over the next 3 days (μ=−0.031) (Fig. 4B). To compare μ scores pre- and post-amputation, we performed a bootstrapping analysis, generating 105 (θ–δ) histograms resampled from each strain's respective pre-amputation histogram and calculating µ. We computed 5×105 experimental resamples, drawing random subsets with sizes matching the sample sizes of the post-amputation experiments of those µ values (9<N<30 for all experimental groups). The number of instances (k) out of 5×105 in which the pre-amputation distribution produced average µ values as or more extreme than observed in the post-amputation experiments was recorded. To be conservative in our estimation of the P-value, the upper bound on P at which k instances would be expected with probability >0.025 was used prior to a P-value correction for 12 multiple comparisons using the formula P*=1−(1−P)12. The difference in pre- and post-amputation distribution is not statistically significant after 3 days (P=0.372).

We next sought to further characterize the mechanosensory basis of motor recovery. Because proprioception allows the fly to learn about the stretch and location of its limbs and thus control them and the forces they exert, we hypothesized that disrupting proprioceptive feedback would hinder a fly's ability to adapt its locomotor behavior post-injury. The TRPV ion channels Inactive and Nanchung are co-expressed in the proprioceptive organs of the fly, including the chordotonal organs of the femur, tarsi and antenna, and are required for wild-type locomotion and hearing (Kim et al., 2003; Gong et al., 2004). As with wild-type animals, flies mutant for inactive (iav3621) exhibited little clockwise/counterclockwise bias while exploring the arena pre-amputation (μ=−0.026), but exhibited biased walking immediately following injury (μ=−0.247). However, unlike wild-type animals, iav3621 flies failed to recover close to their baseline (μ=−0.129 after 3 days). In nanchung mutants (nan36a), the recovery failure is even more pronounced (μ=−0.250 after 3 days). For both inactive and nanchung mutants, the distribution on day 3 was still significantly different from that pre-amputation (P<0.001). In nanchung mutants, we observed a larger bias in the days following amputation than immediately post-amputation, with the bias on day 3 post-amputation being the same as that on day 1 post-amputation. Overall, although mutants did not exhibit as large a bias as wild-type flies immediately post-amputation, their turning bias persisted for the entire duration observed, in contrast to wild-type flies. Together, the behavior of the wild-type and mutant flies before and after amputation implicates proprioception as important for recovery. How this happens requires an analysis at the level of individual legs.

Injury alters gait permanently

To gain insight into the biomechanical processes underlying recovery, we turned to a finer-grained analysis of leg motion. We recorded video of flies walking before amputation, followed by recordings 0, 1, 2 and 3 days after amputation. For the gait data, we analyzed 50≤N≤56 (wild type), 16≤N≤17 (inactive) and 13≤N≤15 (nanchung) walking bouts at each time point, with the slight variation due to fly death or post-processing rejection of runs. Instead of measuring locomotion across entire circular arenas, we captured bouts of fast, straight walking through the middle of arenas at 60 Hz. Using custom semi-automated leg-detection software, we recorded the position of all 6 (or 5 post-amputation) legs frame-by-frame. Movies 2–4 show representative examples of tracked movies pre-, 0 and 3 days after amputation, respectively. Fig. 2A shows annotated frames of a fly moving in a typical (135)(246) tripod gait. Fig. 2B shows stride-stance plots to visualize leg positions on the ground (white) and off the ground (blue) as a function of time. The pre-amputation stride-stance plot is an example of a typical tripod pattern. Immediately post-amputation, we see a non-canonical gait with what may be residual hints of tripod or tetrapod gait. On day 3 post-amputation we see an apparent tetrapod-like gait.

One way of characterizing gaits is on a frame-by-frame basis by considering the number of legs that are concurrently in swing phase (Mendes et al., 2013; Kain et al., 2013). However, this approach is not always satisfactory for several reasons (Wosnitza et al., 2013). It does not capture the view of gaits as persistent states and can introduce potential artifacts due to imaging, e.g. by misclassifying gaits because of imperfect simultaneity in take-off (see Fig. S10), requiring smoothing (Mendes et al., 2013). It is also not immediately apparent how to apply these gait categorization rules to flies with five legs. Therefore, to estimate the frequency of internal gait states, we assigned a gait label to each movie frame that is not based on the observed pattern set of legs in swing phase in that exact frame, but is instead the state of a HMM. This captures the spirit of gaits as persistent states that have respective probabilities of showing one, two or three legs moving simultaneously, and is an algorithmic alternative to hand-tuning windows. To avoid ambiguity, we refer to these hidden states as 3-leg, 2-leg and 1-leg gaits, without distinguishing between which groups of legs move (though as seen in Fig. S6, the predominant 3-leg motions pre-amputation correspond to canonical tripod and 2-leg motions to canonical tetrapod).

This allowed us to consider the relative frequencies of 1-leg, 2-leg and 3-leg gaits (Fig. 5A). In all three genotypes, we observed that the 3-leg gait frequency dropped dramatically from pre-amputation to immediately post-amputation and did not change significantly over the post-amputation period (P>0.060, F-test), remaining near 0. Interestingly, wild-type flies showed some gait plasticity (there was a significant increase post-amputation in the frequency of 2-leg gait, P=0.003), whereas both 2-leg and 1-leg gaits did not change discernibly over the 3-day period in either inactive or nanchung flies (P>0.647 for all conditions). For all strains, speed immediately post-amputation decreased relative to the pre-amputation value (by 34% for wild type, 14% for inactive and 56% for nanchung). Although there was an upward trend in wild-type and nanchung flies over 3 days, speed did not return close to baseline at the end of the 3 days for any of the strains (Fig. 5B). Leg coordination pattern is correlated with walking speed, and hence the lack of recovery seen in these measurements may be related. Wild-type flies walking at higher speeds tend to use more legs (Wosnitza et al., 2013), and we found that this general pattern persists post-amputation. Interestingly, we found that the proportions of the number of legs swinging versus speed do not change significantly over the 3 day period following amputation (the 95% confidence intervals overlap at nearly all points) (Fig. S11). Overall, as with the 2-leg gait, walking speed shows a significant upward trend for wild-type flies (P=0.001, F-test) and not inactive (P=0.741) or nanchung flies (P=0.116). However, neither of these phenomena recapitulates the pattern seen in turn bias recovery. For instance, both wild-type flies and inactive mutants exhibited a predominant proportion of 2-leg gait 3 days post-amputation (even though inactive mutants continue to have a turn bias), and the speed–coordination relationship remains largely the same at all days post-amputation for wild-type flies. Thus, the mechanism of turning bias recovery could also lie elsewhere.

Analysis of parameters that may lead to recovery of unbiased turning. (A) Frequencies of gaits for wild-type flies, and inactive and nanchung mutants found from the hidden Markov model. N≥50 (wild type), N≥16 (inactive) and N≥13 (nanchung) across all time points. The frequency of 3-leg gait decreases from pre-amputation and the slope of the regression is not significantly different from day 0 post-amputation for any strain (P>0.060, F-test). Wild-type flies exhibit some post-amputation gait plasticity, in contrast to the mutant strains. These results may be correlated with walking speed. Individual dots on the post-amputation day lines for inactive and nanchung mutants show significance levels of comparing gait frequency with the corresponding wild-type time point (unpaired t-test with Welch's correction). (B) Speed by strain by day relative to pre-amputation value. While speed never recovers to the pre-amputation value, wild type has a statistically significant upward slope (P=0.001, F-test) which is not present in inactive (P=0.741) or nanchung mutants (P=0.116). (C) Ratio of right (R) side average to the left (L) side average of various measures (leg distance moved per stride, proportion of time legs spend on the ground and leg distance from centroid at placement). The mean distance of the legs from the body centroid, at step placement, becomes lopsided (splayed to the left) after amputation for wild-type flies and inactive mutants, though it recovers significantly post-amputation for inactive mutants (P=0.017, F-test) and not wild-type flies (P=0.182). In nanchung mutants, it does not change from baseline. Likewise, the average distance moved by the tarsi on each side per stride and the proportion of time a leg is down in stance on the right side versus the left side does not show significant recovery for any strain (P>0.188).

Many leg parameters vary little through amputation and recovery

Turning back to the frame-by-frame analysis, we searched for other leg parameters (Fig. 5C) that displayed dynamics matching those of turning bias, i.e. those responding to amputation in all genotypes (with a larger effect in wild type), and largely recovering by day 3 (relative to 1 h post-amputation) in the direction of pre-amputation levels only in wild-type animals.

We found that the mean distance of the legs from the body centroid, at step placement, becomes lopsided (splayed to the left) after amputation and fails to change significantly for wild-type flies (P=0.182, F-test) but not inactive mutants (P=0.017). In nanchung mutants, this parameter does not change discernibly from pre-amputation. The average distance moved by the tarsi on each side per stride does not change discernibly for any strain (P>0.188). Similarly, the proportion of time a leg is down in stance on the right side versus the left side stays essentially constant for all strains (P>0.221) throughout the 3-day period. Thus, none of these parameters follows the qualitative pattern of turn bias recovery. However, it remains a possibility that the changes in a combination of these parameters in the action of walking could collectively explain turn bias recovery. To examine this, we now turn to a neuromechanical model of fly walking. If the virtual fly's turn bias follows the experimental turn bias pattern after fitting parameters from experiment, they may be sufficient to explain turn bias recovery.

Neuromechanical modeling implicates force modulation in recovery

The model framework (Fig. 3A) featured three essential components: (1) the nervous system, which controls the legs; (2) the body; and (3) interaction with the environment, which is mediated by the forces applied by the legs. We treated the neural component as a central pattern generator with six neuronal modules (one per leg) (see Ijspeert, 2008 for an overview). We fit geometric and kinematic parameters with values reported in the literature (e.g. Mendes et al., 2013) and observed in our experiments (i.e. Fig. 5C), leaving only leg forces as free-fitting parameters. The neuronal modules send a signal to the legs after reaching a threshold, which causes the legs to respond by exerting forces on the ground, so that the body moves according to the forces and torques it feels from the legs. This motion drives sensorimotor proprioceptive feedback to the neuronal module and the cycle repeats.

To compare the angular velocity output of the model (angular bias) with the arena locomotion turning bias, we determined a calibration curve (Fig. S8). To do so, we used a simple arena path simulation that had angular bias as a tunable parameter and also captured realistic arena-scale behavior (Fig. S7).

When we ran the model using all empirical parameters but held the force applied by each leg constant, none of the three genotypes exhibited any recovery in turn bias post-amputation (Fig. 6A). If anything, all three lines exhibited increased bias with time, implying that the parameters we have measured so far are insufficient to explain recovery. Therefore, we examined whether force modulation would allow the model to exhibit turn bias recovery.

Model results show that tuning leg forces can capture the recovery profile. (A) Turn bias (μ) determined from angular bias of simulated flies with and without force modulation using the turn bias–angular bias calibration curve (see Materials and methods). With force held constant (black lines), the model predicts that there would be no recovery of turn bias towards baseline from immediately post-amputation to day 3 post-amputation for all strains. With force tuning optimized to match observed recovery on a fly simulated with averaged parameters for each experimental group (orange lines), the experimental recovery profile (red lines as visual guide) can be recapitulated for all strains. Shaded regions are ±1 s.e.m. (B) Force change required in each leg separately to fit the recovery profile. The dashed line is a visual guide indicating no force change post-amputation. Means describe average total force exerted on the right side compared with the left side. The middle leg (red) requires the least change to fit a target recovery profile, followed by the hind leg (yellow) and front leg (blue). The recovery towards baseline is statistically significant for all legs in wild-type flies (P<0.038, F-test). In mutants, the slope is significantly positive only for the front leg of inactive (P<0.001). Based on single-leg comparison, wild-type flies tune force more than mutants over time to obtain a larger recovery effect.

A Monte Carlo optimization approach allowed us to find a ratio of leg forces between the right and left legs that yielded the appropriate angular bias. We did this for each strain and day using averages of the measured parameters. For example, to determine the leg forces needed to generate the locomotor turning bias observed in nanchung flies on day 2 post-amputation, we supplied the average time between strides, proportion of time each leg is down per stride, and leg phases, as measured directly from the corresponding video recordings. Leg forces that yielded µ values matching experimental values were then determined over the course of recovery.

Using this approach were were able to recapitulate the overall trajectory of fly locomotor behavior in response to injury (mean discrepancy <1%) (Fig. 6A). By tuning the leg forces, the strong turning bias induced immediately after amputation could be undone. Thus, modulation of force appears to be sufficient to recapitulate turn bias recovery. As there was no recovery in its absence, the model suggests that force modulation may be necessary for turn bias recovery.

Fig. 6B shows the ratio of total leg forces on the right and left sides that yield simulated locomotion matching observed turn bias values, when the force parameter (ci∈{1,2,3}) is swept linearly exclusively in one leg at a time (across all five legs, there are many combinations of force modulation that succeed). The model suggests that the middle and hind legs require smaller force changes than the front leg to achieve a particular directional bias profile, and that this change is larger in wild-type flies over the course of recovery. The recovery was significant for all legs in wild-type flies (P<0.03, F-test), though the modulation required in the middle legs to achieve turn bias recovery was markedly smaller than in the front and hind legs, whereas among mutants, the recovery was only significant and positive for the front leg in inactive flies (P<0.001), suggesting that wild-type flies modulate force more significantly to achieve recovery.

DISCUSSION

Wild-type flies in the present study initially spend equal portions of time exploring in clockwise and counter-clockwise directions (Fig. 4B). After amputation of the right foreleg, they exhibit a strong counter-clockwise bias. However, after 3 days, their behavior is largely unbiased. By contrast, inactive mutants recover approximately half-way from the maximum bias post-amputation and nanchung mutants do not recover at all. Moving from a behavioral assay to a gait analysis, we also considered the motion of individual legs. Although the 3-leg gait never completely vanishes (either in the wild type or in the mutants), it is nonetheless marginalized starting immediately post-amputation and does not recover over 3 days even as turning bias does. Intriguingly, wild-type flies appear to exhibit changing gait behavior post-amputation, with a significant increase in 2-leg gait and a decrease in 1-leg gait, while the probability of using 3-leg gait remains unchanged. The probabilities of using 1-leg, 2-leg and 3-leg gaits do not change significantly over time in mutants, though inactive mutants appear to favor a 2-leg gait immediately post-amputation while nanchung mutants favor the 1-leg gait. This suggested that gait learning and recovery may be tied to proprioception.

The simple fact of a predominant 2-leg gait at the end of the experiment is unlikely to explain the observed recovery. After all, both wild-type flies and inactive mutants exhibit a similar predominant proportion of 2-leg gait 3 days after recovery (the difference is not significant; P=0.217), and indeed the inactive mutants reach it first. Further, as we saw in the model, unbiased walking could not be achieved without force modulation; phase modulation alone was insufficient.

We then considered measures of several other parameters on a leg-by-leg basis, but found that they were insufficient to explain turn bias recovery. For instance, it is known that in cockroaches, legs play different roles in locomotion: front legs are used more for steering and hind legs more for propulsion (Mu and Ritzmann, 2005). However, even for wild-type flies, the difference in the remaining front leg distance from the centroid between 0 and 3 days post amputation was <1%, suggesting that leg placement alone cannot account for the observed changes in walking direction during recovery. Although several potential parameters of interest such as the average distance legs moved per stride and the proportion of time spent in the air during a stride are likely to be relevant, examining averages from both individual legs and right versus left comparisons for all of these parameters did not yield a satisfactory explanation for the observed recovery of turning bias in walking; for instance, none showed the same qualitative pattern as shown in Fig. 4B. However, it remained a possibility that the small differences in these parameters could, in combination, explain turn bias recovery.

To test this, we developed a minimal Newtonian physical model for leg and body motion. After fitting all parameters from experiments, we were left with one tuning parameter: force. Holding force constant at pre-amputation levels yielded no turn bias recovery (Fig. 6A). Tuning the forces exerted on each leg through a Monte Carlo optimization procedure to match the average angular bias of flies within each experimental group, we found that we were able to recapitulate observed turning bias scores. Tuning force in the middle legs had the largest effect on turning bias. Therefore, the model suggests that force modulation appears to be necessary and sufficient to explain turn bias recovery, given the measured values of all other biophysical parameters and gait patterns. Our findings imply a space of leg force modulation solutions. Many combinations of force modulation across all five legs can balance average forces between the left and right sides of the animal, and flies likely change forces in all of their legs as part of recovery. The front leg might be a special case because it has no contralateral leg to act against. It may be possible for a real fly to modulate the force from that leg with little constraint (e.g. by largely unloading it to become more ‘four-legged’, thereby restoring symmetry).

This suggests that the coordination of forces exerted by each leg is a general mechanism that an animal can control to achieve unbiased walking. In addition, this observation posits a fine-grained behavioral manifestation of proprioceptive defects. A number of studies have shown that deciphering forces and proprioceptive feedback are important in generating stable patterns or gaits (Pearson, 1972; Ridgel et al., 2000; Zill et al., 2004; Fuchs et al., 2012) (for a review from a modeling perspective, see Holmes et al., 2006; for a review with a more biological perspective, see Delcomyn, 2004) and may ‘directly influence [central pattern generators] and motoneurons to maintain phase relations in a decentralized, peripheral manner’ (Holmes et al., 2006) through feedback. Proprioception has also been implicated in walking direction, for example, in stick insects (Akay et al., 2007). Equally important has been an exploration of the interplay of proprioception and recovery in motor control in various insects. For example, Page and Matheson considered locusts and found a shift in limb movements intended for scratching after a surgery-induced decrease in proprioception, followed by recovery to pre-surgery values over the course of a week (Page and Matheson, 2009); Büschges and Pearson discovered that the removal of wing proprioceptors in locusts led to a decreased recovery of the flight motor pattern after wing injury (Büschges and Pearson, 1991; Büschges et al., 1992). Our study points to proprioception as a crucial player in mediating orientation profile plasticity by determining how well an animal can control the individual forces it exerts. In other words, perhaps a proprioception-defective fly ‘wants’ to exert more force on the right-hand side to counteract the effect of an amputated leg, but it cannot sense exactly how much force it is actually applying and is therefore doomed to continue making the same ineffectual exertions.

We note that the TRP channel mutants we considered have defects in various sensory structures, including all chordotonal organs across the body. The most relevant ones to this study are likely the legs, but it is possible that other organs are involved, such as those between the abdominal segments. These possibilities could potentially be resolved using the D. melanogaster transgenic toolkit by, for example, using intersectional genetics to target iav­- or nan-expressing neurons only in the leg. Inducible promoters could be used to compare the injury response of animals with inhibited chordotonal neurons with those with normal neuronal activity, while holding genotype constant. This would provide an advantage over the mutant approach, which might be confounded by other differences in genetic background. Proprioceptive organs other than the chordotonal organs could be involved as well. For example, the campaniform sensilla (Zill et al., 2004) are known to measure force within the cuticle and could be part of post-injury force modulation. Chordotonal organs, by contrast, are generally considered to be stretch rather than force sensors, but if the nervous system encodes the mass of the animal, the information encoded by a dedicated stretch sensor could be used to compute force. Specifically, stretch-sensitive neurons that encode position could stimulate a sequence of high-pass filtered (i.e. rapidly adapting) downstream neurons, which can readily compute signal derivatives. Multiplying the activity of these downstream neurons by the encoded mass value would produce a neural code for force downstream of chordotonal organs. More directly, it has been experimentally observed in stick insects that the afferent projections of different proprioceptive organs (including the femoral chortodonal organs and campaniform sensilla) can interact by exerting presynaptic inhibition on each other (Stein and Schmitz, 1999). This phenomenon appears to be conserved in the Pancrustacea as the chordotonal neurons of crayfish impart presynaptic afferent depolarization on sensory neurons innervating touch-sensitive bristles on swimming limbs, but only at speeds matching those of locomotion (Newland et al., 1996). Thus, even if the chordotonal dendrites encode only position, the chordotonal neurons could encode force by virtue of their interaction with campaniform neurons.

This study points to a number of avenues for future work. A natural question is: how much does each part of the neuronal circuit lead to recovery failure? In this context, one could consider the effect of stum, which is critical for transduction of mechanical stimuli in a subpopulation of proprioceptive neurons responsible for sensing joint angles (Desai et al., 2014), and nompC, which is required for virtually any mechanosensory signaling such as a response to changing joint angles (Chadha et al., 2015). It may also be interesting to better characterize coordination patterns (gaits) in animals after surgery. From a modeling perspective, an interesting extension would be to define a neural network with dynamic, self-tuning connections between neuronal modules in place of a fixed phase, duration and force. Then, one could ask what simple rules could allow the system to recover after injury (adaptive networks in a coupled oscillator system are described in Aoki and Aoyagi, 2011; Isakov and Mahadevan, 2014, for example). Another extension would be to incorporate ‘reflexes and preflexes’ (Kukillaya et al., 2009; Proctor and Holmes, 2010) to understand what role these play in recovery. Finally, we can ask whether a simple force–balance rule can be used in robots, such as those suggested in Schilling et al. (2013) and Cully et al. (2015), thereby encouraging ‘robotic recovery from injury’ and allowing better performance in the field.

Acknowledgements

FOOTNOTES

Competing interests

The authors declare no competing or financial interests.

Author contributions

B.d.B. and S.M.B. conceived and designed the turning bias experiment and data analysis. S.M.B. and J.K.S.C. performed the turning bias experiments. B.S., A.R., E.S.L. and A.I. collected gait analysis data. A.I., L.M. and B.d.B. analyzed data from the gait analysis experiment and developed the theoretical model. A.I., S.M.B., L.M. and B.d.B. wrote the manuscript. All authors edited and revised the manuscript.

Funding

A.I. was supported under FA9550-11-C-0028 awarded by the Department of Defense, Air Force Office of Scientific Research, National Defense Science and Engineering Graduate Fellowship, 32 CFR 168a. B.d.B. and S.M.B. were supported by the Rowland Junior Fellows Program of the Rowland Institute at Harvard.

Similar articles

Subject collections

Other journals from The Company of Biologists

Neuropeptide evolution and function

Neuropeptides are a diverse assemblage of signalling molecules that have key roles in the regulation of behaviour. Understanding the evolutionary relationships and functions of the plethora of neuropeptides has presented a considerable challenge to biologists. Based on presentations and discussions at a Royal Society meeting in 2017, three companion Review articles by Elphick et al., Jékely et al. and DeLaney et al. discuss advances in our knowledge of neuropeptide evolution and function and the techniques that have facilitated progress in this field of research.

The exquisite bright colours of Pachyrhynchus weevils were thought by Alfred Russel Wallace to warn off potential predators, but whether this warning related to their hard exteriors, their spiky legs or some irritating taste had never been tested. Now, a century and half later, a team from Taiwan revisits this question and suggest that hardness itself acts as an effective secondary defence.

In our latest early-career researcher interview, Brooke Flammang, Assistant Professor at the New Jersey Institute of Technology, tells us about her research journey (including writing her Master's thesis in an ambulance while working as a paramedic), the importance of collaboration in integrative biology, and her approach to teaching.

"The paper provided the first quantitative field evidence of the way that animals might gain protection from predation by seeking cover in a group of other similar animals. This protection is known as the dilution effect."

William Foster discusses ‘Evidence for the dilution effect in the selfish herd from fish predation on a marine insect’, the 1981 classic he published in Nature with John Treherne, former JEB Editor-in-Chief.