Skip to main content

Megabouts: a toolbox to quantify zebrafish locomotion

Project description

Megabouts 🐟

Megabouts Logo

PyPI version Documentation Status

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

megabouts-0.1.1.tar.gz (85.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

megabouts-0.1.1-py3-none-any.whl (86.5 MB view details)

Uploaded Python 3

File details

Details for the file megabouts-0.1.1.tar.gz.

File metadata

  • Download URL: megabouts-0.1.1.tar.gz
  • Upload date:
  • Size: 85.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for megabouts-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4474ed98915f60a353cc6286eb4257bad57b4b12e88b79d67931b946e5a31c17
MD5 0c8e6ead74c83bebbac676dc4c108ba4
BLAKE2b-256 857f7857b6c594f4c162cfecb0bf560af7010c45db0e276e5eb030f46bc1d6df

See more details on using hashes here.

Provenance

The following attestation bundles were made for megabouts-0.1.1.tar.gz:

Publisher: publish.yml on orger-lab/megabouts

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file megabouts-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: megabouts-0.1.1-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

Hashes for megabouts-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 443736efadb16dabce03ba4d1ef733c471efd5d233dde736ecff0f6e154171a5
MD5 cd4fda3f3ef2084fd9666df49fc2fa17
BLAKE2b-256 f9b81e2994aaa2a8c2cd0079d7ef517c364ad6f3d6323d1279c68adec9b2ac4a

See more details on using hashes here.

Provenance

The following attestation bundles were made for megabouts-0.1.1-py3-none-any.whl:

Publisher: publish.yml on orger-lab/megabouts

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page