Welcome to the moseq2-app repository. Motion Sequencing (MoSeq) is an unsupervised machine learning method used to describe mouse behavior and moseq2-app is the starting point to MoSeq2 package suite.
To get started, install it with pip install moseq2-app and head over to the wiki for the full procedure and documentation for the MoSeq2 package suite.
Overview
MoSeq takes 3D depth videos as input (obtained using commercially-available sensors) and then uses statistical learning techniques to identify the components of mouse body language. This is achieved by fitting an autoregressive hidden Markov model that parses behavior into a set of sub-second motifs called syllables. This segmentation naturally yields boundaries between syllables, and therefore also reveals the structure that governs the interconnections between syllables over time, which we refer to as behavioral grammar (see Wiltschko et al., 2015 for the first description of MoSeq).
Because MoSeq relies on unsupervised machine learning, MoSeq discovers the set of syllables and grammar expressed in any given experiment. By combining MoSeq with electrophysiology, multi-color photometry, and miniscope methods, neural correlates for 3D behavioral syllables have recently been identified in the dorsolateral striatum (DLS) (Markowitz et al., 2018). Furthermore, MoSeq has been combined with optogenetic stimulation to reveal the differential consequences of activating the motor cortex, the dorsal striatum, and the ventral striatum (Pisanello et al.,2017; Wiltschko et al., 2015). These results are consistent with similar results recently obtained using marker-based approaches to explore the relationship between 3D posture and activity in the posterior parietal cortex (Mimica et al., 2018).
There are two basic steps to MoSeq, and this GitHub repository and the wiki supports both. First, 3D data need to be acquired. Here you will find instructions for assembling a standard MoSeq data acquisition platform, and code to acquire 3D videos of mice as they freely behave. Second, these 3D data need to be modeled. We provide several different methods for modeling the data using MoSeq, which are compared below. We continue development of MoSeq and plan to incorporate additional features in the near future.
MoSeq2 package suite
The MoSeq2 toolkit enables users to model mouse behavior across different experimental groups, and measure the differences between their behavior usages, durations, transition patterns. etc.
This package contains functionalities that can be used interactively in jupyter notebooks. We provide a series of Jupyter Notebooks that cover the entire MoSeq pipeline to process their depth videos of mice, and segment their behavior into what is denoted as "syllables". In addition to the Jupyter notebooks, MoSeq has a Command Line Interface. Consult the wiki page for more detailed documentation of the MoSeq pipeline here.
Getting Started
pip install moseq2-app
Python 3.10 or newer. Verified on Linux; macOS and Windows support is being
verified. Installing moseq2-app brings the rest of the suite with it:
moseq2-extract, moseq2-pca, moseq2-model and moseq2-viz, along with
their command line interfaces.
ffmpeg is a separate requirement. moseq2-extract reads and writes depth
video by calling ffmpeg and ffprobe and expects to find them on your
PATH. No Python install provides them, so install them yourself with conda,
apt or Homebrew.
The notebooks are not part of the package. Download the two that make up the pipeline and put them in the parent directory of your data, which is what lets the interactive video widgets load:
The installation guide carries the whole procedure, including how to launch Jupyter so the notebooks' video widgets work.
You can find more information about the MoSeq2 package suite, the acquisition and analysis pipeline, documentation for Command Line Interface (CLI), tutorials, etc. in the wiki. If you want to explore MoSeq functionalities, check out the guide for downloading test data.
Community Support and Contributing
- Please join
to post questions and interactive with MoSeq developers and users.
- If you encounter bugs, errors or issues, please submit a Bug report here. We encourage you to check out the troubleshooting and tips section and search your issues in the existing issues first.
- If you want to see certain features in MoSeq or you have new ideas, please submit a Feature request here.
- If you want to contribute to our codebases, please check out our Developer Guidelines.
- Please tell us what you think by filling out this user survey.
Versions
Publications
- Mapping Sub-Second Structure in Mouse Behavior
- The Striatum Organizes 3D Behavior via Moment-to-Moment Action Selection
- Q&A: Understanding the composition of behavior
- Computational Neuroethology: A Call to Action
- Revealing the structure of pharmacobehavioral space through motion sequencing
License
MoSeq is freely available for academic use under a license provided by Harvard University. Please refer to the license file for details. If you are interested in using MoSeq for commercial purposes please contact Bob Datta directly at srdatta@hms.harvard.edu, who will put you in touch with the appropriate people in the Harvard Technology Transfer office.
Metadata
Release files for moseq2-app 1.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| moseq2_app-1.4.0.tar.gz | 159.2 kB | Without provenance | Details for moseq2_app-1.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| moseq2_app-1.4.0-py3-none-any.whl | Python 3 | none | any | Details for moseq2_app-1.4.0-py3-none-any.whl |
Total release size: 241.5 kB
Release files / moseq2_app-1.4.0.tar.gz
| Download URL | moseq2_app-1.4.0.tar.gz |
|---|---|
| Size | 159.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1fb112afea8248e963f3e4ed1761a33d61289076350f89c02ec282c3ef58163a
|
|
BLAKE2b-256 checksum How to use checksums |
6bef1ce5f6c20c5999549889cfba2ffac22b5df2df545116a3a00433801c8d74
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.22
|
Release files / moseq2_app-1.4.0-py3-none-any.whl
| Download URL | moseq2_app-1.4.0-py3-none-any.whl |
|---|---|
| Size | 82.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9b29e7e067c79aba17f377e54bc836749608fb98b7332de09da7226e4fcadc25
|
|
BLAKE2b-256 checksum How to use checksums |
eb7f11de54fcaa9af3f5137c889fef8be2fb52d95fba642bd96fd0160ecea578
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.22
|
Security for moseq2-app 1.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.