(A) Trial-averaged calcium activity aligned to lever press for neurons from a single mouse. (B) Same data as (A), but for deconvolved events. (C) Z scored deconvolved events of neurons at baseline versus at lever press. (D) Z scored activity of neurons aligned to single lever press events. (E) Histogram of the times of peak activity relative to lever press, for all neurons. (F) Average activity traces for neurons with peak activity that falls within different bins of time relative to lever press. (G-I) Illustration of time warping procedure for four press sequences. Dots indicate lever press times, as well as time anchors used for pre- and post-trial alignment (six time points per trial). (H) Illustration of how time is either dilated or contracted to match a template sequence. (J-K) Z scored calcium activity before (J) and after (K) time warping, to illustrate the utility of time warping for resolving latent features in unaligned activity. Note the emergence in (K) of peaks in activity corresponding to individual lever press events. This is the same dataset as Figure 6J, but is calcium signal, instead of deconvolved events. Shaded area is SEM.