PyRAT: An Open-Source Python Library for Animal Behavior Analysis
Related Experiment Video
Updated: Sep 22, 2025

Author Spotlight: A Streamlined and Accessible Analysis Method to Quantify Optokinetic Reflex Tracking Responses
Published on: April 12, 2024
Tulio Fernandes De Almeida1, Bruno Guedes Spinelli1, Ramón Hypolito Lima1
1Post Graduation Program in Neuroengineering, Santos Dumont Institute, Edmond and Lily Safra International Institute of Neuroscience, Macaíba, Brazil.
Abstract:
Here we developed an open-source Python-based library called Python rodent Analysis and Tracking (PyRAT). Our library analyzes tracking data to classify distinct behaviors, estimate traveled distance, speed and area occupancy. To classify and cluster behaviors, we used two unsupervised algorithms: hierarchical agglomerative clustering and t-distributed stochastic neighbor embedding (t-SNE). Finally, we built algorithms that associate the detected behaviors with synchronized neural data and facilitate the visualization of this association in the pixel space. PyRAT is fully available on GitHub: https://github.com/pyratlib/pyrat.

