RT Journal Article SR Electronic T1 Stytra: an open-source, integrated system for stimulation, tracking and closed-loop behavioral experiments JF bioRxiv FD Cold Spring Harbor Laboratory SP 492553 DO 10.1101/492553 A1 Štih, Vilim A1 Petrucco, Luigi A1 Kist, Andreas M. A1 Portugues, Ruben YR 2018 UL http://biorxiv.org/content/early/2018/12/10/492553.abstract AB We present Stytra, a flexible, open-source software package, written in Python, that we designed to cover all the general requirements involved in larval zebrafish behavioral experiments. It allows timed stimulus presentation, interfacing with external devices and simultaneous real-time tracking of position, tail and eye motion in both freely-swimming and head-restrained preparations. It logs in standardized formats all recorded quantities, metadata, and code version to allow full provenance tracking, from data acquisition through analysis to publication. The package is modular and expandable for different experimental protocols and setups. Current releases can be found at https://github.com/portugueslab/stytra. We also provide complete documentation with examples for extending the package to new stimuli and hardware, as well as a schema and parts list for behavioral setups. We showcase Stytra by reproducing two previously behavioral protocols, one with head-restrained and the other with freely-swimming larvae, as well as an experiment in which the software is used in the context of a calcium imaging experiment, where it can trigger and communicate with other acquisition devices. Our aims are to help laboratories with little or no experience in the field to start implementing behavioral experiments and to provide a platform for sharing stimulus protocols to enable easy reproduction of experiments and straightforward validation. In addition, Stytra can easily serve as a base platform to design behavioral experiments in other model organisms.