opynfield: An Open-Source Python Package for the Analysis of Open Field Exploration Data

McMullen, E., et al. (2025). opynfield: An Open-Source Python Package for the Analysis of Open Field Exploration Data. Neuroinformatics23(4), 58.

Abstract

The open field test is widely used in behavioral neuroscience, providing insights into exploration, anxiety, and the learning processes associated with habituation to novelty. Analyses of exploratory behaviors in open field areas rely heavily on movement changes over time. These activity measures are susceptible to confounds from group differences in locomotor abilities and only provide an indirect measure of learning during exploration. Considerable effort has been placed on identifying additional measures of behavior that can better describe changes in exploration and habituation of novelty. Two measures for enhanced analysis of exploration are coverage and directional persistence (P++). Coverage measures the number of visits to segments of the arena boundary and represents the number of opportunities to habituate to the novelty of this boundary. P++ measures the probability of continued movement in the same direction, reflecting goal-directed exploration, which decreases as the animal habituates the novel arena. Our new Python package, opynfield, calculates coverage, P++, and activity measures from open field tracking data. We further introduce versions of coverage and the analysis of additional motion probabilities. The package includes new, in-depth statistical approaches and data visualizations. We demonstrate the applicability of opynfield using experiments with Drosophila melanogaster in which we (1) validate opynfield's statistical tests, (2) substantiate coverage as a measure of novelty habituation, and (3) characterize behavioral differences in exploration. We also illustrate the utility of opynfield for analyzing rodent exploration by applying it to data from an experiment with Mus musculus. By leveraging full-density tracking data, opynfield facilitates a more nuanced understanding of exploration, potentially leading to improved insights into animal behavior and changes in learning, locomotor activity, and anxiety.