The actual klinotaxis network falls between the two extreme networks: minimal ( Figure 2 ) and maximal ( Figure 1A ). There are three main reasons why the minimal network is worth studying in more detail. First, the network is fully-connected: each of the sensory neurons can affect all of the motor neurons. Second, while the sensory neurons have been well identified, the circuits of interneurons that process sensory information are much less well characterized. The two interneurons that have been shown to be involved in klinotaxis, AIZ [63] and AIY [82] , are included in the minimal network. This is important because it was not deliberately taken into consideration in the selection of the network; rather it emerged from the experimental constraints and simplifying assumptions. Finally, starting with the minimal network allows us to test the minimum neuroanatomy necessary to produce the behavior. As soon as the network fails in some respect and as more experimental data becomes available, the constraints can be relaxed and more components included in a systematic way.

White disks, chemosensory neurons; gray disks, interneurons; dark gray disks, motor neurons. Black connections represent chemical synapses. Red connections represent electrical gap junctions. The strength and polarity of the connections are still unknown. We show the strength and polarity from the best evolved network. Arrowheads, excitatory connections; filled circles, inhibitory connections. Line thickness shows relative connection strength. Color of the disk's border represents the sign of the bias term θ (black, positive; gray, negative). Thickness of the disk's border represents the magnitude of the bias. All parameters were symmetrical across the dorso-ventral midline.

The unconstrained network connecting ASE to SMB is still rather large, with 88.41% of all neurons and 93.76% of all chemical synapses and gap junctions in the connectome. We reduced this network to the minimal fully-connected one by once again constraining the path length. Constraining the network to paths of length 3 (the minimum consistent with the fully-connected criterion) reduces it to only 23 (7.61%) neurons and 276 (3.78%) chemical synapses and gap junctions. This allows us to test how much of the behavior can be accounted for by the most direct paths only, with indirect paths added in subsequent iterations of the model. There is, however, a further simplification that we can make to the network. Two neurons can be connected by one or more chemical and electrical synapses. We refer to the total number of chemical and electrical synapses between two neurons as the contact number. We simplified the network one step further by setting a threshold for the number of contacts between two neurons. The assumption is that the better-connected paths are more likely to have stronger interactions. When we constrained the network to paths with 2 or more contacts, we obtained a network that contained only two interneuron classes: AIY and AIZ ( Figure 2 ). We refer to this network as the minimal klinotaxis network. Any further simplification breaks the fully-connected criterion.

In order to further reduce the complexity of the network, we constrained the root and target set of neurons based on experimental results. The sensory neurons required for many chemosensory responses have been defined by killing identified neurons with a laser microbeam, and testing the operated animals for their behavioral capabilities. Studies have shown that chemotaxis to sodium and chloride ions are mediated mainly by the ASE sensory neurons [68] . Simultaneous ablation of all amphid and phasmid neurons except ASE spares chemotaxis, indicating that the role of ASE in water-soluble chemotaxis is unique [68] . There have been no studies in the motor neurons involved in the gradual turning observed during forward locomotion in klinotaxis. However, from studies of locomotion [81] , we know SMB motor neurons set the amplitude of sinusoidal movement. Modulating the amplitude of sinusoidal movement at the timescale of head sweeps (see Methods ) during forward locomotion can lead to gradual turning. This gradual turning is a likely candidate for producing the curvature in the translational direction of the worm (i.e., the direction of movement, see Methods ).

How do we decide what path length to constrain the network to? We considered a network to be fully-connected if signals from every sensory neuron could reach every motor neuron. Within the context of klinotaxis, this is an important criterion because it ensures that all information from the environment can be used to modulate motor neurons on both sides of the worm: dorsal and ventral. For any network, there is a minimal path length that meets the fully-connected requirement. For the network connecting all chemosensory neurons to all neck motor neurons that minimum was length 5, which included still 87.74% of all neurons and 92.98% of all the chemical synapses and gap junctions in the connectome dataset.

The klinotaxis network is clearly contained within the maximal network, but is likely to involve a smaller subset of neurons. There are several ways to constrain the maximal network. One of the simplest and most effective is to limit the length of the paths because information is likely to be lost after traveling through many neurons due to nonlinearities and noise. From the maximal network we knew the longest path between chemosensory neurons and neck motor neurons was 7. As we limited the length of the paths, the size of the network (as measured by the number of neurons and chemical and electrical connections) was reduced dramatically ( Figures 1B and 1C ).

A , Maximal network. All paths between chemosensory neurons (white disks) and neck motor neurons (black disks). Interneurons shown in gray. Chemical synapses shown as black lines. Directionality not shown. Gap junctions shown in red. Line thickness represents the relative number of chemical synapses or gap junctions between the two neurons. B , C , Number of neurons and number of chemical synapse and gap junctions in the network as a function of path length. Points represent the number of total neurons and contacts in the network. Dashed lines represent the total number of neurons and synapses and junctions in the connectome.

The maximal network contains all paths between chemosensory and neck motor neurons. The C. elegans chemosensory system enables it to detect a wide variety of volatile and water-soluble cues, with a total of 8 pairs of amphid neurons that are exposed directly to chemicals in the environment: ADF, ADL, ASE, ASG, ASH, ASI, ASJ, ASK [78] , [79] . A total of 113 of the 302 C. elegans neurons are motor neurons [1] . As klinotaxis involves modulation of the side-to-side headswings, we were interested in the motor neurons that innervate the muscles in the head. We therefore only considered the 10 head and neck motor neuron classes: RIV, RIM, RMG, RMF, RMH, RMD, RME, SMB, SMD, and URA [80] . Figure 1A shows all of the paths between these two sets of neurons. Without additional constraints, the network connecting those two sets contains 90.72% of all neurons and 97.95% of all the chemical synapses and gap junctions in the connectome dataset.

In order to identify candidate klinotaxis networks, we mined the C. elegans connectome using the chemosensory neurons as the root set and the neck motor neurons as the target set. We began with the maximal network, connecting all chemosensory neurons to all neck motor neurons. We then constrained this network based on experimental evidence and simplifying assumptions until we arrived at a minimal but neuroanatomically-grounded klinotaxis network.

The sinusoidal relationship between turning bias and bearing, together with the linear relationship between turning bias and the normal component of the gradient, are qualitatively similar to the relationships observed in studies of klinotaxis in real worms [63] . This similarity is significant for two reasons. First, as we did not explicitly include selection criteria in the evolutionary algorithm to approximate these features, this similarity is an emergent property of the evolved networks. Second, the resemblance suggests that the model employs a klinotaxis strategy similar to the one used by real worms, making the model presented here especially appropriate for the generation of testable predictions concerning how the biological network functions.

Each of the data points in the gradient in the translational direction (black points, Figure 4C ) corresponds to the average over two distinct bearings. For example, +90 and −90 degrees both have 0 translational gradient. Their corresponding turning biases are nonzero, equal in magnitude but opposite in sign. So although the translational gradient does not influence the turning bias on average, when we studied the different cases more systematically we found some information in the translational direction: the magnitude of the turns were larger for negative translational gradients than for positive translational gradients (gray points, Figure 4C ). There is a significant difference in the turning bias of the model worm when moving up the gradient at an angle than when moving down the gradient at that same angle (see red points, Figure 4C ). Therefore, the magnitudes of the corrections are larger when the worm is heading away from the peak than when the worm is heading towards the peak. Although this is not a requirement of klinotaxis, it is an efficient component to the strategy exploited by the evolved model worms.

A , Average turning bias vs. bearing. B , Average turning bias vs. the component of the gradient in the normal direction. C , Average turning bias vs. the component of the gradient in the translational direction. Black points represent all of the data averaged into bins according to the translational gradient. Gray points show the data separated between positive and negative turning bias. The two red points highlight the significance of the difference between the turning bias when moving down the gradient versus when moving up the gradient at the same angle. Error bars are standard error of the mean.

Klinotaxis has two necessary conditions: (C1) The organism continuously adjusts its orientation toward the line of steepest ascent; (C2) The adjustments in orientation are made on the basis of comparisons of the stimulus at a single point on the body as this point is swept from side to side over time. To ascertain whether networks met C1, we plotted track-curvature, quantified in terms of turning bias (see Methods ), as a function of instantaneous bearing relative to the gradient peak ( Figure 4A ). According to C1, the algebraic sign of the turning bias should always be opposite to the sign of bearing. Figure 4A shows that this was indeed the case. To ascertain whether the optimized networks met C2, we plotted turning bias as a function of the amplitude of the gradient in the direction normal to the worm's translational movement ( Figure 4B ). This plot revealed that turning bias increased linearly with the amplitude of the gradient normal to the worm, as expected for a simple causal relationship between the concentration differences during head sweeps and turning bias. Furthermore, on average, turning bias was not affected by the model worm's movement in the translational direction (black points, Figure 4C ). This finding suggests that turning bias in the model is controlled by changes in concentration sensed during the side-to-side head sweeps, as required by C2.

In order to determine the mechanism by which model worms reach the peak of the gradient, we first observed how the trajectories of virtual worms varied as a function of the model's random initial bearing (i.e., the angle difference between the direction of translational movement and the direction of the peak of the gradient) and then analyzed whether the trajectories met the two criteria for klinotaxis set out in previous work [77] . Figure 3 shows that model worms made a smooth turn until they were oriented in the direction of steepest ascent. Thus the output of the model was consistent with both real worm tracks during klinotaxis [63] and the previous theoretical model [77] .

Networks were evolved in chemical gradients with conical shapes, where the chemical concentration falls as a linear function of the Euclidean distance to the peak. To test for generalization we measured chemotaxis index and reliability in a Gaussian-shaped chemical gradient (see Methods ), which resembles the gradients used in laboratory tests of chemotaxis in C. elegans [64] . The measures in the Gaussian gradient closely matched those obtained in the conical gradient ( Table 1 ). This experiment shows that evolved networks are not specialized for the shape of the gradient; instead, they embody a more general solution to the task of klinotaxis, making them appropriate for further study.

To identify neuroanatomically constrained neural networks for klinotaxis in C. elegans, we generated a population of 100 different networks using an evolutionary algorithm. Networks evolved reliably after 300 generations. Out of the 100 evolutionary runs, 17 failed to produce networks capable of efficient chemotaxis (chemotaxis index lower than 0.5, see Methods ). Of the rest, we focused only on the highest-performing subpopulation, namely those networks having a chemotaxis index (CI) of at least 0.75 (n = 27). When tested over a longer assay, this subpopulation had an average CI of 0.87. All further analysis was limited to this high-performance subpopulation.

Orientation responses were expressed in terms of turning bias, which was computed over a complete cycle of locomotion following the concentration step. We observed that turning bias varied as a sinusoidal function of the phase of locomotion at which the concentration change occurred ( Figures 5A and 5B ). This function had extrema near phases 0 and π, where the instantaneous velocity vector (v, see Methods ) diverges most from the unbiased translational vector (u, the worm's direction of movement in the absence of external input, see Methods ), and minima near phases of π/2 and 3π/2, where the instantaneous velocity vector diverges least from the unbiased translational vector. In the context of klinotaxis on a gradient, the instantaneous velocity vector at the time of an upstep signals the direction of the peak implied by such a step, whereas the instantaneous velocity vector at the time of a downstep signals the direction opposite to the peak. Thus, the model worm corrects its orientation relative to discrepancies between its velocity vector and the direction of the peak throughout the locomotion phase. The amplitude of the orientation response was proportional to the amplitude of the concentration step ( Figure 5 ). This proportionality is important when the changes in concentration produced during dorsal and ventral sweeps have the same sign but different magnitudes.

A , Response to upsteps. B , Response to downsteps. Plots show turning bias vs. the phase of locomotion at which the concentration step occurred. Each point represents the average across all networks; error bars are standard error of the mean. Shades of gray indicate the magnitude of the concentration step (0.005 black, 0.00333 dark gray, and 0.00166 light gray). Positive and negative values of turning bias result, respectively, in counterclockwise and clockwise rotations of the translational vector. Abbreviations: VS, ventral head sweep; DS, dorsal head sweep (shaded region).

If we consider only the transformation that occurs between the sensors and motors, it is possible to compare the results of the neuroanatomically-grounded model with the previous simplified model. In order to do this, we studied how changes in concentration are transformed into changes in motor responses, as reflected by the worm's orientation, using single stepwise changes in concentration of different magnitudes at different points in the locomotion phase (increments in concentration: upsteps, Figure 5A ; decrements in concentration: downsteps, Figure 5B ).

Analysis of representative network

A neuroanatomically-grounded model allows us to go beyond overall sensorimotor transformations to examine the interneuronal implementation of klinotaxis. In this section we analyze in some detail one of the best evolved networks (Figure 2), a representative of many of the rest of the high-scoring subpopulation. The network's performance depends on the parameters that it evolved, but the solution is not brittle: there is a graceful degradation of the performance as parameters are independently perturbed away from the evolved values (see Figure S1).

In order to understand how changes in concentration travel through the network, we studied how the synaptic potential (henceforth, output) of the neuron changed as a function of step changes in concentration of different sign and magnitude over the full spectrum that the model worms experience during klinotaxis runs (Figure 6). The dynamics of the chemosensory neurons follow directly from their definition (see Methods): ASER and ASEL react only to downsteps and upsteps in concentration, respectively (Figures 6A1 and 6A2).

PPT PowerPoint slide

PowerPoint slide PNG larger image

larger image TIFF original image Download: Figure 6. Neuron output traces in response to step changes in concentration in the best evolved network. A, Chemosensory neuron output, ASE. B, First layer interneuron output, AIY. C, Second layer interneuron output, AIZ. D and E, neck motor neuron output (D, SMBD; E, SMBV). Time is shown on the x-axis. Neuron output is shown on the y-axis. Each trace is color-coded according to the magnitude and sign of the step of the concentration step. The black trace represents the neuron output without input. The neuron output from left cells is shown on the left; the neuron output from right cells is shown on the right. https://doi.org/10.1371/journal.pcbi.1002890.g006

The connections between the chemosensory cells ASEL and ASER and the first interneuron class (AIY) are excitatory and inhibitory, respectively (Figure 2). Therefore, upsteps in concentration move the membrane potential of both AIY cells upward and downsteps in concentration move the membrane potential of both AIY cells downward (henceforth, we will refer to the membrane potential as the activation of the neuron, with positive-going changes as increases in activation and negative-going changes as decreases in activation). How each AIY cell reacts to changes in concentration is a function of their bias parameter in relation to the strength and sign of the incoming chemical synapses from the chemosensory neurons. Because of the nonlinearity of the input-output relation (see Methods, Eq. 3), each AIY cell can only respond to changes in concentration within a certain range (henceforth, sensitivity). Also, given that the parameters of the network are not constrained to be left/right symmetric, the range of sensitivities of the two AIY cells can be different. In this network, AIYL is sensitive to small changes in concentration, positive or negative (Figure 6B1); whereas AIYR, due to a strong negative bias parameter (Figure 2), is only sensitive to large increases in concentration (Figure 6B2). Crucially, the ranges of sensitivities of the two cells are complementary, such that together they cover a broader range of the possible stimuli than individually.

The gap junction between cells drives the activation of the neurons closer together: the lower the resistance, the bigger the effect. The effect, however, is not always noticeable in output space due to the nonlinearity of the input-output relation: changes to the activation of the neuron can be masked by the saturation of the input-output relation. This is the case for the gap junction between the AIY cells in this network (Figures 6B1 and 6B2). Indeed, blocking the gap junction does not alter the dynamics of the output of the two interneurons significantly. From this experiment we conclude that the sensitivities of the AIY cells depend mainly on the incoming chemical synapses from ASE.

Neuroanatomically, AIZ cells only receive a chemical synapse from the AIY cell directly upstream. When we combine this with AIZ's own nonlinear response, we would expect the range of sensitivities to different steps in concentration to be a reduced set from AIY's. But this is not what we observe (Figure 6C). Unlike in the AIY interneurons, the gap junction between these AIZ cells plays an important role. The effect can be seen in AIZR best: even though AIYR is not sensitive to downsteps (Figure 6B2), AIZR is sensitive to them (Figure 6C2). This information is transferred not via the chemical synapses downstream, but via the lateral gap junction with AIZL. The AIZ gap junction plays a crucial role in redistributing and broadening the sensitivities to the changes in concentration between the left and right cells.

Unlike interneurons, motor neurons additionally receive an oscillatory input. Therefore, how they react to step changes in concentration depends on the phase of the locomotion cycle (Figure 6D–E) in which a change occurs. In order to understand their operation, we first consider their dynamics in the absence of sensory input. Figure 7 shows the steady-state input-output (SSIO) curve of the left and right motor neurons. The oscillatory input drives the motor neurons around the red trajectory, with dorsal and ventral cells out of phase. The key feature of the motor neurons is that the sensitive part of the SSIO curve is such that when one of the dorsal motor neuron is in the sensitive area of the curve, the ventral one is not, and vice versa. Even though the SSIO curves for the left (Figure 7A) and right (Figure 7B) pair of motor neurons are different, they share the same principles: (a) the sensitive region is biased with respect to the oscillatory range, and (b) increases in concentration move the input towards the most saturated part of the range; decreases in concentration move the input towards the sensitive part of the range. This is consistent with the principles observed in the motor neurons of the previous sensorimotor-only model [77].

PPT PowerPoint slide

PowerPoint slide PNG larger image

larger image TIFF original image Download: Figure 7. Dynamics of the neck motor neurons. Input-output diagrams for the left (A) and right (B) pair of dorsal and ventral motor neurons. Gray trace, steady-state input-output (SSIO) curve when the head sweep oscillation is absent. Red trace, instantaneous input-output relation when the head sweep oscillation is present. Arrows show the effects of output of the indicated chemosensory neuron on motor neuron input. Shaded areas show the range of oscillation. For each of the SSIO curves, there are dorsal and ventral motor neurons moving out of phase over the red trajectory due to the out of phase input from the oscillatory component. When the dorsal motor neuron is at point a in the curve, the ventral motor neuron is at point d, and vice versa. When the dorsal motor neuron is at point b in the curve, the ventral motor neuron is at point c, and vice versa. For the dorsal/ventral SMBL pair (A), an increase/decrease in chemical concentration would decrease/increase the output of the neuron in d, but not of the neuron in a; decreasing/increasing the difference between the two left neck motor neurons. For the dorsal/ventral SMBR pair (B), a and d represent the opposite regions: a neuron at a is more sensitive to changes in input than the other neuron at d; but the result is the same: an increase/decrease in chemical concentration decreases/increases the difference between the two neck right motor neurons. To different degrees, the same is the case for other points along the curve. https://doi.org/10.1371/journal.pcbi.1002890.g007

It is the asymmetry in the location of the sensitive area in the SSIO curves of the motor neurons that allows for state-dependence in the network (Figure 7). We analyze first the left pair of motor neurons. When the concentration increases, AIZL's activation also increases, and for some range of magnitudes the neuron output increases as well (blue traces Figure 6C1). Given the inhibitory connection to the motor neurons (Figure 2), SMBDL and SMBVL receive less input as a consequence. As the dorsal and ventral neurons are out of phase, one is in the sensitive region of its SSIO curve and the other is not. Therefore, the output of one of the motor neurons decreases and the other one stays the same (compare blue trace in Figure 6D1 to Figure 6E1). This decreases the difference between the output of the dorsal and ventral motor neurons, which ultimately decreases the worm's turning. When the concentration decreases, AIZL's activation also decreases (red traces, Figure 6C1), and for some range of these changes in concentration the neuron output decreases as well. In this case, the motor neurons receive more input, and as a consequence of the bias in sensitivity, the output of one of the motor neurons increases and the other stays saturated (compare red trace in Figure 6D1 to Figure 6E1). This increases the difference between the output of the dorsal and ventral motor neurons, which ultimately increases the worm's turning.

Despite the differences in evolved parameter values, the effect is similar in the right motor neurons (Figures 6D2 and 6E2). When the concentration increases, AIZL's activation also increases, and for some range of magnitudes the neuron output increases as well (blue traces, Figure 6C2). Given the excitatory connection to the motor neurons (Figure 2), SMBDR and SMBVR receive more input as a consequence. As the dorsal and ventral neurons are out of phase, one is in the sensitive region and the other is not. Therefore, the output of one of the motor neurons increases and the other one stays the same (compare blue trace in Figure 6D2 to Figure 6E2). This decreases the difference between the output of the dorsal and ventral motor neurons, which ultimately decreases the worm's turning. When the concentration decreases, AIZR's activation also decreases (red traces, Figure 6C2), and for some range of these changes in concentration the neuron output decreases as well. In this case, the motor neurons receive less input, and as a consequence of the bias in sensitivity, the output of one of the motor neurons decreases and the other stays saturated (compare red trace in Figure 6D2 to Figure 6F2). This increases the difference between the output of the dorsal and ventral motor neurons, which ultimately increases the worm's turning.

In order to understand the range over which each neuron is sensitive to changes in concentration, we visualized the difference in output between the no input and input conditions as a function of the magnitude and polarity of stepwise changes in concentration (Figure 8). In AIY, the sensitive regions of the neuron output for the left and right cells are different (Figure 8A): AIYL is most sensitive to small negative and positive steps whereas AIYR is most sensitive to larger positive steps. We can also use this analysis to study the role of the gap junction, by blocking it and comparing the changes in sensitivity to the unblocked condition. We observed almost no change in the sensitivities of the left and right cells when the gap junction is blocked (dashed curves, Figure 8A). In contrast, for AIZ, the sensitive regions of the neuron output for both the left and right are similar (Figure 8B): both are sensitive to small upsteps and downsteps, though AIZL is still most sensitive to small negative and positive steps and AIZR is biased towards larger positive steps. The difference in the range of sensitivity for the AIZ cells when the gap junction is blocked is dramatic (dashed curves, Figure 8B).

PPT PowerPoint slide

PowerPoint slide PNG larger image

larger image TIFF original image Download: Figure 8. Range of sensitivity to changes in concentration. A, Interneuron class AIY. B, Interneuron class AIZ. Left neuron shown in blue; right neurons shown in red. Flat regions of the curve correspond to areas of no-sensitivity to input over that region. The slope of the curve denotes the degree of sensitivity to changes around that region of the input. For example, AIYR is sensitive to large positive changes in concentration only, whereas AIYL is sensitive to changes in concentration around the midline. Dashed lines show the sensitivity when the gap junction between those two neurons is blocked. In AIY, blocking the gap junction does not affect the sensitivity of its left and right neurons. In AIZ, blocking the gap junction results in substantial differences in the range of sensitivity. C, D, Sensitivity in the left and right pair of motor neurons as a function of the phase of locomotion, respectively. The dorsal motor neuron is shown in blue-green-yellow shades; the ventral motor neuron is shown in gray scale. Similar to the interneurons, the motor neurons have a selective range of sensory input over which they are sensitive. Unlike the interneurons, their sensitivity changes as a function of the worm's sinusoidal movement. Because of the out of phase oscillation between dorsal and ventral motor neurons, which neuron is more sensitive to a certain input swaps back and forth between them. https://doi.org/10.1371/journal.pcbi.1002890.g008

The surfaces in Figures 8C and 8D allow us to visualize how the sensitivities change as a function of locomotion phase, in addition to the magnitude and polarity of the step change in concentration. As for the interneurons, the main differences between the left and right pair of motor neurons is in the range over which they are sensitive to changes in concentration. The left pair of motor neurons is most sensitive to small downsteps and upsteps (Figure 8C), whereas the right pair is more sensitive to large upsteps (Figure 8D). This difference stems from the combination of sensitivities of the AIZ cells upstream (Figure 8B) and the dynamics of the motor neuron (Figure 7). The dorsal and ventral, left and right motor neurons add together to affect the dorsal and ventral muscles, respectively. Therefore, the different ranges of sensitivity are ultimately combined at the level of the dorsal and ventral muscles.

The final issue in analyzing the mechanism of klinotaxis in this model circuit is to consider the behavioral effects of motor activity on the orientation of the body. How do the step changes in concentration result in changes in the translational direction? (cf. Figure 5). In order to answer this question, we analyzed the orientation responses produced by single stepwise changes in concentration (upsteps, Figure 9A; downsteps, Figure 9B).

PPT PowerPoint slide

PowerPoint slide PNG larger image

larger image TIFF original image Download: Figure 9. Orientation responses elicited by stepwise changes in concentration. A, Response to upsteps. B, Response to downsteps. 1, Behavioral traces for four points in the locomotion phase. The black trace shows the trajectory in the absence of a concentration step. The colored traces show the trajectories obtained in response to concentration steps placed at the locations indicated by dots of matching color. The four locations chosen cover a complete cycle of locomotion (dashed box). Vectors indicating the direction of translation (dashed lines) are shown for no concentration step (u), and steps at locations a and c (u a , and u c ). Abbreviations: DS, dorsal head sweep; VS, ventral head sweep (shaded region). 2, Generalization of the turning bias as a function of the timing within the locomotion phase where the step is introduced. The example traces from A1 and B1 are represented by labeled disks in A2 and B2, respectively. https://doi.org/10.1371/journal.pcbi.1002890.g009

Upsteps activate the ON cell, which reduces turning angle. The effect of the turning angle reduction on the worm's translational direction is dependent on the phase of locomotion. We consider two representative phases. First, an upstep at the midpoint of a ventral/dorsal head sweep (Figure 9A1, points a/c): turning angle is decreased for approximately the duration of a head sweep (2.1 secs, cf. Fig. 6). This persistent reduction in turning angle attenuates the ensuing dorsal/ventral turn; with the result that the worm's translational velocity vector rotates ventrally/dorsally (red/green trajectory, vector u a /u c vs. u). Both the dorsal rotation at point a and the ventral rotation at point c are appropriate orientation responses because the model worm turns in the direction of its instantaneous velocity vector at the time of the increase in concentration. Second, an upstep at the ventral/dorsal maximum (point b/d): no rotation occurs because the decrease in turning angle attenuates parts of the dorsal and ventral turns almost equally (blue/yellow trajectory). The absence of rotation at points b and d is appropriate because the model worm's instantaneous velocity vector at the time of the increase in concentration was the same as its translational direction. Downsteps activate the OFF cell, which increases turning angle. The analysis is the same as with upsteps, except that the turning increases instead (Figure 9B1). Crucially, the ventral rotation at point a and the dorsal rotation at point c are appropriate orientation responses because the model worm turns away from the direction of its instantaneous velocity vector at the time of the decrease in concentration (red/green trajectory, vector u a /u c vs. u).

To obtain a more complete understanding of how the simple rules for predicting changes in turning angle lead to correct orientation responses, we expanded the analysis of Figures 9A1 and 9B1 to include steps in concentration not only at points a–d, but also at the points in between (upsteps, Figure 9A2; downsteps Figure 9B2; cf. Figure 5).

This mechanism depends on three basic principles. (1) The two motor neurons are biased such that when one motor neuron is sensitive to sensory input, the other is not. (2) The signs of connections from sensory neurons to motor neurons are adjusted with respect to motor neuron bias such that ON cell activation reduces the curvature of the worm's path, whereas OFF cell activation increases the curvature of the worm's path. (3) The dynamics of sensory responses are adjusted so that changes in curvature are transient, lasting for approximately the duration of a head sweep. As a result, changes in curvature cause the worm's path to veer toward concentration increases and away from concentration decreases, unless the worm's head is moving in the direction of the gradient peak at the time the concentration change is encountered. These principles are similar to those found in the previous sensorimotor-only model [77]. The novelty of the analysis here lies in the implementation of the mechanism at the interneuronal level. The interneurons on the left and right side of the network show a certain amount of shared information about the changes in concentration, but also some degree of specialization: some changes in concentration are sensed by the left side of the network only and some changes in concentration are sensed by the right side of the network only. This feature allows the network to extend the coverage of the range of possible changes in concentration. Finally, the gap junctions between the interneurons can play a key role in distributing the sensitivities.