(A) Schematics of behavioural assay. Head-restrained, tail-free larvae (6 dpf; N = 28 ± 8 fish per opsin group, mean ± SD) were exposed to 2 or 10 ms pulses of light (459 or 617 nm, 0.04–2.55 mW/mm2) with a 20 s inter-stimulus interval while their behaviour was monitored at 500 fps. We also provided 250 ms trains of light pulses at 20 or 40 Hz. (B) Opsin expression in spinal motor neurons in a Tg(mnx1:GAL4;UAS:CoChR-tdTomato) larva at 5 dpf. Imaging field of view corresponds to black box in (A). A, anterior; D, dorsal; P, posterior; V, ventral. Scale bar 50 μm. (C) Swim bouts elicited by a pulse train in Tg(mnx1:GAL4;UAS:CoChR-tdTomato) larvae (left). The control, opsin-negative larva (right), does not respond within 148 ms after stimulus onset. (D) Tail tracking, showing optogenetically-evoked swim bouts in a CoChR-expressing larva (bottom three rows) and a visually-evoked swim in a control opsin-negative larva (top). tbf, tail beat frequency. (E) Distribution of response latencies for all tail movements in opsin-expressing (red) and control opsin-negative larvae (grey). Dotted line indicates maximum latency (50 ms) for a response to be considered optogenetically-triggered. Control larvae exclusively show long latency responses. Each time bin corresponds to 25 ms. (F,L) Response probability of larvae expressing different opsins for single-pulse (F) or pulse-train (L) stimulation (mean ± SEM, across fish). G–Q Latency (G,M), bout duration (H,N), tail angle of the first half beat (θ1; I,O), number of cycles (J,P) and tail beat frequency (K,Q) for single-pulse (G–K) or pulse-train (M–Q) stimulation (mean ± SEM, across fish). See also Figure 3—figure supplement 1 and Figure 3—videos 1 and 2.