This repository contains behavioral analysis data and code for the BAP project using Motion Sequencing (MoSeq). The project investigates how different early-life environmental conditions affect mouse behavior across maternal and offspring populations.
Mice were exposed to four distinct environmental conditions:
| Condition | Description |
|---|---|
| EE | Enriched Environment - Enhanced sensory stimulation, motor challenges, and social interaction |
| LNB | Limited Nesting and Bedding - Restricted nesting materials with minimal bedding |
| NGH | Normal Growth Housing - Standard laboratory housing conditions (baseline control) |
| SI | Social Isolation - Reduced social contact with individual housing |
- Moms: Maternal mice exposed to experimental conditions
- Offsprings: Offspring mice stratified by sex (Males and Females)
BAP_Moseq/
├── README.md # This file
├── 12-1-2025_Run/ # December 2025 analysis run
│ ├── All/ # Combined population processing
│ ├── Moms/ # Maternal mice processing
│ └── Offsprings/ # Offspring mice processing and analysis
│ ├── code/ # Processing and analysis notebooks
│ ├── data/ # Model outputs and processed data
│ └── figs/ # Generated figures
└── 3-27-2025/ # March 2025 analysis run
├── Data/ # Shareable data outputs
│ ├── Fingerprint_Data/ # Raw MoSeq fingerprint data
│ └── PC_Embeddings/ # Principal component embeddings
├── Moms/ # Maternal mice analysis
│ ├── code/ # Processing and analysis notebooks
│ └── data/ # Processed data outputs
└── Offsprings/ # Offspring mice analysis
├── code/ # Processing and analysis notebooks
├── data/ # Processed data outputs
└── figs/ # Generated figures
The Motion Sequencing (MoSeq) pipeline extracts quantitative behavioral features from depth-camera recordings of mouse behavior. Key steps include:
- Extraction: Raw depth data processed to extract pose and position information
- Modeling: Autoregressive Hidden Markov Models identify discrete behavioral syllables
- Analysis: Syllable usage, transition probabilities, and scalar metrics quantified
Separate MoSeq models were trained for each population:
- Moms Model: Trained exclusively on maternal behavioral data
- Offsprings Model: Trained exclusively on offspring behavioral data
This approach optimizes feature extraction for each population's behavioral repertoire.
Five behavioral metrics are extracted per mouse:
- dist_to_center_px: Spatial positioning relative to arena center
- height_ave_mm: Average height and rearing behavior
- length_mm: Body length measurements
- velocity_2d_mm: Two-dimensional movement velocity
- MoSeq: MoSeq-specific behavioral fingerprints
Each metric produces 99 features, yielding a 495-dimensional feature matrix per mouse.
Principal Component Analysis (PCA) reduces the 495-dimensional feature space:
- Moms: 8 principal components optimal
- Male Offspring: 25 principal components optimal (75.8% balanced accuracy)
- Female Offspring: 12 principal components optimal
The March 2025 run contains the primary analysis with:
- Complete fingerprint data for both populations
- Optimized PC embeddings with classification results
- Comprehensive documentation of methodology
The December 2025 run includes:
- Updated processing notebooks
- New model outputs (model-006-4641589)
- Extended analysis with additional classifier notebooks
| File Type | Description |
|---|---|
moseq_df.csv |
Main MoSeq dataframe with session metadata |
stats_df.csv |
Statistical summary per session |
*_syllable_counts.csv |
Syllable usage by group |
*_transition_matrix.csv |
Syllable transition probabilities |
FingerprintSummary_*.csv |
Multi-index behavioral fingerprint data |
*_embedding.csv |
Principal component coordinates |
Each mouse is identified by:
- uuid: Universal unique identifier for cross-study compatibility
- moseq_id: BAP group-specific identifier (session format)
- SessionName: Human-readable session identifier
- Python 3.x
- pandas
- numpy
- scikit-learn
- matplotlib
- seaborn
- scipy
- statsmodels
- joblib
import pandas as pd
# Load offspring embeddings
df_male = pd.read_csv('3-27-2025/Data/PC_Embeddings/Offsprings/Male/males_final_data.csv')
df_female = pd.read_csv('3-27-2025/Data/PC_Embeddings/Offsprings/Female/females_final_data.csv')
# Access PC coordinates by condition
ee_males = df_male[df_male['category'] == 'EE']import pandas as pd
# Load multi-index fingerprint data
summary_df = pd.read_csv('path/to/FingerprintSummary_full.csv',
index_col=[0, 1], header=[0, 1])
# Extract specific population
males_df = summary_df[summary_df.index.get_level_values('group').str.contains('Male')]For detailed methodology on Motion Sequencing:
- Wiltschko AB, et al. (2015) Mapping Sub-Second Structure in Mouse Behavior. Neuron.
- Markowitz JE, et al. (2018) The Striatum Organizes 3D Behavior via Moment-to-Moment Action Selection. Cell.
For questions regarding this repository, please contact the BAP research group.