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

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

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.2
File Size Uploaded Provenance Actions
moseq2_app-1.4.2.tar.gz 159.4 kB Without provenance Details for moseq2_app-1.4.2.tar.gz

Built distribution (wheel)

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

Total release size: 241.9 kB

Release files / moseq2_app-1.4.2.tar.gz

Download URL moseq2_app-1.4.2.tar.gz
Size 159.4 kB
Tags Source
SHA-256 checksum
How to use checksums
632cda1c8e951316e14c0f2d0ffab08f1f0ad138deab1dc47c01a996b2fbc537
BLAKE2b-256 checksum
How to use checksums
bdf10b42e0cd1eb6318fa9fc46873f80d7591f20d3d913c91aa8cc8c5e51e0b2
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.2-py3-none-any.whl

Download URL moseq2_app-1.4.2-py3-none-any.whl
Size 82.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bae90f4beb7e51a4020c512ccc00e39289e85b5192ee22027d8c1a777f46961c
BLAKE2b-256 checksum
How to use checksums
cb25fbc6fcb6b00a226cb7bc0279d6e02edeb24ea25f296ed6f187d8a11dff4d
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.2

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.

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