Skip to main content

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.

Quick Links: MoSeq Slack Channel Documentation DOI

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

You need Python 3.10 or newer on your system. Then:

python -m pip install moseq2-app

If you have several projects on your computer using Python, you may want to install MoSeq2 into a fresh Python environment so its packages cannot collide with theirs. One way to do that is conda; the installation guide shows how.

Verified on Linux; macOS and Windows support is being verified.

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 MoSeq Slack Channel 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

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.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for moseq2-app 1.4.5
File Size Uploaded Provenance Actions
moseq2_app-1.4.5.tar.gz 194.3 kB With provenance Details for moseq2_app-1.4.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for moseq2-app 1.4.5
File Interpreter ABI Platform Actions
moseq2_app-1.4.5-py3-none-any.whl Python 3 none any Details for moseq2_app-1.4.5-py3-none-any.whl

Total release size: 277.7 kB

Release files / moseq2_app-1.4.5.tar.gz

Download URL moseq2_app-1.4.5.tar.gz
Size 194.3 kB
Tags Source
SHA-256 checksum
How to use checksums
12de37f869c865638f54bb8cc889bd39d9403dd57dcb7596457fc47344373fbb
BLAKE2b-256 checksum
How to use checksums
6b0c5a32051c42f7c52055ee56f87f74cf06696262227ba4e9b13e1db832ddcf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Release files / moseq2_app-1.4.5-py3-none-any.whl

Download URL moseq2_app-1.4.5-py3-none-any.whl
Size 83.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dc3ff701fa61f3ee3720c510027d36e564186eda34644da0106a9451dac751f9
BLAKE2b-256 checksum
How to use checksums
06854b0d1922462335808a945c947ffae3660e4fd586c3829b0d624b47c53b98
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Security for moseq2-app 1.4.5

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for moseq2_app-1.4.5.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page