(A) Ascaroside quadrant assay. 1-μL drops of ascaroside or control solutions (green and dark gray, respectively) were spotted on opposite quadrants of a standard culture plate with a square lawn of bacterial food (light gray). Ten animals were placed at the center and their positions were scored at regular intervals to derive a Chemotaxis Index (see STAR Methods). (B) Wild-type animals showed a marked sex difference in behavioral responses to the ascr#2/#3/#8 mixture: males were strongly attracted, while hermaphrodites were weakly repelled. (C) Loss of CEM neurons (ceh-30(lf) mutants) did not detectably influence male behavior. (D, E) Pan-neural feminization (“pan-fem”) caused pheromone repulsion in males, while pan-neural masculinization (“pan-masc”) generated marked attraction in hermaphrodites. (F, G) Feminization of all ciliated sensory neurons (“sens-fem”) eliminated ascaroside attraction in males. Masculinization of ciliated sensory neurons (“sens-masc”) caused a significant change in behavior in hermaphrodites. *p ≤ 0.05, **p ≤ 0.01, ***p ≤ 0.001 by Mann-Whitney test. See also Figure S1.