This repository provides the code for reproducing results from Centralized brain networks underlie grooming body part coordination.
The repository is organized as follows:
-
assets/
Contains the paper figures. -
data/
Contains the data necessary for reproduction. -
src/
Contains Jupyter notebooks for generating figures.FigureX.ipynb
– Notebook to generate Figure X. Expected outputs are shown in the beginning of each notebook.prepare_data/
– Additional code for preprocessing the data.
-
results/
Directory where generated results will be saved. -
download_data.sh
Script to automatically download the required dataset. -
generate_figures.sh
Script to run all notebooks at once and save figures under/results
. -
requirements.txt
Lists the Python dependencies.
On a normal desktop computer with a stable internet connection, the installation usually takes about 5–10 minutes. Follow these steps to set up your environment and get started:
-
Clone the repository:
git clone https://github.com/NeLy-EPFL/antennal-grooming.git cd antennal-grooming
-
Create a virtual environment (optional but recommended):
conda create -n grooming python>=3.8 conda activate grooming
Alternatively, you can use a Python virtual environment:
python -m venv env source env/bin/activate # On Windows: env\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
No special hardware is needed to run the code to replicate the results.
-
Download the data necessary for running the code:
./download_data.sh
Verify that the dataset is successfully downloaded and placed under
/data
. If it fails, download the data manually using this link. -
Navigate to the src folder and open the desired Jupyter notebook:
cd src jupyter notebook Figure1.ipynb
Make sure that Jupyter notebook is installed and your virtual environment is activated.
Alternatively, you can run the following script to automatically run all notebooks under
/src
and save their outputs to/results
../generate_figures.sh
To generate all main figures, this script will take approximately 5 minutes.
Data generated in this paper have been obtained using several other repositories:
- kinematics3d: used to automate 2D & 3D pose estimation on video recordings, using DeepLabCut and Anipose. We used this repository in a separate virtual environment. Please refer to the repository for more information.
- SeqIKPy: used to estimate the joint angles of fly legs and antennae from 3D kinematics. Please refer to the repository for more information.
NOTE: We used the
seqikpy
package inkinematics3d
repository to estimate antennal grooming kinematics throughout the paper (Figs. 1,2,5). - FARMS: used to simulate the fly grooming kinematics in MuJoCo. Please refer to the repository for more information.
NOTE: We used the
farms
package to perform kinematic replay experiments (Fig. 2). - FlyVis: used to train connectome-derived artificial neural networks to emulate grooming behavior. Please refer to the repository for more information.
NOTE: We used the
flyvis
package to train neural networks and perform neural perturbation experiments (Fig. 5,6). A GPU is needed to run the training and analysis scripts.
Please get in touch if you have any questions or comments! You can open an issue on our issues page or e-mail us directly at pembe.ozdil@epfl.ch
If you find this package useful in your research, please consider citing it using the following BibTeX entry:
@article{
ozdil_2024_centralized,
author = {{\"O}zdil, Pembe Gizem and Arreguit, Jonathan and Scherrer, Clara and Ijspeert, Auke and Ramdya, Pavan},
title = {Centralized brain networks underlie body part coordination during grooming},
year = {2024},
doi = {10.1101/2024.12.17.628844},
publisher = {Cold Spring Harbor Laboratory},
URL = {https://www.biorxiv.org/content/early/2024/12/17/2024.12.17.628844},
journal = {bioRxiv}
}