C. elegans displays distinct locomotion in identical environments after exploring different surrounding areas. (A) Schematic of two microfluidic chamber designs—uniform and binary—used for behavioral assays. Both chambers feature an identical assay area (red dashed-line boxes) where locomotion was analyzed, while the exploration zones contain distinct PDMS pillar patterns for worm exploration. (B–E) Bar graphs showing locomotion properties of wild type N2 worms in the assay zones of both chamber types after 1 hour of exploration. Data from binary chambers are shown in orange and from uniform chambers in blue. Shown are (B) locomotion speed, (C) percentage of time spent idle, (D) reversal frequency, and (E) turning frequency. Error bars represent standard error of the mean (SEM); each data point represents the mean behavior value of worms within a chamber. (F) Percent changes in locomotion properties, calculated from data in panels B–E and normalized to the mean value obtained from binary chambers (see Methods), are presented as mean ± SEM. Statistical significance was determined using an unpaired Student’s t-test (***: p < 0.001, *: p < 0.05).

Guanylate cyclase gene gcy-18 functions in AFD to mediate context-dependent locomotion modulation. (A) Speed differences (Δspeed) between uniform and binary chambers of wild type N2, gcy-18 and gcy-12 mutant worms. ΔSpeed was calculated as the percent change in locomotion rates in uniform chambers, relative to the mean of values obtained in binary chambers (see Methods). Mutant worms lacking gcy-18 failed to demonstrate context-dependent adjustments in locomotion speed, as indicated by a low Δspeed value, whereas gcy-12 mutants behaved similarly to wild type worms. (B) A single-copy transgene expressing gcy-18 cDNA under the control of the gcy-8 promoter in AFD restores context-dependent locomotion modulation. (C) Disruption of gcy-8 does not impair context-dependent locomotion modulation. (D) Schematic illustrating the distinct roles of guanylate cyclase genes in AFD sensory neurons: gcy-8 is required for thermosensation but not for context-dependent locomotion modulation, whereas gcy-18 is essential for context-dependent locomotion modulation and plays only a moderate role in thermosensation. Data are presented as mean ± SEM. Each data point represents the mean behavior of worms within a single chamber. Statistical significance was determined using one-way ANOVA followed by a Tukey–Kramer post hoc test (***: p < 0.001).

Cyclic nucleotide-gated (CNG) channel subunits TAX-2 and CNG-3 are required for locomotion modulation, but TAX-4 is not. (A) Schematic representation of CNG channel function. CNG channels are activated by cyclic nucleotides (such as cGMP) and mediate Ca²⁺ influx, thereby influencing neuronal activity and animal behavior. (B) Locomotion speed (µm/s) of N2, tax-2, and tax-4 mutant worms in binary (orange) and uniform (blue) chambers. The tax-2 mutants exhibit identical locomotion rates in both chamber types, whereas worms lacking tax-4 display accelerated basal locomotion while still preserving context-dependent locomotion modulation. (C) Speed differences (Δspeed) for N2, tax-2 mutant, and tax-4 mutant worms. The tax-2 mutants failed to modulate locomotion rates in a context-dependent manner, whereas tax-4 mutations enhanced modulation. (D) Assessment of cng-2, cng-3, and cng-4 roles in locomotion adjustments. The cng-3 mutation abolishes locomotion modulation. (E) Single-copy transgenes expressing cng-3 cDNA under two different AFD-specific promoters restore context-dependent locomotion adjustments. Data are presented as mean ± SEM. Each data point represents the mean behavior of worms within a single chamber. Statistical significance was determined using an unpaired Student’s t-test to compare speeds between uniform and binary chambers (panel B) and one-way ANOVA followed by a Tukey–Kramer post hoc test to compare Δspeed across strains (panels C-E) (*: p < 0.05; **: p < 0.01, and ***: p < 0.001).

AFD, but not its sensory endings, is required for context-dependent locomotion modulation. (A) Schematic representation of AFD function in temperature sensing and locomotion modulation. AFD sensory endings are essential for thermosensation but dispensable for context-dependent locomotion modulation. (B) Locomotion speed (μm/s) of wild type N2 and kcc-3 mutant worms in the binary (orange) and uniform (blue) chambers. The kcc-3 mutants preserve context-dependent locomotion modulation while exhibiting increased basal locomotion rates. (C) Speed differences (Δspeed) for N2 and kcc-3 mutant worms, and (D) for N2 and ttx-1 mutant worms, respectively. Context-dependent locomotion modulation remains in kcc-3 and ttx-1 mutant worms, although they abolish the AFD thermosensory function. (E) Ablation of AFD eliminates the context-dependent locomotion modulation. Data are presented as mean ± SEM. Each data point represents the mean behavior of worms within a single chamber. Statistical significance was determined using an unpaired Student’s t-text (n.s. indicates not significant, and ***: p < 0.001).

Context-dependent locomotion adjustments require both the mechanosensory channel subunit MEC-10 and the AIB interneurons that connect AFD to touch circuits. (A) Schematic representation of neurons synapsing with AFD. AIB provides the shortest pathway linking AFD to touch receptor neurons. (B, C) Speed differences (Δspeed) for N2, mec-10 mutants, and AIB-ablated (-AIB) worms. Both mec-10 mutants (B) and AIB-ablated worms (C) fail to modulate locomotion in microfluidic chambers. Data are presented as mean ± SEM. Each data point represents the mean behavior of worms within a single chamber. Statistical significance was determined using one-way ANOVA followed by a Tukey–Kramer post hoc test (**: p < 0.01).

Tactile-dependent locomotion modulation is disrupted in mutant worms lacking gap junction genes and is restored by engineered Cx36 electrical synapses linking AFD and AIB. (A) Speed differences (Δspeed) for inx-1, 4, 7, 10, 19 mutant worms. (B) Speed differences for inx-7; inx-10 double mutants. (C) Schematic illustrating engineered electrical synapses formed by Cx36 when expressed in adjacent neurons. (D) Tactile-dependent locomotion modulation is restored in inx-7; inx-10 double mutants by expressing Cx36 in AFD and AIB neurons. Data are presented as mean ± SEM. Each data point represents the mean behavior of worms within a single chamber. Statistical significance was determined using one-way ANOVA followed by a Tukey–Kramer post hoc test (*: p < 0.05; **: p < 0.01, and ***: p < 0.001).

List of C. elegans strains used in this study

List of plasmids used to create transgenic C. elegans strains

Worms lacking either gcy-18 or gcy-12 failed to identify their preferred area in microfluidic chambers. Preference index values of wild type N2 worms, gcy-18 mutants, and gcy-12 mutants were determined as described by Han et al. [52]. Wild type worms exhibit a strong preference for a specific zone (zone IV, as defined by Han et al. [52]), whereas both gcy-18 and gcy-12 mutants show significantly reduced preference compared to wild type worms. Bars represent mean ± SEM. Statistical comparisons were performed using one-way ANOVA followed by a Dunnett’s test for multiple comparisons (**p < 0.01).

Temperature shifts do not affect tactile-dependent modulation. (A) Schematic of experimental design: Worms were reared at three different temperatures (17°C, 20°C, and 23°C) and then transferred to 20°C for 1 hour during the behavioral assay. (B) Locomotion speed of wild type N2 worms in the binary (orange) and uniform (blue) chambers after experiencing temperature shifts. Linear regression analysis reveals a significant positive correlation between rearing temperature and locomotion speed in both chambers. (C) Differences in speed (Δspeed) between worms experiencing different temperature shifts. Linear regression significance test shows no significant relationship between Δspeed and temperature shift. Points represent mean ± SEM.