  Spontaneous mouse behavior is composed from repeatedly-used modules of
movement (e.g., rearing, running, grooming) that are flexibly placed into
sequences whose content evolves over time. By identifying behavioral modules
and the order in which they are expressed, researchers can gain insight into
the impact of drugs, genes, context, sensory stimuli and neural activity on
behavior. Here we present a protocol for performing Motion Sequencing (MoSeq),
an ethologically-inspired method that uses 3D machine vision and unsupervised
machine learning to decompose spontaneous mouse behavior in the laboratory into
a series of elemental modules called "syllables". This protocol is based upon a
notebook-based pipeline for MoSeq that includes modules for depth video
acquisition, data pre-processing and modeling, as well as a standardized set of
visualization tools. Users are provided with instructions and code for building
a MoSeq imaging rig and acquiring three-dimensional video of spontaneous mouse
behavior for submission to the modeling framework; the outputs of this protocol
include syllable labels for each frame of video data as well as summary plots
describing how often each syllable was used and how syllables transitioned from
one to the other over time. This protocol and the accompanying pipeline
significantly lower the bar for adopting this unsupervised, data-driven
approach to characterizing mouse behavior, enabling users without significant
computational ethology experience to gain insight into how the structure of
behavior is altered after experimental manipulations.
