Megabouts: a toolbox to quantify zebrafish locomotion
Project description
Megabouts 🐟
Overview
Megabouts is a Python toolbox designed to precisely quantify zebrafish larval locomotion. Our software supports locomotion analysis in both freely swimming and head-restrained conditions, adapting to various experimental setups and recording speeds.
📚 Full documentation and tutorials available at: megabouts.ai
Features
-
Flexible Data Input:
- Multiple tracking methods (full tracking, head tracking, tail tracking)
- Support various frame rates (20-700 Hz) and resolutions
- Compatible with different tracking software (e.g., SLEAP)
-
Analysis Pipeline:
- Tail angle and trajectory preprocessing
- Tail bout detection
- Movement classification using transformer neural networks
- Sparse coding for head-restrained experiments
Installation
pip install megabouts
Quick Start
from megabouts.tracking_data import TrackingConfig, FullTrackingData, load_example_data
from megabouts.pipeline import FullTrackingPipeline
# Load example data
df_recording, fps, mm_per_unit = load_example_data("fulltracking_posture")
# Configure tracking
tracking_cfg = TrackingConfig(fps=fps, tracking="full_tracking")
# Create tracking data
head_x = df_recording["head_x"].values * mm_per_unit
head_y = df_recording["head_y"].values * mm_per_unit
head_yaw = df_recording["head_angle"].values
tail_angle = df_recording.filter(like="tail_angle").values
tracking_data = FullTrackingData.from_posture(
head_x=head_x,
head_y=head_y,
head_yaw=head_yaw,
tail_angle=tail_angle
)
# Create pipeline and run
pipeline = FullTrackingPipeline(tracking_cfg)
tracking, tail, traj, segments, bouts, ethogram = pipeline.run(tracking_data)
License
This software is available for non-commercial research and academic use only. The software was developed by Adrien Jouary, Ph.D. in the laboratory of Michael B. Orger at Fundação Champalimaud. For full license terms, please see the LICENSE.md file.
Citation
@article{jouary2024megabouts,
title={Megabouts: a flexible pipeline for zebrafish locomotion analysis},
author={Jouary, Adrien and Laborde, Alexandre and Silva, Pedro T and Mata, J Miguel
and Marques, Joao C and Collins, Elena and Peterson, Randall T
and Machens, Christian K and Orger, Michael B},
journal={bioRxiv},
pages={2024--09},
year={2024},
publisher={Cold Spring Harbor Laboratory}
}
Contact
- Author: Adrien Jouary
- Email: adrien.jouary at research.fchampalimaud.org
- Organization: Champalimaud Foundation
Acknowledgments
This work was developed at the Champalimaud Foundation in the laboratory of Michael B. Orger.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file megabouts-0.0.0.tar.gz.
File metadata
- Download URL: megabouts-0.0.0.tar.gz
- Upload date:
- Size: 85.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
418aa159855d3da0fd6df642cd113ba6bd11ca907f95d7d68501850eb8abc1be
|
|
| MD5 |
a450e3eb968897a47c6ee079a934ba1d
|
|
| BLAKE2b-256 |
dfac5a2fbaa4b6a444d8e919ead22f8d138ba66b2ba770b6129531049b0e2d8f
|
Provenance
The following attestation bundles were made for megabouts-0.0.0.tar.gz:
Publisher:
publish.yml on orger-lab/megabouts
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
megabouts-0.0.0.tar.gz -
Subject digest:
418aa159855d3da0fd6df642cd113ba6bd11ca907f95d7d68501850eb8abc1be - Sigstore transparency entry: 148897377
- Sigstore integration time:
-
Permalink:
orger-lab/megabouts@00fc6457ec903fe0ae0b323eaa34164b440d0324 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/orger-lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@00fc6457ec903fe0ae0b323eaa34164b440d0324 -
Trigger Event:
release
-
Statement type:
File details
Details for the file megabouts-0.0.0-py3-none-any.whl.
File metadata
- Download URL: megabouts-0.0.0-py3-none-any.whl
- Upload date:
- Size: 86.5 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ff7fb0b77f35ad4547683afafd1089e34fe551dde66514cd4a1c67297a42839b
|
|
| MD5 |
2dfcb1c18c5eac97b5157f493477c9ec
|
|
| BLAKE2b-256 |
db2f51ba3a748df306ddd5094f48d9a36b47683318a634ce76c2d80dfcac1a2d
|
Provenance
The following attestation bundles were made for megabouts-0.0.0-py3-none-any.whl:
Publisher:
publish.yml on orger-lab/megabouts
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
megabouts-0.0.0-py3-none-any.whl -
Subject digest:
ff7fb0b77f35ad4547683afafd1089e34fe551dde66514cd4a1c67297a42839b - Sigstore transparency entry: 148897378
- Sigstore integration time:
-
Permalink:
orger-lab/megabouts@00fc6457ec903fe0ae0b323eaa34164b440d0324 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/orger-lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@00fc6457ec903fe0ae0b323eaa34164b440d0324 -
Trigger Event:
release
-
Statement type: